43 |
echo " (DEF=\"12\")" |
echo " (DEF=\"12\")" |
44 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
45 |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
echo " (-clean) *ONLY* run \"make CLEAN\"" |
46 |
|
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
47 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
48 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
49 |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
echo " (-noclean|-nc) skip the \"make clean\" stage" |
265 |
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=$? ;; |
266 |
'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/..$//'` |
267 |
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=$? ;; |
268 |
'Qntmn') testoutput_var $1 "extforcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum" $2 $3; yy=$? ;; |
269 |
'Qntmx') testoutput_var $1 "extforcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum" $2 $3; yy=$? ;; |
270 |
'Qntav') testoutput_var $1 "extforcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean" $2 $3; yy=$? ;; |
271 |
'Qntsd') testoutput_var $1 "extforcing_qnet_sd" "Qnet Std.Dev" $2 $3; yy=$? ;; |
'Qntsd') testoutput_var $1 "forcing_qnet_sd" "Qnet Std.Dev" $2 $3; yy=$? ;; |
272 |
'aSImn') testoutput_var $1 "seaice_area_min" "SIce Area min" $2 $3; yy=$? ;; |
'aSImn') testoutput_var $1 "seaice_area_min" "SIce Area min" $2 $3; yy=$? ;; |
273 |
'aSImx') testoutput_var $1 "seaice_area_max" "SIce Area max" $2 $3; yy=$? ;; |
'aSImx') testoutput_var $1 "seaice_area_max" "SIce Area max" $2 $3; yy=$? ;; |
274 |
'aSIav') testoutput_var $1 "seaice_area_mean" "SIce Area mean" $2 $3; yy=$? ;; |
'aSIav') testoutput_var $1 "seaice_area_mean" "SIce Area mean" $2 $3; yy=$? ;; |
464 |
tail make.log |
tail make.log |
465 |
echo failed 1>&2 |
echo failed 1>&2 |
466 |
cp make.log $CDIR"/make.log" |
cp make.log $CDIR"/make.log" |
467 |
|
rm -f $EXECUTABLE |
468 |
return 1 |
return 1 |
469 |
else |
else |
470 |
echo successful 1>&2 |
echo successful 1>&2 |
596 |
printf 'runmodel in %s ...' $1 1>&2 |
printf 'runmodel in %s ...' $1 1>&2 |
597 |
# make output.txt |
# make output.txt |
598 |
echo |
echo |
599 |
if test -L $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test -L $EXECUTABLE ; then |
600 |
|
if test -x "../"$builddir"/"$EXECUTABLE ; then |
601 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
diff -q $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1 |
602 |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
outD=$? ; if test $outD != 0 ; then rm -f $EXECUTABLE ; fi |
603 |
|
else rm -f $EXECUTABLE |
604 |
|
fi |
605 |
fi |
fi |
606 |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then |
607 |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp |
635 |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'` |
636 |
fi |
fi |
637 |
rm -f run.log_tmp |
rm -f run.log_tmp |
|
#if test "x$RETVAL" = x0 ; then |
|
638 |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then |
639 |
tail $RUNLOG |
tail $RUNLOG |
640 |
echo successful 1>&2 |
echo successful 1>&2 |
642 |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
#cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE |
643 |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi |
644 |
return 0 |
return 0 |
645 |
|
elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then |
646 |
|
#-- for some weird cases (run is finihed but with error code) |
647 |
|
tail $RUNLOG |
648 |
|
echo finished with error '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
649 |
|
return 0 |
650 |
else |
else |
651 |
tail $RUNLOG |
tail $RUNLOG |
652 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
echo failed '(run:' $RETVAL ' end:' $ENDVAL ')' 1>&2 |
795 |
GSL=f |
GSL=f |
796 |
|
|
797 |
CLEANUP=f |
CLEANUP=f |
798 |
|
NORUN=f |
799 |
QUICK=f |
QUICK=f |
800 |
NOGENMAKE=f |
NOGENMAKE=f |
801 |
NOCLEAN=f |
NOCLEAN=f |
908 |
-clean | --clean) |
-clean | --clean) |
909 |
CLEANUP=t ; DELDIR=t ;; |
CLEANUP=t ; DELDIR=t ;; |
910 |
|
|
911 |
|
-norun | --norun | -nr | --nr) |
912 |
|
NORUN=t ;; |
913 |
-quick | --quick | -q | --q) |
-quick | --quick | -q | --q) |
914 |
QUICK=t ;; |
QUICK=t ;; |
915 |
-nogenmake | --nogenmake | -ng | --ng) |
-nogenmake | --nogenmake | -ng | --ng) |
1057 |
fi |
fi |
1058 |
|
|
1059 |
# create the FORTRAN comparison code |
# create the FORTRAN comparison code |
1060 |
createcodelet |
if test -x tr_cmpnum ; then |
1061 |
|
echo "skipping comparison code build" |
1062 |
|
else |
1063 |
|
createcodelet |
1064 |
|
fi |
1065 |
|
|
1066 |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
# build the mpack utility (if ADDRESSES = NONE, do it to test the build) |
1067 |
if test "x$ADDRESSES" = x ; then |
if test "x$ADDRESSES" = x ; then |
1188 |
if test "x$CLEANUP" = xt ; then |
if test "x$CLEANUP" = xt ; then |
1189 |
echo -n ' --- dir:' $BUILD_DIR ': ' |
echo -n ' --- dir:' $BUILD_DIR ': ' |
1190 |
makeclean $BUILD_DIR |
makeclean $BUILD_DIR |
1191 |
|
rm -f $BUILD_DIR/$EXECUTABLE |
1192 |
if test -d $dir/$rundir/CVS ; then |
if test -d $dir/$rundir/CVS ; then |
1193 |
echo -n ' --- dir:' $dir/$rundir ': ' |
echo -n ' --- dir:' $dir/$rundir ': ' |
1194 |
run_clean $dir/$rundir |
run_clean $dir/$rundir |
1230 |
|
|
1231 |
# Check whether there are "extra runs" for this testdir |
# Check whether there are "extra runs" for this testdir |
1232 |
extra_runs= |
extra_runs= |
1233 |
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
if test "x$NORUN" = xf ; then |
1234 |
|
ex_run_dirs=`( cd $dir ; echo $inputdir.* )` |
1235 |
|
fi |
1236 |
#echo "ex_run_dirs='$ex_run_dirs'" |
#echo "ex_run_dirs='$ex_run_dirs'" |
1237 |
for exd in $ex_run_dirs ; do |
for exd in $ex_run_dirs ; do |
1238 |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
name=`echo $exd | sed -e "s/$inputdir\.//"` |
1275 |
mkdir $rel_CDIR |
mkdir $rel_CDIR |
1276 |
CDIR=`pwd`"/$rel_CDIR" |
CDIR=`pwd`"/$rel_CDIR" |
1277 |
|
|
1278 |
if test "x$CLEANUP" = xt ; then |
if test "x$NORUN" = xt ; then |
1279 |
echo '====>>> this is to check that we never go through this part <<< ===' |
run=N |
1280 |
makeclean $dir/$builddir \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1281 |
&& run_clean $dir/$rundir |
&& makeclean $dir/$builddir \ |
1282 |
|
&& run_clean $dir/$rundir \ |
1283 |
|
&& symlink_mpifiles $dir $code_dir $builddir \ |
1284 |
|
&& makedependmodel $dir/$builddir && makedepend=Y \ |
1285 |
|
&& makemodel $dir/$builddir && make=Y |
1286 |
else |
else |
1287 |
genmakemodel $dir/$builddir && genmake=Y \ |
genmakemodel $dir/$builddir && genmake=Y \ |
1288 |
&& makeclean $dir/$builddir \ |
&& makeclean $dir/$builddir \ |
1295 |
&& results=`testoutput_run $dir $rundir $ref_outp` |
&& results=`testoutput_run $dir $rundir $ref_outp` |
1296 |
fi |
fi |
1297 |
|
|
1298 |
|
#echo "results='$results'" |
1299 |
echo |
echo |
1300 |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results` |
1301 |
echo |
echo |
1382 |
echo "An email containing results was sent to the following addresses:" |
echo "An email containing results was sent to the following addresses:" |
1383 |
echo " \"$ADDRESSES\"" |
echo " \"$ADDRESSES\"" |
1384 |
echo |
echo |
1385 |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
1386 |
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
1387 |
fi |
fi |
|
test -f $DRESULTS".tar" && rm -f $DRESULTS".tar" |
|
|
test -f $DRESULTS".tar.gz" && rm -f $DRESULTS".tar.gz" |
|
1388 |
fi |
fi |
1389 |
fi |
fi |
1390 |
|
|
1391 |
rm -f tr_cmpnum.c tr_cmpnum |
if test "x$QUICK" = xf -a "x$NORUN" = xf ; then |
1392 |
|
rm -f tr_cmpnum.c tr_cmpnum |
1393 |
|
fi |
1394 |
|
|
1395 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1396 |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |
cat $SUMMARY | sed 's/ \. \. \. \. \. \. \. \. \. \. \. \. //' |