42 |
echo " (-bash|-b) STRING preferred location of a \"bash\" or \"sh\" shell" |
echo " (-bash|-b) STRING preferred location of a \"bash\" or \"sh\" shell" |
43 |
echo " (DEF=\"\" for \"bash\")" |
echo " (DEF=\"\" for \"bash\")" |
44 |
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
45 |
|
echo " (-ncad) used genmake2 option \"-nocat4ad\" (-ncad)" |
46 |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
echo " (-makedepend|-md) STRING command to use for \"makedepend\"" |
47 |
echo " (-make|-m) STRING command to use for \"make\"" |
echo " (-make|-m) STRING command to use for \"make\"" |
48 |
echo " (DEF=\"make\")" |
echo " (DEF=\"make\")" |
332 |
'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; |
'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North-av" $2 $refoutp ; yy=$? ;; |
333 |
'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; |
'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;; |
334 |
'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; |
'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;; |
335 |
|
'sbo_M') testoutput_var $1 "sbo_mass" "SBO mass" $2 $refoutp ; yy=$? ;; |
336 |
|
'sboFW') testoutput_var $1 "sbo_mass_fw" "SBO m-FW" $2 $refoutp ; yy=$? ;; |
337 |
|
'sboAc') testoutput_var $1 "sbo_zoamc" "SBO AM-C" $2 $refoutp ; yy=$? ;; |
338 |
|
'sboAp') testoutput_var $1 "sbo_zoamp" "SBO AM-P" $2 $refoutp ; yy=$? ;; |
339 |
'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; |
'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;; |
340 |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
*) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;; |
341 |
esac |
esac |
373 |
if test "x$MKDEPEND" != x ; then |
if test "x$MKDEPEND" != x ; then |
374 |
command="$command -makedepend=$MKDEPEND" |
command="$command -makedepend=$MKDEPEND" |
375 |
fi |
fi |
376 |
if test $KIND = 1 -o $KIND = 2 ; then |
if test $KIND = 4 ; then |
377 |
command="$command --mods=../code_ad" |
command="$command -oad -mods=../$code_dir" |
|
elif test $KIND = 4 ; then |
|
|
command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods ../code_oad" |
|
378 |
else |
else |
379 |
command="$command -mods=../code" |
command="$command -mods=../$code_dir" |
380 |
fi |
fi |
381 |
if test "x$OPTFILE" != xNONE ; then |
if test "x$OPTFILE" != xNONE ; then |
382 |
command="$command -optfile=$OPTFILE" |
command="$command -optfile=$OPTFILE" |
403 |
if test "x$EXTRFLG" != x ; then |
if test "x$EXTRFLG" != x ; then |
404 |
command="$command -extra_flag $EXTRFLG" |
command="$command -extra_flag $EXTRFLG" |
405 |
fi |
fi |
406 |
|
if test "x$NOCATAD" = xt ; then |
407 |
|
command="$command -nocat4ad" |
408 |
|
fi |
409 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
410 |
command="$command -ts" |
command="$command -ts" |
411 |
fi |
fi |
528 |
cd $1; |
cd $1; |
529 |
if test -r Makefile ; then |
if test -r Makefile ; then |
530 |
printf 'make ... ' |
printf 'make ... ' |
531 |
if test "x$REPLMAKE" = x ; then |
$MAKE_CMD $TARG >> make.tr_log 2>&1 |
|
$MAKE $TARG >> make.tr_log 2>&1 |
|
|
else |
|
|
$REPLMAKE $TARG >> make.tr_log 2>&1 |
|
|
fi |
|
532 |
RETVAL=$? |
RETVAL=$? |
533 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
534 |
tail make.tr_log |
tail make.tr_log |
1044 |
if test "x$MAKE" = x ; then |
if test "x$MAKE" = x ; then |
1045 |
MAKE=make |
MAKE=make |
1046 |
fi |
fi |
1047 |
REPLMAKE= |
MAKE_CMD= |
1048 |
if test "x$CC" = x ; then |
if test "x$CC" = x ; then |
1049 |
CC=cc |
CC=cc |
1050 |
fi |
fi |
1057 |
DELDIR= |
DELDIR= |
1058 |
USE_R4= |
USE_R4= |
1059 |
EXTRFLG= |
EXTRFLG= |
1060 |
|
NOCATAD= |
1061 |
|
|
1062 |
#- type of testing (KIND): |
#- type of testing (KIND): |
1063 |
# KIND=0 : forward (= default) ; KIND=1 : Tangent Linear with TAF ; |
# KIND=0 : forward (= default) ; KIND=1 : Tangent Linear with TAF ; |
1117 |
-make | --make | -m | --m) ac_prev=MAKE ;; |
-make | --make | -m | --m) ac_prev=MAKE ;; |
1118 |
-make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; |
-make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;; |
1119 |
|
|
1120 |
-repl_mk | --repl_mk ) ac_prev=REPLMAKE ;; |
-repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;; |
1121 |
-repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;; |
-repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;; |
1122 |
|
|
1123 |
-odir | --odir) ac_prev=OUTDIR ;; |
-odir | --odir) ac_prev=OUTDIR ;; |
1124 |
-odir=* | --odir=*) OUTDIR=$ac_optarg ;; |
-odir=* | --odir=*) OUTDIR=$ac_optarg ;; |
1166 |
-oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else |
-oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else |
1167 |
echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage |
echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage |
1168 |
fi ;; |
fi ;; |
1169 |
|
-ncad) NOCATAD=t ;; |
1170 |
|
|
1171 |
-ieee) echo "Warning: ignore option '-ieee' (already the default)" |
-ieee) echo "Warning: ignore option '-ieee' (already the default)" |
1172 |
printf " ... " ;; |
printf " ... " ;; |
1186 |
|
|
1187 |
-ts) TS=t;; |
-ts) TS=t;; |
1188 |
-papis) PAPIS=t;; |
-papis) PAPIS=t;; |
1189 |
-pcls) PCL=t;; |
-pcls) PCLS=t;; |
1190 |
|
|
1191 |
-*) echo "Error: unrecognized option: "$ac_option |
-*) echo "Error: unrecognized option: "$ac_option |
1192 |
usage ;; |
usage ;; |
1202 |
NOCLEAN=t |
NOCLEAN=t |
1203 |
NODEPEND=t |
NODEPEND=t |
1204 |
fi |
fi |
1205 |
|
if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi |
1206 |
|
|
1207 |
#- check length of MPI machine file: |
#- check length of MPI machine file: |
1208 |
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then |
if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then |
1241 |
ref_outp="output_oadm.txt" |
ref_outp="output_oadm.txt" |
1242 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1243 |
else |
else |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
|
1244 |
code_dir=code |
code_dir=code |
1245 |
inputdir=input |
inputdir=input |
1246 |
ref_outp="output.txt" |
ref_outp="output.txt" |
1247 |
EXECUTABLE="mitgcmuv" |
EXECUTABLE="mitgcmuv" |
1248 |
fi |
fi |
1249 |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
1250 |
|
|
1251 |
xx=`echo $TESTDIRS | awk '{print $1}'` |
xx=`echo $TESTDIRS | awk '{print $1}'` |
1252 |
if test "x$TESTDIRS" = x ; then |
if test "x$TESTDIRS" = x ; then |
1309 |
|
|
1310 |
echo "OK (COMMAND='$COMMAND')" |
echo "OK (COMMAND='$COMMAND')" |
1311 |
|
|
1312 |
TMP=./tr_$$ |
#TMP=./tr_$$ |
1313 |
#- try to put temporary files in system-local /tmp dir |
#- try to put temporary files in system-local /tmp dir |
1314 |
#TMP=/tmp/tr_$$ |
TMP=/tmp/tr_${USER}_$$ |
1315 |
#touch $TMP ; retVal=$? |
touch $TMP ; retVal=$? |
1316 |
#if [ $retVal -eq 0 ] ; then |
if [ $retVal -eq 0 ] ; then |
1317 |
# if test ! -r $TMP ; then TMP=./tr_$$ ; fi |
if test ! -r $TMP ; then TMP=./tr_$$ ; fi |
1318 |
#else |
else |
1319 |
# TMP=./tr_$$ |
TMP=./tr_$$ |
1320 |
#fi |
fi |
1321 |
#rm -f $TMP |
rm -f $TMP |
1322 |
#if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi |
if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi |
1323 |
|
|
1324 |
# set the Default List of output variables to be checked: |
# set the Default List of output variables to be checked: |
1325 |
# (use default or load experiment-specific list from file "tr_checklist") |
# (use default or load experiment-specific list from file "tr_checklist") |
1366 |
CMDLINE="$CMDLINE $yy" ; fi |
CMDLINE="$CMDLINE $yy" ; fi |
1367 |
fi |
fi |
1368 |
done |
done |
|
#for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done |
|
1369 |
MACH=`hostname` |
MACH=`hostname` |
1370 |
UNAMEA=`uname -a` |
UNAMEA=`uname -a` |
1371 |
DATE=`date +%Y%m%d` |
DATE=`date +%Y%m%d` |
1373 |
if test "x$OUTDIR" != x ; then |
if test "x$OUTDIR" != x ; then |
1374 |
BASE="tr_"$OUTDIR"_"$DATE"_" |
BASE="tr_"$OUTDIR"_"$DATE"_" |
1375 |
else |
else |
1376 |
short_name=`hostname | sed 's/\..*$//'` |
#short_name=`hostname -s | tr '[:upper:]' '[:lower:]'` |
1377 |
|
# hostname -s is not universal (does work on AIX system) |
1378 |
|
short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'` |
1379 |
BASE="tr_"$short_name"_"$DATE"_" |
BASE="tr_"$short_name"_"$DATE"_" |
1380 |
fi |
fi |
1381 |
DNUM=0 |
DNUM=0 |
1681 |
if test -f $dir/$builddir/Makefile ; then |
if test -f $dir/$builddir/Makefile ; then |
1682 |
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'` |
1683 |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state |
1684 |
sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
# sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state |
1685 |
|
# bsd-sed cannot do the above code |
1686 |
|
cat $dir/$builddir/Makefile | \ |
1687 |
|
sed -n '/^# executed by:/{N |
1688 |
|
p |
1689 |
|
}' >> $DRESULTS/genmake_state |
1690 |
echo " $mkOpt" >> $DRESULTS/genmake_state |
echo " $mkOpt" >> $DRESULTS/genmake_state |
1691 |
if test "x$OPTFILE" = xNONE ; then |
if test "x$OPTFILE" = xNONE ; then |
1692 |
eval $mkOpt |
eval $mkOpt |
1693 |
sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
# sed "/^No \"OPTFILE\" was specified ; genmake2/a\ OPTFILE=${OPTFILE}"\ |
1694 |
$SUMMARY > tmp.tr_log |
# $SUMMARY > tmp.tr_log |
1695 |
|
# bsd-sed requires a newline after "a\": |
1696 |
|
sed "/^No \"OPTFILE\" was specified ; genmake2/a\\ |
1697 |
|
OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log |
1698 |
RETVAL=$? |
RETVAL=$? |
1699 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1700 |
cp -f tmp.tr_log $SUMMARY |
cp -f tmp.tr_log $SUMMARY |