5 [ -d $1 ] && file=$1/OUTCAR
7 echo "parsing file $file ..."
9 sicnt=`grep 'ions per' $file | awk '{ print $5 }'`
10 ccnt=`grep 'ions per' $file | awk '{ print $6 }'`
11 [ -z $ccnt ] && ccnt=0
13 echo " Si: $sicnt, C: $ccnt, total: $total"
15 cutoff=`grep ENCUT $file | awk '{ print $3 }' | awk -F. '{ print $1 }'`
16 echo " cutoff: $cutoff eV"
18 pawpp=`grep POTCAR $file | tail -1 | awk '{ print $2 }'`
19 if [ "$pawpp" = "PAW_GGA" ]; then
23 if [ "$pawpp" = "PAW" ]; then
27 if [ "$pawpp" = "US" ]; then
28 help=`grep GGA $file | grep eV | tail -1 | awk '{ print $1i }'`
41 energy=`grep energy\ without $file | tail -1 | awk '{ print $8 }'`
43 sifile=free_atoms/si_free_${cutoff}${ext}/OUTCAR
44 cfile=free_atoms/c_free_${cutoff}${ext}/OUTCAR
46 if [ ! -f $sifile ]; then
48 echo "$sifile not found ..."
53 if [ ! -f $cfile ]; then
55 echo "$cfile not found ..."
60 free_si=`grep energy\ without $sifile | tail -1 | awk '{ print $8 }'`
61 free_c=`grep energy\ without $cfile | tail -1 | awk '{ print $8 }'`
62 echo " Si correction: $free_si eV, C correction: $free_c eV"
64 #echo "-> $energy | $total | $sicnt | $ccnt | $free_si | $free_c <-"
65 echo $energy $total | \
66 awk '{ print " total e: " $1 " eV, per atom: " $1/$2 " eV"}'
67 echo "$energy $sicnt $ccnt $free_si $free_c" | \
68 awk '{ print " cohesive energy (Si and C): " ($1-$2*$4-$3*$5)/($2+$3) " eV, " $1-$2*$4-$3*$5 " eV" }'
69 echo "$energy $sicnt $free_c" | \
70 awk '{ print " cohesive energy (C only): " ($1-$2*$3)/$2 " eV, " $1-$2*$3 " eV" }'
71 #echo "$energy $total $free_si_250" | \
72 # awk '{ print " cohesive energy (Si only 250): " ($1-$2*$3)/$2 " eV" }'
73 #echo "$energy $sicnt $free_c_650" | \
74 # awk '{ print " cohesive energy (C only 650): " ($1-$2*$3)/($2) " eV" }'
75 #echo "$energy $sicnt $ccnt $free_si_650 $free_c_650" | \
76 # awk '{ print " cohesive energy (Si and C 650): " ($1-$2*$4-$3*$5)/($2+$3) " eV" }'
77 #echo "$energy $total" | \
78 # awk '{ print " Si:C -> cohesive energy: "$1/$2 " eV" }'