Friday, July 24, 2009

Some GAMESS input basics

Update 2 August 2009: I have changed the discussion regarding the SG1 keyword. New text is in italics.

I have planned some posts in which some details of the GAMESS input will become important, so this post is about the basic anatomy of a GAMESS input file, and some non-default settings that I use all the time.

Here is an input file for a single point energy calculation at the B3LYP/6-31G(d) level of theory for the H2 molecule:

• The order of the groups doesn’t matter, so you can put the $basis group below the $data group.

• You can have several groups of the same kind (e.g. two $contrl groups). If you have the same keyword in both groups, it is the value in the last group that counts. For example,

$contrl runtyp=energy dfttyp=b3lyp $end $contrl runtyp=optimize $endis perfectly legal, and will result in an geometry optimization.

• The order of the keywords within a group doesn’t matter.

$contrl runtyp=energy dfttyp=b3lyp $end

is the same as

$contrl dfttyp=b3lyp runtyp=energy $end

• Note that there is a space in front of any line starting with a $ sign. This is important and if you leave it out GAMESS will not read that line. Note you can use this to “uncomment” a line by adding, for example, a ! For example, this

$contrl runtyp=energy dfttyp=b3lyp $end!$contrl runtyp=optimize $endwill result in a single point energy calculation

• You can use capital letters if you want.

• For parameters that can be true for false, you can use either “.true.” or “.t.” and “.false.” or “.f.” (there's an example below).

• A line can only be 80 characters long. Anything after that is ignored. It is perfectly legal to split a line, for example:

$contrl runtyp=energy dfttyp=b3lyp $end

Some useful options

Almost all of the parameters have default (but there is no default basis set and no defaults in $data). For example, the default runtyp is energy, so

$contrl dfttyp=b3lyp $end

will result in a single point energy evaluation. If $contrl is missing entirely, GAMESS will compute a single point energy at the RHF level.

There is a few defaults that I almost always change

Single point energy calculations (not AM1 or PM3)

$scf dirscf=.t. $end

This tells GAMESS to recompute the integrals at each SCF step rather than reading them from hard disk. Most computers can recompute a number faster than they can find it on the hard disk.

DFT single point energy calculations

$dft sg1=.t. $end

Computing the DFT energy requires a numerical integration over a grid. The default grid is very fine (has a lot of points). Standard Grid 1 (sg1) is adequate for most purposes and much faster. Note that this leads to inaccurate gradients and should not be used for geometry optimizations.

DFT, AM1, and PM3 frequency calculations

$force nvib=2 $end

DFT and semiempirical Hessians (second energy derivatives) are computed numerically, by displacing each atom in the x, y, and z direction and computing the first derivative. This is usually not accurate enough. nvib=2 leads to a displacement in both the positive and negative x, y, and z direction resulting in more accurate frequencies.

I think the default criterion for geometry convergence (0.0001) is too strict, and the default number of steps (2o) is too small. So I usually use 0.0005 and 50, respectively. Optimizing in internal coordinates instead of Cartesian coordinates (default) usually speeds up convergence, because the former are "more quadratic". nzvar=1 tells GAMESS to use internal coordinates and dlc and auto tells GAMESS to automatically generate delocalized internal coordinates.

Unfortunately, the DLC implementation in GAMESS only looks for covalent bonds, not H-bonds and such. So you have to specify these if you have specify non-covalently bonded molecules in the input file. For example, in the case of water dimer (see figure for numbering), you do it like this

$zmat nonvdw(1)=1,4 $end

Note that you don't have to specify the H-bond in HO-CH2-CH2-OH, since the OH groups are connected by covalent bonds.

So, an input file for a geometry optimization of the water dimer would look like what I show below. That might seem a lot to type, but the trick is of course to type is once, store it somewhere handy, and copy it into new files.