@@ -36,6 +36,7 @@ has_r=`grep -En '(^|[[:space:]])out_mat_r($|[[:space:]])' INPUT | awk '{print $2
3636deepks_out_labels=` grep deepks_out_labels INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
3737deepks_bandgap=` grep deepks_bandgap INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
3838has_lowf=` grep out_wfc_lcao INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
39+ has_wfc_r=` grep out_wfc_r INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
3940gamma_only=` grep gamma_only INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
4041# echo $running_path
4142base=` grep -En ' (^|[[:space:]])basis_type($|[[:space:]])' INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
@@ -109,6 +110,28 @@ if ! test -z "$has_hs" && [ $has_hs -eq 1 ]; then
109110 total_s=` sum_file OUT.autotest/data-0-S`
110111 echo " totalSmatrix $total_s " >> $1
111112fi
113+
114+ # echo "$has_wfc_r" ## test out_wfc_r > 0
115+ if ! test -z " $has_wfc_r " && [ $has_wfc_r -eq 1 ]; then
116+ if [[ ! -f OUT.autotest/running_scf.log ]]; then
117+ echo " Can't find file OUT.autotest/running_scf.log"
118+ exit 1
119+ fi
120+ nband=` grep NBANDS OUT.autotest/running_scf.log| awk ' {print $3}' `
121+ nbxx=` grep nbxx OUT.autotest/running_scf.log| awk ' {print $3}' `
122+ for(( band= 0 ;band< $nband ;band++ )) ; do
123+ if [[ -f " OUT.autotest/wfc_realspace/wfc_realspace_0_$band " ]]; then
124+ variance_wfc_r=` sed -n " 13,$" p OUT.autotest/wfc_realspace/wfc_realspace_0_$band | \
125+ awk -v all=$nbxx ' BEGIN {sumall=0} {for(i=1;i<=NF;i++) {sumall+=($i-1)*($i-1)}}\
126+ END {printf"%.5f",(sumall/all)}' `
127+ echo " variance_wfc_r_0_$band $variance_wfc_r " >> $1
128+ else
129+ echo " Can't find file OUT.autotest/wfc_realspace/wfc_realspace_0_$band "
130+ exit 1
131+ fi
132+ done
133+ fi
134+
112135# echo "$has_lowf" ## test out_wfc_lcao > 0
113136if ! test -z " $has_lowf " && [ $has_lowf -eq 1 ]; then
114137 if ! test -z " $gamma_only " && [ $gamma_only -eq 1 ]; then
0 commit comments