15 June 2018

652. N/EDA in GAMESS. 4. Running NEDA

Posts 1, 2 and 3.

For this you will need to have linked gamess and nbo.

Here's an example input that works:
andy@carbon:~$ less fast/gamess/mgme_tzvp/Mg_tzvp_opt_neda_2.inp ! File created by the GAMESS Input Deck Generator Plugin for Avogadro $CONTRL SCFTYP=RHF RUNTYP=energy DFTTYP=PBE0 ICHARG=1 MULT=1 NOSYM=1 $END ! $PCM SOLVNT=NEPTANE $END ! $PCMCAV RADII=SUAHF $END ! $SCF DIRSCF=.TRUE. $END $BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END $system mwords=2000 memddi=500 $end $INTGRL NOPK=1 $END $NBO MOLUNIT <1> > <2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23> $END $DEL NEDA END $END $DATA Title C1 Mg 12.0 3.14572 1.02487 1.29474 N 7.0 4.95329 0.37304 1.62652 N 7.0 3.11530 2.89665 1.82263 C 6.0 5.44265 -0.98008 1.41792 C 6.0 5.80308 1.30078 2.07039 C 6.0 1.96130 3.78017 1.78886 C 6.0 4.28661 3.37927 2.23846 C 6.0 5.48149 2.64462 2.33178 H 1.0 6.31935 3.22840 2.68338 C 6.0 4.36331 4.81950 2.64988 H 1.0 5.37500 5.09552 2.93515 H 1.0 3.70056 5.01438 3.49762 H 1.0 4.03950 5.47541 1.83769 C 6.0 7.22682 0.90313 2.32491 H 1.0 7.68811 0.50750 1.41630 H 1.0 7.27827 0.11050 3.07627 H 1.0 7.81805 1.74612 2.67254 H 1.0 5.81529 -1.43220 2.34182 H 1.0 4.63475 -1.61377 1.04987 H 1.0 6.24793 -1.02060 0.67837 H 1.0 1.72108 4.18678 2.77556 H 1.0 2.10316 4.62224 1.10460 H 1.0 1.08587 3.22835 1.44552 $END


And here's the output:
Natural Energy Decomposition Analysis (Summary): Component Energy(wfn) Energy(wfn) (kcal/mol) ------------------------------------------------------------------------------ C7H13N2Mg(+) -583.0832392(scf) -582.9738665(loc) CT = -68.632 ES = -394.694 POL = -353.983 XC = -29.974 1. Mg(+2) -199.0566873(def) -199.0582918(cp) DEF(SE) = 1.007( 0.400) 2. C7H13N2(-) -382.6763191(def) -383.3176043(cp) DEF(SE) = 402.412(176.794) --------- E = -443.864 Electrical (ES+POL+SE) : -571.483 Charge Transfer (CT) : -68.632 Core (XC+DEF-SE) : 196.251 ------------ Total Interaction (E) : -443.864 ..... done with NBO analysis .....
A couple of things to note:
* It runs with PCM, but the results seem nonsensical, in addition to it finding a lot more fragments than without PCM (the latter thing can be amended with NAO)

* If I use DEF2TZVP with PBE0 and DIRSCF=.TRUE. It'll get stuck during the NBO run at
437. RY ( 5) H 23 0.00000 0.00000 0.00000 NEXT STEP: Perform one SCF cycle to evaluate the energy of the new density matrix constructed from the deleted NBO Fock matrix. ------------------------------------------------------------------------------ -------------------------- R-PBE0 SCF CALCULATION -------------------------- DENSITY MATRIX CONVERGENCE THRESHOLD= 2.00E-05 COARSE -> FINE DFT GRID SWITCH THRESHOLD= 3.00E-04 (SWITCH IN $DFT) HF -> DFT SWITCH THRESHOLD= 0.00E+00 (SWOFF IN $DFT) DIRECT SCF CALCULATION, SCHWRZ=T FDIFF=T, DIRTHR= 0.00E+00 NITDIR=10 NONZERO BLOCKS ITER EX DEM TOTAL ENERGY E CHANGE DENSITY CHANGE DIIS ERROR INTEGRALS SKIPPED
It's not consuming any CPU at this point (nor is nbo). I'm running w/o DIRSCF now, but it's very slow, and requires ca 30 Gb of scratch space even for a small molecule like this one.

MOLUNIT <1> >
<2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23>
is not necessary for this run. You can simply use NBO $END instead.

651. N/EDA in GAMESS. 3. Running L/CMOEDA

As it turns out, while MOEDA works fine with pure and hybrid functionals, it does not appear to like PCM, giving weird results.

Here's an example of a run that works, with a few key words highlighted:
! File created by the GAMESS Input Deck Generator Plugin for Avogadro $BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END ! $PCM SOLVNT=NEPTANE $END ! $PCMCAV RADII=SUAHF $END $CONTRL SCFTYP=RHF RUNTYP=EDA DFTTYP=PBE0 ICHARG=1 MULT=1 $END $CONTRL NOSYM=1 $END $SYSTEM MWORDS=2500 MEMDDI=500 $END $SCF DIRSCF=.TRUE. $END $lmoeda matom(1)=1,22 mcharg(1)=2,-1 mmult(1)=1,1 $end $DATA Test of MOEDA using a Mg coordination compound. C1 Mg 12.0 3.14572 1.02487 1.29474 N 7.0 4.95329 0.37304 1.62652 N 7.0 3.11530 2.89665 1.82263 C 6.0 5.44265 -0.98008 1.41792 C 6.0 5.80308 1.30078 2.07039 C 6.0 1.96130 3.78017 1.78886 C 6.0 4.28661 3.37927 2.23846 C 6.0 5.48149 2.64462 2.33178 H 1.0 6.31935 3.22840 2.68338 C 6.0 4.36331 4.81950 2.64988 H 1.0 5.37500 5.09552 2.93515 H 1.0 3.70056 5.01438 3.49762 H 1.0 4.03950 5.47541 1.83769 C 6.0 7.22682 0.90313 2.32491 H 1.0 7.68811 0.50750 1.41630 H 1.0 7.27827 0.11050 3.07627 H 1.0 7.81805 1.74612 2.67254 H 1.0 5.81529 -1.43220 2.34182 H 1.0 4.63475 -1.61377 1.04987 H 1.0 6.24793 -1.02060 0.67837 H 1.0 1.72108 4.18678 2.77556 H 1.0 2.10316 4.62224 1.10460 H 1.0 1.08587 3.22835 1.44552 $END
The ! comments out the PCM lines. I generated the input from an .xyz file through avogadro, and then edited the file manually to get the charges etc. right.

Here's the output:
DIRECT SCF CALCULATION, SCHWRZ=T FDIFF=F, DIRTHR= 0.00E+00 NITDIR=10 DFT IS SWITCHED OFF, PERFORMING PURE SCF UNTIL SWOFF THRESHOLD IS REACHED. NONZERO BLOCKS ITER EX DEM TOTAL ENERGY E CHANGE DENSITY CHANGE DIIS ERROR INTEGRALS SKIPPED *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 0 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 EXECUTION OF GAMESS TERMINATED -ABNORMALLY- AT Thu Jun 14 23:30:05 2018 6712269 WORDS OF DYNAMIC MEMORY USED CPU 0: STEP CPU TIME= 1.73 TOTAL CPU TIME= 2.0 ( 0.0 MIN) TOTAL WALL CLOCK TIME= 2.1 SECONDS, CPU UTILIZATION IS 96.70% DDI Process 0: error code 911 ddikick.x: application process 0 quit unexpectedly. ddikick.x: Fatal error detected. The error is most likely to be in the application, so check for input errors, disk space, memory needs, application bugs, etc. ddikick.x will now clean up all processes, and exit... DDI Process 1: terminated upon request. DDI Process 2: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 1 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 2 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 DDI Process 3: terminated upon request. DDI Process 4: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 3 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 DDI Process 5: terminated upon request. *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 4 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 *** ERROR *** IN -DAWRIT- ROUTINE ON NODE 5 DAWRIT HAS REQUESTED A RECORD WITH LENGTH DIFFERENT THAN BEFORE - ABORT FORCED. DAF RECORD 88 NEW LENGTH = 20100 OLD LENGTH = 190 ddikick.x: Sending kill signal to DDI processes. ddikick.x: Execution terminated due to error(s). unset echo

650. N/EDA in GAMESS. 2. Defining an external basis set

This is post number two in a series. Post 1 is here: http://verahill.blogspot.com/2018/06/649-neda-in-gamess-1-recompiling-gamess.html

Defining external basis sets isn't hard, but I find that the gamess documentation isn't great, and there isn't as much online as one would hope.


1. Either way, I'll create an external basis set file with def2svp and def2tzvp at /opt/gamess/gamess_nbo/EXTFILE.txt

2. Get the basis set definition from https://bse.pnl.gov/bse/portal -- select the atoms you want, and the basis set, set format to GAMESS US, and click Get Basis Set.


3. When you paste the data into the EXTFILE.txt,
a) skip the $DATA tag, and
b) change the atom definition to their corresponding symbols (e.g. H instead of Hydrogen) and append the name of the basis set,

so the beginning looks like this:
MG DEF2SVP S 5 1 4953.8339196 -0.57778967498E-02 2 745.18044154 -0.43124761082E-01 3 169.21604972 -0.19268216987 4 47.300672019 -0.48641439116 5 14.461336973 -0.42550894077 S 3 1 24.768174789 0.87956969984E-01 2 2.4940945349 -0.55165058128 3 0.87807584533 -0.53443294833 S 1 1 0.87212782497E-01 1.0000000 S 1 1 0.33599293780E-01 1.0000000 P 5 1 98.053010494 -0.14480564601E-01 2 22.586932277 -0.95495750787E-01 3 6.8391509842 -0.30787672651 4 2.2332843818 -0.49936292886 5 0.71606599387 -0.31503476213 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 0.1010000 1.0000000 H DEF2SVP S 3 1 13.0107010 0.19682158E-01 2 1.9622572 0.13796524 3 0.44453796 0.47831935 S 1 1 0.12194962 1.0000000 P 1 1 0.8000000 1.0000000 C DEF2SVP
and the end like this:
D 1 1 0.64500000 1.0000000 F 1 1 1.42800000 1.0000000 MG DEF2TZVP S 7 1 31438.3495550 0.60912311326E-03 2 4715.5153354 0.47066196465E-02 3 1073.1629247 0.24135820657E-01 4 303.57238768 0.93628959834E-01 5 98.626251042 0.26646742093 6 34.943808417 0.47890929917 7 12.859785199 0.33698490286 S 3 1 64.876913004 0.19180889307E-01 2 19.725520777 0.90913704392E-01 3 2.8951804339 -0.39563756125 S 2 1 1.1960454710 1.6827603373 2 0.54329451156 0.52141091954 S 1 1 0.10099104092 1.0000000 S 1 1 0.36865728085E-01 1.0000000 P 5 1 179.87189612 0.53799549018E-02 2 42.120069376 0.39318014098E-01 3 13.120503032 0.15740129476 4 4.6257503609 0.35919094128 5 1.6695211016 0.45533379310 P 1 1 0.58551012105 1.0000000 P 1 1 0.18914796195 1.0000000 P 1 1 0.53768755187E-01 1.0000000 D 1 1 3.4440000 1.0000000 D 1 1 0.2900000 1.0000000 D 1 1 0.0700000 1.0000000


4. Edit the gms-files.csh in your gamess root (e.g. /opt/gamess/gamess_nbo)
setenv EXTBAS /opt/gamess/gamess_nbo/EXTFILE.txt


5. To use, put
$BASIS EXTFIL=.TRUE. GBASIS=DEF2TZVP $END
or
$BASIS EXTFIL=.TRUE. GBASIS=DEF2SVP $END
in your gamess input file.

649. N/EDA in GAMESS. 1. Recompiling GAMESS US with NBO6

I need to do energy decomposition analysis (EDA), but only have licenses for Gaussian and NBO6 (i.e. not ADF, turbomole, QChem etc.). NEDA isn't supported by NBO6 with gaussian (afaik).

NWChem, my usual gaussian alternative, doesn't support NBO6 beyond writing a .47 file.

Enter GAMESS US. I've been trying out gamess every few years, but I've found that it's slow and unreliable (very difficult to get SCF convergence) for the systems I work with (polyanions). Some of this may obviously be down to my lack of familiarity with the code -- there are probably plenty of satisified users of GAMESS US.

Either way, NBO6 suppports NEDA with GAMESS US. Also, GAMESS US does two different types  of   EDA: the common Morokuma-Kitaura (MOROKM) one (although only with HF) and an alternative approach by Su and Li that's referred to by GAMESS as LMOEDA (or CMOEDA).

MOROKM and LMOEDA as supported out of the box by GAMESS, but to get it to do NEDA you need to re-link it against NBO. Luckily it's even easier than the instructions in the NBO gamess file (i.e. no need to edit code).

NOTE: I could only link with gfortran 4.9 (jessie). gfortran 6.3 (stretch) failed to link (messages re -fPIC; recompiling gamess with -fPIC didn't solve it).

To compile gamess, see e.g. http://verahill.blogspot.com/2013/06/4xx-gamess-us-2013-r1-on-debian-wheezy.html

Once you've done the ddi/comp and compall steps, edit lked and search for NBO. Change to

set NBO=true set NBOLIB="/opt/nbo6/bin/gmsnbo.i8.a"
assuming that this location is correct.

Then do lked as in the post above.