Page 1 of 1

VASP 5.2 and CONTCAR files

Posted: Mon May 25, 2009 1:59 pm
by metosa
Hi,

We have recently upgraded to vasp 5.2.

Our problem is that CONTARs generated with vasp 5.2 is not compatible with older versions. New vasp adds a line containing atom information to the CONTCARs. Our visualization tools (VESTA...) and scripts do not understand CONTCARs. Even vasp 4.6 do not understand vasp 5.2 CONTCARs as POSCAR....

How can ve prevent this situation ?
Can we modify the vasp code files ? If so, which lines...

----POSCAR----
systemx
1.00000000000000
2.4649999999999999 0.0000000000000000 0.0000000000000000
0.0000000000000000 23.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 9.9999999999999964
5 5
Direct
0.5037768256733397 0.1091864655149025 -0.0000003669165434
0.0024231410422420 0.2037776464893860 -0.0000001423893188
0.5015323254726387 0.2987072691063380 -0.0000003423035529
0.0013982574818563 0.3939021608015714 0.9999960553132785
0.5012000646284720 0.4903877572768863 0.0000193383385749
0.0035708352874256 0.1393500974831601 -0.0000000042872012
0.5022683582993777 0.2348846680321348 -0.0000003359231600
0.0014847954522989 0.3300268754514138 0.0000005218048660
0.5013741393148736 0.4249819543016217 0.9999872610331654
0.0013042014636313 0.5181291009332052 -0.0000011808463632


---- CONTCAR from vasp 5.2 ----

systemx
1.00000000000000
2.4649999999999999 0.0000000000000000 0.0000000000000000
0.0000000000000000 23.0000000000000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 9.9999999999999964
B N
5 5
Direct
0.5037768256733397 0.1091864655149025 -0.0000003669165434
0.0024231410422420 0.2037776464893860 -0.0000001423893188
0.5015323254726387 0.2987072691063380 -0.0000003423035529
0.0013982574818563 0.3939021608015714 0.9999960553132785
0.5012000646284720 0.4903877572768863 0.0000193383385749
0.0035708352874256 0.1393500974831601 -0.0000000042872012
0.5022683582993777 0.2348846680321348 -0.0000003359231600
0.0014847954522989 0.3300268754514138 0.0000005218048660
0.5013741393148736 0.4249819543016217 0.9999872610331654
0.0013042014636313 0.5181291009332052 -0.0000011808463632

VASP 5.2 and CONTCAR files

Posted: Sun Jun 14, 2009 1:41 pm
by metosa
Below script solves this problem temporarily.

#!/usr/bin/env bash

file=$1
random=$RANDOM
pos5s_case=`awk "NR==9" $file | awk '{print NF}'`
if [ $pos5s_case = 1 ]; then
awk "NR<6" $file >> $1.$random
awk "NR>6" $file >> $1.$random
mv $1.$random $file
exit
fi

pos5_case=`awk "NR==6" $file | awk '{print ($1*1)}'`
if [ $pos5_case = 0 ]; then
awk "NR<6" $file >> $1.$random
awk "NR>6" $file >> $1.$random
mv $1.$random $file
exit
fi

----------------

usage: ./script CONTCAR