Editing
Get-irc-path.sh
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== CODE == #!/bin/bash # Script for extracting the IRC (Intrinsic Reaction Coordinate) trajectory # from 2 subdirectories and # (C) David Karhanek 2010-09-29, ICIQ Tarragona # Unless the dir names are the defaults "1" and "2", submit them to the script as 2 arguments if [ $# != 0 ] ; then if [ $# == 2 ] ; then dir1=$1 ; dir2=$2 ; fi ; else dir1=1 ; dir2=2 ; fi # Parse energies and their last values grep E0 ${dir1}/OSZICAR | awk '{printf "%14.7f\n",$5}' > 1.dat grep E0 ${dir2}/OSZICAR | awk '{printf "%14.7f\n",$5}' > 2.dat E01=`sed '$!d' 1.dat` ; E02=`sed '$!d' 2.dat` # Decide which directory relates to products, put the energies together if [ $(echo "$E02 < $E01" | bc -q) == 1 ] ; then ini=1 ; fin=2 ; else ini=2 ; fin=1 ; fi tac $ini.dat | sed '$d' > 3.dat ; cat $fin.dat >> 3.dat awk '{printf "%03u%14.7f\n",NR,$1}' 3.dat > trajectory.dat # Perform simple statistics on the initial (IS), transition (TS) and final (FS) states # (the TS energy check : the values should not differ by more than 0.01 eV) ETSINI=`sed q $ini.dat` ; ETSFIN=`sed q $fin.dat` ; EIS=`sed '$!d' $ini.dat` ; EFS=`sed '$!d' $fin.dat` if [ $(echo "a=($ETSFIN-($ETSINI))/1;if(0>a)a*=-1;a<0.01" | bc -ql) == 1 ] ; then LTSM="OK" ; else LTSM="NOT_OK_!!!" ; fi ETS=$(echo "($ETSFIN+$ETSINI)/2" | bc -ql) EA=$(echo "$ETS-$EIS" | bc -ql) ; ER=$(echo "$EFS-$EIS" | bc -ql) of=statistics.txt ; if [ -f $of ] ; then mv $of old-$of ; fi printf "TS energies in both runs matching? .. %s\n" $LTSM >> $of printf "E(IS) = %14.7f eV Initial State (subdir %s)\n" $EIS $ini >> $of printf "E(TS) = %14.7f eV Transition State\n" $(echo "($ETSFIN+$ETSINI)/2" | bc -ql) >> $of printf "E(IS) = %14.7f eV Final State (subdir %s)\n" $EFS $fin >> $of printf "E(A) = %14.7f eV Energy Barrier\n" $EA >> $of printf "E(R) = %14.7f eV Reaction Heat\n" $ER >> $of # List output on-screen, clean-up printf "\n== IRC traj. ==\n" ; cat trajectory.dat printf "\n== Statistics: ==\n" ; cat $of rm -rf ?.dat > /dev/null
Summary:
Please note that all contributions to Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information