#! /usr/bin/awk -f # # # Author: Artur Michalak # Date added to Database: 10/06/05 # # Purpose: This awk script processes an ADF output from a QM/MM run and creates a file containing # the geometries used in the calculation e.g. in a geometry optimization # of linear transit. The geometry is specified in terms of xyz coordinates. # There is a seperate version for non-QM/MM runs. # # Usage: mkxyz ADFoutputfile.log >geometryfile.xyz # BEGIN { ltparg=0 nat =0 } # # /Final/ && /geometry at step: 1/ { getline getline getline getline getline getline getline getline nnn=$1 nat=0 while (nnn!="---------------------------------------") { nat++ ats[nat]=$1 x[nat]=$2 y[nat]=$3 z[nat]=$4 getline nnn=$1 } printf "%6d \n", nat print " Initial geometry" for (i=1;i<=nat;i++) printf " %2s %10.4f %10.4f %10.4f \n", ats[i],x[i],y[i],z[i] } # # /Final/ && /geometry/ && /at/ { for (i=1;i<=7;i++) getline printf "%6d \n", nat printf " %20s \n", title for (i=1;i<=nat;i++) { getline ats[i]=$1 x[i]=$2 y[i]=$3 z[i]=$4 printf " %2s %10.4f %10.4f %10.4f \n", ats[i],x[i],y[i],z[i] } } / G E O M E T R Y U P D A T E ***/ { ngeo=$16 + 1 if ($18=="LT") { ltrun="OK" nlt=$19 title=sprintf(" Geometry No. %4d LT %4d (%10.3f)",ngeo,nlt,ltparv) } else title=sprintf(" Geometry No. %4d ",ngeo) }