I use a simple script to do some quantum calculations with gaussian package. the script as follows
#!/bin/sh
#put a gaussian input file into a new folder in the same name
#and submit this new job
for i in *.gjf
do
FN=$( echo $i | sed 's/.gjf//')
mkdir $FN
mv $FN.gjf ./$FN
cp ./g03.sh ./$FN
mv ./$FN/g03.sh ./$FN/OPT-$FN
cd $FN
qsub -V OPT-$FN
cd ..
done
#END
It works fine. The general function of this simple script is going: 1. to list the input file in the present folder; 2. to create a folder with the same name; 3. to move the input file into this newly created folder; 4. to submit it.
I would like to know how to add two extra functions into this script:
- If the job fails, it always leave a very large file name core.*. How to remove it automatically.
- A checkpoint file named <jobname>.chk will be generated by gaussian package. How to do execute the following command "formchk <jobname>.chk" immediately after the job finished.
It should not be a strange idea. what I don't know is how to know when the job finished.
Please helps.
Thank you in advance!
ZHEN, from Shanghai, China.