From fb0fd78e36b2a295e43059cf9140f0f73fb4ccb7 Mon Sep 17 00:00:00 2001 From: LUNASEA <33978601+maki49@users.noreply.github.com> Date: Sat, 13 Jul 2024 06:53:42 +0800 Subject: [PATCH] fix LR test logic (#4678) --- tests/integrate/tools/catch_properties.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/integrate/tools/catch_properties.sh b/tests/integrate/tools/catch_properties.sh index 321467e139..8265565b60 100755 --- a/tests/integrate/tools/catch_properties.sh +++ b/tests/integrate/tools/catch_properties.sh @@ -74,9 +74,14 @@ test -e $1 && rm $1 #-------------------------------------------- # if NOT non-self-consistent calculations or linear response #-------------------------------------------- +is_lr=0 +if [ ! -z $esolver_type ] && ([ $esolver_type == "lr" ] || [ $esolver_type == "ks-lr" ]); then + is_lr=1 +fi + if [ $calculation != "nscf" ] && [ $calculation != "get_wf" ]\ && [ $calculation != "get_pchg" ] && [ $calculation != "get_S" ]\ -&& [ $esolver_type != "ks-lr" ] && [ $esolver_type != "lr" ]; then +&& [ $is_lr == 0 ]; then #etot=`grep ETOT_ $running_path | awk '{print $2}'` etot=$(grep "ETOT_" "$running_path" | tail -1 | awk '{print $2}') etotperatom=`awk 'BEGIN {x='$etot';y='$natom';printf "%.10f\n",x/y}'` @@ -467,7 +472,7 @@ if ! test -z "$out_current" && [ $out_current ]; then echo "CompareCurrent_pass $?" >>$1 fi -if ! test -z "$esolver_type" && ([ $esolver_type == "lr" ] || [ $esolver_type == "ks-lr" ]); then +if [ $is_lr == 1 ]; then lr_path=OUT.autotest/running_lr.log lrns=$(get_input_key_value "lr_nstates" "INPUT") lrns1=`echo "$lrns + 1" |bc`