48 |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
echo " (-match) NUMBER Matching Criteria (number of digits)" |
49 |
echo " (DEF=\"$MATCH_CRIT\")" |
echo " (DEF=\"$MATCH_CRIT\")" |
50 |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
echo " (-j) JOBS use \"make -j JOBS\" for parallel builds" |
51 |
|
echo " (-ef) STRING used as genmake2 \"-extra_flag\" argument" |
52 |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
echo " (-clean) *ONLY* run \"make CLEAN\" & clean run-dir" |
53 |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
echo " (-norun|-nr) skip the \"runmodel\" stage (stop after make)" |
54 |
|
echo " (-obj) only produces objects (=norun & no executable)" |
55 |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
echo " (-runonly|-ro) *ONLY* run stage (=\"-quick\" without make)" |
56 |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
echo " (-quick|-q) same as \"-nogenmake -noclean -nodepend\"" |
57 |
echo " (-nogenmake|-ng) skip the genmake stage" |
echo " (-nogenmake|-ng) skip the genmake stage" |
251 |
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 |
252 |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$? |
253 |
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 ;; |
254 |
'Cost') testoutput_var $1 "ADM precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;; |
'Cost') testoutput_var $1 "ADM ref_cost_function" "ADM CostFct" $2 $3; yy=$? ;; |
255 |
'Grad') testoutput_var $1 "ADM precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;; |
'AdGrd') testoutput_var $1 "ADM adjoint_gradient" "ADM Ad Grad" $2 $3; yy=$? ;; |
256 |
|
'FDGrd') testoutput_var $1 "ADM finite-diff_grad" "ADM FD Grad" $2 $3; yy=$? ;; |
257 |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
'Tmn') testoutput_var $1 "dynstat_theta_min" "Theta minimum" $2 $3; yy=$? ;; |
258 |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
'Tmx') testoutput_var $1 "dynstat_theta_max" "Theta maximum" $2 $3; yy=$? ;; |
259 |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean" $2 $3; yy=$? ;; |
361 |
if test "x$USE_R4" = xt ; then |
if test "x$USE_R4" = xt ; then |
362 |
command="$command -use_r4" |
command="$command -use_r4" |
363 |
fi |
fi |
364 |
|
if test "x$EXTRFLG" != x ; then |
365 |
|
command="$command -extra_flag $EXTRFLG" |
366 |
|
fi |
367 |
if test "x$TS" = xt ; then |
if test "x$TS" = xt ; then |
368 |
command="$command -ts" |
command="$command -ts" |
369 |
fi |
fi |
484 |
cd $1; |
cd $1; |
485 |
if test -r Makefile ; then |
if test -r Makefile ; then |
486 |
printf 'make ... ' |
printf 'make ... ' |
487 |
if test "x$ADM" = xt ; then |
$MAKE $TARG >> make.tr_log 2>&1 |
|
$MAKE adall >> make.tr_log 2>&1 |
|
|
elif test "x$OADM" = xt ; then |
|
|
$MAKE adAll >> make.tr_log 2>&1 |
|
|
else |
|
|
if test "x$JOBS" = x ; then |
|
|
$MAKE >> make.tr_log 2>&1 |
|
|
else |
|
|
$MAKE -j $JOBS >> make.tr_log 2>&1 |
|
|
fi |
|
|
fi |
|
488 |
RETVAL=$? |
RETVAL=$? |
489 |
if test "x$RETVAL" != x0 ; then |
if test "x$RETVAL" != x0 ; then |
490 |
tail make.tr_log |
tail make.tr_log |
951 |
CC=cc |
CC=cc |
952 |
fi |
fi |
953 |
JOBS= |
JOBS= |
954 |
|
TARG= |
955 |
MPI=0 |
MPI=0 |
956 |
MPI_MFILE= |
MPI_MFILE= |
957 |
MULTI_THREAD=f |
MULTI_THREAD=f |
958 |
OUTDIR= |
OUTDIR= |
959 |
DELDIR= |
DELDIR= |
960 |
USE_R4= |
USE_R4= |
961 |
|
EXTRFLG= |
962 |
|
|
963 |
ADM= |
ADM= |
964 |
OADM= |
OADM= |
1023 |
-j | --j) ac_prev=JOBS ;; |
-j | --j) ac_prev=JOBS ;; |
1024 |
-j=* | --j=*) JOBS=$ac_optarg ;; |
-j=* | --j=*) JOBS=$ac_optarg ;; |
1025 |
|
|
1026 |
|
-ef | --ef) ac_prev=EXTRFLG ;; |
1027 |
|
-ef=* | --ef=*) EXTRFLG=$ac_optarg ;; |
1028 |
|
|
1029 |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
-clean | --clean) CLEANUP=t ; DELDIR=t ;; |
1030 |
|
|
1031 |
-norun | --norun | -nr | --nr) NORUN=t ;; |
-norun | --norun | -nr | --nr) NORUN=t ;; |
1032 |
|
-obj | --obj ) TARG='obj' ; NORUN=t ;; |
1033 |
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
-runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;; |
1034 |
-quick | --quick | -q | --q) QUICK=t ;; |
-quick | --quick | -q | --q) QUICK=t ;; |
1035 |
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
-nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;; |
1105 |
|
|
1106 |
#- setting for forward or ADM testing |
#- setting for forward or ADM testing |
1107 |
if test "x$ADM" = xt ; then |
if test "x$ADM" = xt ; then |
1108 |
|
if test "x$TARG" = xobj ; then TARG=adobj ; else TARG=adall ; fi |
1109 |
code_dir=code_ad |
code_dir=code_ad |
1110 |
inputdir=input_ad |
inputdir=input_ad |
1111 |
ref_outp="output_adm.txt" |
ref_outp="output_adm.txt" |
1112 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1113 |
elif test "x$OADM" = xt ; then |
elif test "x$OADM" = xt ; then |
1114 |
|
TARG=adAll |
1115 |
code_dir=code_oad |
code_dir=code_oad |
1116 |
inputdir=input_oad |
inputdir=input_oad |
1117 |
ref_outp="output_oadm.txt" |
ref_outp="output_oadm.txt" |
1118 |
EXECUTABLE="mitgcmuv_ad" |
EXECUTABLE="mitgcmuv_ad" |
1119 |
else |
else |
1120 |
|
if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi |
1121 |
code_dir=code |
code_dir=code |
1122 |
inputdir=input |
inputdir=input |
1123 |
ref_outp="output.txt" |
ref_outp="output.txt" |
1196 |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
ii=`echo $EMPTY_RESULTS | awk '{print NF}'` |
1197 |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf " ."}}'` |
1198 |
else |
else |
1199 |
DEF_CHECK_LIST='Grad Cost Grad' |
DEF_CHECK_LIST='AdGrd Cost AdGrd FDGrd' |
1200 |
EMPTY_RESULTS='.. ..' |
EMPTY_RESULTS='.. ..' |
1201 |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'` |
1202 |
fi |
fi |
1283 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1284 |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
line_0="$line_0 ----T----- ----S----- ----U----- ----V-----" |
1285 |
line_1="G D M c m s m s m s m s" |
line_1="G D M c m s m s m s m s" |
1286 |
line_2="E p a R g m m e . m m e . m m e . m m e ." |
line_2="e p a R g m m e . m m e . m m e . m m e ." |
1287 |
line_3="N n k u 2 i a a d i a a d i a a d i a a d" |
line_3="n n k u 2 i a a d i a a d i a a d i a a d" |
1288 |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
line_4="2 d e n d n x n . n x n . n x n . n x n ." |
1289 |
for ii in $PTRACERS_NUM ; do |
for ii in $PTRACERS_NUM ; do |
1290 |
line_0="$line_0 --PTR 0"$ii"--" |
line_0="$line_0 --PTR 0"$ii"--" |
1307 |
else line_0="default "$MATCH_CRIT ; fi |
else line_0="default "$MATCH_CRIT ; fi |
1308 |
echo "$line_0" | tee -a $SUMMARY |
echo "$line_0" | tee -a $SUMMARY |
1309 |
cat << EOF | tee -a $SUMMARY |
cat << EOF | tee -a $SUMMARY |
1310 |
G D M C G |
G D M C A F |
1311 |
E p a R o r |
e p a R o d D |
1312 |
N n k u s a |
n n k u s G G |
1313 |
2 d e n t d |
2 d e n t r r |
1314 |
|
|
1315 |
EOF |
EOF |
1316 |
fi |
fi |
1540 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
1541 |
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state |
1542 |
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \ |
1543 |
| grep -v '^... compiler version ' > tr_1.tmp_log |
| grep -v '^... compiler version ' > tr_1.tmp_log |
1544 |
sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state |
1545 |
|
sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \ |
1546 |
>> $DRESULTS/genmake_state |
>> $DRESULTS/genmake_state |
1547 |
rm -f tr_1.tmp_log |
rm -f tr_1.tmp_log |
1548 |
fi |
fi |