Skip to content

Commit e8c4262

Browse files
committed
modify the calculation of grid number
1 parent 4fd6c02 commit e8c4262

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tests/integrate/tools/catch_properties.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ if ! test -z "$has_wfc_r" && [ $has_wfc_r -eq 1 ]; then
117117
echo "Can't find file OUT.autotest/running_scf.log"
118118
exit 1
119119
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}'`
120+
nband=$(grep NBANDS OUT.autotest/running_scf.log|awk '{print $3}')
121+
allgrid=$(grep "fft grid for wave functions" OUT.autotest/running_scf.log|awk -F "[=,]" '{print $2*$3*$4}')
122122
for((band=0;band<$nband;band++));do
123123
if [[ -f "OUT.autotest/wfc_realspace/wfc_realspace_0_$band" ]];then
124124
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)}}\
125+
awk -v all=$allgrid 'BEGIN {sumall=0} {for(i=1;i<=NF;i++) {sumall+=($i-1)*($i-1)}}\
126126
END {printf"%.5f",(sumall/all)}'`
127127
echo "variance_wfc_r_0_$band $variance_wfc_r" >>$1
128128
else

0 commit comments

Comments
 (0)