4545${auxiliary_basis}
4646${cabs}
4747int;
48+
4849{hf;${shift}
4950 maxit,999;
50- wf,spin=${spin},charge=${charge};}
51+ wf,spin=${spin},charge=${charge};
52+ }
5153
52- ${restricted}${method};
54+ ${restricted}${method}
5355
5456${job_type_1}
5557${job_type_2}${block}
@@ -221,7 +223,7 @@ def write_input_file(self) -> None:
221223 input_dict ['charge' ] = self .charge
222224 input_dict ['label' ] = self .species_label
223225 input_dict ['memory' ] = self .input_file_memory
224- input_dict ['method' ] = self .level .method
226+ input_dict ['method' ] = f' { self .level .method } ;'
225227 input_dict ['shift' ] = self .args ['trsh' ]['shift' ] if 'shift' in self .args ['trsh' ].keys () else ''
226228 input_dict ['spin' ] = self .multiplicity - 1
227229 input_dict ['xyz' ] = xyz_to_str (self .xyz )
@@ -247,26 +249,42 @@ def write_input_file(self) -> None:
247249 pass
248250
249251 if 'IGNORE_ERROR in the ORBITAL directive' in self .args ['trsh' ].keys ():
250- keywords .append ('ORBITAL,IGNORE_ERROR' )
252+ keywords .append (' ORBITAL,IGNORE_ERROR; ' )
251253
252254 if 'mrci' in self .level .method or 'rs2' in self .level .method :
255+ active = self .species [0 ].active
253256 input_dict ['restricted' ] = ''
254257 if '_' in self .level .method :
255258 methods = self .level .method .split ('_' )
256259 input_dict ['method' ] = ''
257260 for method in methods :
258- input_dict ['method' ] += '\n \n {' + method .lower () + ';\n '
261+ input_dict ['method' ] += '\n {' + method .lower () + ';\n '
259262 if 'mp2' not in method .lower ():
260263 input_dict ['method' ] += ' maxit,999;\n '
261- input_dict ['method' ] += f' wf,spin={ input_dict ["spin" ]} ,charge={ input_dict ["charge" ]} ;' + '}'
264+ input_dict ['method' ] += f' wf,spin={ input_dict ["spin" ]} ,charge={ input_dict ["charge" ]} ;\n '
265+ if 'casscf' in method .lower () and active is not None :
266+ if 'occ' in active :
267+ input_dict ['method' ] += f' occ,{ "," .join ([str (i ) for i in active ["occ" ]])} ;\n '
268+ if 'closed' in active :
269+ input_dict ['method' ] += f' closed,{ "," .join ([str (i ) for i in active ["closed" ]])} ;\n '
270+ input_dict ['method' ] += ' state,1;\n ' # ground state
271+ input_dict ['method' ] += '}\n '
262272 else :
263273 input_dict ['method' ] = f"""{{casscf;
264274 maxit,999;
265- wf,spin={ input_dict ['spin' ]} ,charge={ input_dict ['charge' ]} ;}}
266-
267- {{mrci{ "-f12" if "f12" in self .level .method .lower () else "" } ;
275+ wf,spin={ input_dict ['spin' ]} ,charge={ input_dict ['charge' ]} ;
276+ """
277+ if active is not None :
278+ if 'occ' in active :
279+ input_dict ['method' ] += f' occ,{ "," .join ([str (i ) for i in active ["occ" ]])} ;\n '
280+ if 'closed' in active :
281+ input_dict ['method' ] += f' closed,{ "," .join ([str (i ) for i in active ["closed" ]])} ;\n '
282+ input_dict ['method' ] += ' state,1;\n ' # ground state
283+ input_dict ['method' ] += '}\n \n '
284+ input_dict ['method' ] += f"""{{mrci{ "-f12" if "f12" in self .level .method .lower () else "" } ;
268285 maxit,999;
269- wf,spin={ input_dict ['spin' ]} ,charge={ input_dict ['charge' ]} ;}}"""
286+ wf,spin={ input_dict ['spin' ]} ,charge={ input_dict ['charge' ]} ;
287+ }}"""
270288 if 'mrci' in self .level .method :
271289 input_dict ['block' ] += '\n \n E_mrci=energy;\n E_mrci_Davidson=energd;\n \n table,E_mrci,E_mrci_Davidson;'
272290
0 commit comments