Skip to content

Commit

Permalink
Merge pull request #3 from joegair/master
Browse files Browse the repository at this point in the history
update orca_file.py for compatibility with orca 5
  • Loading branch information
ekwan committed Jan 31, 2023
2 parents c922f8a + b835d78 commit b364bfb
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions cctk/orca_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,22 +172,16 @@ def read_file(cls, filename):
properties[-1]["frequencies"] = sorted(parse.read_freqs(lines))

enthalpies = lines.find_parameter("Total Enthalpy", expected_length=5, which_field=3)
if len(enthalpies) == 1:
properties[-1]["enthalpy"] = enthalpies[0]
elif len(enthalpies) > 1:
raise ValueError(f"unexpected # of enthalpies found!\nenthalpies = {enthalpies}")
properties[-1]["enthalpy"] = enthalpies[-1]

gibbs = lines.find_parameter("Final Gibbs free enthalpy", expected_length=7, which_field=5)
if len(gibbs) == 1:
properties[-1]["gibbs_free_energy"] = gibbs[0]
elif len(gibbs) > 1:
raise ValueError(f"unexpected # of gibbs free energies found!\ngibbs free energies = {enthalpies}")
gibbs = lines.find_parameter("Final Gibbs free", expected_length=7, which_field=5)
properties[-1]["gibbs_free_energy"] = gibbs[-1]

temperature = lines.find_parameter("Temperature", expected_length=4, which_field=2)
if len(temperature) == 1 and len(gibbs) > 0:
properties[-1]["temperature"] = temperature[0]
corrected_free_energy = get_corrected_free_energy(gibbs[0], properties[-1]["frequencies"],
frequency_cutoff=100.0, temperature=temperature[0])
if len(temperature) > 0 and len(gibbs) > 0:
properties[-1]["temperature"] = temperature[-1]
corrected_free_energy = get_corrected_free_energy(gibbs[-1], properties[-1]["frequencies"],
frequency_cutoff=100.0, temperature=temperature[-1])
properties[-1]["quasiharmonic_gibbs_free_energy"] = float(corrected_free_energy)

if OrcaJobType.NMR in job_types:
Expand Down

0 comments on commit b364bfb

Please sign in to comment.