/[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.207 by jmc, Fri Jan 15 22:14:22 2016 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)"
# Line 61  usage() Line 71  usage()
71      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"      echo "  (-postclean|-pc)         after each exp. test, clean build-dir & run-dir"
72      echo "  (-deloutp|-do)           delete output files after successful run"      echo "  (-deloutp|-do)           delete output files after successful run"
73      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"  
74      echo      echo
75      echo "and where STRING can be a whitespace-delimited list"      echo "and where STRING can be a whitespace-delimited list"
76      echo "such as:"      echo "such as:"
# Line 125  testoutput_var() Line 132  testoutput_var()
132          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2
133      fi      fi
134      if [ -r $1/$4/$OUTPUTFILE ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
135          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | nl > ${TMP}a.txt
136          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l ${TMP}a.txt | awk '{print $1}' `
137          if [ $lncntA -lt 2 ]; then          if [ $lncntA -lt 2 ]; then
138              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
139                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
140              fi              fi
141              rm -f tmp1.txt ; return 99              rm -f ${TMP}a.txt ; return 99
142          fi          fi
143      else      else
144          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 147  testoutput_var()
147      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
148          echo testoutput_var: grep "$2" $1/$5 1>&2          echo testoutput_var: grep "$2" $1/$5 1>&2
149      fi      fi
150      grep "$2" $1/$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/$5 | sed 's/.*=//' | nl > ${TMP}b.txt
151      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l ${TMP}b.txt | awk '{print $1}' `
152      if [ $lncntB -lt 2 ]; then      if [ $lncntB -lt 2 ]; then
153          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
154              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
155          fi          fi
156          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
157      fi      fi
158      if [ $lncntA -ne $lncntB ]; then      if [ $lncntA -ne $lncntB ]; then
159          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
160              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
161          fi          fi
162          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
163      fi      fi
164      has_nan=`cat tmp1.txt | grep -i nan | wc -l`      has_nan=`cat ${TMP}a.txt | grep -i nan | wc -l`
165      if [ $has_nan -gt 0  ] ; then      if [ $has_nan -gt 0  ] ; then
166          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2
167          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
168      fi      fi
169      has_inf=`cat tmp1.txt | grep -i inf | wc -l`      has_inf=`cat ${TMP}a.txt | grep -i inf | wc -l`
170      if [ $has_inf -gt 0  ] ; then      if [ $has_inf -gt 0  ] ; then
171          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2
172          rm -f tmp1.txt tmp2.txt ; return 99          rm -f ${TMP}a.txt ${TMP}b.txt ; return 99
173      fi      fi
174      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
175          echo testoutput_var: join tmp1.txt tmp2.txt 1>&2          echo testoutput_var: join ${TMP}a.txt ${TMP}b.txt 1>&2
176      fi      fi
177      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
178        join ${TMP}a.txt ${TMP}b.txt | awk '{print $1 " " $2 " " $3}' | sed -e 's|:||g' > ${TMP}c.txt
179      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
180          echo testoutput_var: compare_lines 1>&2          echo testoutput_var: compare_lines 1>&2
181      fi      fi
182      if [ $verbose -gt 1 ]; then      if [ $verbose -gt 1 ]; then
183          cat tmp3.txt 1>&2          cat ${TMP}c.txt 1>&2
184      fi      fi
185      echo "-1" >> tmp3.txt      echo "-1" >> ${TMP}c.txt
186      # 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`  
187      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
188          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
189              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 194  testoutput_var()
194              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
195          fi          fi
196      fi      fi
197      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f ${TMP}a.txt ${TMP}b.txt ${TMP}c.txt
198    
199      return $digits_of_similarity      return $digits_of_similarity
200  }  }
# Line 322  testoutput_run() Line 328  testoutput_run()
328          '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=$? ;;
329          '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=$? ;;
330          '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=$? ;;
331          '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=$? ;;
332          '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=$? ;;
333          '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=$? ;;
334            'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;;
335            'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;;
336             'sbo_M') testoutput_var $1 "sbo_mass"          "SBO mass"        $2 $refoutp ; yy=$? ;;
337             'sboFW') testoutput_var $1 "sbo_mass_fw"       "SBO m-FW"        $2 $refoutp ; yy=$? ;;
338             'sboAc') testoutput_var $1 "sbo_zoamc"         "SBO AM-C"        $2 $refoutp ; yy=$? ;;
339             'sboAp') testoutput_var $1 "sbo_zoamp"         "SBO AM-P"        $2 $refoutp ; yy=$? ;;
340            'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;
341                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
342            esac            esac
343            if test $xx = $sVar            if test $xx = $sVar
# Line 361  genmakemodel() Line 374  genmakemodel()
374              if test "x$MKDEPEND" != x ; then              if test "x$MKDEPEND" != x ; then
375                  command="$command -makedepend=$MKDEPEND"                  command="$command -makedepend=$MKDEPEND"
376              fi              fi
377              if test $KIND = 1 -o $KIND = 2 ; then              if test $KIND = 4 ; then
378                  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'"  
379              else              else
380                  command="$command -mods=../code"                  command="$command -mods=../$code_dir"
381              fi              fi
382              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
383                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
# Line 393  genmakemodel() Line 404  genmakemodel()
404              if test "x$EXTRFLG" != x ; then              if test "x$EXTRFLG" != x ; then
405                  command="$command -extra_flag $EXTRFLG"                  command="$command -extra_flag $EXTRFLG"
406              fi              fi
407                if test "x$NOCATAD" = xt ; then
408                    command="$command -nocat4ad"
409                fi
410              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
411                  command="$command -ts"                  command="$command -ts"
412              fi              fi
# Line 423  genmakemodel() Line 437  genmakemodel()
437  makeclean()  makeclean()
438  {  {
439      # makeclean directory      # makeclean directory
440      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
441      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
442          echo "make Clean skipped!"          echo "make Clean skipped!"
443      else      else
# Line 455  run_clean() Line 469  run_clean()
469      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
470          echo "run_clean skipped!"          echo "run_clean skipped!"
471      else      else
472          (        (
473              cd $1;          cd $1;
474              printf 'clean run-dir ... '          printf 'clean run-dir ... '
475              # part of what is done after "make clean" when doing "make CLEAN"          # part of what is done after "make clean" when doing "make CLEAN"
476              find . -name "*.meta" -exec rm {} \;          find . -name "*.meta" -exec rm {} \;
477              find . -name "*.data" -exec rm {} \;          find . -name "*.data" -exec rm {} \;
478              find . -name "fort.*" -exec rm {} \;          find . -name "fort.*" -exec rm {} \;
479              find . -type l -exec rm {} \;          find . -type l -exec rm {} \;
480              #- should remove executable only if sym-link (alredy done above)          #- should remove executable only if sym-link (already done above)
481              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
482              rm -rf mnc_test_*          rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_*
483              rm -f *_MIT_CE_000.opt0000 costfunction*0000          rm -f *_MIT_CE_000.opt0000 costfunction*0000
484              echo successful          rm -f oad_cp.[0-9][0-9][0-9].?????
485              exit 0          rm -rf mnc_test_*
486          )          echo successful
487            exit 0
488          )
489      fi      fi
490  }  }
491    
# Line 512  makemodel() Line 528  makemodel()
528      else      else
529          cd $1;          cd $1;
530          if test -r Makefile ; then          if test -r Makefile ; then
531              printf 'make ... '              if test "x$MKSMALLF" = xt ; then
532              if test "x$REPLMAKE" = x ; then                  printf 'make small_f ... '
533                  $MAKE $TARG >> make.tr_log 2>&1                  $MAKE_CMD small_f >> make.tr_log 2>&1
534              else                  RETVAL=$?
535                  $REPLMAKE $TARG >> make.tr_log 2>&1                  if test "x$RETVAL" != x0 ; then
536                        tail make.tr_log
537                        echo failed
538                        cp genmake.log genmake.tr_log $CDIR
539                        tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail"
540                        rm -f $EXECUTABLE
541                        mk_fail=1
542                    else
543                        echo successful
544                    fi
545              fi              fi
546                printf 'make ... '
547                $MAKE_CMD $TARG >> make.tr_log 2>&1
548              RETVAL=$?              RETVAL=$?
549              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
550                  tail make.tr_log                  tail make.tr_log
# Line 534  makemodel() Line 561  makemodel()
561              mk_fail=2              mk_fail=2
562          fi          fi
563      fi      fi
564        if test $KIND = 1 -a -f taf_ftl.log ; then
565            head -1 taf_ftl.log >> $CDIR"/summary.txt"
566        fi
567      if test $KIND = 2 -a -f taf_ad.log ; then      if test $KIND = 2 -a -f taf_ad.log ; then
568              head -1 taf_ad.log >> $CDIR"/summary.txt"          head -1 taf_ad.log >> $CDIR"/summary.txt"
569              nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`          nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`
570              nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`          nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
571              echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \          if test -f taf_output ; then
572                n2er=`grep -c 'TAF *.* ERROR ' taf_output`
573                n3er=`grep -c '\*ERROR\* ' taf_output`
574                nerr=`expr $nerr + $n2er + $n3er`
575            fi
576            echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
577                                  >> $CDIR"/summary.txt"                                  >> $CDIR"/summary.txt"
578      fi      fi
579      if test $mk_fail != 0 ; then return $mk_fail ; fi      if test $mk_fail != 0 ; then return $mk_fail ; fi
# Line 757  runmodel() Line 792  runmodel()
792          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
793              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
794              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
795              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
796              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
797                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
798              fi              fi
# Line 785  runmodel() Line 820  runmodel()
820              # output do not exist or is older than executable:              # output do not exist or is older than executable:
821              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG
822              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
823            #- Divided Adjoint Run:
824            #  get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA"
825                if test $KIND = 2 -a -f run_ADM_DIVA ; then
826                  adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'`
827                  echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG
828                  eval "let $adm_diva_nb"
829                  if [ $add_DIVA_runs -ge 1 ] ; then
830                    rm -f costf* divided.ctrl snapshot*
831                    echo -n "(add_DIVA_runs=$add_DIVA_runs) ... "
832                    for ii in `seq 1 $add_DIVA_runs` ; do
833                      ( eval $COMMAND ) >> $RUNLOG 2>&1
834                      echo " additional DIVA run # $ii : done" >> $RUNLOG
835                      mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii}
836                    done
837                  fi
838                fi
839            #- special DIVA processing ends here
840              ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
841              RETVAL=$?              RETVAL=$?
842              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
# Line 802  runmodel() Line 854  runmodel()
854            fi            fi
855          fi          fi
856          rm -f run.log_tmp          rm -f run.log_tmp
857          #- in all cases where OutputFile exists, report SIZE (and AD time)          #- in all cases where OutputFile exists, report SIZE and time
858          if test -f $OUTPUTFILE ; then          if test -f $OUTPUTFILE ; then
859            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
860                  | sed 's/(PID.TID 0000.0001)     //' >> $CDIR"/summary.txt"                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
861            if test $KIND = 2 ; then  #         grep -A3 'Seconds in section "ALL' $OUTPUTFILE \
862              grep -A3 'Seconds in section "ALL' $OUTPUTFILE >> $CDIR"/summary.txt"  #               | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
863            fi  #         some implementations of grep cannot do contextual searches so we
864    #         replace the above with a sed command
865              cat $OUTPUTFILE | sed -n '/Seconds in section "ALL/{N
866              N
867              N
868              p
869              }' | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
870          fi          fi
871          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
872          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 910  formatresults() Line 968  formatresults()
968          fi          fi
969      fi      fi
970      printf '  %s' $nm      printf '  %s' $nm
971        if test $KIND = 2 ; then
972            #-- apppend taf repport summary:
973            tafrep=`grep -c '^ TAF reports ' $CDIR/summary.txt`
974            if test $tafrep = 1 ; then
975                grep '^ TAF reports ' $CDIR/summary.txt | awk '{printf "  (e=%i, w=%i)",$3,$6}'
976            fi
977        fi
978      printf '\n'      printf '\n'
979    
980  }  }
# Line 995  SKIPDIRS= Line 1060  SKIPDIRS=
1060  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
1061  HAVE_MPACK=  HAVE_MPACK=
1062  MPACK=  MPACK=
1063    SENDCMD=
1064    SAVDIR='.'
1065  COMMAND=  COMMAND=
1066  MKDEPEND=  MKDEPEND=
1067  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1068      MAKE=make      MAKE=make
1069  fi  fi
1070  REPLMAKE=  MAKE_CMD=
1071  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1072      CC=cc      CC=cc
1073  fi  fi
# Line 1013  OUTDIR= Line 1080  OUTDIR=
1080  DELDIR=  DELDIR=
1081  USE_R4=  USE_R4=
1082  EXTRFLG=  EXTRFLG=
1083    NOCATAD=
1084    MKSMALLF=
1085    
1086  #- type of testing (KIND):  #- type of testing (KIND):
1087  #   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 1119  for ac_option ; do
1119          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
1120          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
1121    
1122            -send | --send ) ac_prev=SENDCMD ;;
1123            -send=* | --send=* ) SENDCMD=$ac_optarg ;;
1124            -savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;;
1125            -savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;;
1126    
1127          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
1128          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
1129          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
# Line 1067  for ac_option ; do Line 1141  for ac_option ; do
1141          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1142          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1143    
1144          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1145          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1146    
1147          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1148          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1116  for ac_option ; do Line 1190  for ac_option ; do
1190          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1191                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1192                fi ;;                fi ;;
1193            -ncad) NOCATAD=t ;;
1194            -small_f) MKSMALLF=t ;;
1195    
1196          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1197                   printf " ... " ;;                   printf " ... " ;;
# Line 1135  for ac_option ; do Line 1211  for ac_option ; do
1211    
1212          -ts) TS=t;;          -ts) TS=t;;
1213          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1214          -pcls) PCL=t;;          -pcls) PCLS=t;;
1215    
1216          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1217              usage ;;              usage ;;
# Line 1151  if test "x$QUICK" = xt ; then Line 1227  if test "x$QUICK" = xt ; then
1227      NOCLEAN=t      NOCLEAN=t
1228      NODEPEND=t      NODEPEND=t
1229  fi  fi
1230    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1231    
1232  #- check length of MPI machine file:  #- check length of MPI machine file:
1233  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 1266  elif test $KIND = 4 ; then
1266      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1267      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1268  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1269      code_dir=code      code_dir=code
1270      inputdir=input      inputdir=input
1271      ref_outp="output.txt"      ref_outp="output.txt"
1272      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1273  fi  fi
1274    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1275    
1276  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1277  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1241  done Line 1318  done
1318  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1319  #echo 'TESTDIRS='${TESTDIRS}'<'  #echo 'TESTDIRS='${TESTDIRS}'<'
1320    
 if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  
     OPTFILE=$MITGCM_OF  
 fi  
   
1321  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1322  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1323  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1324  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1325      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1326  fi  else
1327  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1328      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -np TR_NPROC ./$EXECUTABLE" ; fi
1329  fi  fi
1330    
1331  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1332    
1333    #TMP=./tr_$$
1334    #- try to put temporary files in system-local /tmp dir
1335    TMP=/tmp/tr_${USER}_$$
1336    touch $TMP ; retVal=$?
1337    if [ $retVal -eq 0 ] ; then
1338      if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1339    else
1340      TMP=./tr_$$
1341    fi
1342    rm -f $TMP
1343    if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1344    
1345  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1346  #  (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 1363  else
1363  fi  fi
1364    
1365  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
1366  if test -x tr_cmpnum ; then  if test "x$CLEANUP" = xt -o -x tr_cmpnum ; then
1367      echo "skipping comparison code build"      echo "skipping comparison code build"
1368  else  else
1369      createcodelet      createcodelet
1370  fi  fi
1371    
1372  #  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)
1373  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then
1374      echo "skipping mpack build"      echo "skipping mpack build"
1375  else  else
1376      build_mpack      build_mpack
1377        if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi
1378  fi  fi
1379    
1380  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
1381  CMDLINE=$0  CMDLINE=$0
1382  for xx in "$@" ; do nw=`echo $xx | wc -w`  for xx in "$@" ; do nw=`echo $xx | wc -w`
1383      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"      if test $nw = '1' ; then CMDLINE="$CMDLINE $xx" ; else
1384                          else CMDLINE="$CMDLINE '$xx'" ; fi        nb=`echo $xx | grep -c '='`
1385          if test $nb = 0 ; then CMDLINE="$CMDLINE '$xx'"
1386          else yy=`echo "$xx'" | sed "s/=/='/"` ;
1387                                 CMDLINE="$CMDLINE $yy" ; fi
1388        fi
1389  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1390  MACH=`hostname`  MACH=`hostname`
1391  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1392  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1305  BASE="tr_"$MACH"_"$DATE"_" Line 1394  BASE="tr_"$MACH"_"$DATE"_"
1394  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1395      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1396  else  else
1397      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1398       # hostname -s is not universal (does work on AIX system)
1399        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1400      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1401  fi  fi
1402  DNUM=0  DNUM=0
# Line 1342  if test "x$OPTFILE" != xNONE ; then Line 1433  if test "x$OPTFILE" != xNONE ; then
1433          echo >> $SUMMARY          echo >> $SUMMARY
1434          echo "  OPTFILE=$OPTFILE" >> $SUMMARY          echo "  OPTFILE=$OPTFILE" >> $SUMMARY
1435      else      else
1436          echo | tee $SUMMARY          echo | tee -a $SUMMARY
1437          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee $SUMMARY          echo "ERROR: can't read OPTFILE=\"$OPTFILE\"" | tee -a $SUMMARY
1438          exit 1          exit 1
1439      fi      fi
1440  else  else
# Line 1370  if test $KIND = 0 ; then Line 1461  if test $KIND = 0 ; then
1461  else  else
1462      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`
1463    if test $KIND = 1 ; then    if test $KIND = 1 ; then
1464      echo "TANGLIN=true" >> $SUMMARY     #echo "TANGLIN=true" >> $SUMMARY
1465        echo "TangLin generated by TAF" >> $SUMMARY
1466      elif test $KIND = 3 ; then
1467        echo "TangLin generated by OpenAD" >> $SUMMARY
1468      elif test $KIND = 2 ; then
1469       #echo "ADJOINT=true" >> $SUMMARY
1470        echo "Adjoint generated by TAF" >> $SUMMARY
1471      else
1472        echo "Adjoint generated by OpenAD" >> $SUMMARY
1473      fi
1474      if test $KIND = 1 -o $KIND = 3 ; then
1475      line_1="G D M    C  T  F"      line_1="G D M    C  T  F"
1476      line_2="e p a R  o  L  D"      line_2="e p a R  o  L  D"
1477    else    else
     echo "ADJOINT=true" >> $SUMMARY  
1478      line_1="G D M    C  A  F"      line_1="G D M    C  A  F"
1479      line_2="e p a R  o  d  D"      line_2="e p a R  o  d  D"
1480    fi    fi
# Line 1382  else Line 1482  else
1482      line_4="2 d e n  t  r  r"      line_4="2 d e n  t  r  r"
1483      echo >> $SUMMARY      echo >> $SUMMARY
1484  fi  fi
1485    if test "x$CLEANUP" != xt ; then
1486      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1487      echo "$line_1" | tee -a $SUMMARY      echo "$line_1" | tee -a $SUMMARY
1488      echo "$line_2" | tee -a $SUMMARY      echo "$line_2" | tee -a $SUMMARY
1489      echo "$line_3" | tee -a $SUMMARY      echo "$line_3" | tee -a $SUMMARY
1490      echo "$line_4" | tee -a $SUMMARY      echo "$line_4" | tee -a $SUMMARY
1491      echo ""        | tee -a $SUMMARY      echo ""        | tee -a $SUMMARY
1492    fi
1493  echo "-------------------------------------------------------------------------------"  echo "-------------------------------------------------------------------------------"
1494    
1495  #  ...and each test directory...  #  ...and each test directory...
# Line 1412  for dir in $TESTDIRS ; do Line 1514  for dir in $TESTDIRS ; do
1514              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1515              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1516              rm -f SIZE.h.mpi genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1517                rm -rf mpi_headers
1518          )          )
1519          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1520              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1496  for dir in $TESTDIRS ; do Line 1599  for dir in $TESTDIRS ; do
1599      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1600      extra_runs=      extra_runs=
1601      if test "x$NORUN" = xf ; then      if test "x$NORUN" = xf ; then
1602          ex_run_dirs=`( cd $dir ; echo $inputdir.* )`          ex_run_dirs=`( cd $dir ; ls -d $inputdir.* 2> /dev/null )`
1603      fi      fi
1604      #echo "ex_run_dirs='$ex_run_dirs'"      #echo "ex_run_dirs='$ex_run_dirs'"
1605      for exd in $ex_run_dirs ; do      for exd in $ex_run_dirs ; do
1606          name=`echo $exd | sed -e "s/$inputdir\.//"`          name=`echo $exd | sed -e "s/$inputdir\.//"`
1607          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1608          outf="$dir/results/$refExOut"          outf="$dir/results/$refExOut"
         #if test -f $outf -a -r $outf ; then  
1609          if test -r $outf -o -r ${outf}.gz ; then          if test -r $outf -o -r ${outf}.gz ; then
1610            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1611              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
# Line 1587  for dir in $TESTDIRS ; do Line 1689  for dir in $TESTDIRS ; do
1689              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1690              runmodel $dir/$pfxdir.$ex && run=Y \              runmodel $dir/$pfxdir.$ex && run=Y \
1691              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
1692              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"  
1693              echo 1>&2              echo 1>&2
1694              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1695              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 1698  for dir in $TESTDIRS ; do
1698              fi              fi
1699          done          done
1700    
1701      if test -f $DRESULTS"/"genmake_state ; then : ; else      if test ! -f $DRESULTS"/"genmake_state ; then
1702          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1703              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/^# //'`
1704              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1705              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1706    # bsd-sed cannot do the above code
1707                cat $dir/$builddir/Makefile | \
1708                    sed -n '/^# executed by:/{N
1709                                              p
1710                                              }' >> $DRESULTS/genmake_state
1711              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1712              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1713                  eval $mkOpt                  eval $mkOpt
1714                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1715                          $SUMMARY > tr_0.tmp_log  #                       $SUMMARY > tmp.tr_log
1716    # bsd-sed requires a newline after "a\":
1717                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1718                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1719                  RETVAL=$?                  RETVAL=$?
1720                  if test "x$RETVAL" = x0 ; then rm -f $SUMMARY                  if test "x$RETVAL" = x0 ; then
1721                          cp tr_0.tmp_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY
                 else rm -f tr_0.tmp_log  
1722                  fi                  fi
1723                    rm -f tmp.tr_log
1724              fi              fi
1725              gmkLog=$dir/$builddir/genmake.log              gmkLog=$dir/$builddir/genmake.log
1726              grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1              if test -r $gmkLog ; then
1727              RETVAL=$?                  grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1728              if test "x$RETVAL" = x0 ; then                  RETVAL=$?
1729                  echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state                  if test "x$RETVAL" = x0 ; then
1730                  sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \                    echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state
1731                          | grep -v '^... compiler version ' > tr_1.tmp_log                    echo "extract compiler version:"   >> $DRESULTS/genmake_state
1732                  sed -n '1p' tr_1.tmp_log >> $DRESULTS/genmake_state                    sed -n '/Get compiler version/,/<-- compiler version/p' \
1733                  sed -n '2,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \                       $gmkLog | grep -v '^... compiler version ' > tmp.tr_log
1734                          >> $DRESULTS/genmake_state                    sed -n '1p' tmp.tr_log >> $DRESULTS/genmake_state
1735                  rm -f tr_1.tmp_log                    sed -n '2,/^$/p' tmp.tr_log | sed '/^$/d' | sed 's/^./ &/' \
1736                                             >> $DRESULTS/genmake_state
1737                      rm -f tmp.tr_log
1738                    fi
1739                fi
1740                gmkLog=$dir/$builddir/genmake_state
1741                if test -r $gmkLog ; then
1742                    echo -n "from '$gmkLog', "      >> $DRESULTS/genmake_state
1743                    echo "get genmake settings:"    >> $DRESULTS/genmake_state
1744                    sed -n '/^HAVE_/p' $gmkLog | sed 's/^./ &/' \
1745                                                    >> $DRESULTS/genmake_state
1746              fi              fi
1747          fi          fi
1748      fi      fi
# Line 1648  date >> $SUMMARY Line 1767  date >> $SUMMARY
1767  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
1768      echo "No results email was sent."      echo "No results email was sent."
1769  else  else
1770      if test "x$HAVE_MPACK" = xt ; then      if test "x$SENDCMD" != x ; then
1771          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          if [ $verbose -gt 1 ]; then
1772              && gzip $DRESULTS".tar" \             echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
1773              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES          fi
1774            tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
1775                && gzip ${SAVDIR}/${DRESULTS}".tar" \
1776                && $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
1777          RETVAL=$?          RETVAL=$?
1778          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1779              echo              echo
# Line 1664  else Line 1786  else
1786              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1787              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1788              echo              echo
1789              test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"              test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"
1790              test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"              test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"
1791          fi          fi
1792      fi      fi
1793  fi  fi
# Line 1685  fi Line 1807  fi
1807  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then
1808      rm -rf $DRESULTS      rm -rf $DRESULTS
1809  fi  fi
1810    echo "======== End of testreport execution ========"

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

  ViewVC Help
Powered by ViewVC 1.1.22