Description
Openmolcas dynamically switches between a "default format" and a "compact format" of printing molecular orbitals and their expansion in atomic basis functions depending on the number of molecular orbitals (see codebase)
cclib currently only supports the "default format" and will error with
~/cclib/cclib/parser/molcasparser.py in extract(self, inputfile, line)
825 info = tokens[3:]
826 j = 0
--> 827 for i in orbital_index:
828 print(line)
829 mocoeffs[int(i)-1].append(float(info[j]))
UnboundLocalError: local variable 'orbital_index' referenced before assignment
when encountering the "compact format".
The manual claims that the compact format is selected automatically when the number of molecular orbitals exceeds 256 but I encountered this already for a case of 124 orbitals.
The relevant section in cclib starts in
cclib/cclib/parser/molcasparser.py
Lines 753 to 778 in d972641
I currently don't have time to add support for the compact format myself -- but until support for the "compact format" is added to cclib, as a workaround openmolcas users can add the keyword PRORBITALS=1 3
to the SCF
section to select the "default format" independent of molecule size.