Energies: Difference between revisions

From Wiki
Jump to navigation Jump to search
No edit summary
Dkarhanek (talk | contribs)
mNo edit summary
Line 6: Line 6:


----
----
<nowiki>#!/bin/awk -f</nowiki>
<nowiki>
 
#!/usr/bin/awk -f
<nowiki>BEGIN {</nowiki>
BEGIN {
 
      }
}
{
 
  {if ($3 == "E(RB+HF-LYP)"){ b3lyp =$5} }
 
  {if ($5 == "zero-point"){ zero=$7} }
{
  {if ($6 == "Free"){ free=$8} }
 
  {if (($1 == "Normal") && ($2 == "termination"))
 
  {print "Normal termination"} }
<nowiki>{if ($3 == "E(RB+HF-LYP)"){ b3lyp =$5
  {if (($1 == "Error") && ($2 == "termination")){
</nowiki>
  print "Error termination"
}
  print "Error termination"
 
  print "Error termination"
}
  print "Error termination"
 
  print "Error termination"} }
 
}
<nowiki>{if ($5 == "zero-point"){ zero=$7</nowiki>
END {
 
      print "    b3lyp  ", " zpe corrected ", " Free energy "
}
      print b3lyp, zero, free
 
    }</nowiki>
}
 
 
<nowiki>{if ($6 == "Free"){ free=$8</nowiki>
 
}
 
}
 
 
<nowiki>{if (($1 == "Normal") && ($2 == "termination")){</nowiki>
 
<nowiki>print "Normal termination"</nowiki>
 
}
 
}
 
 
 
<nowiki>{if (($1 == "Error") && ($2 == "termination")){</nowiki>
 
<nowiki>print "Error termination"</nowiki>
 
<nowiki>print "Error termination"</nowiki>
 
<nowiki>print "Error termination"</nowiki>
 
<nowiki>print "Error termination"</nowiki>
 
<nowiki>print "Error termination"</nowiki>
 
}
 
}
 
}
 
 
<nowiki>END{</nowiki>
 
<nowiki>print "    b3lyp  ", " zpe corrected ", " Free energy "</nowiki>
 
<nowiki>print b3lyp, zero, free</nowiki>
 
}
----
----

Revision as of 18:36, 1 June 2011

go back to Main Page, Computational Resources, Scripts

This is an AWK script.

The following script will go through a Gaussian output looking for the b3lyp energy (the fifth "word" in the output line where E(RB+HF-LYP) appears), the zero point corrected energy (7th "word" in the same line as zero-point) and Free energy (8th "word" in the output line containing Free). If the calculation finished correctly "Normal termination" will appear on the screen, if not "Error termination" will be printed 5 times in the screen.


 #!/usr/bin/awk -f
 BEGIN {
       }
 {
  {if ($3 == "E(RB+HF-LYP)"){ b3lyp =$5} }
  {if ($5 == "zero-point"){ zero=$7}  }
  {if ($6 == "Free"){ free=$8}  }
  {if (($1 == "Normal") && ($2 == "termination"))
   {print "Normal termination"} }
  {if (($1 == "Error") && ($2 == "termination")){
   print "Error termination"
   print "Error termination"
   print "Error termination"
   print "Error termination"
   print "Error termination"} }
 }
 END {
      print "    b3lyp   ", " zpe corrected ", " Free energy "
      print b3lyp, zero, free
     }