Skip to content

Commit bb5ab4a

Browse files
author
andy
committed
Merge branch 'worktree-agent-a394c1c0782dc2b59'
# Conflicts: # tests/parsers/fixtures/README.md
2 parents 7215926 + 98f6411 commit bb5ab4a

32 files changed

Lines changed: 11479 additions & 23 deletions

‎data/client/config/properties‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ Energy Gibbs Free Energy EGIBBS Energy PropValue
160160
Energy Heat Capacity (Cp) HEATCAP NA PropValue
161161
Energy Thermochemistry Temperature THERMOTEMP Temperature PropValue
162162
#
163+
# Solvation. ESOLV is E(solution) - E(gas), stored only where the code
164+
# prints both totals (NWChem COSMO). Gaussian and ORCA SMD print just the
165+
# cavity-dispersion term, kept apart as ESOLVCDS since it is not the full
166+
# solvation free energy.
167+
Energy Solvation Energy (E_sol - E_gas) ESOLV Energy PropValue
168+
Energy SMD Cavity-Dispersion Term (CDS) ESOLVCDS Energy PropValue
169+
#
163170
#
164171
Energy Total Energy Vector TEVEC Energy PropTSVector<Geometry Step>
165172
Energy Kinetic Energy Vector KEVEC Energy PropTSVector<Geometry Step>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
type: map
3+
title: "Thermochemistry and solvation keys: what each code prints, and where NWChem's come from"
4+
area: codereg
5+
section: "How a property gets from disk into the Properties menu"
6+
paths: ["scripts/parsers/gaussian-16.thermo", "scripts/parsers/gaussian-09.thermo", "scripts/parsers/nwchem.thermo", "scripts/parsers/orca.solv", "scripts/parsers/gaussian-16.solv", "scripts/parsers/nwchem.desc", "data/client/config/properties"]
7+
issues: [176]
8+
---
9+
EZEROPT/ETHERM/ENTHALPY/ENTROPY/EGIBBS hold Hartree for every code;
10+
ENTROPY is T*S (not S), the others are absolute (ZPE is the correction).
11+
THERMOTEMP carries T. Gaussian prints the sums directly. NWChem prints
12+
only corrections, so `nwchem.thermo` adds them to the first total energy
13+
after the Hessian banner. MOPAC prints no Gibbs energy; EGIBBS is left
14+
unset on purpose (see `mopac.thermo`).
15+
16+
NWChem's ecce_print trace contains no thermochemistry and no COSMO data,
17+
so `nwchem.desc` reads the stdout file (`nwch.nwout`) through a `File=`
18+
entry; the old `begin%zero point` EZEROPT entry can never fire. That
19+
`File=` path is replayed in tests/parsers but not yet seen in a live
20+
ECCE job.
21+
22+
ESOLV is E(solution) - E(gas) and is set only where both totals are
23+
printed (NWChem COSMO). Gaussian SMD and ORCA SMD print only the
24+
cavity-dispersion term, stored as ESOLVCDS; a full solvation energy from
25+
them needs a separate gas-phase job. ORCA's last `SMD CDS (Gcds)` comes
26+
from the last SCF of the numerical frequency step, a displaced geometry
27+
(about 1e-5 Eh from the final geometry's value).

‎scripts/parsers/gaussian-09.desc‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,25 @@ Frequency=first
121121
End=Harmonic frequencies
122122
[END]
123123

124-
[NULL2]
125-
Script=gaussian-09.null
124+
# The block also swallows the rest of the output up to the next
125+
# "Cartesian Forces" line, as the NULL2 entry it replaces did, so the
126+
# entries below cannot match inside it.
127+
[EZEROPT][ETHERM][ENTHALPY][EGIBBS][ENTROPY][THERMOTEMP]
128+
Script=gaussian-09.thermo
126129
Begin= Thermochemistry
127-
Frequency=first
130+
Frequency=last
128131
End=Cartesian Forces
129132
[END]
130133

134+
# SMD only; PCM prints no solvation term of its own.
135+
[ESOLVCDS]
136+
Script=gaussian-09.solv
137+
Begin=SMD-CDS \(non-electrostatic\) energy
138+
Frequency=last
139+
Skip=0
140+
Lines=1
141+
[END]
142+
131143
[DIPOLE1]
132144
Script=gaussian-09.dipole
133145
Begin=Dipole moment\=

‎scripts/parsers/gaussian-09.solv‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env perl
2+
################################################################################
3+
#
4+
# Purpose:
5+
# Gaussian SMD prints, after every SCF, only the non-electrostatic
6+
# cavity-dispersion-solvent-structure term:
7+
# SMD-CDS (non-electrostatic) energy (kcal/mol) = 1.43
8+
# It prints no gas-phase total, so the full solvation free energy cannot
9+
# be formed from one job and this is stored as ESOLVCDS, not ESOLV.
10+
# kcal/mol is converted to Hartree like every other energy.
11+
#
12+
################################################################################
13+
14+
$| = 1;
15+
16+
use constant KCAL_PER_HARTREE => 627.5094740631;
17+
18+
$_ = <STDIN>;
19+
exit(0) if (!defined($_) || !/=\s*(-?\d+\.\d+)\s*$/);
20+
my $value = sprintf("%.10f", $1 / KCAL_PER_HARTREE);
21+
22+
print "key: ESOLVCDS\n";
23+
print "size:\n1\n";
24+
print "values:\n$value\n";
25+
print "units:\nHartree\n";
26+
print "END\n";
27+
exit(0);

‎scripts/parsers/gaussian-09.thermo‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env perl
2+
################################################################################
3+
#
4+
# Purpose:
5+
# Extracts the Thermochemistry block of a Gaussian Freq job into the keys
6+
# ORCA already fills: EZEROPT, ETHERM, ENTHALPY, EGIBBS and ENTROPY, plus
7+
# THERMOTEMP. Same script for Gaussian 09 and 16 (identical block layout).
8+
#
9+
# Units: Gaussian prints the "Sum of electronic and ..." lines as absolute
10+
# energies in Hartree/particle, so ETHERM/ENTHALPY/EGIBBS need no
11+
# conversion. EZEROPT is the "Zero-point correction" (the correction, as
12+
# for ORCA, not the electronic-plus-ZPE sum). ENTROPY holds T*S in
13+
# Hartree, as for ORCA, so S (cal/mol-K, total row of the table) is
14+
# multiplied by the printed temperature.
15+
#
16+
# Temperature 298.150 Kelvin. Pressure 1.00000 Atm.
17+
# Zero-point correction= 0.024386 (Hartree/Particle)
18+
# Sum of electronic and thermal Energies= -74.938683
19+
# Sum of electronic and thermal Enthalpies= -74.937739
20+
# Sum of electronic and thermal Free Energies= -74.959907
21+
# E (Thermal) CV S
22+
# Total 17.080 5.968 46.658
23+
#
24+
# The pressure has no property key, so it is not stored.
25+
#
26+
################################################################################
27+
28+
$| = 1;
29+
30+
use constant KCAL_PER_HARTREE => 627.5094740631;
31+
32+
my ($temp, $zpe, $etherm, $enth, $gibbs, $S);
33+
my $inTable = 0;
34+
while (<STDIN>) {
35+
if (/^\s*Temperature\s+(\d+\.\d+)\s+Kelvin/) { $temp = $1; }
36+
elsif (/Zero-point correction=\s+(-?\d+\.\d+)/) { $zpe = $1; }
37+
elsif (/Sum of electronic and thermal Energies=\s+(-?\d+\.\d+)/) { $etherm = $1; }
38+
elsif (/Sum of electronic and thermal Enthalpies=\s+(-?\d+\.\d+)/) { $enth = $1; }
39+
elsif (/Sum of electronic and thermal Free Energies=\s+(-?\d+\.\d+)/) { $gibbs = $1; }
40+
elsif (/E \(Thermal\)\s+CV\s+S/) { $inTable = 1; }
41+
elsif ($inTable && /^\s*Total\s+\S+\s+\S+\s+(-?\d+\.\d+)\s*$/) { $S = $1; $inTable = 0; }
42+
}
43+
44+
sub emit {
45+
my ($key, $value, $units) = @_;
46+
print "key: $key\n";
47+
print "size:\n1\n";
48+
print "values:\n$value\n";
49+
print "units:\n$units\n";
50+
print "END\n";
51+
}
52+
53+
&emit("EZEROPT", $zpe, "Hartree") if (defined($zpe));
54+
&emit("ETHERM", $etherm, "Hartree") if (defined($etherm));
55+
&emit("ENTHALPY", $enth, "Hartree") if (defined($enth));
56+
if (defined($S) && defined($temp)) {
57+
&emit("ENTROPY", sprintf("%.8f", $S * $temp / 1000.0 / KCAL_PER_HARTREE), "Hartree");
58+
}
59+
&emit("EGIBBS", $gibbs, "Hartree") if (defined($gibbs));
60+
&emit("THERMOTEMP", $temp, "Kelvin") if (defined($temp));
61+
exit(0);

‎scripts/parsers/gaussian-16.desc‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,25 @@ Frequency=first
135135
End=Harmonic frequencies
136136
[END]
137137

138-
[NULL2]
139-
Script=gaussian-16.null
138+
# The block also swallows the rest of the output up to the next
139+
# "Cartesian Forces" line, as the NULL2 entry it replaces did, so the
140+
# entries below cannot match inside it.
141+
[EZEROPT][ETHERM][ENTHALPY][EGIBBS][ENTROPY][THERMOTEMP]
142+
Script=gaussian-16.thermo
140143
Begin= Thermochemistry
141-
Frequency=first
144+
Frequency=last
142145
End=Cartesian Forces
143146
[END]
144147

148+
# SMD only; PCM prints no solvation term of its own.
149+
[ESOLVCDS]
150+
Script=gaussian-16.solv
151+
Begin=SMD-CDS \(non-electrostatic\) energy
152+
Frequency=last
153+
Skip=0
154+
Lines=1
155+
[END]
156+
145157
[DIPOLE1]
146158
Script=gaussian-16.dipole
147159
Begin=Dipole moment\=

‎scripts/parsers/gaussian-16.solv‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env perl
2+
################################################################################
3+
#
4+
# Purpose:
5+
# Gaussian SMD prints, after every SCF, only the non-electrostatic
6+
# cavity-dispersion-solvent-structure term:
7+
# SMD-CDS (non-electrostatic) energy (kcal/mol) = 1.43
8+
# It prints no gas-phase total, so the full solvation free energy cannot
9+
# be formed from one job and this is stored as ESOLVCDS, not ESOLV.
10+
# kcal/mol is converted to Hartree like every other energy.
11+
#
12+
################################################################################
13+
14+
$| = 1;
15+
16+
use constant KCAL_PER_HARTREE => 627.5094740631;
17+
18+
$_ = <STDIN>;
19+
exit(0) if (!defined($_) || !/=\s*(-?\d+\.\d+)\s*$/);
20+
my $value = sprintf("%.10f", $1 / KCAL_PER_HARTREE);
21+
22+
print "key: ESOLVCDS\n";
23+
print "size:\n1\n";
24+
print "values:\n$value\n";
25+
print "units:\nHartree\n";
26+
print "END\n";
27+
exit(0);

‎scripts/parsers/gaussian-16.thermo‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/env perl
2+
################################################################################
3+
#
4+
# Purpose:
5+
# Extracts the Thermochemistry block of a Gaussian Freq job into the keys
6+
# ORCA already fills: EZEROPT, ETHERM, ENTHALPY, EGIBBS and ENTROPY, plus
7+
# THERMOTEMP. Same script for Gaussian 09 and 16 (identical block layout).
8+
#
9+
# Units: Gaussian prints the "Sum of electronic and ..." lines as absolute
10+
# energies in Hartree/particle, so ETHERM/ENTHALPY/EGIBBS need no
11+
# conversion. EZEROPT is the "Zero-point correction" (the correction, as
12+
# for ORCA, not the electronic-plus-ZPE sum). ENTROPY holds T*S in
13+
# Hartree, as for ORCA, so S (cal/mol-K, total row of the table) is
14+
# multiplied by the printed temperature.
15+
#
16+
# Temperature 298.150 Kelvin. Pressure 1.00000 Atm.
17+
# Zero-point correction= 0.024386 (Hartree/Particle)
18+
# Sum of electronic and thermal Energies= -74.938683
19+
# Sum of electronic and thermal Enthalpies= -74.937739
20+
# Sum of electronic and thermal Free Energies= -74.959907
21+
# E (Thermal) CV S
22+
# Total 17.080 5.968 46.658
23+
#
24+
# The pressure has no property key, so it is not stored.
25+
#
26+
################################################################################
27+
28+
$| = 1;
29+
30+
use constant KCAL_PER_HARTREE => 627.5094740631;
31+
32+
my ($temp, $zpe, $etherm, $enth, $gibbs, $S);
33+
my $inTable = 0;
34+
while (<STDIN>) {
35+
if (/^\s*Temperature\s+(\d+\.\d+)\s+Kelvin/) { $temp = $1; }
36+
elsif (/Zero-point correction=\s+(-?\d+\.\d+)/) { $zpe = $1; }
37+
elsif (/Sum of electronic and thermal Energies=\s+(-?\d+\.\d+)/) { $etherm = $1; }
38+
elsif (/Sum of electronic and thermal Enthalpies=\s+(-?\d+\.\d+)/) { $enth = $1; }
39+
elsif (/Sum of electronic and thermal Free Energies=\s+(-?\d+\.\d+)/) { $gibbs = $1; }
40+
elsif (/E \(Thermal\)\s+CV\s+S/) { $inTable = 1; }
41+
elsif ($inTable && /^\s*Total\s+\S+\s+\S+\s+(-?\d+\.\d+)\s*$/) { $S = $1; $inTable = 0; }
42+
}
43+
44+
sub emit {
45+
my ($key, $value, $units) = @_;
46+
print "key: $key\n";
47+
print "size:\n1\n";
48+
print "values:\n$value\n";
49+
print "units:\n$units\n";
50+
print "END\n";
51+
}
52+
53+
&emit("EZEROPT", $zpe, "Hartree") if (defined($zpe));
54+
&emit("ETHERM", $etherm, "Hartree") if (defined($etherm));
55+
&emit("ENTHALPY", $enth, "Hartree") if (defined($enth));
56+
if (defined($S) && defined($temp)) {
57+
&emit("ENTROPY", sprintf("%.8f", $S * $temp / 1000.0 / KCAL_PER_HARTREE), "Hartree");
58+
}
59+
&emit("EGIBBS", $gibbs, "Hartree") if (defined($gibbs));
60+
&emit("THERMOTEMP", $temp, "Kelvin") if (defined($temp));
61+
exit(0);

‎scripts/parsers/nwchem.desc‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,14 @@ Skip=1
282282
Lines=1
283283
[END]
284284

285+
# Thermochemistry and COSMO solvation exist only in NWChem's stdout (the
286+
# primary output file), not in the ecce_print trace, hence a File= entry.
287+
[EZEROPT][ETHERM][ENTHALPY][ENTROPY][EGIBBS][THERMOTEMP][ESOLV]
288+
Script=nwchem.thermo
289+
File=nwch.nwout
290+
Begin=nwch.nwout
291+
[END]
292+
285293
[MULLIKEN]
286294
Script=nwchem.mulliken
287295
Begin=begin%total mulliken atomic

‎scripts/parsers/nwchem.thermo‎

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/env perl
2+
################################################################################
3+
#
4+
# Purpose:
5+
# Reads NWChem's plain stdout (not the ecce_print trace, which carries no
6+
# thermochemistry and no solvation data) and emits EZEROPT, ETHERM,
7+
# ENTHALPY, ENTROPY, EGIBBS, THERMOTEMP and, for COSMO, ESOLV.
8+
#
9+
# NWChem prints only corrections, so the absolute values ORCA and Gaussian
10+
# report are rebuilt here. The reference electronic energy is the first
11+
# "Total <method> energy" after the Hessian banner, i.e. the energy at the
12+
# analysed geometry, not a later displaced-geometry energy:
13+
# ETHERM = E + thermal correction to energy
14+
# ENTHALPY = E + thermal correction to enthalpy
15+
# ENTROPY = T * S (Hartree, as for ORCA)
16+
# EGIBBS = ENTHALPY - T*S
17+
#
18+
# Temperature = 298.15K
19+
# Zero-Point correction to Energy = 16.145 kcal/mol ( 0.025729 au)
20+
# Thermal correction to Energy = 17.922 kcal/mol ( 0.028561 au)
21+
# Thermal correction to Enthalpy = 18.515 kcal/mol ( 0.029505 au)
22+
# Total Entropy = 45.039 cal/mol-K
23+
#
24+
# ESOLV = sol phase energy - gas phase energy from the COSMO summary. The
25+
# summary's own "(electrostatic) solvation energy" line is the magnitude
26+
# of that difference, so the sign is taken from the two totals.
27+
#
28+
################################################################################
29+
30+
$| = 1;
31+
32+
use constant KCAL_PER_HARTREE => 627.5094740631;
33+
34+
my ($e, $temp, $zpe, $dE, $dH, $S, $gas, $sol);
35+
my $inHessian = 0;
36+
while (<STDIN>) {
37+
$inHessian = 1 if (/NWChem Nuclear Hessian and Frequency Analysis/);
38+
if ($inHessian && !defined($e)
39+
&& /^\s+Total [\w()\-\. ]*? energy\s+=\s+(-?\d+\.\d+)\s*$/) {
40+
$e = $1;
41+
}
42+
if (/^\s*Temperature\s+=\s+(\d+\.\d+)K/) { $temp = $1; }
43+
elsif (/Zero-Point correction to Energy\s+=.*\(\s*(-?\d+\.\d+)\s+au\)/) { $zpe = $1; }
44+
elsif (/Thermal correction to Energy\s+=.*\(\s*(-?\d+\.\d+)\s+au\)/) { $dE = $1; }
45+
elsif (/Thermal correction to Enthalpy\s+=.*\(\s*(-?\d+\.\d+)\s+au\)/) { $dH = $1; }
46+
elsif (/^\s*Total Entropy\s+=\s+(-?\d+\.\d+)\s+cal\/mol-K/) { $S = $1; }
47+
elsif (/^\s*gas phase energy\s+=\s+(-?\d+\.\d+)/) { $gas = $1; }
48+
elsif (/^\s*sol phase energy\s+=\s+(-?\d+\.\d+)/) { $sol = $1; }
49+
}
50+
51+
sub emit {
52+
my ($key, $value, $units) = @_;
53+
print "key: $key\n";
54+
print "size:\n1\n";
55+
print "values:\n$value\n";
56+
print "units:\n$units\n";
57+
print "END\n";
58+
}
59+
60+
if (defined($e) && defined($dE) && defined($dH) && defined($S) && defined($temp)) {
61+
my $ts = $S * $temp / 1000.0 / KCAL_PER_HARTREE;
62+
&emit("EZEROPT", $zpe, "Hartree") if (defined($zpe));
63+
&emit("ETHERM", sprintf("%.8f", $e + $dE), "Hartree");
64+
&emit("ENTHALPY", sprintf("%.8f", $e + $dH), "Hartree");
65+
&emit("ENTROPY", sprintf("%.8f", $ts), "Hartree");
66+
&emit("EGIBBS", sprintf("%.8f", $e + $dH - $ts), "Hartree");
67+
&emit("THERMOTEMP", $temp, "Kelvin");
68+
}
69+
if (defined($gas) && defined($sol)) {
70+
&emit("ESOLV", sprintf("%.10f", $sol - $gas), "Hartree");
71+
}
72+
exit(0);

0 commit comments

Comments
 (0)