How to start and run a simple calculation with Gaussian

  1. You need the coordinates, charge, and multiplicity
  2. The first line specifies your job, i.e. the method, the task (), and the basis set.

  3. Methods: HF, MP2, MP3, B3LYP, AM1, PM3, CCSD(T), etc.
    Basis sets: most basis sets can be requested by their normal names, e.g. Sto-3G, 6-311+G(2d,2p).
    Tasks: Opt = geometry optimisation; Freq = frequency calculation; no option = single-point energy calculation
    Gaussian is not case sensitive
    You should start the line by #P indicating that you will have more than minimum output.
    #P CCSD(T)/6-311+G(2d,2p) Opt
  4. The next line should be blank (since the command line can be more than one line).
  5. The third line is the Title. It can also be split in several lines and must be ended by a blank line.
  6. The next line gives the charge and the multiplicity of the calculation in this order.

  7. The mulitiplicity specifies the spin state:  (1=singlet=no unpaired electrons, 2=doublet, etc.).
    Most normal molecules are singlets.
  8. The following lines gives the geometry of the molecule. It can be specified in Cartesian coordinates (x, y, z, in Ångström), starting with the atomic symbol or number. Alternatively, it can be given as an Z-matrix (see Appendix E in Frank Jensen and the sample input below). The geometry is ended by a blank line.
  9. The rest of the file contains additional input, is any (depending on the keywords). The file must end with a blank line.
  10. The job is started by:

  11. rung98 input_file &
    The output will be found in the file input_file.out.
    You must specify the ampersand ("&") if you want to do other calculations when the job runs.
If you run several similar calculations, it may be wise to save all important informations in a checkpoint file. This is done with the line
which should be first in the file.
You can use the contents in the checkpoint file in other calculations by giving the same checkpoint file name.
Guess=Read (in the command line) tells the program to read the wavefunction from the checkpoint file.
Geom=AllCheck (also in the command line) tells the program to read the title, charge, multiplicity and (final) geometry from the checkpoint file. The corresponding lines should then be ommitted from the input file.

To ensure that our local post-processing programs work, use always the #P keyword!

Sample input files

#P HF Sto-3G Opt Freq

Simple geometry optimisation and frequency calculation on water

    0    1
o        0.000000    0.127170    0.000000
h        0.757997   -0.508679    0.000000
h       -0.757997   -0.508679    0.000000

#P CCSD(T)/6-311+G(2d,2p) Opt

Geometry optimisation of water with a Z-matrix (necessary with numerical gradients)

    0    1

OH 0.9572
HOH 104.52

#P MP2=RW aug-cc-pVTZ MaxDisk=2000MB Pop=(Full,NO,MK,NBO) Nosymm

Compound job with more input

    0    1
o        0.000000    0.127170    0.000000
h        0.757997   -0.508679    0.000000
h       -0.757997   -0.508679    0.000000

! RW
 3, 0

#P MP2=RW aug-cc-pVTZ Pop=(Full,NO,MK,NBO) Density=Current
    Guess(Read,Only) Geom=AllCheck

#t B3LYP/cc-pVTZ Freq(ReadFC,ReadISO) Geom=Check

Example of Freq calculations with new isotopes
O(18) Phenoxyl Radical; CCL 14 Jun 2001

  0  2

298.150  1.00000

#P B3LYP/6-31G* Scf(Conver=6) SCRF=(CPCM,Read)

Solvation calculation with non-default dielectric constant
Cu+, B3LYP/6-31G*, Vacuum, E8, 21/5-01

 1  1
cu 0.0 0.0 0.0

! CPCM data

#P HF/STO-3G SCRF(PCM,solvent=water)

Simple PCM input to get non-polar energies

 1  1
cu 0.0 0.0 0.0


How to run with a range-separated functional

# TD(NStates=10)/lc-pbepbe/6-31G(d) iop(3/107=0100000000,3/108=0100000000) SCF(MaxCycles=512,XQC,Fermi) Geom(Connectivity) Scrf(solvent=o-DiChloroBenzene)


0 1
 C                 -7.60804968   -2.30417181   -0.22155883
 C                 -8.98640433   -2.16504207   -0.07565774
 C                 -9.54920751   -0.91947813    0.21091194
 C                 -8.74122111    0.21029755    0.35656787
 C                 -7.36721291    0.07870952    0.21260668
 C                 -6.80221512   -1.17580738   -0.07583145
 H                 -7.17416201   -3.27495209   -0.44537243
 H                 -9.62998425   -3.03306296   -0.18598201
 H                -10.62602315   -0.82906697    0.32127531
 H                 -9.18925088    1.17558731    0.57929966
 C                 -4.33948705   -1.93732702   -0.42749252
 C                 -5.35252950   -1.01536584   -0.17135522
 C                 -5.03768557    0.33629795    0.05483102
 C                 -3.72451268    0.76823030    0.02975335
 C                 -2.69147025   -0.15054230   -0.23716495
 C                 -3.02176126   -1.49890999   -0.46246911
 H                 -4.56688645   -2.98431572   -0.60725972
 H                 -3.48130374    1.80730595    0.23491654
 H                 -2.23240826   -2.21083318   -0.68824507
 C                 -6.29381893    1.14931802    0.32383222
 C                 -6.26700716    1.77016074    1.72829846
 H                 -7.20466940    2.29743541    1.93142522
 H                 -6.13026215    1.00296054    2.49566119
 H                 -5.44882230    2.49264205    1.81369355
 C                 -6.48662270    2.24646998   -0.73325400
 H                 -7.42850449    2.77844255   -0.56492071
 H                 -6.50589005    1.82324431   -1.74156307
 H                 -5.67303173    2.97726158   -0.68152653
 C                 -1.30523481    0.30725727   -0.27985587
 C                 -0.82773658    1.57659766   -0.52004023
 S                  0.01746948   -0.78301193    0.00437106
 C                  0.58016347    1.67165140   -0.48651543
 H                 -1.47547948    2.41626100   -0.74496862
 C                  1.20896102    0.47189032   -0.22248974
 H                  1.13166856    2.58567577   -0.66116630
 C                  2.62541312    0.16881330   -0.12810343
 C                  3.63700733    1.18938865   -0.11636111
 C                  3.10577249   -1.12552930   -0.03734398
 C                  5.04560444    0.85625289   -0.01532928
 C                  4.47396023   -1.44777627    0.06782310
 H                  2.40340988   -1.95412930   -0.05020802
 C                  5.48759808   -0.50709262    0.07945153
 H                  4.72736500   -2.50124330    0.14615466
 N                  5.83412292    1.93256136   -0.02390614
 N                  3.41915069    2.50321035   -0.19186127
 S                  4.86921471    3.23341794   -0.14363884
 C                  6.89241016   -0.87157624    0.17497279
 C                  7.99670073   -0.07071519    0.37629717
 S                  7.38694842   -2.54126055    0.04157578
 C                  9.21613007   -0.79310270    0.42958351
 H                  7.91888882    1.00293999    0.48226461
 C                  9.04229259   -2.13839605    0.26545750
 H                 10.18491571   -0.33219811    0.58420162
 H                  9.79037443   -2.91969995    0.25837832

 1 2 1.0 6 2.0 7 1.0
 2 3 2.0 8 1.0
 3 4 1.0 9 1.0
 4 5 2.0 10 1.0
 5 6 1.0 20 1.0

From G09 manual:

Long range corrected functionals. The non-Coulomb part of exchange functionals typically dies off too rapidly and becomes very inaccurate at large distances, making them unsuitable for modeling processes such as electron excitations to high orbitals. Various schemes have been devised to handle such cases. Gaussian 09 offers the following functionals which include long range corrections:

In addition, the prefix LC- may be added to any pure functional to apply the long correction of Hirao and coworkers [Iikura01]: e.g., LC-BLYP.

Omega for short/long range Hartree-Fock exchange.
0 - Standard HF exchange
MMMMMNNNNN - Short range HF exchange with NNNNN/10000 and long range exchange with MMMMM/10000.

Omega for short/long range DFT exchange.
0 - Standard DFT exchange or default from functional.
MMMMMNNNNN - Short range DFT exchange with NNNNN /10000 and long range DFT exchange with MMMMM/10000.

Omega for short/long range DFT correlation
0 - Standard DFT correlation or default from functional.
MMMMMNNNNN - Short range DFT correlation with NNNNN /10000 and long range DFT correlation with MMMMM/10000

This command is used to construct a rigid potential energy surface of one or more internal coordinates.
The coordinates have to be specified in Z-matrix format.
For the coordinate you want to scan, add after variable definition, the starting value, the number of steps -1, and the step size.

Example (scan of the last dihedral):
#P B3LYP/6-31G* Scan


    0    1
c 1 ch1
h 2 ch2 1 hch1
h 2 ch2 1 hch1 3 hch2 1
o 2 oc  1 hco1 4 hco2 1
h 5 oh  2 coh  1 hoch 0

 oc =1.419
 oh =0.969
 coh =107.646
 hoch=-180. 11 30.0

Another example:
#P MP2/6-311++G(3df,3pd) Scan
    0    1
he 1 r

r=1.1872 40 0.10 

This is a up to three layer combined QC/MM or QC/QC method.
The input is similar to a normal input, but you specify two or three different after the oniom keyword
and for each atom you specify which layer it belongs to: High (first method), Medium (second method) or Low (third method), and optionally the junction replacement atoms (typically H).

Most methods works with Oniom, e.g. optimisations and frequency calculations. However, SCRF does not work (it is not available for semiempirical or molecular mechanical methods).

changeparm command oo can set up a G09 Oniom calculation from an ComQum (amber) calculation.

#P Oniom(B3LYP/6-31G*:PM3:Amber) Opt Freq

A three-layer oniom calculation of CH3-CH2-CHO

0 1
 h   1.303312051   0.000000000   1.949234062 High
 c   0.375760127   0.000000000   1.351034669 High
 o  -0.718742386   0.000000000   1.904192435 High
 c   0.583631613   0.000000000  -0.143478503 Medium H
 h   1.171836119  -0.887154331  -0.398970957 Medium
 h   1.171836119   0.887154331  -0.398970957 Medium
 c  -0.720914899   0.000000000  -0.916455389 Low H
 h  -1.320117994   0.884637788  -0.676628009 Low
 h  -1.320117994  -0.884637788  -0.676628009 Low
 h  -0.526482757   0.000000000  -1.993329341 Low

How to get non-polar terms with G09

#p hf sp nosymm iop(5/13=1) scf=tight scrf=(PCM,solvent=Toluene,ExternalIteration,read)


0 1
Coordinate here

dis rep cav

for x in  ; do
# filename = Cavitation Dispersion Repulsion Sum
echo "$x  =   " $(grep 'Cavitation' $x.log | awk '{print $5}') $(grep 'Dispersion' $x.log | awk '{print $5}') $(grep 'Repulsion' $x.log | awk '{print $5}') $(grep 'Total non e' $x.log | awk '{print $6}')  >>pcm.out


The current version is Gaussian-09, Revision A02 (Installed by MUL 18/6-10)
Older available versions are Gaussian-03, Revision D.02 and Gaussian-98, Revision A.9

On Abisko/Kebnekaise, Gaussian-16 (A.03-AVX2) is available
module add gaussian/16.A.03-AVX2
#SBATCH -n 1 
#SBATCH -t 168:00:00 

export job=gauss 
module add PGI/15.10-GCC-4.9.3-2.25 
module add gaussian/g09 

g09 <"$job" >$SLURM_SUBMIT_DIR/"$job".out 

On Aurora, you do
#SBATCH -n 1
#SBATCH -t 168:00:00

export job=gauss
module add PGI/15.10-GCC-4.9.3-2.25
module add gaussian/g09

g09 <"$job" >$SLURM_SUBMIT_DIR/"$job".out

On milleotto and platon you do
module add gaussian

For old version:
module add gaussian/g03

A manual is present in
The keywords are listed in

The program is located in
g03 is not compiled on gefion, but g98 is compilded and can be run with command rung98.

An older revision (A.5) is found in
/molcas/DIVPROG/lib/Gaussian/g98  (signe)

Alternative versions of g98 A.5 with a higher maximum TSARE can be found in
/molcas/DIVPROG/lib/Gaussian/New/g98  (signe)

Gaussian-94 can be found in
/molcas/DIVPROG/lib/Gaussian/g94  (signe)

You can use the following script to run Gaussian (/home/ulf/Bin/rung98).
You should change the rows in bold face

export g98root=/home/bio/GAUSS
export GAUSS_EXEDIR=$g98root/g98/bsd:$g98root/g98
export GAUSS_SCRDIR=/temp1/ulf/Gaussian
export G98BASIS="$g98root/g98/basis"
$g98root/g98/g98 <"$1" >>"$1".out

If you put this script in your bin directory with the name rung98, you can then start a job with
rung98 input_file
and you will find the result in the file input_file.out.

Warnings of this type (with G98 Rev A.5) can safely be ignored:
1621782:/sw/gaussian/g98/l103.exe: rld: Warning: Calling set_fpc_csr with (0x1000800)
1621782:/sw/gaussian/g98/l9999.exe: rld: Warning: The aggregate IEEE exceptions required (OEX_FPU_MIN) (0x10) not as complete as the aggregate IEEE exceptions permitted (OEX_FPU_MAX>>8)(0x0).
1621782:/sw/gaussian/g98/l9999.exe: rld: Warning: Use "elfdump -op " to see the floating-point exceptions (OEX) flags for the latest object.
1621782:/sw/gaussian/g98/l9999.exe: rld: Warning: Using aggregate 0x10 as OEX_FPU_MIN to add floating-point exceptions flags with set_fpc_csr()

Originally on gefion, I got (Aug-12)

Erroneous write during file extend. write -1 instead of 4096
Probably out of disk space.
Write error in NtrExt1: Bad address
Segmentation fault

Following a search in internet, it turned out that this could be solved by inserting 0 in the file /proc/sys/kernel/randomize_va_space
sudo echo 0 > /proc/sys/kernel/randomize_va_space
This solved the problem

We can run gaussian03 on swegrid. It is limited to users who have an SNAC account, but we are among those.

Install the nordugrid software on your local machine, cf. talk by Valera and previous email from Jonas Lindeman. Get a Distinguished Name (DN) by running the command:

grid-cert-info -subject

Then after a few days you will receive an email with your DN. Follow the instructions, and email your DN to Jonas Lindeman and ask for access to swegrid under the SNIC account: snic-021-03-22-vo

Follow the instructions on regarding G03. Notice that the example is a parallel job.

The swegrid_manual is attached, and some useful links are: (SWEGRID) (sofware, manuals, etc.) (Valera's talk)

It is far from easy to compile it on Linux.
The versions on whenim64 and husmodern are copied from garm (executables; garm.tar).
I do no know how we (who?) managed to compile it on garm (probably originally on husmodern).
Gaussian 98 Installation Instructions for Linux

Compile the utility programs (formchk, newzmat, etc.)
To compile these programs, copy the corresponing row in the end of the file bldg98.log and replace with util.a.

For example (one row):
f77 -nocpp -w -mips4 -64 -align64 -r10000 -G 0 -O3 -LNO:blocking=OFF:prefetch=1 -r8const -trapuv -OPT:roundoff=3:IEEE_arithmetic=3:IEEE_comparisons=1:liberal_ivdep=TRUE:Olimit=0:reorg_common=OFF -o formchk formchk.o util.a -lblas -lfastm

This is done by the script /molcas/DIVPROG/lib/Gaussian/G98new/g98/ulfmake

Links to
G98 Technical information
G98 Release notes
Gaussian 98 Installation Instructions for Linux

How to run Gaussian98 in parallel on Alarik
#SBATCH -U snic2015-1-300
#SBATCH --ntasks-per-node 16
#SBATCH -t 99:59:00
#SBATCH --exclusive
#SBATCH --mem=1900mb

module add gaussian/g09
(time g09 < ${WRKDIR}/${SLURM_JOB_NAME}.com) > ${WRKDIR}/${SLURM_JOB_NAME}.log

And in input file:

# pbe1pbe/6-311G(d) scrf=(solvent=acetonitrile) opt

2015-10-03. 1[Fe(CNC)2]+2 optimization.

2 3
Fe    -0.000012    -0.051825     0.000465
 C     0.791840    -1.598493    -0.993365
 N    -1.915864    -1.068013    -3.470195

How to run Gaussian98 in parallel

#PBS -l nodes=6:toto7
#PBS -l walltime=72:00:00
#PBS -j oe

echo Gaussian running on head node:
echo Slaves nodes are:

export g98root=$HOME/g98a9
. $g98root/g98/bsd/g98.profile
export LINDA_CLC=network
export  LINDA_FLC=network
echo gauss_flags:

cp * /disk/local
cd /disk/local
g98 mg4w-3.05-opt.gjf

How to split large RWF files (>2GB)

#P UB3LYP/Gen Freq SCF(Vshift=0,Conver=6,MaxCycle=300)
   Geom=AllCheck Guess=Read MaxDisk=13000MB

! Gen basis set

How to run excited states with TD
Also open-shell ground state.
Use keyword TD (G98 manual p. 155).
Chapter 9 (7, p. 173) in Exploring chemistry with electronic structure methods gives a detailed description of the CIS method
which has similar input and output.

Use a normal SCF calculation input file and add in the final step:
TD(Nstates=12,Root=1,50-50) Density Pop=Full
Nstates is the number of interesting states and
Root is the root of interest (for population analysis and geometry optimisation)
50-50 indicates that you are interested in both singlet and triplet states.

Typical output of a Frequency calculation:

 SCF Done:  E(RB+HF-LYP) =  -76.4070229620     A.U. after   10 cycles
             Convg  =    0.9037D-08             -V/T =  2.0052
             S**2   =   0.0000
 KE= 7.601163519654D+01 PE=-1.989603930100D+02 EE= 3.745590692757D+01
 Leave Link  502 at Wed Mar 28 04:59:08 2001, MaxMem=    6291456 cpu:       7.3
 (Enter /usr/local/lib/Gaussian/G98new/g98/l801.exe)
 Range of M.O.s used for correlation:     1    18
 NBasis=    18 NAE=     5 NBE=     5 NFC=     0 NFV=     0
 NROrb=     18 NOA=     5 NOB=     5 NVA=    13 NVB=    13
 Leave Link  801 at Wed Mar 28 04:59:08 2001, MaxMem=    6291456 cpu:       0.0
 (Enter /usr/local/lib/Gaussian/G98new/g98/l1101.exe)
 Using compressed storage.
 Will process   3 atoms per pass.
 Leave Link 1101 at Wed Mar 28 04:59:10 2001, MaxMem=    6291456 cpu:       1.7
 (Enter /usr/local/lib/Gaussian/G98new/g98/l1102.exe)
 Use density number 0.
 Leave Link 1102 at Wed Mar 28 04:59:11 2001, MaxMem=    6291456 cpu:       0.4
 (Enter /usr/local/lib/Gaussian/G98new/g98/l1110.exe)
 Forming Gx(P) for the SCF density.
 Integral derivatives from FoFDir, PRISM(SPDF).
 Do as many integral derivatives as possible in FoFDir.
 G2DrvN: MDV=   6291456.
 G2DrvN: will do    3 atoms at a time, making    1 passes doing MaxLOS=2.
 Petite list used in FoFDir.
 MinBra= 0 MaxBra= 2 Meth= 1.
 IRaf=       0 NMat=   1 IRICut=       1 DoRegI=T DoRafI=F ISym2E= 1 JSym2E=1.
 FoFDir used for L=0 through L=2.
 Leave Link 1110 at Wed Mar 28 04:59:19 2001, MaxMem=    6291456 cpu:       6.1
 (Enter /usr/local/lib/Gaussian/G98new/g98/l1002.exe)
 Minotr:  Closed-shell wavefunction.
          Direct CPHF calculation.
          Solving linear equations simultaneously.
          Using symmetry in CPHF.
          Requested convergence is 1.0D-08 RMS, and 1.0D-07 maximum.
          Secondary convergence is 1.0D-12 RMS, and 1.0D-12 maximum.
          Differentiating once with respect to electric field.
                with respect to dipole field.
          Differentiating once with respect to nuclear coordinates.
          NewPWx=T KeepS1=F KeepF1=F KeepIn=F MapXYZ=F.
          MDV=       6291456
          Using IRadAn=       2.
          Store integrals in memory, NReq=      876501.
 Symmetry not used in FoFDir.
 MinBra= 0 MaxBra= 2 Meth= 1.
 IRaf=       0 NMat=   1 IRICut=       1 DoRegI=T DoRafI=F ISym2E= 0 JSym2E=0.
          There are  12 degrees of freedom in the 1st order CPHF.
  10 vectors were produced by pass  0.
 AX will form  10 AO Fock derivatives at one time.
   9 vectors were produced by pass  1.
   9 vectors were produced by pass  2.
   9 vectors were produced by pass  3.
   5 vectors were produced by pass  4.
   3 vectors were produced by pass  5.
 Inv2:  IOpt= 1 Iter= 1 AM= 1.09D-15 Conv= 1.00D-12.
 Inverted reduced A of dimension  45 with in-core refinement.
 Leave Link 1002 at Wed Mar 28 04:59:27 2001, MaxMem=    6291456 cpu:       5.5
 (Enter /usr/local/lib/Gaussian/G98new/g98/l601.exe)
 Copying SCF densities to generalized density rwf, ISCF=0 IROHF=0.


            Population analysis using the SCF density.


 Leave Link  601 at Wed Mar 28 04:59:28 2001, MaxMem=    6291456 cpu:       0.5
 (Enter /usr/local/lib/Gaussian/G98new/g98/l701.exe)
 Compute integral second derivatives.
 ... and contract with generalized density number  0.
 Leave Link  701 at Wed Mar 28 04:59:31 2001, MaxMem=    6291456 cpu:       2.5
 (Enter /usr/local/lib/Gaussian/G98new/g98/l702.exe)
 L702 exits ... SP integral derivatives will be done elsewhere.
 Leave Link  702 at Wed Mar 28 04:59:32 2001, MaxMem=    6291456 cpu:       0.0
 (Enter /usr/local/lib/Gaussian/G98new/g98/l703.exe)
 Compute integral second derivatives.
 Integral derivatives from FoFDir, PRISM(SPDF).
 Petite list used in FoFDir.
 MinBra= 0 MaxBra= 2 Meth= 1.
 IRaf=       0 NMat=   1 IRICut=       1 DoRegI=T DoRafI=F ISym2E= 1 JSym2E=1.
 Leave Link  703 at Wed Mar 28 04:59:52 2001, MaxMem=    6291456 cpu:      13.9
 (Enter /usr/local/lib/Gaussian/G98new/g98/l716.exe)
 Dipole        = 1.97314156D-05-8.22036304D-01 0.00000000D+00
 Polarizability= 7.33514026D+00 1.70957942D-03 5.34051953D+00
                 2.28341401D-04 1.91679577D-05 2.73823266D+00
 Full mass-weighted force constant matrix:
 Low frequencies ---  -54.4316   -0.0023   -0.0019   -0.0016   46.0086   70.3001
 Low frequencies --- 1712.8326 3718.8261 3841.6059
 Harmonic frequencies (cm**-1), IR intensities (KM/Mole),
 Raman scattering activities (A**4/AMU), Raman depolarization ratios,
 reduced masses (AMU), force constants (mDyne/A) and normal coordinates:
                     1                      2                      3
                    A'                     A'                     A'
 Frequencies --  1712.8326              3718.8261              3841.6059