3 # get the kohn sham levels (plotted nicely)
15 if [ ! -f $file ]; then
16 echo "no OUTCAR file found ..."
26 startline=`grep -n spin\ component\ 1 $file | tail -1 | awk -F: '{ print $1 }'`
27 echo -en "spin component 1 ($startline)... "
28 sed -n "$startline,/spin component 2/p" $file | grep ^' '*[0-9] | \
29 while read number energy occu; do
30 if [ "$occu" = "1.00000" ]; then
31 echo "0.18 $energy 0.1" >> $1/ks_levels_o
32 elif [ "$occu" = "0.00000" ]; then
33 echo "0.18 $energy 0.1" >> $1/ks_levels_u
35 echo "0.18 $energy 0.1" >> $1/ks_levels_p
41 startline=`grep -n spin\ component\ 2 $file | tail -1 | awk -F: '{ print $1 }'`
42 echo -en "spin component 2 ($startline) ... "
43 sed -n "$startline,/---/p" $file | grep ^' '*[0-9] | \
44 while read number energy occu; do
45 if [ "$occu" = "1.00000" ]; then
46 echo "0.42 $energy 0.1" >> $1/ks_levels_o
47 elif [ "$occu" = "0.00000" ]; then
48 if [ "$center" = "0" ]; then
49 echo -en "setting mid value -> $energy ... "
51 echo "$energy" > $1/temp_e
53 echo "0.42 $energy 0.1" >> $1/ks_levels_u
55 echo "0.42 $energy 0.1" >> $1/ks_levels_p
60 center=`cat $1/temp_e`
61 yl=`echo $center $WDOWN | awk '{ print $1-$2 }'`
62 yh=`echo $center $WUP | awk '{ print $1+$2 }'`
63 echo "generating gnuplot file ($center, $yl, $yh, $ly) ..."
64 cat > $1/ksl_plot.gpi <<!
65 plot "ks_levels_o" w xerrorbars pt $OPT ps $PS t "", "ks_levels_u" w xerrorbars pt $UPT ps $PS t "", "ks_levels_p" w xerrorbars pt $OPT ps $PS t ""
67 set ylabel "Kohn-Sham levels [eV]"
70 set xlabel "Spin up / down"
76 set term epslatex standalone color solid size 3.5,7
83 echo "running gnuplot and latex ..."
92 echo "file: $1/ksl.ps"