Jump to content

Mod:Hunt Research Group: get freq

From ChemWiki
#! /bin/csh
#
# a program to get frequency data from a guassian log file  
#
# data.log holds the original input file
# data.freq is the output
#
   echo 'welcome to get frequencies'
#
# set up directory stuff
#
   set actdir = $PWD
   set wkdir = $PWD/tmp
   if (-d "$wkdir") then
     rm $wkdir/*.* >& error
   else
     mkdir $wkdir   
   endif
   cd $wkdir
#
# GET INPUT INFORMATION
#
   if (${#argv} < 1) then
     echo input file to analyse
     set logfile=$<
   else
     set logfile=$argv[1]
   endif
#
# GET FREQUENCIES FROM FILE
#
   cp $actdir/$logfile.log data.log
   grep -i 'Frequencies --' data.log > data.1
   awk 'NR<2 {print $0}'<data.1 >data.3
   awk 'NR>2 {printf "%g \n",$3;printf "%g \n",$4;printf "%g \n",$5 }' <data.1 >data.2
   cp data.2 $actdir/$logfile.colfreq
#
   wc -l data.2 > data.4
   set lines=`awk '{print $1}' <data.4`   
#
   grep -i 'IR Inten    --' data.log > data.5
   awk '{printf "%g \n",$4;printf "%g \n",$5;printf "%g \n",$6 }' <data.5 >data.6
   cp data.6 $actdir/$logfile.colint 
#
# INFORMATION FOR USER
#
   cd $actdir
   echo 'from your log file:'
   cat $wkdir/data.3
   echo "the number of vibrational modes is "$lines
   echo "a list of frequencies is in file "$logfile.colfreq
   echo "a list of intensities is in file "$logfile.colint 
#   cat $logfile.colfreq
#
exit