Get-dimer-dir.sh: Difference between revisions
Jump to navigation
Jump to search
New page: go back to Main Page, Computational Resources, Chemistry & More, Computational Codes, VASP, IDM == DESCRIPTION == Use the script "<TT>get-dimer-dir.sh</TT>" (''vi... |
mNo edit summary |
||
| Line 19: | Line 19: | ||
if test -f OUTCAR ; then printf "present, OK.\n" ; else printf "NOT PRESENT! Bye-bye.\n" ; exit ; fi | if test -f OUTCAR ; then printf "present, OK.\n" ; else printf "NOT PRESENT! Bye-bye.\n" ; exit ; fi | ||
IBRION=`grep IBRION OUTCAR | awk '{print $3}'` | IBRION=`grep IBRION OUTCAR | awk '{print $3}'` | ||
if [[ $IBRION -gt 8 || $IBRION -lt 5 ]] ; then printf " However, it is not a frequency job. Bye-Bye.\n" ; exit ; fi | if <nowiki>[[</nowiki> $IBRION -gt 8 || $IBRION -lt 5 <nowiki>]]</nowiki> ; then printf " However, it is not a frequency job. Bye-Bye.\n" ; exit ; fi | ||
VASPVER=`head -1 OUTCAR | cut -c 7` | VASPVER=`head -1 OUTCAR | cut -c 7` | ||
NIONS=`grep NIONS OUTCAR | awk '{print $12}'` | NIONS=`grep NIONS OUTCAR | awk '{print $12}'` | ||
Revision as of 11:26, 22 September 2010
go back to Main Page, Computational Resources, Chemistry & More, Computational Codes, VASP, IDM
DESCRIPTION
Use the script "get-dimer-dir.sh" (vide infra) to process OUTCAR from a VASP frequency job in order to obtain a DIMERDIRECTION file:
get-dimer-dir.sh
No arguments needed, it reads an OUTCAR (in the current directory!) and creates a DIMERDIRECTION file at the same place.
CODE
#!/bin/bash
# Script for extracting the displacement vector of the (lowest) imaginary frequency
# from an OUTCAR file as to setup IDM (Improved Dimer Method) calculation.
# David Karhanek, 2010-09-21 @ ICIQ Tarragona
# Get basic data from OUTCAR
printf " Checking for OUTCAR file... "
if test -f OUTCAR ; then printf "present, OK.\n" ; else printf "NOT PRESENT! Bye-bye.\n" ; exit ; fi
IBRION=`grep IBRION OUTCAR | awk '{print $3}'`
if [[ $IBRION -gt 8 || $IBRION -lt 5 ]] ; then printf " However, it is not a frequency job. Bye-Bye.\n" ; exit ; fi
VASPVER=`head -1 OUTCAR | cut -c 7`
NIONS=`grep NIONS OUTCAR | awk '{print $12}'`
grep -A $(($NIONS+1)) 'cm-1' OUTCAR > temp.tmp
NVIBS=`grep 'cm-1' temp.tmp | wc -l`
NIMAG=`grep 'f/i' temp.tmp | wc -l`
if test "$VASPVER" -lt "5" ; then NVIBS=$(($NVIBS/2)) ; NIMAG=$(($NIMAG/2)) ; fi
printf " VASP version %1g.*. Total of %3g atoms, %3g vibration modes, %3g imaginary mode(s).\n" $VASPVER $NIONS $NVIBS $NIMAG
# Parse the lowest imaginary mode displacement vector
tail -$NIONS temp.tmp | awk '{printf " %12.6f%12.6f%12.6f\n",$4,$5,$6}' > DIMERDIRECTION
rm temp.tmp
printf " Output saved into the file 'DIMERDIRECTION'.\n"
COMMON ERRORS
If you find some bugs, report them to David.
--Dkarhanek 12:10, 22 September 2010 (CEST)