/[MITgcm]/MITgcm/verification/testreport
ViewVC logotype

Diff of /MITgcm/verification/testreport

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.188 by jmc, Fri Jul 19 18:49:33 2013 UTC revision 1.211 by jmc, Wed Jan 11 23:21:21 2017 UTC
# Line 11  usage() Line 11  usage()
11      echo      echo
12      echo "where possible OPTIONS are:"      echo "where possible OPTIONS are:"
13      echo "  (-help|-h)               print usage"      echo "  (-help|-h)               print usage"
14        echo " ---- type of test : ----"
15        echo "  (-tlm)                   perform a Tangent Linear run"
16        echo "  (-adm|-ad)               perform an adjoint run"
17        echo "  (-oad)                   perform an OpenAD adjoint run"
18      echo "  (-mth)                   run multi-threaded (using eedata.mth)"      echo "  (-mth)                   run multi-threaded (using eedata.mth)"
19      echo "  (-mpi)                   use MPI to compile and run on 2 processors"      echo "  (-mpi)                   use MPI to compile and run on 2 processors"
20      echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"      echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
21      echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"      echo "  (-mfile|-mf) STRING      MPI: file with list of possible machines to run on"
22        echo "  (-command|-c) STRING     command to run (e.g., if non-standard MPI setting)"
23        echo "                            DEF='mitgcmuv' or ='mpirun -np TR_NPROC mitgcmuv'"
24        echo " ---- testing options : ----"
25        echo "  (-optfile|-of) STRING    optfile to use"
26      echo "  (-fast)                  use optfile default for compiler flags (no '-ieee')"      echo "  (-fast)                  use optfile default for compiler flags (no '-ieee')"
27      echo "                            DEF=off => use IEEE numerics option (if available)"      echo "                            DEF=off => use IEEE numerics option (if available)"
28      echo "  (-devel)                 use optfile developement flags (if available)"      echo "  (-devel)                 use optfile developement flags (if available)"
29      echo "  (-gsl)                   compile with \"-gsl\" flag"      echo "  (-gsl)                   compile with \"-gsl\" flag"
30      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"
     echo "  (-optfile|-of) STRING    list of optfiles to use"  
     echo "  (-addr|-a) STRING        list of email recipients"  
     echo "                             (DEF=\"\" no email is sent)"  
     echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"  
     echo "                             (DEF=\"../tools/mpack-1.6\")"  
31      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"      echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"
32      echo "                             (recognized groups: basic, tutorials)"      echo "                             (recognized groups: basic, tutorials)"
33      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
# Line 32  usage() Line 35  usage()
35      echo "                              test THIS_EXP + all the following)"      echo "                              test THIS_EXP + all the following)"
36      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"      echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
37      echo "                             (DEF=\"\" which test all)"      echo "                             (DEF=\"\" which test all)"
38      echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"      echo "  (-ts)                    provide timing information per timestep"
39      echo "                             Bourne-compatible \"sh\" shell"      echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
40        echo "  (-pcls)                  provide MFlop/s per timestep using PCL"
41        echo " ---- system options : ----"
42        echo "  (-bash|-b) STRING        preferred location of a \"bash\" or \"sh\" shell"
43      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
44      echo "  (-tlm)                   perform a Tangent Linear run"      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"
45      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-ncad)                  use genmake2 option \"-nocat4ad\" (-ncad)"
46      echo "  (-oad)                   perform an OpenAD adjoint run"      echo "  (-small_f)               make target small_f before making target all"
     echo "  (-command|-c) STRING     command to run"  
47      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
48      echo "  (-make|-m) STRING        command to use for \"make\""      echo "  (-make|-m) STRING        command to use for \"make\""
49      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
50      echo "  (-odir) STRING           used to build output directory name"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
51      echo "                             (DEF=\"hostname\")"      echo " ---- output options : ----"
 #   echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"  
 #   echo "                             (DEF=\"1 2 3 4 5\")"  
52      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
53      echo "                             (DEF=\"$MATCH_CRIT\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
54      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-odir) STRING           used to build output directory name"
55      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"      echo "                             (DEF=\"hostname\")"
56        echo "  (-addr|-a) STRING        list of email recipients"
57        echo "                             (DEF=\"\" no email is sent)"
58        echo "  (-send)       STRING     sending command (instead of using mpack)"
59        echo "  (-savdir|-sd) STRING     location to save output tar file to send (DEF='$SAVDIR')"
60        echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"
61        echo "                             (DEF=\"../tools/mpack-1.6\")"
62        echo " -- do only some parts: --"
63      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"
64      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
65      echo "  (-obj)                   only produces objects (=norun & no executable)"      echo "  (-obj)                   only produces objects (=norun & no executable)"
66        echo "  (-src)                   only produces small '*.f' src files (not even obj)"
67        echo "                            + with: '-adm/-tlm', also makes taf outp src code"
68      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"      echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
69      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
70      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
# Line 61  usage() Line 73  usage()
73      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
74      echo "  (-deloutp|-do)           delete output files after successful run"      echo "  (-deloutp|-do)           delete output files after successful run"
75      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
     echo "  (-ts)                    provide timing information per timestep"  
     echo "  (-papis)                 provide MFlop/s per timestep using PAPI"  
     echo "  (-pcls)                  provide MFlop/s per timestep using PCL"  
76      echo      echo
77      echo "and where STRING can be a whitespace-delimited list"      echo "and where STRING can be a whitespace-delimited list"
78      echo "such as:"      echo "such as:"
# Line 125  testoutput_var() Line 134  testoutput_var()
134          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2
135      fi      fi
136      if [ -r $1/$4/$OUTPUTFILE ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
137          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | nl > ${TMP}a.txt
138          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' `
139          if [ $lncntA -lt 2 ]; then          if [ $lncntA -lt 2 ]; then
140              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
141                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
142              fi              fi
143              rm -f tmp1.txt ; return 99              rm -f ${TMP}a.txt ; return 99
144          fi          fi
145      else      else
146          echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2          echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2
# Line 140  testoutput_var() Line 149  testoutput_var()
149      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
150          echo testoutput_var: grep "$2" $1/$5 1>&2          echo testoutput_var: grep "$2" $1/$5 1>&2
151      fi      fi
152      grep "$2" $1/$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/$5 | sed 's/.*=//' | nl > ${TMP}b.txt
153      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' `
154      if [ $lncntB -lt 2 ]; then      if [ $lncntB -lt 2 ]; then
155          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
156              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
157          fi          fi
158          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
159      fi      fi
160      if [ $lncntA -ne $lncntB ]; then      if [ $lncntA -ne $lncntB ]; then
161          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
162              echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2              echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2
163          fi          fi
164          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
165      fi      fi
166      has_nan=`cat tmp1.txt | grep -i nan | wc -l`      has_nan=`cat ${TMP}a.txt | grep -i nan | wc -l`
167      if [ $has_nan -gt 0  ] ; then      if [ $has_nan -gt 0  ] ; then
168          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2
169          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
170      fi      fi
171      has_inf=`cat tmp1.txt | grep -i inf | wc -l`      has_inf=`cat ${TMP}a.txt | grep -i inf | wc -l`
172      if [ $has_inf -gt 0  ] ; then      if [ $has_inf -gt 0  ] ; then
173          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2
174          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
175      fi      fi
176      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
177          echo testoutput_var: join tmp1.txt tmp2.txt 1>&2          echo testoutput_var: join ${TMP}a.txt ${TMP}b.txt 1>&2
178      fi      fi
179      join tmp1.txt tmp2.txt | awk '{print $1 " " $2 " " $3}' > tmp3.txt      # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number
180        join ${TMP}a.txt ${TMP}b.txt | awk '{print $1 " " $2 " " $3}' | sed -e 's|:||g' > ${TMP}c.txt
181      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
182          echo testoutput_var: compare_lines 1>&2          echo testoutput_var: compare_lines 1>&2
183      fi      fi
184      if [ $verbose -gt 1 ]; then      if [ $verbose -gt 1 ]; then
185          cat tmp3.txt 1>&2          cat ${TMP}c.txt 1>&2
186      fi      fi
187      echo "-1" >> tmp3.txt      echo "-1" >> ${TMP}c.txt
188      # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number      digits_of_similarity=`./tr_cmpnum < ${TMP}c.txt`
     cat tmp3.txt | sed -e 's|:||g' > tmp4.txt  
     digits_of_similarity=`./tr_cmpnum < tmp4.txt`  
189      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
190          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
191              echo testoutput_var: No comparison was available for \"$3\" 1>&2              echo testoutput_var: No comparison was available for \"$3\" 1>&2
# Line 188  testoutput_var() Line 196  testoutput_var()
196              echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2              echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2
197          fi          fi
198      fi      fi
199      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f ${TMP}a.txt ${TMP}b.txt ${TMP}c.txt
200    
201      return $digits_of_similarity      return $digits_of_similarity
202  }  }
# Line 264  testoutput_run() Line 272  testoutput_run()
272          allargs=""          allargs=""
273          for xx in $listVar          for xx in $listVar
274          do          do
275            case $xx in           #ii=`echo $xx | sed 's/^pt[0-9][0-9]*..$/XXX/'`        #- any ptr number
276              ii=`echo $xx | sed 's/^pt[1-9]..$/XXX/'`              #- 1 to 9 ptr number
277              if test $ii != 'XXX' ; then
278              #- all except ptracer stats:
279                case $xx in
280             'PS')  if [ $debug -gt 0 ]             'PS')  if [ $debug -gt 0 ]
281                    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
282                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $refoutp ; yy=$?                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $refoutp ; yy=$?
# Line 291  testoutput_run() Line 303  testoutput_run()
303             'Vmx') testoutput_var $1 "dynstat_vvel_max"  "V maximum"       $2 $refoutp ; yy=$? ;;             'Vmx') testoutput_var $1 "dynstat_vvel_max"  "V maximum"       $2 $refoutp ; yy=$? ;;
304             'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean"          $2 $refoutp ; yy=$? ;;             'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean"          $2 $refoutp ; yy=$? ;;
305             'Vsd') testoutput_var $1 "dynstat_vvel_sd"   "V Std.Dev"       $2 $refoutp ; yy=$? ;;             'Vsd') testoutput_var $1 "dynstat_vvel_sd"   "V Std.Dev"       $2 $refoutp ; yy=$? ;;
         'pt1mn'|'pt2mn'|'pt3mn'|'pt4mn'|'pt5mn') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_min"  "p0"$ii"_min"   $2 $refoutp ; yy=$? ;;  
         'pt1mx'|'pt2mx'|'pt3mx'|'pt4mx'|'pt5mx') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_max"  "p0"$ii"_max"   $2 $refoutp ; yy=$? ;;  
         'pt1av'|'pt2av'|'pt3av'|'pt4av'|'pt5av') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $refoutp ; yy=$? ;;  
         'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $refoutp ; yy=$? ;;  
306           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $refoutp ; yy=$? ;;           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $refoutp ; yy=$? ;;
307           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $refoutp ; yy=$? ;;           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $refoutp ; yy=$? ;;
308           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $refoutp ; yy=$? ;;           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $refoutp ; yy=$? ;;
# Line 327  testoutput_run() Line 331  testoutput_run()
331          '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=$? ;;
332          '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=$? ;;
333          '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=$? ;;
334             'sbo_M') testoutput_var $1 "sbo_mass"          "SBO mass"        $2 $refoutp ; yy=$? ;;
335             'sboFW') testoutput_var $1 "sbo_mass_fw"       "SBO m-FW"        $2 $refoutp ; yy=$? ;;
336             'sboAc') testoutput_var $1 "sbo_zoamc"         "SBO AM-C"        $2 $refoutp ; yy=$? ;;
337             'sboAp') testoutput_var $1 "sbo_zoamp"         "SBO AM-P"        $2 $refoutp ; yy=$? ;;
338          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;          'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;
339                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
340            esac              esac
341              else
342              #- ptracers stats:
343                nn=`echo $xx | sed 's/pt//' | sed 's/..$//'`
344                ii=`echo $xx | sed 's/^pt[0-9]*//'`
345                case $ii in
346                'mn') testoutput_var $1 "trcstat_ptracer0"$nn"_min"  "p0"$nn"_min"  $2 $refoutp ; yy=$? ;;
347                'mx') testoutput_var $1 "trcstat_ptracer0"$nn"_max"  "p0"$nn"_max"  $2 $refoutp ; yy=$? ;;
348                'av') testoutput_var $1 "trcstat_ptracer0"$nn"_mean" "p0"$nn"_mean" $2 $refoutp ; yy=$? ;;
349                'sd') testoutput_var $1 "trcstat_ptracer0"$nn"_sd"   "p0"$nn"_StDv" $2 $refoutp ; yy=$? ;;
350                esac
351              fi
352            if test $xx = $sVar            if test $xx = $sVar
353            then allargs="$allargs > $yy <"            then allargs="$allargs > $yy <"
354            else allargs="$allargs $yy"            else allargs="$allargs $yy"
# Line 364  genmakemodel() Line 383  genmakemodel()
383              if test "x$MKDEPEND" != x ; then              if test "x$MKDEPEND" != x ; then
384                  command="$command -makedepend=$MKDEPEND"                  command="$command -makedepend=$MKDEPEND"
385              fi              fi
386              if test $KIND = 1 -o $KIND = 2 ; then              if test $KIND = 4 ; then
387                  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 ../../OpenAD/code_oad_all'"  
388              else              else
389                  command="$command -mods=../code"                  command="$command -mods=../$code_dir"
390              fi              fi
391              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
392                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
# Line 396  genmakemodel() Line 413  genmakemodel()
413              if test "x$EXTRFLG" != x ; then              if test "x$EXTRFLG" != x ; then
414                  command="$command -extra_flag $EXTRFLG"                  command="$command -extra_flag $EXTRFLG"
415              fi              fi
416                if test "x$NOCATAD" = xt ; then
417                    command="$command -nocat4ad"
418                fi
419              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
420                  command="$command -ts"                  command="$command -ts"
421              fi              fi
# Line 426  genmakemodel() Line 446  genmakemodel()
446  makeclean()  makeclean()
447  {  {
448      # makeclean directory      # makeclean directory
449      if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi      if test "x$NOGENMAKE" = xf ; then rm -f $1/make.tr_log ; fi
450      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
451          echo "make Clean skipped!"          echo "make Clean skipped!"
452      else      else
# Line 458  run_clean() Line 478  run_clean()
478      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
479          echo "run_clean skipped!"          echo "run_clean skipped!"
480      else      else
481          (        (
482              cd $1;          cd $1;
483              printf 'clean run-dir ... '          printf 'clean run-dir ... '
484              # part of what is done after "make clean" when doing "make CLEAN"          # part of what is done after "make clean" when doing "make CLEAN"
485              find . -name "*.meta" -exec rm {} \;          find . -name "*.meta" -exec rm {} \;
486              find . -name "*.data" -exec rm {} \;          find . -name "*.data" -exec rm {} \;
487              find . -name "fort.*" -exec rm {} \;          find . -name "fort.*" -exec rm {} \;
488              find . -type l -exec rm {} \;          find . -type l -exec rm {} \;
489              #- should remove executable only if sym-link (alredy done above)          #- should remove executable only if sym-link (already done above)
490              rm -f $RUNLOG *.txt STD* w2_tile_topology.????.log *diagnostics.log datetime          rm -f $RUNLOG *.txt STDOUT.* STDERR.* *diagnostics.log *.[0-9][0-9][0-9][0-9].log
491              rm -rf mnc_test_*          rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_*
492              rm -f *_MIT_CE_000.opt0000 costfunction*0000          rm -f *_MIT_CE_000.opt0000 costfunction*0000
493              rm -f oad_cp.000.[0-9][0-9][0-9][0-9][0-9]          rm -f oad_cp.[0-9][0-9][0-9].?????
494              echo successful          rm -rf mnc_test_*
495              exit 0          echo successful
496          )          exit 0
497          )
498      fi      fi
499  }  }
500    
# Line 516  makemodel() Line 537  makemodel()
537      else      else
538          cd $1;          cd $1;
539          if test -r Makefile ; then          if test -r Makefile ; then
540              printf 'make ... '              if test "x$MKSMALLF" = xt ; then
541              if test "x$REPLMAKE" = x ; then                  printf 'make small_f ... '
542                  $MAKE $TARG >> make.tr_log 2>&1                  $MAKE_CMD small_f >> make.tr_log 2>&1
543              else                  RETVAL=$?
544                  $REPLMAKE $TARG >> make.tr_log 2>&1                  if test "x$RETVAL" != x0 ; then
545                        tail make.tr_log
546                        echo failed
547                        cp genmake.log genmake.tr_log $CDIR
548                        tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail"
549                        rm -f $EXECUTABLE
550                        mk_fail=1
551                    else
552                        echo successful
553                    fi
554              fi              fi
555                printf "make $TARG ... "
556                $MAKE_CMD $TARG >> make.tr_log 2>&1
557              RETVAL=$?              RETVAL=$?
558              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
559                  tail make.tr_log                  tail make.tr_log
# Line 547  makemodel() Line 579  makemodel()
579          nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`          nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
580          if test -f taf_output ; then          if test -f taf_output ; then
581              n2er=`grep -c 'TAF *.* ERROR ' taf_output`              n2er=`grep -c 'TAF *.* ERROR ' taf_output`
582              nerr=`expr $nerr + $n2er`              n3er=`grep -c '\*ERROR\* ' taf_output`
583                nerr=`expr $nerr + $n2er + $n3er`
584          fi          fi
585          echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \          echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
586                                  >> $CDIR"/summary.txt"                                  >> $CDIR"/summary.txt"
# Line 768  runmodel() Line 801  runmodel()
801          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
802              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
803              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
804              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
805              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
806                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
807              fi              fi
# Line 834  runmodel() Line 867  runmodel()
867          if test -f $OUTPUTFILE ; then          if test -f $OUTPUTFILE ; then
868            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
869                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
870            grep -A3 'Seconds in section "ALL' $OUTPUTFILE \  #         grep -A3 'Seconds in section "ALL' $OUTPUTFILE \
871                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"  #               | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
872    #         some implementations of grep cannot do contextual searches so we
873    #         replace the above with a sed command
874              cat $OUTPUTFILE | sed -n '/Seconds in section "ALL/{N
875              N
876              N
877              p
878              }' | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
879          fi          fi
880          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
881          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 1029  SKIPDIRS= Line 1069  SKIPDIRS=
1069  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
1070  HAVE_MPACK=  HAVE_MPACK=
1071  MPACK=  MPACK=
1072    SENDCMD=
1073    SAVDIR='.'
1074  COMMAND=  COMMAND=
1075  MKDEPEND=  MKDEPEND=
1076  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1077      MAKE=make      MAKE=make
1078  fi  fi
1079  REPLMAKE=  MAKE_CMD=
1080  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1081      CC=cc      CC=cc
1082  fi  fi
# Line 1047  OUTDIR= Line 1089  OUTDIR=
1089  DELDIR=  DELDIR=
1090  USE_R4=  USE_R4=
1091  EXTRFLG=  EXTRFLG=
1092    NOCATAD=
1093    MKSMALLF=
1094    
1095  #- type of testing (KIND):  #- type of testing (KIND):
1096  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;
# Line 1084  for ac_option ; do Line 1128  for ac_option ; do
1128          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
1129          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
1130    
1131            -send | --send ) ac_prev=SENDCMD ;;
1132            -send=* | --send=* ) SENDCMD=$ac_optarg ;;
1133            -savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;;
1134            -savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;;
1135    
1136          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
1137          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
1138          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
# Line 1101  for ac_option ; do Line 1150  for ac_option ; do
1150          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1151          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1152    
1153          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1154          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1155    
1156          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1157          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1123  for ac_option ; do Line 1172  for ac_option ; do
1172    
1173          -norun | --norun | -nr | --nr) NORUN=t ;;          -norun | --norun | -nr | --nr) NORUN=t ;;
1174          -obj | --obj ) TARG='obj' ; NORUN=t ;;          -obj | --obj ) TARG='obj' ; NORUN=t ;;
1175            -src | --src ) TARG='small_f' ; NORUN=t ;;
1176          -runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;;          -runonly | --runonly | -ro | --ro) QUICK=t ; NOMAKE=t ;;
1177          -quick | --quick | -q | --q) QUICK=t ;;          -quick | --quick | -q | --q) QUICK=t ;;
1178          -nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;;          -nogenmake | --nogenmake | -ng | --ng) NOGENMAKE=t ;;
# Line 1150  for ac_option ; do Line 1200  for ac_option ; do
1200          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1201                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1202                fi ;;                fi ;;
1203            -ncad) NOCATAD=t ;;
1204            -small_f) MKSMALLF=t ;;
1205    
1206          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1207                   printf " ... " ;;                   printf " ... " ;;
# Line 1169  for ac_option ; do Line 1221  for ac_option ; do
1221    
1222          -ts) TS=t;;          -ts) TS=t;;
1223          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1224          -pcls) PCL=t;;          -pcls) PCLS=t;;
1225    
1226          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1227              usage ;;              usage ;;
# Line 1185  if test "x$QUICK" = xt ; then Line 1237  if test "x$QUICK" = xt ; then
1237      NOCLEAN=t      NOCLEAN=t
1238      NODEPEND=t      NODEPEND=t
1239  fi  fi
1240    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1241    
1242  #- check length of MPI machine file:  #- check length of MPI machine file:
1243  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
# Line 1205  fi Line 1258  fi
1258    
1259  #- setting for forward or ADM testing  #- setting for forward or ADM testing
1260  if test $KIND = 1 ; then  if test $KIND = 1 ; then
1261      TARG=ftlall      if test "x$TARG" = xsmall_f ; then TARG=ftltaf ; else TARG=ftlall ; fi
1262      code_dir=code_ad      code_dir=code_ad
1263      inputdir=input_ad      inputdir=input_ad
1264      ref_outp="output_tlm.txt"      ref_outp="output_tlm.txt"
1265      EXECUTABLE="mitgcmuv_ftl"      EXECUTABLE="mitgcmuv_ftl"
1266  elif test $KIND = 2 ; then  elif test $KIND = 2 ; then
1267      if test "x$TARG" = xobj ; then TARG=adobj ; else TARG=adall ; fi      if test "x$TARG" = x        ; then TARG=adall ; fi
1268        if test "x$TARG" = xobj     ; then TARG=adobj ; fi
1269        if test "x$TARG" = xsmall_f ; then TARG=adtaf ; fi
1270      code_dir=code_ad      code_dir=code_ad
1271      inputdir=input_ad      inputdir=input_ad
1272      ref_outp="output_adm.txt"      ref_outp="output_adm.txt"
# Line 1223  elif test $KIND = 4 ; then Line 1278  elif test $KIND = 4 ; then
1278      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1279      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1280  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1281      code_dir=code      code_dir=code
1282      inputdir=input      inputdir=input
1283      ref_outp="output.txt"      ref_outp="output.txt"
1284      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1285  fi  fi
1286    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1287    
1288  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1289  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1275  done Line 1330  done
1330  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1331  #echo 'TESTDIRS='${TESTDIRS}'<'  #echo 'TESTDIRS='${TESTDIRS}'<'
1332    
 if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  
     OPTFILE=$MITGCM_OF  
 fi  
   
1333  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1334  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1335  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1336  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1337      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1338  fi  else
1339  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1340      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -np TR_NPROC ./$EXECUTABLE" ; fi
1341  fi  fi
1342    
1343  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1344    
1345    #TMP=./tr_$$
1346    #- try to put temporary files in system-local /tmp dir
1347    TMP=/tmp/tr_${USER}_$$
1348    touch $TMP ; retVal=$?
1349    if [ $retVal -eq 0 ] ; then
1350      if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1351    else
1352      TMP=./tr_$$
1353    fi
1354    rm -f $TMP
1355    if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1356    
1357  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1358  #  (use default or load experiment-specific list from file "tr_checklist")  #  (use default or load experiment-specific list from file "tr_checklist")
# Line 1319  else Line 1382  else
1382  fi  fi
1383    
1384  #  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)
1385  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then
1386      echo "skipping mpack build"      echo "skipping mpack build"
1387  else  else
1388      build_mpack      build_mpack
1389        if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi
1390  fi  fi
1391    
1392  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
# Line 1335  for xx in "$@" ; do nw=`echo $xx | wc -w Line 1399  for xx in "$@" ; do nw=`echo $xx | wc -w
1399                               CMDLINE="$CMDLINE $yy" ; fi                               CMDLINE="$CMDLINE $yy" ; fi
1400      fi      fi
1401  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1402  MACH=`hostname`  MACH=`hostname`
1403  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1404  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1343  BASE="tr_"$MACH"_"$DATE"_" Line 1406  BASE="tr_"$MACH"_"$DATE"_"
1406  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1407      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1408  else  else
1409      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1410       # hostname -s is not universal (does work on AIX system)
1411        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1412      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1413  fi  fi
1414  DNUM=0  DNUM=0
# Line 1461  for dir in $TESTDIRS ; do Line 1526  for dir in $TESTDIRS ; do
1526              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1527              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1528              rm -f SIZE.h.mpi genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1529                rm -rf mpi_headers
1530          )          )
1531          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1532              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1599  for dir in $TESTDIRS ; do Line 1665  for dir in $TESTDIRS ; do
1665              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1666              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1667              && makemodel $dir/$builddir && make=Y              && makemodel $dir/$builddir && make=Y
1668                echo
1669      else      else
1670          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1671              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
# Line 1609  for dir in $TESTDIRS ; do Line 1676  for dir in $TESTDIRS ; do
1676              && linkdata $dir/$rundir $inputdir \              && linkdata $dir/$rundir $inputdir \
1677              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1678              && results=`testoutput_run $dir $rundir $ref_outp`              && results=`testoutput_run $dir $rundir $ref_outp`
1679                echo 1>&2
1680      fi      fi
1681      #echo "results='$results'"      #echo "results='$results'"
1682    
1683          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
         echo 1>&2  
1684          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1685          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1686    
# Line 1635  for dir in $TESTDIRS ; do Line 1702  for dir in $TESTDIRS ; do
1702              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1703              runmodel $dir/$pfxdir.$ex && run=Y \              runmodel $dir/$pfxdir.$ex && run=Y \
1704              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
             fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`  
1705              echo 1>&2              echo 1>&2
1706    
1707                fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1708              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1709              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1710              if test "x$POSTCLEAN" = x2 ; then              if test "x$POSTCLEAN" = x2 ; then
# Line 1648  for dir in $TESTDIRS ; do Line 1716  for dir in $TESTDIRS ; do
1716          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1717              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/^# //'`
1718              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1719              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1720    # bsd-sed cannot do the above code
1721                cat $dir/$builddir/Makefile | \
1722                    sed -n '/^# executed by:/{N
1723                                              p
1724                                              }' >> $DRESULTS/genmake_state
1725              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1726              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1727                  eval $mkOpt                  eval $mkOpt
1728                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1729                          $SUMMARY > tmp.tr_log  #                       $SUMMARY > tmp.tr_log
1730    # bsd-sed requires a newline after "a\":
1731                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1732                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1733                  RETVAL=$?                  RETVAL=$?
1734                  if test "x$RETVAL" = x0 ; then rm -f $SUMMARY                  if test "x$RETVAL" = x0 ; then
1735                          cp tmp.tr_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY
                 else rm -f tmp.tr_log  
1736                  fi                  fi
1737                    rm -f tmp.tr_log
1738              fi              fi
1739              gmkLog=$dir/$builddir/genmake.log              gmkLog=$dir/$builddir/genmake.log
1740              if test -r $gmkLog ; then              if test -r $gmkLog ; then
# Line 1674  for dir in $TESTDIRS ; do Line 1750  for dir in $TESTDIRS ; do
1750                                           >> $DRESULTS/genmake_state                                           >> $DRESULTS/genmake_state
1751                    rm -f tmp.tr_log                    rm -f tmp.tr_log
1752                  fi                  fi
1753                  echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state              fi
1754                  echo "get NETCDF & LAPACK settings:" >> $DRESULTS/genmake_state              gmkLog=$dir/$builddir/genmake_state
1755                  sed -n '/set HAVE_NETCDF=/p' $gmkLog >> $DRESULTS/genmake_state              if test -r $gmkLog ; then
1756                  sed -n '/set HAVE_LAPACK=/p' $gmkLog >> $DRESULTS/genmake_state                  echo -n "from '$gmkLog', "      >> $DRESULTS/genmake_state
1757                    echo "get genmake settings:"    >> $DRESULTS/genmake_state
1758                    sed -n '/^HAVE_/p' $gmkLog | sed 's/^./ &/' \
1759                                                    >> $DRESULTS/genmake_state
1760              fi              fi
1761          fi          fi
1762      fi      fi
# Line 1702  date >> $SUMMARY Line 1781  date >> $SUMMARY
1781  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
1782      echo "No results email was sent."      echo "No results email was sent."
1783  else  else
1784      if test "x$HAVE_MPACK" = xt ; then      if test "x$SENDCMD" != x ; then
1785          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          if [ $verbose -gt 1 ]; then
1786              && gzip $DRESULTS".tar" \             echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
1787              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES          fi
1788            tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
1789                && gzip ${SAVDIR}/${DRESULTS}".tar" \
1790                && $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
1791          RETVAL=$?          RETVAL=$?
1792          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1793              echo              echo
# Line 1718  else Line 1800  else
1800              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1801              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1802              echo              echo
1803              test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"              test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"
1804              test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"              test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"
1805          fi          fi
1806      fi      fi
1807  fi  fi

Legend:
Removed from v.1.188  
changed lines
  Added in v.1.211

  ViewVC Help
Powered by ViewVC 1.1.22