@@ -48,7 +48,8 @@ test -e $1 && rm $1
4848# --------------------------------------------
4949# if NOT non-self-consistent calculations
5050# --------------------------------------------
51- if [ $calculation != " nscf" ] && [ $calculation != " ienvelope" ]; then
51+ if [ $calculation != " nscf" ] && [ $calculation != " ienvelope" ]\
52+ && [ $calculation != " istate" ] ; then
5253 etot=` grep ETOT_ $running_path | awk ' {print $2}' `
5354 etotperatom=` awk ' BEGIN {x=' $etot ' ;y=' $natom ' ;printf "%.10f\n",x/y}' `
5455 echo " etotref $etot " >> $1
142143if [ $calculation == " ienvelope" ]; then
143144 nfile=0
144145 envfiles=` ls OUT.autotest/ | grep ENV`
145- for env in $envfiles ;
146- do
147- nelec=` ../tools/sum_ENV_H2 OUT.autotest/$env `
148- nfile=$(( $nfile + 1 ))
149- echo " nelec$nfile $nelec " >> $1
150- done
146+ if test -z " $envfiles " ; then
147+ echo " Can't find ENV(-elope) files"
148+ exit 1
149+ else
150+ for env in $envfiles ;
151+ do
152+ nelec=` ../tools/sum_ENV_H2 OUT.autotest/$env `
153+ nfile=$(( $nfile + 1 ))
154+ echo " nelec$nfile $nelec " >> $1
155+ done
156+ fi
157+ fi
158+
159+ if [ $calculation == " istate" ]; then
160+ chgfiles=` ls OUT.autotest/ | grep -E ' _CHG$' `
161+ if test -z " $chgfiles " ; then
162+ echo " Can't find BAND_CHG files"
163+ exit 1
164+ else
165+ for chg in $chgfiles ;
166+ do
167+ total_chg=` ../tools/sum_BAND_CHG_H2 OUT.autotest/$chg `
168+ echo " $chg $total_chg " >> $1
169+ done
170+ fi
171+ cubefiles=` ls OUT.autotest/ | grep -E ' .cube$' `
172+ if test -z " $cubefiles " ; then
173+ echo " Can't find BAND_CHG files"
174+ exit 1
175+ else
176+ for cube in $cubefiles ;
177+ do
178+ total_chg=` ../tools/sum_BAND_CHG_H2_cube OUT.autotest/$cube `
179+ echo " $cube $total_chg " >> $1
180+ done
181+ fi
151182fi
152183
153184# echo $total_band
0 commit comments