108 |
if [ -r $1/$4/$OUTPUTFILE ]; then |
if [ -r $1/$4/$OUTPUTFILE ]; then |
109 |
grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt |
grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt |
110 |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
lncntA=`wc -l tmp1.txt | awk '{print $1}' ` |
111 |
if [ $lncntA -lt 3 ]; then |
if [ $lncntA -lt 2 ]; then |
112 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
113 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
114 |
fi |
fi |
123 |
fi |
fi |
124 |
grep "$2" $1/results/$5 | sed 's/.*=//' | cat -n > tmp2.txt |
grep "$2" $1/results/$5 | sed 's/.*=//' | cat -n > tmp2.txt |
125 |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
lncntB=`wc -l tmp2.txt | awk '{print $1}' ` |
126 |
if [ $lncntB -lt 3 ]; then |
if [ $lncntB -lt 2 ]; then |
127 |
if [ $verbose -gt 0 ]; then |
if [ $verbose -gt 0 ]; then |
128 |
echo Not enough lines of output when searching for "$2" 1>&2 |
echo Not enough lines of output when searching for "$2" 1>&2 |
129 |
fi |
fi |
235 |
# testoutput_run directory subdir reference_output |
# testoutput_run directory subdir reference_output |
236 |
# |
# |
237 |
# test output from 1 run in "directory" |
# test output from 1 run in "directory" |
238 |
if test "x$ADM" = x ; then |
# if test "x$ADM" = x ; then |
239 |
# default list of output variables to be checked: |
# default list of output variables to be checked: |
240 |
# 1rst : main variable used to decide if it pass or FAIL |
# 1rst : main variable used to decide if it pass or FAIL |
241 |
# others : number of matching digits to be printed in summary.txt |
# others : number of matching digits to be printed in summary.txt |
270 |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi |
271 |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
272 |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;; |
273 |
'Cost') testoutput_var $1 "ADM precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;; |
'Cost') testoutput_var $1 "ADM precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;; |
274 |
'Grad') testoutput_var $1 "ADM precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;; |
'Grad') testoutput_var $1 "ADM precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;; |
275 |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
276 |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
277 |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
296 |
testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;; |
testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;; |
297 |
'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` |
'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'` |
298 |
testoutput_var $1 "trcstat_ptracer0"$ii"_sd" "p0"$ii"_StDv" $2 $3; yy=$? ;; |
testoutput_var $1 "trcstat_ptracer0"$ii"_sd" "p0"$ii"_StDv" $2 $3; yy=$? ;; |
299 |
|
'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
300 |
|
'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
301 |
|
'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
302 |
|
'Qntsd') testoutput_var $1 "extforcing_qnet_sd" "Qnet Std.Dev" $2 $3; yy=$? ;; |
303 |
|
'aSImn') testoutput_var $1 "seaice_area_min" "SIce Area min" $2 $3; yy=$? ;; |
304 |
|
'aSImx') testoutput_var $1 "seaice_area_max" "SIce Area max" $2 $3; yy=$? ;; |
305 |
|
'aSIav') testoutput_var $1 "seaice_area_mean" "SIce Area mean" $2 $3; yy=$? ;; |
306 |
|
'aSIsd') testoutput_var $1 "seaice_area_sd" "SIce Area StDv" $2 $3; yy=$? ;; |
307 |
|
'hSImn') testoutput_var $1 "seaice_heff_min" "SIce Heff min" $2 $3; yy=$? ;; |
308 |
|
'hSImx') testoutput_var $1 "seaice_heff_max" "SIce Hell max" $2 $3; yy=$? ;; |
309 |
|
'hSIav') testoutput_var $1 "seaice_heff_mean" "SIce Hell mean" $2 $3; yy=$? ;; |
310 |
|
'hSIsd') testoutput_var $1 "seaice_heff_sd" "SIce Hell StDv" $2 $3; yy=$? ;; |
311 |
|
'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;; |
312 |
|
'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South" $2 $3; yy=$? ;; |
313 |
|
'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North" $2 $3; yy=$? ;; |
314 |
|
'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global" $2 $3; yy=$? ;; |
315 |
|
'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South" $2 $3; yy=$? ;; |
316 |
|
'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North" $2 $3; yy=$? ;; |
317 |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
318 |
esac |
esac |
319 |
if test $xx = $sVar |
if test $xx = $sVar |
331 |
echo $allargs |
echo $allargs |
332 |
fi |
fi |
333 |
|
|
334 |
else |
# else |
335 |
testoutput_ad $1 $2 "precision_grdchk_result" |
# testoutput_ad $1 $2 "precision_grdchk_result" |
336 |
fi |
# fi |
337 |
} |
} |
338 |
|
|
339 |
genmakemodel() |
genmakemodel() |
929 |
fi |
fi |
930 |
|
|
931 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
932 |
if test "x$ADM" = xt ; then |
# if test "x$ADM" = xt ; then |
933 |
LIST=`scandirs results_ad/$ref_outp` |
# LIST=`scandirs results_ad/$ref_outp` |
934 |
else |
# else |
935 |
LIST=`scandirs results/$ref_outp` |
LIST=`scandirs results/$ref_outp` |
936 |
fi |
# fi |
937 |
else |
else |
938 |
#- expand group of experiments: |
#- expand group of experiments: |
939 |
LIST=" " |
LIST=" " |
1095 |
else |
else |
1096 |
echo "ADJOINT=true" >> $SUMMARY |
echo "ADJOINT=true" >> $SUMMARY |
1097 |
echo >> $SUMMARY |
echo >> $SUMMARY |
1098 |
|
if [ $MATCH_CRIT -lt 10 ] ; |
1099 |
|
then line_0="default "$MATCH_CRIT ; |
1100 |
|
else line_0="default "$MATCH_CRIT ; fi |
1101 |
|
echo "$line_0" | tee -a $SUMMARY |
1102 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1103 |
G D M C G |
G D M C G |
1104 |
E p a R o r |
E p a R o r |
1218 |
fi |
fi |
1219 |
|
|
1220 |
echo |
echo |
1221 |
if test "x$ADM" = x ; then |
# if test "x$ADM" = x ; then |
1222 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1223 |
echo |
echo |
1224 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1225 |
touch $CDIR"/summary.txt" |
touch $CDIR"/summary.txt" |
1226 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
1227 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
1228 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
1244 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1245 |
fres="$fres.$ex" |
fres="$fres.$ex" |
1246 |
echo |
echo |
1247 |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
echo "$fres" | sed 's/ 99/ --/g' | sed 's/ > />/' | sed 's/ < /</' >> $SUMMARY |
1248 |
touch $CDIR"/summary.txt" |
touch $CDIR"/summary.txt" |
1249 |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $CDIR"/summary.txt" |
1250 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
1251 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
1252 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
1253 |
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
1254 |
if test "x$POSTCLEAN" = xt ; then |
if test "x$POSTCLEAN" = xt ; then |
1255 |
run_clean $dir/tr_run.$ex |
run_clean $dir/tr_run.$ex |
1256 |
fi |
fi |
1257 |
done |
done |
1258 |
else |
# else |
1259 |
fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
# fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
1260 |
fres=$fres"$results $dir" |
# fres=$fres"$results $dir" |
1261 |
echo |
# echo |
1262 |
echo "$fres" >> $SUMMARY |
# echo "$fres" >> $SUMMARY |
1263 |
touch $CDIR"/summary.txt" |
# touch $CDIR"/summary.txt" |
1264 |
echo "fresults='$fres'" >> $CDIR"/summary.txt" |
# echo "fresults='$fres'" >> $CDIR"/summary.txt" |
1265 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
# echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
1266 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
# echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
1267 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
# echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
1268 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
# echo "tdir='$dir'" >> $CDIR"/summary.txt" |
1269 |
fi |
# fi |
1270 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1271 |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ |
1272 |
>> $CDIR"/summary.txt" |
>> $CDIR"/summary.txt" |
1273 |
fi |
fi |
1274 |
|
|