]> hackdaworld.org Git - physik/posic.git/commitdiff
added display of partialy occupied levels in a different color
authorhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 12 Oct 2009 17:44:07 +0000 (19:44 +0200)
committerhackbard <hackbard@sage.physik.uni-augsburg.de>
Mon, 12 Oct 2009 17:44:07 +0000 (19:44 +0200)
vasp_tools/get_ks_levels

index 220c7c9d8dbd473f3c7b93738fc594d77da6c222..922955a0ef911e9a39f9a9f3fe3ee839c5d74632 100755 (executable)
@@ -27,10 +27,12 @@ startline=`grep -n spin\ component\ 1 $file | tail -1 | awk -F: '{ print $1 }'`
 echo -en "spin component 1 ($startline)... "
 sed -n "$startline,/spin component 2/p" $file | grep ^' '*[0-9] | \
        while read number energy occu; do
-               if [ "$occu" != "0.00000" ]; then
+               if [ "$occu" = "1.00000" ]; then
                echo "0.18 $energy 0.1" >> $1/ks_levels_o
-               else
+               elif [ "$occu" = "0.00000" ]; then
                echo "0.18 $energy 0.1" >> $1/ks_levels_u
+               else
+               echo "0.18 $energy 0.1" >> $1/ks_levels_p
                fi
        done
 echo "done"
@@ -40,15 +42,17 @@ startline=`grep -n spin\ component\ 2 $file | tail -1 | awk -F: '{ print $1 }'`
 echo -en "spin component 2 ($startline) ... "
 sed -n "$startline,/---/p" $file | grep ^' '*[0-9] | \
        while read number energy occu; do
-               if [ "$occu" != "0.00000" ]; then
+               if [ "$occu" = "1.00000" ]; then
                echo "0.42 $energy 0.1" >> $1/ks_levels_o
-               else
+               elif [ "$occu" = "0.00000" ]; then
                        if [ "$center" = "0" ]; then
                                echo -en "setting mid value -> $energy ... "
                                center=$energy
                                echo "$energy" > $1/temp_e
                        fi
                echo "0.42 $energy 0.1" >> $1/ks_levels_u
+               else
+               echo "0.42 $energy 0.1" >> $1/ks_levels_p
                fi
        done
 echo "done"
@@ -58,7 +62,7 @@ yl=`echo $center $WDOWN | awk '{ print $1-$2 }'`
 yh=`echo $center $WUP | awk '{ print $1+$2 }'`
 echo "generating gnuplot file ($center, $yl, $yh, $ly) ..."
 cat > $1/ksl_plot.gpi <<!
-plot "ks_levels_o" w xerrorbars pt $OPT ps $PS t "", "ks_levels_u" w xerrorbars pt $UPT ps $PS t ""
+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 ""
 unset bars
 set ylabel "Kohn-Sham levels [eV]"
 set xrange [0:0.6]