#!/bin/tcsh -f # # .................................................................... # This script was supplied by Lisa M. Perez at the Laboratory # for Molecular Simulation at Texas A&M University. # http://www.chem.tamu.edu/LMS # # This script has not been tested fully and is provided on an "as is" # basis # # Last updated February 20th, 2006 # # .................................................................... # if ( $#argv == 0 ) goto help foreach i ( $* ) switch ($i) case -help : goto help endsw end # .................................................................... # run the job # .................................................................... set name=`hostname` set name=$name:r set name=$name:r set name=$name:r if ( $name == "k2" || $name == "titan" || $name == "agave" ) then setenv g03root /usr/local/g03 source $g03root/g03/bsd/g03.login else if ( $name == "cosmos" ) then g03root=/usr/local/g03/c02.scsl export g03root . $g03root/g03/bsd/g03.profile alias g03=$g03root/g03/g03 endif endif set j=0 set p=g03 @ ivar=0 foreach i ( $* ) @ ivar++ switch ($i) case -p set j=1 breaksw case -d set j=2 breaksw case -hl set j=3 breaksw endsw end if ( $j == 0 ) then set data=$argv[1] else set data=$argv[2] endif if ( ! -e {$data}.chk ) then echo The checkpoint file {$data}.chk does not exist exit endif if ( $j == 0 ) then set homo=$argv[2] set occ=$argv[3] set uno=$argv[4] set lumo=`expr $homo + 1` set m=0 set m=`expr $homo - $occ + 1` set occ=`expr $occ - 1` set n=0 set n=`expr $homo + $uno` set uno=`expr $uno + 1` endif echo '%chk=surface.chk' > surface.com echo '#p b3lyp chkbasis guess=(read,only) geom=(allcheck)' >> surface.com if ( $j == 0 ) then echo 'cube=(40,orbital)' >> surface.com echo '' >> surface.com echo 'surface.cube' >> surface.com endif if ( $j == 3 ) then echo 'cube=(40,orbital)' >> surface.com echo '' >> surface.com echo 'surface.cube' >> surface.com endif if ( $j == 0 ) then while ( $homo >= $m ) echo $homo >> surface.com set homo=`expr $homo - 1` end while ( $lumo <= $n ) echo $lumo >> surface.com set lumo=`expr $lumo + 1` end echo '' echo 'Generating the orbital cube file. This may take a while if your molecule is large.' endif if ( $j == 3 ) then echo 'homo lumo' >> surface.com echo '' echo 'Generating the orbital cube file. This may take a while if your molecule is large.' endif if ( $j == 2 ) then echo 'cube=(40,density)' >> surface.com echo '' >> surface.com echo 'surface.cube' >> surface.com echo '' >> surface.com echo '' echo 'Generating the density cube file. This may take a while if your molecule is large.' endif if ( $j == 1 ) then echo 'cube=(40,potential)' >> surface.com echo '' >> surface.com echo 'surface.cube' >> surface.com echo '' >> surface.com echo '' echo 'Generating the electrostatic potential cube file. This may take a while if your molecule is large.' endif echo ' ' >> surface.com \cp {$data}.chk surface.chk ($p < surface.com > surface.log ) >& surface.err cat surface.err if ( $j == 0 ) then \mv surface.cube {$data}_cube if ( -e {$data}_cube ) then echo '' echo The orbital cube file {$data}_cube has been generated echo '' else echo An error occured, please check to make sure that your checkpoint file is good. echo '' echo Use chkchk filename.chk to check your checkpoint file echo '' endif else if ( $j == 2 ) then \mv surface.cube {$data}_density.cube if ( -e {$data}_density.cube ) then echo '' echo The density cube file {$data}_density.cube has been generated echo '' else echo An error occured, please check to make sure that your checkpoint file is good. echo '' echo Use chkchk filename.chk to check your checkpoint file echo '' endif else if ( $j == 3 ) then \mv surface.cube {$data}_hl.cube if ( -e {$data}_hl.cube ) then echo '' echo The oribital cube file {$data}_hl.cube has been generated echo '' else echo An error occured, please check to make sure that your checkpoint file is good. echo '' echo Use chkchk filename.chk to check your checkpoint file echo '' endif else \mv surface.cube {$data}_potential.cube if ( -e {$data}_potential.cube ) then echo '' echo The potential cube file {$data}_potential.cube has been generated echo '' else echo An error occured, please check to make sure that your checkpoint file is good. echo '' echo Use chkchk filename.chk to check your checkpoint file echo '' endif endif endif endif (\rm surface.chk surface.log surface.err 1)>& /dev/null exit #..................................................................... help: echo " " echo 'cubeprep will use Guassian 03 to generate a low resolution molecular ' echo ' orbital, potential, or density cube file' echo '' echo 'The default program is Gaussian 03.' echo '' echo ' To generate a molecular orbital cube file (filename.hl.cube) with only the homo and lumo:' echo " Syntax : cubeprep -hl filename " echo " " echo ' To generate a molecular orbital cube file (filename.cube) with more orbitals: ' echo " Syntax : cubeprep filename [homo] [occ] [unocc]" echo " " echo " Filename is the name of the checkpoint file (minus the suffix (aka .chk))" echo '' echo ' [homo] is the highest occupied orbital number' echo ' ' echo ' [occ] is the number of occupied orbitals you wish to generate' echo ' ' echo ' [unocc] is the number of unoccupied orbitals you wish to generate' echo "" echo 'For example: cubeprep temp 33 5 2 ' echo '' echo ' will generate a cube file with orbital 33(homo) 32 31 30 29 34(lumo) 35 ' echo '' echo ' To generate a potential cube file (filename.potential.cube):' echo ' Syntax : cubeprep -p filename ' echo ' ' echo ' To generate a density cube file (filename.density.cube):' echo ' Syntax : cubeprep -d filename ' echo ' ' exit