#!/bin/bash

##########
#update the variables below as needed
##########

JOB=HMT_B3LYP_TZP_KlamtWater_GO_QTAIM	#this is the name of your job
		#make sure there are no spaces in the name
CURDIR=`'pwd'`  #do not change this line
TIME='24:00:00' #run time (hh:mm:ss) - 2 hours
NODES=1		#total number of nodes
TASKS=128        #total number of mpi tasks requested
		#should be 128 tasks per node

#########
#Do not change this next section!
#########
cat > $JOB.sbatch << EOF_ALL
#!/bin/sh

#SBATCH -J $JOB  	         # job name
#SBATCH -o $CURDIR/$JOB.out
#SBATCH -e $CURDIR/$JOB.err
#SBATCH -N $NODES                # total number of nodes 
#SBATCH -n $TASKS                # total number of mpi tasks requested
#SBATCH -t $TIME                 # run time (hh:mm:ss) - 1.5 hours
#SBATCH --exclude=c004
#!/bin/sh

AMS_JOBNAME=$JOB $AMSBIN/ams << eor

########
#replace the lines below with your adf input file
#starting with the "Task"
########

Task GeometryOptimization
Properties
    PESPointCharacter Yes
End
System
    Atoms
        N -1.4102378 0.0 0.4900602 adf.R=1.83
        N 0.0 0.0 -1.48202952 adf.R=1.83
        N 0.7051189 1.22130176 0.4900602 adf.R=1.83
        N 0.7051189 -1.22130176 0.4900602 adf.R=1.83
        C -1.44093027 0.0 -0.9529032 adf.R=2.00
        C 0.7204651399999999 1.24788222 -0.9529032 adf.R=2.00
        C -0.69496959 1.20372264 0.9700379 adf.R=2.00
        C -0.69496959 -1.20372264 0.9700379 adf.R=2.00
        C 0.7204651399999999 -1.24788222 -0.9529032 adf.R=2.00
        C 1.38993918 0.0 0.9700379 adf.R=2.00
        H -1.92519803 -0.89144874 -1.34215222 adf.R=1.30
        H -1.92519803 0.89144874 -1.34215222 adf.R=1.30
        H 0.19058177 2.11299477 -1.34215222 adf.R=1.30
        H 1.73461627 1.22154604 -1.34215222 adf.R=1.30
        H -1.20931934 2.09460254 0.6137092 adf.R=1.30
        H -0.6945393 1.20297735 2.05741019 adf.R=1.30
        H -1.20931934 -2.09460254 0.6137092 adf.R=1.30
        H -0.6945393 -1.20297735 2.05741019 adf.R=1.30
        H 1.73461627 -1.22154604 -1.34215222 adf.R=1.30
        H 0.19058177 -2.11299477 -1.34215222 adf.R=1.30
        H 2.41863868 0.0 0.6137092 adf.R=1.30
        H 1.38907859 0.0 2.05741019 adf.R=1.30
    End
    BondOrders
         1 5 1.0
         1 7 1.0
         1 8 1.0
         2 5 1.0
         2 6 1.0
         2 9 1.0
         3 6 1.0
         3 7 1.0
         3 10 1.0
         4 8 1.0
         4 9 1.0
         4 10 1.0
         5 11 1.0
         5 12 1.0
         6 13 1.0
         6 14 1.0
         7 15 1.0
         7 16 1.0
         8 17 1.0
         8 18 1.0
         9 19 1.0
         9 20 1.0
         10 21 1.0
         10 22 1.0
    End
End

Engine ADF
    Basis
        Type TZP
        Core None
    End
    Save TAPE10
    XC
        Hybrid B3LYP
    End
    Relativity
        Level None
    End
    Symmetry C(3V)
    Solvation
        Surf Delley
        Solv name=Water cav0=0.0 cav1=0.0067639
        Charged method=CONJ
        C-Mat POT
        SCF VAR ALL 
        CSMRSP
    End
    QTAIM
        Enabled Yes
        AnalysisLevel Full
    End
EndEngine
eor

########
#do not change the rest of the file!
########


mv $JOB.results/ams.log $JOB.logfile
rm slurm-*.out

EOF_ALL

sbatch < $JOB.sbatch
