#!/bin/csh
#PBS -l ncpus=16
#PBS -N nwchem
#PBS -l walltime=5:00
#PBS -o nwchem.out
#PBS -j oe
#PBS -q debug
# make the module command available
source /usr/share/modules/init/csh
# load the nwchem module
module load nwchem/6.0
set echo
# define your scratch directory
set scr = $SCRATCH/nwchem
# If the scratch directory already exists, delete it
if ( -d $scr ) then
rm -rf $scr
endif
# make a new scratch directory and go there
mkdir $scr
cd $scr
# copy the input file over from $PBS_O_WORKDIR
# $PBS_O_WORKDIR is the directory that this job was submitted from
cp $PBS_O_WORKDIR/s2.nw .
# run the job using mpi. Direct the NWChem output to s2.out
mpirun -np $PBS_NCPUS nwchem s2.nw > $PBS_O_WORKDIR/s2.out
# clean up files if no longer needed
cd $PBS_O_WORKDIR
# delete the scratch directory
rm -f $scr