Geom.s
go back to Main Page, Computational Resources, Scripts, Scripts for VASP
Execute this script (geom.s OUTCAR) will generate a file called MOLCAR. This file is legible for MOLDEN, and includes the energies and geometries of each steps of OUTCAR file.
# # Gerard Novell Leruth # Conversion archivos OUTCAR de optimización VASP a molden format # Uso: geom.s OUTCAR #
file=$1 echo [MOLDEN FORMAT] > MOLCAR
declare -a num_ions_type
num_ions_type=($(grep "ions per type" $file | cut -b 20- ))
let j=$(grep -c POTCAR $file)/2
for i in $(seq 1 $j); do
let k=$i-1
ions_type[$k]=$(grep POTCAR $file | awk '{print $3}' | head -$i | tail -1 )
done
num_ions=$(grep IONS $file | awk '{print $12}')
iter=$(grep -c POSITION $file)
echo [GEOCONV] >> MOLCAR echo energy >> MOLCAR
for m in $(seq 1 $iter); do
echo $(grep -m $m "entropy=" $file | tail -1 | awk '{print $7}' ) >> MOLCAR
done
echo [GEOMETRIES] >> MOLCAR
for l in $(seq 1 $iter); do
echo $num_ions >> MOLCAR
echo -e >> MOLCAR
let k=$num_ions
p=0
j=${num_ions_type[$p]}
cap=1
for i in $(seq 1 $k); do
atom=${ions_type[$p]}
if [ [ $j = $i && $j != $k ] ]; then
let p=$p+1
let j=$j+${num_ions_type[$p]}
fi
let cap=$i+1
X=$(grep -m $l -$cap POSITION $file | tail -1 | awk '{print $1}')
Y=$(grep -m $l -$cap POSITION $file | tail -1 | awk '{print $2}')
Z=$(grep -m $l -$cap POSITION $file | tail -1 | awk '{print $3}')
echo $atom $X $Y $Z >> MOLCAR
done done
molden MOLCAR #rm MOLCAR