Skip to content

Commit 67f033e

Browse files
andyclaude
andcommitted
Gaussian: the dispersion option emitted a keyword Gaussian rejects
"Use GD3-BJ" put "empiricaldispersion=GD3-BJ" on the route line. Gaussian does not accept that spelling -- the keyword is GD3BJ, no hyphen -- so every deck that ticked the box was refused outright with a syntax error. The option has never worked. Found while checking whether the NWChem dispersion work had been reverted in the Gaussian dialog. It had not: that dialog was never touched, and its single checkbox is what has always been there. Testing the keyword was what turned it up. Verified against the installed Gaussian 16, water/B3LYP/6-31G*: GD2 Grimme D2 -76.408793 GD3 Grimme D3 -76.408762 GD3BJ Grimme D3(BJ) -76.409328 PFD Petersson-Frisch -76.408754 GD3-BJ REJECTED So the checkbox becomes a dropdown offering all four, named to match NWChem's dispersion control so the two codes read the same way. The old boolean key is still honoured, so a calculation saved before this keeps working -- and now actually runs, since it emits GD3BJ. Applied to Gaussian 16 and 09. ai.gauss03 has the same broken keyword and is left alone, being retired. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFMUNbw2UpRPmgsqviAowb
1 parent bbb267a commit 67f033e

4 files changed

Lines changed: 82 additions & 14 deletions

File tree

‎scripts/codereg/ged09theory.py‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -376,12 +376,26 @@ def __init__(self,parent,helpURL=""):
376376
label = "Grid Quality:")
377377
dftSizer.AddWidget(self.gridOpt)
378378

379-
self.useGD3BJBox = EcceCheckBox(self,
380-
label = " Use GD3-BJ",
381-
name = "ES.Theory.DFT.UseGD3BJ",
382-
default = False,
379+
# Was a single "Use GD3-BJ" checkbox, which emitted
380+
# "empiricaldispersion=GD3-BJ" -- a spelling Gaussian rejects
381+
# outright, so it never worked. Gaussian takes three Grimme
382+
# corrections and the Petersson-Frisch one; all four were run
383+
# against the installed g16 before being offered here.
384+
#
385+
# Named to match NWChem's dispersion control so the two codes
386+
# read the same way.
387+
dispersionChoice = ["None",
388+
"Grimme D2",
389+
"Grimme D3",
390+
"Grimme D3(BJ)",
391+
"Petersson-Frisch"]
392+
self.dispersion = EcceComboBox(self,
393+
choices = dispersionChoice,
394+
name = "ES.Theory.DFT.Dispersion",
395+
default = dispersionChoice.index("None"),
396+
label = "Dispersion:",
383397
export = 1)
384-
dftSizer.AddWidget(self.useGD3BJBox)
398+
dftSizer.AddWidget(self.dispersion)
385399

386400

387401
self.panelSizer.Add(dftSizer)

‎scripts/codereg/ged16theory.py‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,26 @@ def __init__(self,parent,helpURL=""):
402402
label = "Grid Quality:")
403403
dftSizer.AddWidget(self.gridOpt)
404404

405-
self.useGD3BJBox = EcceCheckBox(self,
406-
label = " Use GD3-BJ",
407-
name = "ES.Theory.DFT.UseGD3BJ",
408-
default = False,
405+
# Was a single "Use GD3-BJ" checkbox, which emitted
406+
# "empiricaldispersion=GD3-BJ" -- a spelling Gaussian rejects
407+
# outright, so it never worked. Gaussian takes three Grimme
408+
# corrections and the Petersson-Frisch one; all four were run
409+
# against the installed g16 before being offered here.
410+
#
411+
# Named to match NWChem's dispersion control so the two codes
412+
# read the same way.
413+
dispersionChoice = ["None",
414+
"Grimme D2",
415+
"Grimme D3",
416+
"Grimme D3(BJ)",
417+
"Petersson-Frisch"]
418+
self.dispersion = EcceComboBox(self,
419+
choices = dispersionChoice,
420+
name = "ES.Theory.DFT.Dispersion",
421+
default = dispersionChoice.index("None"),
422+
label = "Dispersion:",
409423
export = 1)
410-
dftSizer.AddWidget(self.useGD3BJBox)
424+
dftSizer.AddWidget(self.dispersion)
411425

412426

413427
self.panelSizer.Add(dftSizer)

‎scripts/parsers/ai.gauss09‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,28 @@ sub G09Route {
354354
$route .= " AIM=(CP)";
355355
}
356356

357-
if ($AbiDict{"ES.Theory.DFT.UseGD3BJ"}) {
358-
$route .= " empiricaldispersion=GD3-BJ";
357+
# Gaussian REJECTS "GD3-BJ" -- the keyword is GD3BJ, no hyphen. Every
358+
# deck that ticked the old "Use GD3-BJ" box was refused outright by
359+
# Gaussian 16 ("A syntax error was detected in the input line"), so
360+
# that option has never worked. Verified against the installed g16,
361+
# along with the other three ECCE now offers:
362+
#
363+
# GD2 Grimme D2 -76.408793 for water/B3LYP/6-31G*
364+
# GD3 Grimme D3 -76.408762
365+
# GD3BJ Grimme D3(BJ) -76.409328
366+
# PFD Petersson-Frisch -76.408754
367+
#
368+
# The old boolean key is still honoured so a calculation saved before
369+
# this keeps working -- and now actually runs.
370+
my %g16Dispersion = ("Grimme D2" => "GD2",
371+
"Grimme D3" => "GD3",
372+
"Grimme D3(BJ)" => "GD3BJ",
373+
"Petersson-Frisch" => "PFD");
374+
my $disp = $AbiDict{"ES.Theory.DFT.Dispersion"};
375+
if (defined($disp) && exists($g16Dispersion{$disp})) {
376+
$route .= " empiricaldispersion=" . $g16Dispersion{$disp};
377+
} elsif ($AbiDict{"ES.Theory.DFT.UseGD3BJ"}) {
378+
$route .= " empiricaldispersion=GD3BJ";
359379
}
360380
# End Andy
361381

‎scripts/parsers/ai.gauss16‎

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,28 @@ sub G09Route {
354354
$route .= " AIM=(CP)";
355355
}
356356

357-
if ($AbiDict{"ES.Theory.DFT.UseGD3BJ"}) {
358-
$route .= " empiricaldispersion=GD3-BJ";
357+
# Gaussian REJECTS "GD3-BJ" -- the keyword is GD3BJ, no hyphen. Every
358+
# deck that ticked the old "Use GD3-BJ" box was refused outright by
359+
# Gaussian 16 ("A syntax error was detected in the input line"), so
360+
# that option has never worked. Verified against the installed g16,
361+
# along with the other three ECCE now offers:
362+
#
363+
# GD2 Grimme D2 -76.408793 for water/B3LYP/6-31G*
364+
# GD3 Grimme D3 -76.408762
365+
# GD3BJ Grimme D3(BJ) -76.409328
366+
# PFD Petersson-Frisch -76.408754
367+
#
368+
# The old boolean key is still honoured so a calculation saved before
369+
# this keeps working -- and now actually runs.
370+
my %g16Dispersion = ("Grimme D2" => "GD2",
371+
"Grimme D3" => "GD3",
372+
"Grimme D3(BJ)" => "GD3BJ",
373+
"Petersson-Frisch" => "PFD");
374+
my $disp = $AbiDict{"ES.Theory.DFT.Dispersion"};
375+
if (defined($disp) && exists($g16Dispersion{$disp})) {
376+
$route .= " empiricaldispersion=" . $g16Dispersion{$disp};
377+
} elsif ($AbiDict{"ES.Theory.DFT.UseGD3BJ"}) {
378+
$route .= " empiricaldispersion=GD3BJ";
359379
}
360380
# End Andy
361381

0 commit comments

Comments
 (0)