Skip to content

Commit f844e8d

Browse files
authored
Merge branch 'main' into input_io_bugfix
2 parents 4762511 + 28c096d commit f844e8d

File tree

12 files changed

+5294
-9
lines changed

12 files changed

+5294
-9
lines changed

arkane/data/gaussian/starred_rotational_constant.log

Lines changed: 2964 additions & 0 deletions
Large diffs are not rendered by default.

arkane/data/molpro/C5OH5_CCSD(T)_F12.out

Lines changed: 556 additions & 0 deletions
Large diffs are not rendered by default.

arkane/data/orca/freq_orca_5.0.4.log

Lines changed: 1709 additions & 0 deletions
Large diffs are not rendered by default.

arkane/ess/gaussian.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@ def load_conformer(self, symmetry=None, spin_multiplicity=0, optical_isomers=Non
227227
logging.debug('Conformer {0} is assigned a spin multiplicity of {1}'
228228
.format(label, spin_multiplicity))
229229

230+
# Keep track of rotational constants as we go in case Gaussian prints ****** instead of the value
231+
if 'Rotational constants (GHZ):' in line and '*****' not in line:
232+
rot_const = [float(d) for d in line.split()[-3:]]
233+
230234
# The data we want is in the Thermochemistry section of the output
231235
if '- Thermochemistry -' in line:
232236
modes = []
@@ -246,9 +250,15 @@ def load_conformer(self, symmetry=None, spin_multiplicity=0, optical_isomers=Non
246250

247251
# Read moments of inertia for external rotational modes
248252
elif 'Rotational constants (GHZ):' in line:
249-
inertia = [float(d) for d in line.split()[-3:]]
253+
inertia = [d for d in line.split()[-3:]]
254+
for i in range(len(inertia)):
255+
if '*******' in inertia[i]:
256+
try: # set rotational constant to the last known value
257+
inertia[i] = rot_const[i]
258+
except NameError:
259+
raise LogError('Rotational constant listed as ***** and no previous value given')
250260
for i in range(3):
251-
inertia[i] = constants.h / (8 * constants.pi * constants.pi * inertia[i] * 1e9) \
261+
inertia[i] = constants.h / (8 * constants.pi * constants.pi * float(inertia[i]) * 1e9) \
252262
* constants.Na * 1e23
253263
rotation = NonlinearRotor(inertia=(inertia, "amu*angstrom^2"), symmetry=symmetry)
254264
modes.append(rotation)

arkane/ess/molpro.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ def load_energy(self, zpe_scale_factor=1.):
350350
# Search for e_elect
351351
for line in lines:
352352
if f12 and f12a:
353-
if 'CCSD(T)-F12a' in line and 'energy' in line:
353+
if ('CCSD(T)-F12a' in line or 'CCSD(T)-F12/' in line and '!' not in line) and 'energy' in line:
354354
e_elect = float(line.split()[-1])
355355
break
356356
elif f12 and f12b:

arkane/ess/orca.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,11 @@ def load_conformer(self, symmetry=None, spin_multiplicity=0, optical_isomers=Non
215215
if spin_multiplicity == 0 and ' Multiplicity Mult' in line:
216216
spin_multiplicity = int(float(line.split()[3]))
217217

218-
if ' Mode freq' in line:
218+
if 'Mode' in line and "freq" in line:
219219
frequencies = list()
220220
for line_ in log[(i + 2):]:
221+
if "------" in line_:
222+
continue
221223
if not line_.strip():
222224
break
223225
frequencies.extend([float(line_.split()[1])])
@@ -236,7 +238,7 @@ def load_conformer(self, symmetry=None, spin_multiplicity=0, optical_isomers=Non
236238
if len(inertia) and not all(i == 0.0 for i in inertia):
237239
if any(i == 0.0 for i in inertia):
238240
inertia.remove(0.0)
239-
rot.append(LinearRotor(inertia=(inertia, "amu*angstrom^2"), symmetry=symmetry))
241+
rot.append(LinearRotor(inertia=(inertia[0], "amu*angstrom^2"), symmetry=symmetry))
240242
else:
241243
rot.append(NonlinearRotor(inertia=(inertia, "amu*angstrom^2"), symmetry=symmetry))
242244

environment.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,18 @@ dependencies:
105105
# configure packages to use OpenBLAS instead of Intel MKL
106106
- blas=*=openblas
107107

108+
# Cantera 2.6 on the Cantera channel is configured to use Intel MKL. It doesn't specify a version minimum
109+
# but crashes if MKL is too old, so we have to enforce a minimum version here. But, if we can switch over
110+
# to the conda-forge version, we should be able to remove this line (and maybe the two after it)
111+
# because it use OpenBLAS instead.
112+
- conda-forge::mkl >=2023.1.0
113+
# 2023.1.0 is just a guess at the minimum version. Older versions might work too.
114+
- conda-forge::libcurl <= 8.9
115+
# There's a Julia/PyCall installation bug associated with libcurl 8.10+:
116+
# https://discourse.julialang.org/t/curl-multi-assign-and-segmentation-fault-when-installing-package/120901/3
117+
- conda-forge::pyopenssl >20
118+
# ThermoCentralDatabaseInterface fails if pyopenssl is too old. 20 is just a guess at the version number.
119+
108120
# additional packages that are required, but not specified here (and why)
109121
# pydqed, pydas, mopac, and likely others require a fortran compiler (specifically gfortran)
110122
# in the environment. Normally we would add this to the environment file with

rmgpy/data/kinetics/depository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def __init__(self,
6262
depository=None,
6363
family=None,
6464
entry=None,
65-
electrons=None,
65+
electrons=0,
6666
):
6767
Reaction.__init__(self,
6868
index=index,

test/arkane/ess/arkaneGaussianTest.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,3 +246,28 @@ def test_load_negative_frequency(self):
246246
with pytest.raises(LogError):
247247
log = GaussianLog(os.path.join(self.data_path, "rocbs-qb3_85_methanol.out"))
248248
imaginary_freq = log.load_negative_frequency()
249+
250+
def test_load_rotational_constants(self):
251+
"""
252+
Load the rotational constants from a Gaussian output file.
253+
"""
254+
# try reading rotational constants from a regular gaussian log file with no stars
255+
log = GaussianLog(os.path.join(self.data_path, "ethylene.log"))
256+
conformer, unscaled_freqs = log.load_conformer()
257+
assert NonlinearRotor in [type(mode) for mode in conformer.modes]
258+
for mode in conformer.modes:
259+
if isinstance(mode, NonlinearRotor):
260+
assert mode.symmetry == 4
261+
# test the rotational constants are read in correctly
262+
assert np.all(np.isclose(mode.inertia.value_si, np.array([5.69516245e-47, 2.77584017e-46, 3.34535660e-46]), atol=1e-48))
263+
264+
265+
# test that it can read in the rotational constants even if the last instance is stars instead of digits
266+
log = GaussianLog(os.path.join(self.data_path, "starred_rotational_constant.log"))
267+
conformer, unscaled_freqs = log.load_conformer()
268+
assert NonlinearRotor in [type(mode) for mode in conformer.modes]
269+
for mode in conformer.modes:
270+
if isinstance(mode, NonlinearRotor):
271+
assert mode.symmetry == 1
272+
# test the rotational constants are read in correctly
273+
assert np.all(np.isclose(mode.inertia.value_si, np.array([5.64469824e-54, 1.86319657e-46, 1.86319657e-46]), atol=1e-48))

test/arkane/ess/molproTest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,12 @@ def test_load_rad_from_molpro_log_f12(self):
106106
"""
107107
log = MolproLog(os.path.join(self.data_path, "OH_f12.out"))
108108
e0 = log.load_energy()
109-
110109
assert round(abs(e0 / constants.Na / constants.E_h - -75.663696424380), 5) == 0
111110

111+
log = MolproLog(os.path.join(self.data_path, "C5OH5_CCSD(T)_F12.out"))
112+
e0 = log.load_energy()
113+
assert round(abs(e0 / constants.Na / constants.E_h - -268.317057640597), 5) == 0
114+
112115
def test_load_hosi_from_molpro_log(self):
113116
"""
114117
Uses a molpro log file for HOSI to test that its

0 commit comments

Comments
 (0)