/[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.175 by jmc, Wed Aug 15 23:19:21 2012 UTC revision 1.202 by mlosch, Tue Mar 3 15:55:51 2015 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    list of optfiles 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)                  used genmake2 option \"-nocat4ad\" (-ncad)"
     echo "  (-oad)                   perform an OpenAD adjoint run"  
     echo "  (-command|-c) STRING     command to run"  
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\")"
49      echo "  (-odir) STRING           used to build output directory name"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
50      echo "                             (DEF=\"hostname\")"      echo " ---- output options : ----"
 #   echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"  
 #   echo "                             (DEF=\"1 2 3 4 5\")"  
51      echo "  (-match) NUMBER          Matching Criteria (number of digits)"      echo "  (-match) NUMBER          Matching Criteria (number of digits)"
52      echo "                             (DEF=\"$MATCH_CRIT\")"      echo "                             (DEF=\"$MATCH_CRIT\")"
53      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-odir) STRING           used to build output directory name"
54      echo "  (-ef) STRING             used as genmake2 \"-extra_flag\" argument"      echo "                             (DEF=\"hostname\")"
55        echo "  (-addr|-a) STRING        list of email recipients"
56        echo "                             (DEF=\"\" no email is sent)"
57        echo "  (-send)       STRING     sending command (instead of using mpack)"
58        echo "  (-savdir|-sd) STRING     location to save output tar file to send (DEF='$SAVDIR')"
59        echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"
60        echo "                             (DEF=\"../tools/mpack-1.6\")"
61        echo " -- do only some parts: --"
62      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"      echo "  (-clean)                 *ONLY* run \"make CLEAN\" & clean run-dir"
63      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"      echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
64      echo "  (-obj)                   only produces objects (=norun & no executable)"      echo "  (-obj)                   only produces objects (=norun & no executable)"
# Line 61  usage() Line 70  usage()
70      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
71      echo "  (-deloutp|-do)           delete output files after successful run"      echo "  (-deloutp|-do)           delete output files after successful run"
72      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"  
73      echo      echo
74      echo "and where STRING can be a whitespace-delimited list"      echo "and where STRING can be a whitespace-delimited list"
75      echo "such as:"      echo "such as:"
# Line 125  testoutput_var() Line 131  testoutput_var()
131          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2
132      fi      fi
133      if [ -r $1/$4/$OUTPUTFILE ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
134          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | nl > ${TMP}a.txt
135          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' `
136          if [ $lncntA -lt 2 ]; then          if [ $lncntA -lt 2 ]; then
137              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
138                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
139              fi              fi
140              rm -f tmp1.txt ; return 99              rm -f ${TMP}a.txt ; return 99
141          fi          fi
142      else      else
143          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 146  testoutput_var()
146      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
147          echo testoutput_var: grep "$2" $1/$5 1>&2          echo testoutput_var: grep "$2" $1/$5 1>&2
148      fi      fi
149      grep "$2" $1/$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/$5 | sed 's/.*=//' | nl > ${TMP}b.txt
150      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' `
151      if [ $lncntB -lt 2 ]; then      if [ $lncntB -lt 2 ]; then
152          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
153              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
154          fi          fi
155          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
156      fi      fi
157      if [ $lncntA -ne $lncntB ]; then      if [ $lncntA -ne $lncntB ]; then
158          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
159              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
160          fi          fi
161          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
162      fi      fi
163      has_nan=`cat tmp1.txt | grep -i nan | wc -l`      has_nan=`cat ${TMP}a.txt | grep -i nan | wc -l`
164      if [ $has_nan -gt 0  ] ; then      if [ $has_nan -gt 0  ] ; then
165          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2
166          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
167      fi      fi
168      has_inf=`cat tmp1.txt | grep -i inf | wc -l`      has_inf=`cat ${TMP}a.txt | grep -i inf | wc -l`
169      if [ $has_inf -gt 0  ] ; then      if [ $has_inf -gt 0  ] ; then
170          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2
171          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
172      fi      fi
173      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
174          echo testoutput_var: join tmp1.txt tmp2.txt 1>&2          echo testoutput_var: join ${TMP}a.txt ${TMP}b.txt 1>&2
175      fi      fi
176      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
177        join ${TMP}a.txt ${TMP}b.txt | awk '{print $1 " " $2 " " $3}' | sed -e 's|:||g' > ${TMP}c.txt
178      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
179          echo testoutput_var: compare_lines 1>&2          echo testoutput_var: compare_lines 1>&2
180      fi      fi
181      if [ $verbose -gt 1 ]; then      if [ $verbose -gt 1 ]; then
182          cat tmp3.txt 1>&2          cat ${TMP}c.txt 1>&2
183      fi      fi
184      echo "-1" >> tmp3.txt      echo "-1" >> ${TMP}c.txt
185      # 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`  
186      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
187          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
188              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 193  testoutput_var()
193              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
194          fi          fi
195      fi      fi
196      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f ${TMP}a.txt ${TMP}b.txt ${TMP}c.txt
197    
198      return $digits_of_similarity      return $digits_of_similarity
199  }  }
# Line 322  testoutput_run() Line 327  testoutput_run()
327          'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $refoutp ; yy=$? ;;          'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $refoutp ; yy=$? ;;
328          'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South"  $2 $refoutp ; yy=$? ;;          'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South"  $2 $refoutp ; yy=$? ;;
329          'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North"  $2 $refoutp ; yy=$? ;;          'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North"  $2 $refoutp ; yy=$? ;;
330          'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global"    $2 $refoutp ; yy=$? ;;          'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Glob-ave"  $2 $refoutp ; yy=$? ;;
331          'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South"     $2 $refoutp ; yy=$? ;;          'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South-av"  $2 $refoutp ; yy=$? ;;
332          'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North"     $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=$? ;;
334            '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=$? ;;
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
342            if test $xx = $sVar            if test $xx = $sVar
# Line 361  genmakemodel() Line 373  genmakemodel()
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 ../../OpenAD/code_oad_all'"  
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"
# Line 393  genmakemodel() Line 403  genmakemodel()
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
# Line 423  genmakemodel() Line 436  genmakemodel()
436  makeclean()  makeclean()
437  {  {
438      # makeclean directory      # makeclean directory
439      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
440      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
441          echo "make Clean skipped!"          echo "make Clean skipped!"
442      else      else
# Line 455  run_clean() Line 468  run_clean()
468      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
469          echo "run_clean skipped!"          echo "run_clean skipped!"
470      else      else
471          (        (
472              cd $1;          cd $1;
473              printf 'clean run-dir ... '          printf 'clean run-dir ... '
474              # part of what is done after "make clean" when doing "make CLEAN"          # part of what is done after "make clean" when doing "make CLEAN"
475              find . -name "*.meta" -exec rm {} \;          find . -name "*.meta" -exec rm {} \;
476              find . -name "*.data" -exec rm {} \;          find . -name "*.data" -exec rm {} \;
477              find . -name "fort.*" -exec rm {} \;          find . -name "fort.*" -exec rm {} \;
478              find . -type l -exec rm {} \;          find . -type l -exec rm {} \;
479              #- should remove executable only if sym-link (alredy done above)          #- should remove executable only if sym-link (already done above)
480              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
481              rm -rf mnc_test_*          rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_*
482              rm -f *_MIT_CE_000.opt0000 costfunction*0000          rm -f *_MIT_CE_000.opt0000 costfunction*0000
483              echo successful          rm -f oad_cp.[0-9][0-9][0-9].?????
484              exit 0          rm -rf mnc_test_*
485          )          echo successful
486            exit 0
487          )
488      fi      fi
489  }  }
490    
# Line 513  makemodel() Line 528  makemodel()
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
# Line 534  makemodel() Line 545  makemodel()
545              mk_fail=2              mk_fail=2
546          fi          fi
547      fi      fi
548        if test $KIND = 1 -a -f taf_ftl.log ; then
549            head -1 taf_ftl.log >> $CDIR"/summary.txt"
550        fi
551      if test $KIND = 2 -a -f taf_ad.log ; then      if test $KIND = 2 -a -f taf_ad.log ; then
552              head -1 taf_ad.log >> $CDIR"/summary.txt"          head -1 taf_ad.log >> $CDIR"/summary.txt"
553              nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`          nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`
554              nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`          nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
555              echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \          if test -f taf_output ; then
556                n2er=`grep -c 'TAF *.* ERROR ' taf_output`
557                n3er=`grep -c '\*ERROR\* ' taf_output`
558                nerr=`expr $nerr + $n2er + $n3er`
559            fi
560            echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
561                                  >> $CDIR"/summary.txt"                                  >> $CDIR"/summary.txt"
562      fi      fi
563      if test $mk_fail != 0 ; then return $mk_fail ; fi      if test $mk_fail != 0 ; then return $mk_fail ; fi
# Line 757  runmodel() Line 776  runmodel()
776          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
777              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
778              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
779              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
780              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
781                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
782              fi              fi
# Line 785  runmodel() Line 804  runmodel()
804              # output do not exist or is older than executable:              # output do not exist or is older than executable:
805              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG
806              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi              if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
807            #- Divided Adjoint Run:
808            #  get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA"
809                if test $KIND = 2 -a -f run_ADM_DIVA ; then
810                  adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'`
811                  echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG
812                  eval "let $adm_diva_nb"
813                  if [ $add_DIVA_runs -ge 1 ] ; then
814                    rm -f costf* divided.ctrl snapshot*
815                    echo -n "(add_DIVA_runs=$add_DIVA_runs) ... "
816                    for ii in `seq 1 $add_DIVA_runs` ; do
817                      ( eval $COMMAND ) >> $RUNLOG 2>&1
818                      echo " additional DIVA run # $ii : done" >> $RUNLOG
819                      mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii}
820                    done
821                  fi
822                fi
823            #- special DIVA processing ends here
824              ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
825              RETVAL=$?              RETVAL=$?
826              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
# Line 802  runmodel() Line 838  runmodel()
838            fi            fi
839          fi          fi
840          rm -f run.log_tmp          rm -f run.log_tmp
841          #- in all cases where OutputFile exists, report SIZE (and AD time)          #- in all cases where OutputFile exists, report SIZE and time
842          if test -f $OUTPUTFILE ; then          if test -f $OUTPUTFILE ; then
843            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
844                  | sed 's/(PID.TID 0000.0001)     //' >> $CDIR"/summary.txt"                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
845            if test $KIND = 2 ; then  #         grep -A3 'Seconds in section "ALL' $OUTPUTFILE \
846              grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt"  #               | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
847            fi  #         some implementations of grep cannot do contextual searches so we
848    #         replace the above with a sed command
849              cat $OUTPUTFILE | sed -n '/Seconds in section "ALL/{N
850              N
851              N
852              p
853              }' | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
854          fi          fi
855          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
856          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 910  formatresults() Line 952  formatresults()
952          fi          fi
953      fi      fi
954      printf '  %s' $nm      printf '  %s' $nm
955        if test $KIND = 2 ; then
956            #-- apppend taf repport summary:
957            tafrep=`grep -c '^ TAF reports ' $CDIR/summary.txt`
958            if test $tafrep = 1 ; then
959                grep '^ TAF reports ' $CDIR/summary.txt | awk '{printf "  (e=%i, w=%i)",$3,$6}'
960            fi
961        fi
962      printf '\n'      printf '\n'
963    
964  }  }
# Line 995  SKIPDIRS= Line 1044  SKIPDIRS=
1044  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
1045  HAVE_MPACK=  HAVE_MPACK=
1046  MPACK=  MPACK=
1047    SENDCMD=
1048    SAVDIR='.'
1049  COMMAND=  COMMAND=
1050  MKDEPEND=  MKDEPEND=
1051  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1052      MAKE=make      MAKE=make
1053  fi  fi
1054  REPLMAKE=  MAKE_CMD=
1055  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1056      CC=cc      CC=cc
1057  fi  fi
# Line 1013  OUTDIR= Line 1064  OUTDIR=
1064  DELDIR=  DELDIR=
1065  USE_R4=  USE_R4=
1066  EXTRFLG=  EXTRFLG=
1067    NOCATAD=
1068    
1069  #- type of testing (KIND):  #- type of testing (KIND):
1070  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;
# Line 1050  for ac_option ; do Line 1102  for ac_option ; do
1102          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
1103          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
1104    
1105            -send | --send ) ac_prev=SENDCMD ;;
1106            -send=* | --send=* ) SENDCMD=$ac_optarg ;;
1107            -savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;;
1108            -savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;;
1109    
1110          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
1111          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
1112          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
# Line 1067  for ac_option ; do Line 1124  for ac_option ; do
1124          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1125          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1126    
1127          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1128          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1129    
1130          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1131          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1116  for ac_option ; do Line 1173  for ac_option ; do
1173          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1174                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1175                fi ;;                fi ;;
1176            -ncad) NOCATAD=t ;;
1177    
1178          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1179                   printf " ... " ;;                   printf " ... " ;;
# Line 1135  for ac_option ; do Line 1193  for ac_option ; do
1193    
1194          -ts) TS=t;;          -ts) TS=t;;
1195          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1196          -pcls) PCL=t;;          -pcls) PCLS=t;;
1197    
1198          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1199              usage ;;              usage ;;
# Line 1151  if test "x$QUICK" = xt ; then Line 1209  if test "x$QUICK" = xt ; then
1209      NOCLEAN=t      NOCLEAN=t
1210      NODEPEND=t      NODEPEND=t
1211  fi  fi
1212    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1213    
1214  #- check length of MPI machine file:  #- check length of MPI machine file:
1215  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
# Line 1189  elif test $KIND = 4 ; then Line 1248  elif test $KIND = 4 ; then
1248      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1249      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1250  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1251      code_dir=code      code_dir=code
1252      inputdir=input      inputdir=input
1253      ref_outp="output.txt"      ref_outp="output.txt"
1254      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1255  fi  fi
1256    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1257    
1258  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1259  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1247  fi Line 1306  fi
1306    
1307  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1308  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1309  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1310  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1311      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1312  fi  else
1313  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1314      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -v -np TR_NPROC ./$EXECUTABLE" ; fi
1315  fi  fi
1316    
1317  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1318    
1319    #TMP=./tr_$$
1320    #- try to put temporary files in system-local /tmp dir
1321    TMP=/tmp/tr_${USER}_$$
1322    touch $TMP ; retVal=$?
1323    if [ $retVal -eq 0 ] ; then
1324      if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1325    else
1326      TMP=./tr_$$
1327    fi
1328    rm -f $TMP
1329    if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1330    
1331  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1332  #  (use default or load experiment-specific list from file "tr_checklist")  #  (use default or load experiment-specific list from file "tr_checklist")
# Line 1278  else Line 1349  else
1349  fi  fi
1350    
1351  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
1352  if test -x tr_cmpnum ; then  if test "x$CLEANUP" = xt -o -x tr_cmpnum ; then
1353      echo "skipping comparison code build"      echo "skipping comparison code build"
1354  else  else
1355      createcodelet      createcodelet
1356  fi  fi
1357    
1358  #  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)
1359  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then
1360      echo "skipping mpack build"      echo "skipping mpack build"
1361  else  else
1362      build_mpack      build_mpack
1363        if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi
1364  fi  fi
1365    
1366  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
1367  CMDLINE=$0  CMDLINE=$0
1368  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
1369      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" ; else
1370                          else CMDLINE="$CMDLINE '$xx'" ; fi        nb=`echo $xx | grep -c '='`
1371          if test $nb = 0 ; then CMDLINE="$CMDLINE '$xx'"
1372          else yy=`echo "$xx'" | sed "s/=/='/"` ;
1373                                 CMDLINE="$CMDLINE $yy" ; fi
1374        fi
1375  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1376  MACH=`hostname`  MACH=`hostname`
1377  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1378  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1305  BASE="tr_"$MACH"_"$DATE"_" Line 1380  BASE="tr_"$MACH"_"$DATE"_"
1380  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1381      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1382  else  else
1383      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1384       # hostname -s is not universal (does work on AIX system)
1385        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1386      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1387  fi  fi
1388  DNUM=0  DNUM=0
# Line 1342  if test "x$OPTFILE" != xNONE ; then Line 1419  if test "x$OPTFILE" != xNONE ; then
1419          echo >> $SUMMARY          echo >> $SUMMARY
1420          echo "  OPTFILE=$OPTFILE" >> $SUMMARY          echo "  OPTFILE=$OPTFILE" >> $SUMMARY
1421      else      else
1422          echo | tee $SUMMARY          echo | tee -a $SUMMARY
1423          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee -a $SUMMARY
1424          exit 1          exit 1
1425      fi      fi
1426  else  else
# Line 1370  if test $KIND = 0 ; then Line 1447  if test $KIND = 0 ; then
1447  else  else
1448      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`
1449    if test $KIND = 1 ; then    if test $KIND = 1 ; then
1450      echo "TANGLIN=true" >> $SUMMARY     #echo "TANGLIN=true" >> $SUMMARY
1451        echo "TangLin generated by TAF" >> $SUMMARY
1452      elif test $KIND = 3 ; then
1453        echo "TangLin generated by OpenAD" >> $SUMMARY
1454      elif test $KIND = 2 ; then
1455       #echo "ADJOINT=true" >> $SUMMARY
1456        echo "Adjoint generated by TAF" >> $SUMMARY
1457      else
1458        echo "Adjoint generated by OpenAD" >> $SUMMARY
1459      fi
1460      if test $KIND = 1 -o $KIND = 3 ; then
1461      line_1="G D M    C  T  F"      line_1="G D M    C  T  F"
1462      line_2="e p a R  o  L  D"      line_2="e p a R  o  L  D"
1463    else    else
     echo "ADJOINT=true" >> $SUMMARY  
1464      line_1="G D M    C  A  F"      line_1="G D M    C  A  F"
1465      line_2="e p a R  o  d  D"      line_2="e p a R  o  d  D"
1466    fi    fi
# Line 1382  else Line 1468  else
1468      line_4="2 d e n  t  r  r"      line_4="2 d e n  t  r  r"
1469      echo >> $SUMMARY      echo >> $SUMMARY
1470  fi  fi
1471    if test "x$CLEANUP" != xt ; then
1472      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1473      echo "$line_1" | tee -a $SUMMARY      echo "$line_1" | tee -a $SUMMARY
1474      echo "$line_2" | tee -a $SUMMARY      echo "$line_2" | tee -a $SUMMARY
1475      echo "$line_3" | tee -a $SUMMARY      echo "$line_3" | tee -a $SUMMARY
1476      echo "$line_4" | tee -a $SUMMARY      echo "$line_4" | tee -a $SUMMARY
1477      echo ""        | tee -a $SUMMARY      echo ""        | tee -a $SUMMARY
1478    fi
1479  echo "-------------------------------------------------------------------------------"  echo "-------------------------------------------------------------------------------"
1480    
1481  #  ...and each test directory...  #  ...and each test directory...
# Line 1412  for dir in $TESTDIRS ; do Line 1500  for dir in $TESTDIRS ; do
1500              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1501              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1502              rm -f SIZE.h.mpi genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1503                rm -rf mpi_headers
1504          )          )
1505          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1506              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1496  for dir in $TESTDIRS ; do Line 1585  for dir in $TESTDIRS ; do
1585      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1586      extra_runs=      extra_runs=
1587      if test "x$NORUN" = xf ; then      if test "x$NORUN" = xf ; then
1588          ex_run_dirs=`( cd $dir ; echo $inputdir.* )`          ex_run_dirs=`( cd $dir ; ls -d $inputdir.* 2> /dev/null )`
1589      fi      fi
1590      #echo "ex_run_dirs='$ex_run_dirs'"      #echo "ex_run_dirs='$ex_run_dirs'"
1591      for exd in $ex_run_dirs ; do      for exd in $ex_run_dirs ; do
1592          name=`echo $exd | sed -e "s/$inputdir\.//"`          name=`echo $exd | sed -e "s/$inputdir\.//"`
1593          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1594          outf="$dir/results/$refExOut"          outf="$dir/results/$refExOut"
         #if test -f $outf -a -r $outf ; then  
1595          if test -r $outf -o -r ${outf}.gz ; then          if test -r $outf -o -r ${outf}.gz ; then
1596            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1597              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
# Line 1587  for dir in $TESTDIRS ; do Line 1675  for dir in $TESTDIRS ; do
1675              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1676              runmodel $dir/$pfxdir.$ex && run=Y \              runmodel $dir/$pfxdir.$ex && run=Y \
1677              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
1678              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
             fres="$fres.$ex"  
1679              echo 1>&2              echo 1>&2
1680              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1681              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
# Line 1597  for dir in $TESTDIRS ; do Line 1684  for dir in $TESTDIRS ; do
1684              fi              fi
1685          done          done
1686    
1687      if test -f $DRESULTS"/"genmake_state ; then : ; else      if test ! -f $DRESULTS"/"genmake_state ; then
1688          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1689              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/^# //'`
1690              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1691              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1692    # bsd-sed cannot do the above code
1693                cat $dir/$builddir/Makefile | \
1694                    sed -n '/^# executed by:/{N
1695                                              p
1696                                              }' >> $DRESULTS/genmake_state
1697              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1698              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1699                  eval $mkOpt                  eval $mkOpt
1700                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1701                          $SUMMARY > tr_0.tmp_log  #                       $SUMMARY > tmp.tr_log
1702    # bsd-sed requires a newline after "a\":
1703                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1704                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1705                  RETVAL=$?                  RETVAL=$?
1706                  if test "x$RETVAL" = x0 ; then rm -f $SUMMARY                  if test "x$RETVAL" = x0 ; then
1707                          cp tr_0.tmp_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY
                 else rm -f tr_0.tmp_log  
1708                  fi                  fi
1709                    rm -f tmp.tr_log
1710              fi              fi
1711              gmkLog=$dir/$builddir/genmake.log              gmkLog=$dir/$builddir/genmake.log
1712              grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1              if test -r $gmkLog ; then
1713              RETVAL=$?                  grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1714              if test "x$RETVAL" = x0 ; then                  RETVAL=$?
1715                  echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state                  if test "x$RETVAL" = x0 ; then
1716                  sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \                    echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state
1717                          | grep -v '^... compiler version ' > tr_1.tmp_log                    echo "extract compiler version:"   >> $DRESULTS/genmake_state
1718                  sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state                    sed -n '/Get compiler version/,/<-- compiler version/p' \
1719                  sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \                       $gmkLog | grep -v '^... compiler version ' > tmp.tr_log
1720                          >> $DRESULTS/genmake_state                    sed -n '1p' tmp.tr_log >> $DRESULTS/genmake_state
1721                  rm -f tr_1.tmp_log                    sed -n '2,/^$/p' tmp.tr_log | sed '/^$/d' | sed 's/^./ &/' \
1722                                             >> $DRESULTS/genmake_state
1723                      rm -f tmp.tr_log
1724                    fi
1725                    echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state
1726                    echo "get NETCDF & LAPACK settings:" >> $DRESULTS/genmake_state
1727                    sed -n '/set HAVE_NETCDF=/p' $gmkLog >> $DRESULTS/genmake_state
1728                    sed -n '/set HAVE_LAPACK=/p' $gmkLog >> $DRESULTS/genmake_state
1729              fi              fi
1730          fi          fi
1731      fi      fi
# Line 1648  date >> $SUMMARY Line 1750  date >> $SUMMARY
1750  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
1751      echo "No results email was sent."      echo "No results email was sent."
1752  else  else
1753      if test "x$HAVE_MPACK" = xt ; then      if test "x$SENDCMD" != x ; then
1754          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          if [ $verbose -gt 1 ]; then
1755              && gzip $DRESULTS".tar" \             echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
1756              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES          fi
1757            tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
1758                && gzip ${SAVDIR}/${DRESULTS}".tar" \
1759                && $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
1760          RETVAL=$?          RETVAL=$?
1761          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1762              echo              echo
# Line 1664  else Line 1769  else
1769              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1770              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1771              echo              echo
1772              test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"              test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"
1773              test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"              test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"
1774          fi          fi
1775      fi      fi
1776  fi  fi
# Line 1685  fi Line 1790  fi
1790  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then
1791      rm -rf $DRESULTS      rm -rf $DRESULTS
1792  fi  fi
1793    echo "======== End of testreport execution ========"

Legend:
Removed from v.1.175  
changed lines
  Added in v.1.202

  ViewVC Help
Powered by ViewVC 1.1.22