# # This awk script will take the cartesian coordinates from a g03 archive and make a cc1 file suitable for the pc version of chem3d without # connectivity. If there are results from a frequency calculations (freq or opt+freq) it will pull those coordinates. # If it is only an optimization it will pull the optimized coordinates from the archive. # # This script was created by Lisa M. Perez at the Laboratory for Molecular Simulation and is provided as is. This script # has not been fully tested. Use at your own risk. # # Please e-mail Lisa M. Perez at mouse@mail.chem.tamu.edu with problems. # # To use this script you should make an alias in your .cshrc or .login file: # # alias cc1 'awk -f /home/mouse/cc1_dos.awk \!*.log > \!*.cc1' # # for bash shell use (.bashrc) # # function cc1_dos() { command awk -f /home/mouse/prog/cc1_dos.awk "$@".log > "$@".cc1 ; } # # This alias implies that you put cc1.awk in your home directory and that your Gaussian output files end in .log # You will type cc1 filename to execute. The script will create a file named filename.cc1 # # last updated 03/11/04 # BEGIN{n="";i=0;a="";s=17} # Look for optimization results in the archive /\\FOpt\\/,/\\\\Version/ { b=$0 sub (" ", "", b) a=a b n=0 } # Look for frequency results in the archive /\\Freq\\/,/\\\\Version/ { b=$0 sub (" ", "", b) g=g b n=1 } END { # split the freq coordinates into the variable c if (n==1) { split(g,c,FS="\\") } # split the opt coordinates into the variable c if (n==0) { split(a,c,FS="\\") } # Test to see if n is equal to null. If so, print an error message. if (n=="") { print "The script was unable to find the archive. Check to make sure that your job finished normally." } # count the number of atoms in the molecule and put it into the variable i while (c[s] != "") { i=i+1 s=s+1 } # set s to 17 since the coordinates are the 17th record in the archive and then print each record until a null record is reached s=17 print i" " print " " while (c[s] != "") { split (c[s],d,FS=",") # check to see if the format is an,x,y,z or an,int,x,y,z if (d[5]=="") printf "%2.2s %15.10f %15.10f %15.10f \n",d[1],d[2],d[3],d[4] else printf "%2.2s %15.10f %15.10f %15.10f \n",d[1],d[3],d[4],d[5] s=s+1 } }