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" != "0.00000" ]; then
31 echo "0.18 $energy 0.1" >> $1/ks_levels_o
33 echo "0.18 $energy 0.1" >> $1/ks_levels_u
39 startline=`grep -n spin\ component\ 2 $file | tail -1 | awk -F: '{ print $1 }'`
40 echo -en "spin component 2 ($startline) ... "
41 sed -n "$startline,/---/p" $file | grep ^' '*[0-9] | \
42 while read number energy occu; do
43 if [ "$occu" != "0.00000" ]; then
44 echo "0.42 $energy 0.1" >> $1/ks_levels_o
46 if [ "$center" = "0" ]; then
47 echo -en "setting mid value -> $energy ... "
49 echo "$energy" > $1/temp_e
51 echo "0.42 $energy 0.1" >> $1/ks_levels_u
56 center=`cat $1/temp_e`
57 yl=`echo $center $WDOWN | awk '{ print $1-$2 }'`
58 yh=`echo $center $WUP | awk '{ print $1+$2 }'`
59 echo "generating gnuplot file ($center, $yl, $yh, $ly) ..."
60 cat > $1/ksl_plot.gpi <<!
61 plot "ks_levels_o" w xerrorbars pt $OPT ps $PS t "", "ks_levels_u" w xerrorbars pt $UPT ps $PS t ""
63 set ylabel "Kohn-Sham levels [eV]"
66 set xlabel "Spin up / down"
72 set term epslatex standalone color solid size 3.5,7
79 echo "running gnuplot and latex ..."
88 echo "file: $1/ksl.ps"