#!/bin/csh # script to run an inital mopac optimization and then a DeFT optimization # followed by a GAMESS single point NBO population analysis set JOB='web'$01 # header for html output errors set H='Content-type: text/html\n\n

Sorry-there was an Error

' setenv MOPACDIR /usr/local/bin if ( -e hessian ) rm hessian $MOPACDIR/Mopac.e $JOB if (! -e $JOB.arc ) then echo $H echo 'Sorry your structure is too weird for me' exit(1) endif #echo initial geometry completed md.pl $JOB o > $JOB setenv input_file $JOB echo 'Content-type: text/html\n\n

Your calculation is running

' echo 'If your calculation does not complete before your browser quits,' echo 'check the Results section for the results. Look for' $JOB'.html

' echo '' setenv my_directory $HOME setenv DeFT_directory /usr/local/bin setenv temp_directory /var/tmp/tmp$$ mkdir $temp_directory # default parameters for md.pl are used unless convergence problems arise set levshft = 0 DeFT: cd $temp_directory touch core chmod u+w core touch $my_directory/restart_$input_file cp $my_directory/restart_$input_file old_restart cp $my_directory/$input_file input cp $DeFT_directory/bases bases cp $my_directory/hessian hessian chmod u+w bases $DeFT_directory/DeFT < input > $my_directory/$input_file.dft cp new_restart $my_directory/restart_$input_file rm core espot bases input hessian old_restart new_restart fort.* cd $my_directory # check for multiplicity error set con = `grep "make sense" $input_file.dft` if ( $#con != 0 ) then echo $H echo 'Sorry the charge and multiplicity do not agree' exit 1 endif # check for scf convergence set con = `grep unsucc $input_file.dft` if ( $#con != 0 ) then if ( $levshft == 3 ) then echo $H echo 'Sorry the main calculation did not converge(scf)' exit 1 endif # echo scf unsuccessful adding levelshift if ( $levshft == 0 ) then md.pl $JOB o 0 0.05 > $input_file set levshft = 1 goto DeFT endif if ( $levshft == 1 ) then # sed 's/levelshift 0.0/levelshift 3.0/' $input_file > dink # mv dink $input_file md.pl $JOB o 0 3.0 > $input_file set levshft = 2 goto DeFT endif if ( $levshft == 2 ) then # sed 's/levelshift 3.0/levelshift 6.0/' $input_file > dink # mv dink $input_file # set mixing 0.3 levelshift 6eV and expands the bond lengths by 4% md.pl $JOB o 4 6.0 > $input_file set levshft = 3 goto DeFT endif endif # check for geometry convergence set con = `grep "geometry not" $input_file.dft` if ( $#con != 0 ) then echo $H echo 'Sorry the main calculation did not converge(geo)' exit 1 endif # remove mopac and dft files rm hessian $JOB.dat $JOB.log $JOB.out $JOB.arc $JOB.end $JOB restart_$input_file #echo completed final geometry # build GAMESS input file from DeFT output if (! -e $JOB.dft ) then echo $H echo 'Sorry the main calculation did not complete' exit(1) endif dg.pl $JOB > $JOB.inp # # C-shell script to execute a GAMESS --production-- job. # set SCR=$temp_directory # # #echo doing population analysis # Grab a copy of the input file. cp $JOB.inp $SCR/$JOB.F05 # file assignments. # ASCII output files IRCDATA and PUNCH should be written by NFS to # your file server's disk, if applicable. # Other files are binary, and should be stored on local disk for # improved I/O, and deleted at the conclusion of the job. # setenv IRCDATA $SCR/$JOB.irc setenv INPUT $SCR/$JOB.F05 setenv PUNCH $SCR/$JOB.dat setenv GAMESS /usr/local/bin setenv AOINTS $SCR/$JOB.F08 setenv MOINTS $SCR/$JOB.F09 setenv DICTNRY $SCR/$JOB.F10 setenv DRTFILE $SCR/$JOB.F11 setenv CIVECTR $SCR/$JOB.F12 setenv NTNFMLA $SCR/$JOB.F13 setenv CIINTS $SCR/$JOB.F14 setenv WORK15 $SCR/$JOB.F15 setenv WORK16 $SCR/$JOB.F16 setenv CSFSAVE $SCR/$JOB.F17 setenv FOCKDER $SCR/$JOB.F18 setenv DASORT $SCR/$JOB.F20 setenv JKFILE $SCR/$JOB.F23 setenv ORDINT $SCR/$JOB.F24 setenv EFPIND $SCR/$JOB.F25 setenv MCDIIS $SCR/$JOB.F30 if ( -e $PUNCH ) rm $PUNCH endif # now execute GAMESS. # A sequential mode .p file is built on the fly, if you # are using a parallel-linked version. Its pathname may # need to be changed! $GAMESS/gamess.x $JOB > $JOB.gms rm -f $SCR/$JOB.F* rm -f $SCR/$JOB.dat rmdir $temp_directory rm -f FILE.48 $JOB.dat $JOB.inp # create pdb file for CHIME or RasMol setenv BABEL_DIR /usr/local/bin if (! -e $JOB.gms ) then echo $H echo 'Sorry the population analysis did not complete' exit(1) endif set con = `grep ABNORMALLY $JOB.gms` if ( $#con != 0 ) then echo $H echo 'Sorry the population analysis did not complete' exit(1) endif $BABEL_DIR/babel -igamout $JOB.gms -omdl $JOB.mol # convert output files to HTML if (! -e $JOB.mol ) then echo $H echo 'Sorry did not convert structure file' exit(1) endif mol2d.pl $JOB > $JOB.htm if (! -e $JOB.htm ) then echo $H echo 'Sorry did not convert to 2D structure' exit(1) endif rcp $JOB.mol atlas:/data/htdocs/chemistry/webmo wodg.pl $JOB > $JOB.html rcp $JOB.html atlas:/data/htdocs/chemistry/webmo/results # header to finsih up #echo '

' #echo '' #echo '-> Return to Molecular Structure Page. ' #echo '' #echo '-> Return to Chemistry Home Page
' #echo '' cat $JOB.html #rm $JOB.dft $JOB.gms $JOB.mol $JOB.htm exit