Skip to content

Commit 9fe9e64

Browse files
committed
Fill in rot const with last known value if given ****s
1 parent 8adfab5 commit 9fe9e64

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

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)

0 commit comments

Comments
 (0)