diff --git a/examples/bsse/water/result.ref b/examples/bsse/water/result.ref index 5cc1c2f3ac..f2c9658c10 100644 --- a/examples/bsse/water/result.ref +++ b/examples/bsse/water/result.ref @@ -1 +1,5 @@ --13.3178 +-13.31774791420906 +E_H2O: -466.1219344619547 +E_O: -427.6267373722137 +E_H1: -12.58872471938786 +E_H2: -12.58872445614408 diff --git a/examples/bsse/water/run.sh b/examples/bsse/water/run.sh index 1cc75c99f4..c7a6ec2ca2 100755 --- a/examples/bsse/water/run.sh +++ b/examples/bsse/water/run.sh @@ -23,14 +23,18 @@ mv OUT.ABACUS/running_scf.log OUT.ABACUS/running_scf_H2.log rm STRU -E_H2O=`grep GE H2O_scf.output | tail -n 1 | awk '{printf $2}'` -E_O=`grep GE O_scf.output | tail -n 1 | awk '{printf $2}'` -E_H1=`grep GE H1_scf.output | tail -n 1 | awk '{printf $2}'` -E_H2=`grep GE H2_scf.output | tail -n 1 | awk '{printf $2}'` -result=$(awk 'BEGIN{print "'$E_H2O'" - "'$E_O'" - "'$E_H1'" - "'$E_H2'"}') +E_H2O=$(grep FINAL_ETOT_IS OUT.ABACUS/running_scf_H2O.log | awk '{printf $2}') +E_O=$(grep FINAL_ETOT_IS OUT.ABACUS/running_scf_O.log | awk '{printf $2}') +E_H1=$(grep FINAL_ETOT_IS OUT.ABACUS/running_scf_H1.log | awk '{printf $2}') +E_H2=$(grep FINAL_ETOT_IS OUT.ABACUS/running_scf_H2.log | awk '{printf $2}') +result=$(echo "scale=12; ${E_H2O} - ${E_O} - ${E_H1} - ${E_H2}" | bc -l) echo $result > result.out -result_ref=$(cat result.ref) -difference=$(awk 'BEGIN{print "'$result'" - "'$result_ref'"}') +echo "E_H2O: $E_H2O" >> result.out +echo "E_O: $E_O" >> result.out +echo "E_H1: $E_H1" >> result.out +echo "E_H2: $E_H2" >> result.out +result_ref=$(cat result.ref | head -1) +difference=$(echo "scale=12; $result - $result_ref" | bc -l) difference=$(awk -v a=$difference 'BEGIN{if(a<0) print -1*a; else print a}') if [[ ! -f H2O_scf.output ]] ||