Here is a script made to facilitate the submission of files into the supercomputers via SSH. Be aware that this script only works with files with the .gjf extension and is for the only purpose of submitting a job in Gaussian.
The script is the following:
if [ $# -eq 1 ]
then
filename=`basename $1 .gjf`
echo "#!/bin/bash
#SBATCH -J \"$filename\"
#SBATCH -n 16
#SBATCH -N 1
#SBATCH -o $filename-%J.o
#SBATCH -e $filename-%J.e
#SBATCH -p mendoza_q
#SBATCH -t 120:00:00
module load gaussian09
g09<$filename.gjf>$filename.out" > sub.slurm
sbatch sub.slurm
exit 0
fi
This script takes the name of the file you want to submit, deletes the extension (which must me originally .gjf), and stores it in a variable called filename. Then, it creates a SLURM file called sub.slurm with the input file name and the information about the processors required, maximum run time, etc. Finally, the SLURM file is automatically submitted through the SSH to the supercomputers with the sbatch command.
The script must be called with one argument, which would be the input file. For example, if we have a job we want to submit to Gaussian called samplefile.gjf, and we have an alias called submit already configured in .bashrc with the path to the script, then the way to use it would be the following:
submit samplefile.gjf
Of course, the current working directory should contain the file you want to submit.
A script was created to analyze the .out file from a Gaussian job. This facilitates the task of reading the entire file to look for the energies of the molecule or molecule group. This script takes the output file from a Gaussian job as input. The output is a summary with the thermochemistry results in the following format:
************SUMMARY***********
Electronic Energy = ####.###### (Hartree/Particle)
Zero-Point Correction = #.######
Thermal correction to Energy= = #.######
Thermal Correction to Enthalpy = #.######
Thermal Correction to Gibbs Free Energy = #.######
Sum of Electronic and Zero-Point Energies = ####.######
Sum of Electronic and thermal Energies = ####.######
Sum of Electronic and Thermal Enthalpies = ####.######
Sum of Electronic and Thermal Free Energies = ####.######
It is recommended to create an alias with the path to the script with the name summary. This way, if there is an output file with the name samplefile.out, the way to call this script would be:
summary samplefile.out
The summary script is the following:
if [ $# -eq 1 ]
then
#echo " "
#echo "********SCF ENERGY************"
#grep "SCF Done" $1 | nl
SCF=`grep "SCF Done" $1 | tail -1 | awk '{print $5}'`
SCF1=`printf "%.6f" $SCF`
#echo " "
#echo "*************ZPE*************"
ZPEH=`grep "Zero-point correction" $1 | awk '{print $3}'`
ZPE1=`printf "%s" $ZPEH`
ZPES=`grep "Sum of electronic and zero-point Energies=" $1 | awk '{print $7}'`
ZPE2=`printf "%s" $ZPES`
#echo " "
#echo "*******Thermal Energy********"
ThermalH=`grep "Thermal correction to Energy=" $1 | awk '{print $5}'`
Thermal1=`printf "%s" $ThermalH`
ThermalS=`grep "Sum of electronic and thermal Energies=" $1 | awk '{print $7}'`
Thermal2=`printf "%s" $ThermalS`
#echo " "
#echo "*********ENTHALPY************"
EnthalpyH=`grep "Thermal correction to Enthalpy=" $1 | awk '{print $5}'`
Enthalpy1=`printf "%s" $EnthalpyH`
EnthalpyS=`grep "Sum of electronic and thermal Enthalpies=" $1 | awk '{print $7}'`
Enthalpy2=`printf "%s" $EnthalpyS`
#echo " "
#echo "*********GIBBS FREE**********"
GibbsH=`grep "Thermal correction to Gibbs Free Energy=" $1 | awk '{print $7}'`
Gibbs1=`printf "%s" $GibbsH`
GibbsS=`grep "Sum of electronic and thermal Free Energies=" $1 | awk '{print $8}'`
Gibbs2=`printf "%s" $GibbsS`
echo " "
echo "************SUMMARY***********"
echo "Electronic Energy = $SCF1 (Hartree/Particle)"
echo " "
echo "Zero-Point Correction = $ZPE1"
echo "Thermal correction to Energy= = $Thermal1"
echo "Thermal Correction to Enthalpy = $Enthalpy1"
echo "Thermal Correction to Gibbs Free Energy = $Gibbs1"
echo " "
echo "Sum of Electronic and Zero-Point Energies = $ZPE2"
echo "Sum of Electronic and thermal Energies = $Thermal2"
echo "Sum of Electronic and Thermal Enthalpies = $Enthalpy2"
echo "Sum of Electronic and Thermal Free Energies = $Gibbs2"
exit 0
fi