@@ -46,11 +46,7 @@ gamma_only=`grep gamma_only INPUT | awk '{print $2}' | sed s/[[:space:]]//g`
4646imp_sol=` grep imp_sol INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
4747# echo $running_path
4848base=` grep -En ' (^|[[:space:]])basis_type($|[[:space:]])' INPUT | awk ' {print $2}' | sed s/[[:space:]]//g`
49- if [ $base == " pw" ]; then word=" plane_wave_line"
50- else
51- word=" lcao_line"
52- fi
53- # echo $word
49+ word=" driver_line"
5450test -e $1 && rm $1
5551# --------------------------------------------
5652# if NOT non-self-consistent calculations
6662
6763# echo $etot
6864# echo "hasforce:"$has_force
69- if ! test -z " $has_force " && [ $has_force -eq 1 ]; then
65+ if ! test -z " $has_force " && [ $has_force == 1 ]; then
7066 nn3=` echo " $natom + 4" | bc`
7167 # nn1=`echo "$natom + 1" |bc`
7268 # nn5=`echo "$natom + 6" |bc`
7975
8076# echo $total_force
8177# echo "has_stress:"$has_stress
82- if ! test -z " $has_stress " && [ $has_stress -eq 1 ]; then
78+ if ! test -z " $has_stress " && [ $has_stress == 1 ]; then
8379 # grep -A6 "TOTAL-STRESS" $running_path|sed '1,4d'|sed '4,8d' >stress.txt
8480 grep -A6 " TOTAL-STRESS" $running_path | awk ' NF==3' | tail -3> stress.txt
8581 total_stress=` sum_file stress.txt`
8985
9086
9187# echo $total_stress
92- # if ! test -z "$has_charge" && [ $has_charge -eq 1 ]; then
88+ # if ! test -z "$has_charge" && [ $has_charge == 1 ]; then
9389# total_charge=`sum_file OUT.autotest/SPIN1_CHG`
9490# echo "totalchargeref $total_charge" >>$1
9591# fi
9692
9793
9894# echo $total_charge
99- if ! test -z " $has_dos " && [ $has_dos -eq 1 ]; then
95+ if ! test -z " $has_dos " && [ $has_dos == 1 ]; then
10096 total_dos=` cat OUT.autotest/DOS1_smearing.dat | awk ' END {print}' | awk ' {print $3}' `
10197 echo " totaldosref $total_dos " >> $1
10298fi
10399# smearing_dos=`sum_file OUT.autotest/DOS1_smearing.dat`
104100# echo "totaldossmearing $smearing_dos" >> $1
105101
106102# echo Onsager coefficiency
107- if ! test -z " $has_cond " && [ $has_cond -eq 1 ]; then
103+ if ! test -z " $has_cond " && [ $has_cond == 1 ]; then
108104 onref=refOnsager.txt
109105 oncal=Onsager.txt
110106 python3 ../tools/CompareFile.py $onref $oncal 2
114110
115111# echo total_dos
116112# echo $has_band
117- if ! test -z " $has_band " && [ $has_band -eq 1 ]; then
113+ if ! test -z " $has_band " && [ $has_band == 1 ]; then
118114 total_band=` sum_file OUT.autotest/BANDS_1.dat`
119115 echo " totalbandref $total_band " >> $1
120116fi
121117# echo $has_hs
122- if ! test -z " $has_hs " && [ $has_hs -eq 1 ]; then
123- if ! test -z " $gamma_only " && [ $gamma_only -eq 1 ]; then
118+ if ! test -z " $has_hs " && [ $has_hs == 1 ]; then
119+ if ! test -z " $gamma_only " && [ $gamma_only == 1 ]; then
124120 href=data-0-H.ref
125121 hcal=OUT.autotest/data-0-H
126122 sref=data-0-H.ref
@@ -139,15 +135,15 @@ if ! test -z "$has_hs" && [ $has_hs -eq 1 ]; then
139135fi
140136
141137# echo $has_hs2
142- if ! test -z " $has_hs2 " && [ $has_hs2 -eq 1 ]; then
138+ if ! test -z " $has_hs2 " && [ $has_hs2 == 1 ]; then
143139 python3 ../tools/CompareFile.py data-HR-sparse_SPIN0.csr.ref OUT.autotest/data-HR-sparse_SPIN0.csr 8
144140 echo " CompareHR_pass $? " >> $1
145141 python3 ../tools/CompareFile.py data-SR-sparse_SPIN0.csr.ref OUT.autotest/data-SR-sparse_SPIN0.csr 8
146142 echo " CompareSR_pass $? " >> $1
147143fi
148144
149145# echo "$has_wfc_r" ## test out_wfc_r > 0
150- if ! test -z " $has_wfc_r " && [ $has_wfc_r -eq 1 ]; then
146+ if ! test -z " $has_wfc_r " && [ $has_wfc_r == 1 ]; then
151147 if [[ ! -f OUT.autotest/running_scf.log ]]; then
152148 echo " Can't find file OUT.autotest/running_scf.log"
153149 exit 1
@@ -168,7 +164,7 @@ if ! test -z "$has_wfc_r" && [ $has_wfc_r -eq 1 ]; then
168164fi
169165
170166# echo "$has_wfc_pw" ## test out_wfc_pw > 0
171- if ! test -z " $has_wfc_pw " && [ $has_wfc_pw -eq 1 ]; then
167+ if ! test -z " $has_wfc_pw " && [ $has_wfc_pw == 1 ]; then
172168 if [[ ! -f OUT.autotest/WAVEFUNC1.txt ]]; then
173169 echo " Can't find file OUT.autotest/WAVEFUNC1.txt"
174170 exit 1
@@ -189,8 +185,8 @@ if ! test -z "$has_wfc_pw" && [ $has_wfc_pw -eq 1 ]; then
189185fi
190186
191187# echo "$has_lowf" ## test out_wfc_lcao > 0
192- if ! test -z " $has_lowf " && [ $has_lowf -eq 1 ]; then
193- if ! test -z " $gamma_only " && [ $gamma_only -eq 1 ]; then
188+ if ! test -z " $has_lowf " && [ $has_lowf == 1 ]; then
189+ if ! test -z " $gamma_only " && [ $gamma_only == 1 ]; then
194190 wfc_cal=OUT.autotest/LOWF_GAMMA_S1.dat
195191 wfc_ref=LOWF_GAMMA_S1.dat.ref
196192 else
@@ -214,7 +210,7 @@ if ! test -z "$has_lowf" && [ $has_lowf -eq 1 ]; then
214210 echo " Compare_wfc_lcao_pass $? " >> $1
215211fi
216212
217- if ! test -z " $out_dm " && [ $out_dm -eq 1 ]; then
213+ if ! test -z " $out_dm " && [ $out_dm == 1 ]; then
218214 dmfile=` ls OUT.autotest/ | grep " ^SPIN1_DM" `
219215 if test -z " $dmfile " ; then
220216 echo " Can't find DM files"
@@ -241,7 +237,7 @@ if ! test -z "$out_dm" && [ $out_dm -eq 1 ]; then
241237 fi
242238fi
243239
244- if ! test -z " $out_mul " && [ $out_mul -eq 1 ]; then
240+ if ! test -z " $out_mul " && [ $out_mul == 1 ]; then
245241 python3 ../tools/CompareFile.py mulliken.txt.ref OUT.autotest/mulliken.txt 8
246242 echo " Compare_mulliken_pass $? " >> $1
247243fi
@@ -287,7 +283,7 @@ if [ $calculation == "istate" ]; then
287283 fi
288284fi
289285
290- if ! test -z " $imp_sol " && [ $imp_sol -eq 1 ]; then
286+ if ! test -z " $imp_sol " && [ $imp_sol == 1 ]; then
291287 esol_el=` grep E_sol_el $running_path | awk ' {print $3}' `
292288 esol_cav=` grep E_sol_cav $running_path | awk ' {print $3}' `
293289 echo " esolelref $esol_el " >> $1
298294ttot=` grep $word $running_path | awk ' {print $3}' `
299295echo " totaltimeref $ttot " >> $1
300296
301- if ! test -z " $deepks_out_labels " && [ $deepks_out_labels -eq 1 ]; then
297+ if ! test -z " $deepks_out_labels " && [ $deepks_out_labels == 1 ]; then
302298 sed ' /n_des/d' descriptor.dat > des_tmp.txt
303299 total_des=` sum_file des_tmp.txt 5`
304300 rm des_tmp.txt
305301 echo " totaldes $total_des " >> $1
306302fi
307303
308- if ! test -z " $deepks_bandgap " && [ $deepks_bandgap -eq 1 ]; then
304+ if ! test -z " $deepks_bandgap " && [ $deepks_bandgap == 1 ]; then
309305 odelta=` python3 get_odelta.py`
310306 echo " odelta $odelta " >> $1
311307 oprec=` python3 get_oprec.py`
0 commit comments