Skip to content

Gaussian 16 User Guide

Overview

Gaussian 16 is a comprehensive quantum chemistry package for electronic structure calculations. This guide covers usage on the cluster.

Version: Revision A.03 Installation: /sw/gaussian/g16 Module: gaussian/g16

Loading the Module

module load gaussian/g16

To verify the module is loaded:

module list
which g16

Main Commands

Command Description
g16 Main Gaussian 16 executable
formchk Convert binary checkpoint files to formatted text
cubegen Generate cube files for visualization
freqchk Extract vibrational frequencies and thermochemistry
gauopt Optimization utility
cubman Manipulate cube files

Input File Format

Gaussian input files (.com or .gjf) have the following structure:

%chk=checkpoint.chk
%mem=2GB
%nprocshared=4
# HF/6-31G(d) Opt Freq

Water molecule optimization

0 1
O
H 1 0.96
H 1 0.96 2 104.5

Key sections: - %chk: Checkpoint file name - %mem: Memory per process - %nprocshared: Number of shared-memory cores - #: Route section with method and basis set - Empty line, then title - Empty line, then charge and multiplicity - Molecular geometry (Z-matrix or Cartesian)

Running Gaussian

Interactive Testing (Short Jobs Only)

# On login node (very short tests only, < 1 minute)
module load gaussian/g16
g16 < input.com > output.log

Cluster Job Submission

Serial Job (job_g16_serial.sh):

#!/bin/bash
#SBATCH --job-name=g16_job
#SBATCH --output=g16_%j.out
#SBATCH --error=g16_%j.err
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=1
#SBATCH --mem=4GB
#SBATCH --time=24:00:00

# Load Gaussian module
module load gaussian/g16

# Set scratch directory
export GAUSS_SCRDIR=$TMPDIR

# Run Gaussian
g16 < input.com > output.log

Parallel SMP Job (job_g16_smp.sh):

#!/bin/bash
#SBATCH --job-name=g16_smp
#SBATCH --output=g16_%j.out
#SBATCH --error=g16_%j.err
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=16
#SBATCH --mem=32GB
#SBATCH --time=48:00:00

# Load Gaussian module
module load gaussian/g16

# Set scratch directory
export GAUSS_SCRDIR=$TMPDIR

# Run Gaussian (cores set in input file with %nprocshared)
g16 < input.com > output.log

GPU-Accelerated Job (if available):

#!/bin/bash
#SBATCH --job-name=g16_gpu
#SBATCH --output=g16_%j.out
#SBATCH --error=g16_%j.err
#SBATCH --nodes=1
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --gres=gpu:1
#SBATCH --mem=16GB
#SBATCH --time=24:00:00

# Load Gaussian module
module load gaussian/g16

# Set scratch directory
export GAUSS_SCRDIR=$TMPDIR

# Run Gaussian with GPU acceleration
g16 < input.com > output.log

Submit with:

sbatch job_g16_smp.sh

Memory and Scratch Management

Memory Allocation

Set memory in your input file %mem line: - %mem=2GB: 2 gigabytes per process - %mem=4000MB: 4000 megabytes per process

Important: Total memory = %mem × number of processes

Scratch Files

Gaussian uses scratch files during calculations. Best practices:

  1. Use TMPDIR (automatic): bash export GAUSS_SCRDIR=$TMPDIR

  2. Monitor scratch usage: Large calculations may generate 10-100 GB of scratch files

  3. Clean up (automatic when job ends if using $TMPDIR)

Common Calculation Types

Geometry Optimization

# B3LYP/6-31+G(d,p) Opt

Geometry optimization of benzene

0 1
C
C 1 1.39
C 2 1.39 1 120.0
C 3 1.39 2 120.0 1 0.0
C 4 1.39 3 120.0 2 0.0
C 5 1.39 4 120.0 3 0.0
H 1 1.08 2 120.0 3 180.0
H 2 1.08 1 120.0 6 180.0
H 3 1.08 2 120.0 1 180.0
H 4 1.08 3 120.0 2 180.0
H 5 1.08 4 120.0 3 180.0
H 6 1.08 5 120.0 4 180.0

Frequency Calculation

# B3LYP/6-31+G(d,p) Freq

Frequency calculation

0 1
O  0.000000  0.000000  0.117790
H  0.000000  0.757151 -0.471161
H  0.000000 -0.757151 -0.471161

Single Point Energy

# MP2/cc-pVTZ

Single point energy

0 1
... geometry ...

# B3LYP/6-31G(d) Opt=(TS,CalcFC,NoEigenTest)

TS search

0 1
... approximate TS geometry ...

Checkpoint Files and Restart

Saving Checkpoint Files

In your input:

%chk=molecule.chk

Converting Checkpoint Files

# Binary to formatted
formchk molecule.chk molecule.fchk

# Formatted to binary
unfchk molecule.fchk molecule.chk

Restarting Calculations

Add Guess=Read Geom=Check to route section:

%chk=molecule.chk
# HF/6-31G(d) Opt Guess=Read Geom=Check

Post-Processing and Analysis

Extract Geometry from Checkpoint

formchk molecule.chk
# Output: molecule.fchk (text format)

Generate Cube Files

# Electron density cube
cubegen 0 density=scf molecule.fchk density.cube

# HOMO orbital
cubegen 0 mo=HOMO molecule.fchk homo.cube

# LUMO orbital
cubegen 0 mo=LUMO molecule.fchk lumo.cube

Extract Frequencies

freqchk molecule.chk

Performance Tips

  1. Use appropriate memory: Set %mem to ~80% of requested Slurm memory
  2. SMP parallelization: Use %nprocshared for shared-memory parallel jobs
  3. Scratch location: Always use $TMPDIR for scratch files
  4. Checkpoint frequency: Use %chk to save intermediate results
  5. Basis set selection:
  6. Small molecules: 6-31G(d), 6-31+G(d,p)
  7. Larger systems: 6-31G(d), STO-3G for initial optimizations
  8. High accuracy: cc-pVTZ, aug-cc-pVTZ

Troubleshooting

Common Errors

Error: "Insufficient memory" - Increase %mem in input file - Request more memory in Slurm (--mem)

Error: "Disk quota exceeded" - Check scratch directory space - Use $TMPDIR for scratch files - Clean up old checkpoint files

Error: "Convergence failure" - Try different optimization algorithm: Opt=GDIIS or Opt=Newton - Use better initial geometry - Reduce symmetry constraints

Error: "Linear angle in Z-matrix" - Switch to Cartesian coordinates - Or fix angles in Z-matrix

Getting Help

  1. Check Gaussian manual: https://gaussian.com/man/
  2. Review output file for error messages
  3. Check .err file from Slurm job
  4. Contact cluster support

License and Citation

Gaussian 16 is commercial software. Ensure you have appropriate licensing.

Citation:

Gaussian 16, Revision A.03,
M. J. Frisch, G. W. Trucks, H. B. Schlegel, et al.
Gaussian, Inc., Wallingford CT, 2016.

Additional Resources

  • Official website: https://gaussian.com/
  • User manual: https://gaussian.com/man/
  • Basis set exchange: https://www.basissetexchange.org/
  • Computational Chemistry List: http://www.ccl.net/

Example Workflow

Complete workflow for geometry optimization + frequency:

# 1. Create input file
cat > water_opt.com << 'EOF'
%chk=water.chk
%mem=4GB
%nprocshared=8
# B3LYP/6-31+G(d,p) Opt Freq

Water optimization and frequencies

0 1
O
H 1 0.96
H 1 0.96 2 104.5

EOF

# 2. Create Slurm job
cat > job.sh << 'EOF'
#!/bin/bash
#SBATCH --cpus-per-task=8
#SBATCH --mem=8GB
#SBATCH --time=4:00:00
module load gaussian/g16
export GAUSS_SCRDIR=$TMPDIR
g16 < water_opt.com > water_opt.log
EOF

# 3. Submit job
sbatch job.sh

# 4. Monitor progress
tail -f water_opt.log
squeue -u $USER

# 5. After completion, extract results
formchk water.chk water.fchk
cubegen 0 density=scf water.fchk water_density.cube

Notes

  • Always test with small calculations first
  • Monitor disk usage in scratch directories
  • Save checkpoint files for large calculations
  • Check convergence criteria in output files
  • Gaussian 16 requires specific licensing - contact administrators for access

For questions or issues specific to this cluster installation, contact the system administrators.