Search:

# Running Calculations On A Grid

Very often, it is desirable to calculate parts of what we call a potential energy surface'' rather than simply focusing on the stationary points. To facilitate this type of calculation, a feature has been added to the program system that allows all types of calculations to be run over one- and two-dimensional grids that can be specified by either cartesian or internal coordinates (those internal coordinates that are specified in the ZMAT file).

Using either GRID=CARTESIAN or GRID=INTERNAL, the program writes out a list of geometries that will be used in the series of calculations; these can be found in the file "grid.xyz" in the working directory. Another file named "grid.log" is also written, and contains the x,E (1D) or x,y,E (2D) data, where x and y represent values of internal coordinates or scaled cartesian displacements (see below), and E is the highest level energy calculated at that geometry (EOM takes precedence over reference state correlation energy which in turn takes precedence over the SCF energy). This "grid.log" file is especially useful as it can serve as input with little or no modification to plotting and contouring programs.

It is recognized that users may sometimes want to plot something other than the energy (vibrational frequencies, NMR chemical shifts, dipole moments, etc.), but there is currently no way to change what is written to the "grid.log" file. To get the required data to plot, it will be necessary to extract it from the principal output file, but the "grid.log" file is still useful as it keeps a record of the values of coordinates that correspond to each calculation that appears sequentially in the output.

Input and Output

The two types of grid calculation are specified by GRID=INTERNAL and GRID=CARTESIAN, with an additional input region required for both calculations. For the first option, an internal coordinate (Z-matrix) specification of the geometry is necessary (it is not compatible with COORD=CARTESIAN!), and for the second option, a cartesian coordinate geometry specification is required. Example ZMAT files, descriptions and outputs for both types of calculation are shown below:

   water   H    O 1 R   H 2 R 1 A      R=1.0   A=100.      *CFOUR(CALC=SCF,BASIS=DZP,GRID=INTERNAL)
%grid   2   1 0.9 0.02 6   3 100. 1. 6\\


In this case (GRID=INTERNAL), the parameters below the have the following meaning:

• First line: Number of internal coordinates that will be varied (must be 1-10)
• Second line: First entry is the internal coordinate number (R is the first internal coordinate that appears in the Z-matrix), second entry is the starting value for that coordinate (and all others that are equivalent to it by symmetry), third is the stepsize, fourth is the number of steps. If desired, a coordinate can be set to start at the current value of another coordinate, making a i.ge.j type loop. To do this, the second entry of the line should read %#, where # is the other coordinate's position in the list, not its internal coordinate number. If triangular grids of this sort are desired, then all groups of triangularized coordinates must collectively be at the start or at the end of the specifications. That is, you cannot specify two triangular indices, one non-triangular one, and then three more triangular indices.
• Third line: Same as above (note that A is the third internal coordinate as the Z-matrix file is read left-to-right, top-to-bottom.

This calculation produce the following grid.xyz and grid.log files:

grid.xyz

    1        0.9000000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6749155958        0.0000000000        1.9960866785
2        0.9000000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6695062298        0.0000000000        2.0252730057
3        0.9000000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6635883160        0.0000000000        2.0543604811
4        0.9000000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6571636571        0.0000000000        2.0833402445
5        0.9000000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6502342102        0.0000000000        2.1122034684
6        0.9000000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7007538686
1.6428020858        0.0000000000        2.1409413608
7        0.9200000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.7121359423        0.0000000000        2.0404441603
8        0.9200000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.7066063682        0.0000000000        2.0702790724
9        0.9200000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.7005569453        0.0000000000        2.1000129362
10        0.9200000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.6939895162        0.0000000000        2.1296366944
11        0.9200000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.6869060815        0.0000000000        2.1591413233
12        0.9200000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7385483990
1.6793087989        0.0000000000        2.1885178355
13        0.9400000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7493562889        0.0000000000        2.0848016420
14        0.9400000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7437065067        0.0000000000        2.1152851392
15        0.9400000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7375255745        0.0000000000        2.1456653914
16        0.9400000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7308153752        0.0000000000        2.1759331443
17        0.9400000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7235779528        0.0000000000        2.2060791781
18        0.9400000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.7763429294
1.7158155119        0.0000000000        2.2360943102
19        0.9600000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7865766355        0.0000000000        2.1291591238
20        0.9600000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7808066451        0.0000000000        2.1602912060
21        0.9600000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7744942037        0.0000000000        2.1913178465
22        0.9600000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7676412343        0.0000000000        2.2222295942
23        0.9600000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7602498242        0.0000000000        2.2530170330
24        0.9600000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8141374598
1.7523222249        0.0000000000        2.2836707849
25        0.9800000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.8237969821        0.0000000000        2.1735166055
26        0.9800000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.8179067835        0.0000000000        2.2052972728
27        0.9800000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.8114628330        0.0000000000        2.2369703016
28        0.9800000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.8044670933        0.0000000000        2.2685260440
29        0.9800000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.7969216955        0.0000000000        2.2999548879
30        0.9800000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8519319903
1.7888289379        0.0000000000        2.3312472596
31        1.0000000000      100.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8610173286        0.0000000000        2.2178740873
32        1.0000000000      101.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8550069220        0.0000000000        2.2503033396
33        1.0000000000      102.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8484314622        0.0000000000        2.2826227568
34        1.0000000000      103.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8412929524        0.0000000000        2.3148224939
35        1.0000000000      104.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8335935668        0.0000000000        2.3468927427
36        1.0000000000      105.0000000000
0.0000000000        0.0000000000        0.0000000000
0.0000000000        0.0000000000        1.8897265207
1.8253356509        0.0000000000        2.3788237343


grid.log

    0.90000000000000  100.00000000000000  -76.04036622049759
0.90000000000000  101.00000000000000  -76.04078581956877
0.90000000000000  102.00000000000000  -76.04114532117904
0.90000000000000  103.00000000000000  -76.04144563649147
0.90000000000000  104.00000000000000  -76.04168769261167
0.90000000000000  105.00000000000000  -76.04187243379241
0.92000000000000  100.00000000000000  -76.04402849474391
0.92000000000000  101.00000000000000  -76.04440243445698
0.92000000000000  102.00000000000000  -76.04471733514663
0.92000000000000  103.00000000000000  -76.04497407240058
0.92000000000000  104.00000000000000  -76.04517353895315
0.92000000000000  105.00000000000000  -76.04531664572092
0.94000000000000  100.00000000000000  -76.04556445926659
0.94000000000000  101.00000000000000  -76.04589454787919
0.94000000000000  102.00000000000000  -76.04616664521535
0.94000000000000  103.00000000000000  -76.04638159187495
0.94000000000000  104.00000000000000  -76.04654024651097
0.94000000000000  105.00000000000000  -76.04664348669797
0.96000000000000  100.00000000000000  -76.04524537911652
0.96000000000000  101.00000000000000  -76.04553348287507
0.96000000000000  102.00000000000000  -76.04576463550323
0.96000000000000  103.00000000000000  -76.04593964248616
0.96000000000000  104.00000000000000  -76.04605932797199
0.96000000000000  105.00000000000000  -76.04612453549646
0.98000000000000  100.00000000000000  -76.04331045822190
0.98000000000000  101.00000000000000  -76.04355849512490
0.98000000000000  102.00000000000000  -76.04375061509799
0.98000000000000  103.00000000000000  -76.04388758768199
0.98000000000000  104.00000000000000  -76.04397020145203
0.98000000000000  105.00000000000000  -76.04399926460759
1.00000000000000  100.00000000000000  -76.03997071763045
1.00000000000000  101.00000000000000  -76.04018064785870
1.00000000000000  102.00000000000000  -76.04033568957210
1.00000000000000  103.00000000000000  -76.04043657495215
1.00000000000000  104.00000000000000  -76.04048405538951
1.00000000000000  105.00000000000000  -76.04047890199641


Now for the case of GRID=CARTESIAN, an example file is:

   water
H 0. 0.75 0.57
O 0. 0. 0.
H 0. -0.75 0.57

*CFOUR(CALC=SCF,BASIS=DZP,GRID=CARTESIAN,COORD=CARTESIAN)

%grid
2
1 0.0 0.1 4
2 0.0 0.1 4

0. 0. 0.
0. 0. 1.
0. 0. 0.

0. 1. 0.
0. 0. 0.
0. -1. 0.


Here, the input below the

• First line: Number of cartesian displacement vectors that will be varied (must be 1-6)
• Second line: First entry must be "1"; second entry is the lowest scaling factor that will be applied to coordinate 1; third entry is the step in the increments of the scaling factor; fourth entry is the number of steps.
• Third line: Same as above, except that first entry must be "2"
• Fourth line: must be blank
• Next entry: First cartesian displacement vector, of a length appropriate for the desired scaling factors
• Next entry: blank line
• Next entry: Second cartesian displacement vector, of a length appropriate for the desired scaling factors

grid.xyz

    1        0.1000000000        0.1000000000
0.0000000000        1.5172948905        1.0771441168
0.0000000000        0.0000000000        0.1000000000
0.0000000000       -1.5172948905        1.0771441168
2        0.1000000000        0.2000000000
0.0000000000        1.6172948905        1.0771441168
0.0000000000        0.0000000000        0.1000000000
0.0000000000       -1.6172948905        1.0771441168
3        0.1000000000        0.3000000000
0.0000000000        1.7172948905        1.0771441168
0.0000000000        0.0000000000        0.1000000000
0.0000000000       -1.7172948905        1.0771441168
4        0.1000000000        0.4000000000
0.0000000000        1.8172948905        1.0771441168
0.0000000000        0.0000000000        0.1000000000
0.0000000000       -1.8172948905        1.0771441168
5        0.2000000000        0.1000000000
0.0000000000        1.5172948905        1.0771441168
0.0000000000        0.0000000000        0.2000000000
0.0000000000       -1.5172948905        1.0771441168
6        0.2000000000        0.2000000000
0.0000000000        1.6172948905        1.0771441168
0.0000000000        0.0000000000        0.2000000000
0.0000000000       -1.6172948905        1.0771441168
7        0.2000000000        0.3000000000
0.0000000000        1.7172948905        1.0771441168
0.0000000000        0.0000000000        0.2000000000
0.0000000000       -1.7172948905        1.0771441168
8        0.2000000000        0.4000000000
0.0000000000        1.8172948905        1.0771441168
0.0000000000        0.0000000000        0.2000000000
0.0000000000       -1.8172948905        1.0771441168
9        0.3000000000        0.1000000000
0.0000000000        1.5172948905        1.0771441168
0.0000000000        0.0000000000        0.3000000000
0.0000000000       -1.5172948905        1.0771441168
10        0.3000000000        0.2000000000
0.0000000000        1.6172948905        1.0771441168
0.0000000000        0.0000000000        0.3000000000
0.0000000000       -1.6172948905        1.0771441168
11        0.3000000000        0.3000000000
0.0000000000        1.7172948905        1.0771441168
0.0000000000        0.0000000000        0.3000000000
0.0000000000       -1.7172948905        1.0771441168
12        0.3000000000        0.4000000000
0.0000000000        1.8172948905        1.0771441168
0.0000000000        0.0000000000        0.3000000000
0.0000000000       -1.8172948905        1.0771441168
13        0.4000000000        0.1000000000
0.0000000000        1.5172948905        1.0771441168
0.0000000000        0.0000000000        0.4000000000
0.0000000000       -1.5172948905        1.0771441168
14        0.4000000000        0.2000000000
0.0000000000        1.6172948905        1.0771441168
0.0000000000        0.0000000000        0.4000000000
0.0000000000       -1.6172948905        1.0771441168
15        0.4000000000        0.3000000000
0.0000000000        1.7172948905        1.0771441168
0.0000000000        0.0000000000        0.4000000000
0.0000000000       -1.7172948905        1.0771441168
16        0.4000000000        0.4000000000
0.0000000000        1.8172948905        1.0771441168
0.0000000000        0.0000000000        0.4000000000
0.0000000000       -1.8172948905        1.0771441168


grid.log

    0.10000000000000    0.10000000000000  -76.04459446194009
0.10000000000000    0.20000000000000  -76.03620616674398
0.10000000000000    0.30000000000000  -76.02097011206199
0.10000000000000    0.40000000000000  -76.00070388002217
0.20000000000000    0.10000000000000  -76.04195808652202
0.20000000000000    0.20000000000000  -76.03738677908885
0.20000000000000    0.30000000000000  -76.02453190768475
0.20000000000000    0.40000000000000  -76.00563416167584
0.30000000000000    0.10000000000000  -76.03499966217109
0.30000000000000    0.20000000000000  -76.03510785497427
0.30000000000000    0.30000000000000  -76.02523747165098
0.30000000000000    0.40000000000000  -76.00813838399765
0.40000000000000    0.10000000000000  -76.02415560298566
0.40000000000000    0.20000000000000  -76.02971355974555
0.40000000000000    0.30000000000000  -76.02335962819663
0.40000000000000    0.40000000000000  -76.00843652007552


Gathering more than final energies

To have something other than the energy appear in the grid.log file, you can include the red% record corresponding to the quantity that you wish to tabulate. As an example, having

%altgrid
NUCREP

in the ZMAT file would result in having the nuclear repulsion energy - instead of the total energy - appear in the grid.log file.

It might be the case that you want more than energies (or just one other quantity) to be tabulated. While this can always be done by going through the output file (or files, if the calculation is done with GRID_ALGORITHM=PARALLEL), this can be something of a nuisance. However, the following provision might be useful and save you work and frustration in writing detailed scripts or carrying out tedious edits with lots of cutting and pasting. It turns out that anything which is in the JOBARC file can be retrieved from each point in the calculation. To do this, simply add a list like that below to your ZMAT file:

%pullgrd
SCFENEG 1
OVERLAP 10
This directs CFOUR to go into the JOBARC file at the end of each point, and retrieve 1 (floating point) number from the JOBARC record SCFENEG and (the first) 10 (floating point) numbers from the JOBARC record called OVERLAP. While it might be useful to know the SCF energy even when the grid is for, say, CCSDT(Q), it isn't clear why one might want to know elements of the overlap matrix. This is just for purposes of illustration. After the %pullgrd record, there can be a string of any length (but it cannot be interrupted by a blank line) of entries

ABCDEFGH XXX
where ABCDEFGH is an (eight-character) JOBARC record name, and XXX is its length. At the moment, this feature works only for floating point double-precision reals, but it could be fairly easily amended to allow for integers in the future. At the end of a job, there will be an extra file called grid.extra that contains all of the information from these additional requested records. For example, the ZMAT file

water
H
O 1 R*
H 2 R* 1 A

R=0.97
A=100.

*CFOUR(CALC=MP2,FROZEN_CORE=ON,BASIS=PVDZ,GRID=INTERNAL)

%grid
1
3 95. 5. 3

%pullgrd
SCFENEG 1
OVERLAP 10

which directs CFOUR to perform optimizations of the bond length of water as a function of angles constrained to 95, 100 and 105 degrees, produces the following grid.extra file

    1 SCFENEG      1
-76.023735361888
1 OVERLAP     10
2.82085617062167        2.84412293007511        3.28165907779947 \\
0.412073448935037       0.363012189757060        2.60704366163121 \\
0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000   2.14106053205295
2 SCFENEG      1
-76.0258145066436
2 OVERLAP     10
2.77850289329446        2.80398322332843        3.24107998082627 \\
0.382458301212966       0.355754034821042        2.54578886359834  \\
0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000   2.11645058793796
3 SCFENEG      1
-76.0264332902633
3 OVERLAP     10
2.73969430778937        2.76618441854544        3.20250289721375  0.355722004767705       0.347999193521576        2.48848063049420  0.000000000000000E+000  0.000000000000000E+000  0.000000000000000E+000   2.09647657705348where the first number is the grid point and the rest of the information is that requested.    One can also retrieve the actual optimzed parameters by using


water
H
O 1 R*
H 2 R* 1 A

R=0.97
A=100.

*CFOUR(CALC=MP2,FROZEN_CORE=ON,BASIS=PVDZ,GRID=INTERNAL)

%grid
1
3 95. 5. 3

%pullgrd
SCFENEG 1
OPTPARAM 1
which produces

    1 SCFENEG      1
-76.0237353621749
1 OPTPARAM     1
1.83168258053728

2 SCFENEG      1
-76.0258145066116
2 OPTPARAM     1
1.82551516809018

3 SCFENEG      1
-76.0264332902544
3 OPTPARAM     1
1.82007886851007


where the optimized parameter (R in the ZMAT above) is given for each bond angle. R is in bohr; an angle would be in radians.

Of course, using this presupposes that you know something of the arcane contents of the JOBARC file, knowledge that has presumably not made its way to you. While there is some documentation on this topic here, it is decidedly incomplete and lacking. Your best bet would be to write to the CFOUR website and say something like "I would like to know the value of vwwtyla78 from each of my grid points; is there a JOBARC record that would help?"