/[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.180 by jmc, Tue Sep 4 19:27:52 2012 UTC revision 1.209 by jmc, Wed Aug 3 19:42:31 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 264  testoutput_run() Line 270  testoutput_run()
270          allargs=""          allargs=""
271          for xx in $listVar          for xx in $listVar
272          do          do
273            case $xx in           #ii=`echo $xx | sed 's/^pt[0-9][0-9]*..$/XXX/'`        #- any ptr number
274              ii=`echo $xx | sed 's/^pt[1-9]..$/XXX/'`              #- 1 to 9 ptr number
275              if test $ii != 'XXX' ; then
276              #- all except ptracer stats:
277                case $xx in
278             'PS')  if [ $debug -gt 0 ]             'PS')  if [ $debug -gt 0 ]
279                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi                    then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi
280                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $refoutp ; yy=$?                    testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $refoutp ; yy=$?
# Line 291  testoutput_run() Line 301  testoutput_run()
301             'Vmx') testoutput_var $1 "dynstat_vvel_max"  "V maximum"       $2 $refoutp ; yy=$? ;;             'Vmx') testoutput_var $1 "dynstat_vvel_max"  "V maximum"       $2 $refoutp ; yy=$? ;;
302             'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean"          $2 $refoutp ; yy=$? ;;             'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean"          $2 $refoutp ; yy=$? ;;
303             'Vsd') testoutput_var $1 "dynstat_vvel_sd"   "V Std.Dev"       $2 $refoutp ; yy=$? ;;             'Vsd') testoutput_var $1 "dynstat_vvel_sd"   "V Std.Dev"       $2 $refoutp ; yy=$? ;;
         'pt1mn'|'pt2mn'|'pt3mn'|'pt4mn'|'pt5mn') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_min"  "p0"$ii"_min"   $2 $refoutp ; yy=$? ;;  
         'pt1mx'|'pt2mx'|'pt3mx'|'pt4mx'|'pt5mx') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_max"  "p0"$ii"_max"   $2 $refoutp ; yy=$? ;;  
         'pt1av'|'pt2av'|'pt3av'|'pt4av'|'pt5av') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $refoutp ; yy=$? ;;  
         'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`  
            testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $refoutp ; yy=$? ;;  
304           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $refoutp ; yy=$? ;;           'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $refoutp ; yy=$? ;;
305           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $refoutp ; yy=$? ;;           'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $refoutp ; yy=$? ;;
306           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $refoutp ; yy=$? ;;           'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $refoutp ; yy=$? ;;
# Line 322  testoutput_run() Line 324  testoutput_run()
324          '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=$? ;;
325          '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=$? ;;
326          '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=$? ;;
327          '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=$? ;;
328          '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=$? ;;
329          '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=$? ;;
330            'HthMxS') testoutput_var $1 "thSI_IceH_max_S" "thSIc H South-max" $2 $refoutp ; yy=$? ;;
331            'HthMxN') testoutput_var $1 "thSI_IceH_max_N" "thSIc H North-max" $2 $refoutp ; yy=$? ;;
332             'sbo_M') testoutput_var $1 "sbo_mass"          "SBO mass"        $2 $refoutp ; yy=$? ;;
333             'sboFW') testoutput_var $1 "sbo_mass_fw"       "SBO m-FW"        $2 $refoutp ; yy=$? ;;
334             'sboAc') testoutput_var $1 "sbo_zoamc"         "SBO AM-C"        $2 $refoutp ; yy=$? ;;
335             'sboAp') testoutput_var $1 "sbo_zoamp"         "SBO AM-P"        $2 $refoutp ; yy=$? ;;
336            'StrmIc') testoutput_var $1 "STREAMICE_FP_ERR" "StreamIce Solver" $2 $refoutp ; yy=$? ;;
337                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;                *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
338            esac              esac
339              else
340              #- ptracers stats:
341                nn=`echo $xx | sed 's/pt//' | sed 's/..$//'`
342                ii=`echo $xx | sed 's/^pt[0-9]*//'`
343                case $ii in
344                'mn') testoutput_var $1 "trcstat_ptracer0"$nn"_min"  "p0"$nn"_min"  $2 $refoutp ; yy=$? ;;
345                'mx') testoutput_var $1 "trcstat_ptracer0"$nn"_max"  "p0"$nn"_max"  $2 $refoutp ; yy=$? ;;
346                'av') testoutput_var $1 "trcstat_ptracer0"$nn"_mean" "p0"$nn"_mean" $2 $refoutp ; yy=$? ;;
347                'sd') testoutput_var $1 "trcstat_ptracer0"$nn"_sd"   "p0"$nn"_StDv" $2 $refoutp ; yy=$? ;;
348                esac
349              fi
350            if test $xx = $sVar            if test $xx = $sVar
351            then allargs="$allargs > $yy <"            then allargs="$allargs > $yy <"
352            else allargs="$allargs $yy"            else allargs="$allargs $yy"
353            fi            fi
354          done          done
355            echo 1>&2
356    
357          nbVar=`echo $listVar | awk '{print NF}'`          nbVar=`echo $listVar | awk '{print NF}'`
358          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then          if [ $nbVar -lt $LEN_CHECK_LIST ] ; then
# Line 361  genmakemodel() Line 382  genmakemodel()
382              if test "x$MKDEPEND" != x ; then              if test "x$MKDEPEND" != x ; then
383                  command="$command -makedepend=$MKDEPEND"                  command="$command -makedepend=$MKDEPEND"
384              fi              fi
385              if test $KIND = 1 -o $KIND = 2 ; then              if test $KIND = 4 ; then
386                  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'"  
387              else              else
388                  command="$command -mods=../code"                  command="$command -mods=../$code_dir"
389              fi              fi
390              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
391                  command="$command -optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
# Line 393  genmakemodel() Line 412  genmakemodel()
412              if test "x$EXTRFLG" != x ; then              if test "x$EXTRFLG" != x ; then
413                  command="$command -extra_flag $EXTRFLG"                  command="$command -extra_flag $EXTRFLG"
414              fi              fi
415                if test "x$NOCATAD" = xt ; then
416                    command="$command -nocat4ad"
417                fi
418              if test "x$TS" = xt ; then              if test "x$TS" = xt ; then
419                  command="$command -ts"                  command="$command -ts"
420              fi              fi
# Line 423  genmakemodel() Line 445  genmakemodel()
445  makeclean()  makeclean()
446  {  {
447      # makeclean directory      # makeclean directory
448      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
449      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
450          echo "make Clean skipped!"          echo "make Clean skipped!"
451      else      else
# Line 455  run_clean() Line 477  run_clean()
477      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
478          echo "run_clean skipped!"          echo "run_clean skipped!"
479      else      else
480          (        (
481              cd $1;          cd $1;
482              printf 'clean run-dir ... '          printf 'clean run-dir ... '
483              # part of what is done after "make clean" when doing "make CLEAN"          # part of what is done after "make clean" when doing "make CLEAN"
484              find . -name "*.meta" -exec rm {} \;          find . -name "*.meta" -exec rm {} \;
485              find . -name "*.data" -exec rm {} \;          find . -name "*.data" -exec rm {} \;
486              find . -name "fort.*" -exec rm {} \;          find . -name "fort.*" -exec rm {} \;
487              find . -type l -exec rm {} \;          find . -type l -exec rm {} \;
488              #- should remove executable only if sym-link (alredy done above)          #- should remove executable only if sym-link (already done above)
489              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
490              rm -rf mnc_test_*          rm -f datetime costfinal divided.ctrl snapshot* output_adm.*.diva_*
491              rm -f *_MIT_CE_000.opt0000 costfunction*0000          rm -f *_MIT_CE_000.opt0000 costfunction*0000
492              echo successful          rm -f oad_cp.[0-9][0-9][0-9].?????
493              exit 0          rm -rf mnc_test_*
494          )          echo successful
495            exit 0
496          )
497      fi      fi
498  }  }
499    
# Line 512  makemodel() Line 536  makemodel()
536      else      else
537          cd $1;          cd $1;
538          if test -r Makefile ; then          if test -r Makefile ; then
539              printf 'make ... '              if test "x$MKSMALLF" = xt ; then
540              if test "x$REPLMAKE" = x ; then                  printf 'make small_f ... '
541                  $MAKE $TARG >> make.tr_log 2>&1                  $MAKE_CMD small_f >> make.tr_log 2>&1
542              else                  RETVAL=$?
543                  $REPLMAKE $TARG >> make.tr_log 2>&1                  if test "x$RETVAL" != x0 ; then
544                        tail make.tr_log
545                        echo failed
546                        cp genmake.log genmake.tr_log $CDIR
547                        tail -$NBLINES_MKLOG make.tr_log > $CDIR"/make.tr_log_tail"
548                        rm -f $EXECUTABLE
549                        mk_fail=1
550                    else
551                        echo successful
552                    fi
553              fi              fi
554                printf "make $TARG ... "
555                $MAKE_CMD $TARG >> make.tr_log 2>&1
556              RETVAL=$?              RETVAL=$?
557              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
558                  tail make.tr_log                  tail make.tr_log
# Line 535  makemodel() Line 570  makemodel()
570          fi          fi
571      fi      fi
572      if test $KIND = 1 -a -f taf_ftl.log ; then      if test $KIND = 1 -a -f taf_ftl.log ; then
573              head -1 taf_ftl.log >> $CDIR"/summary.txt"          head -1 taf_ftl.log >> $CDIR"/summary.txt"
574      fi      fi
575      if test $KIND = 2 -a -f taf_ad.log ; then      if test $KIND = 2 -a -f taf_ad.log ; then
576              head -1 taf_ad.log >> $CDIR"/summary.txt"          head -1 taf_ad.log >> $CDIR"/summary.txt"
577              nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`          nerr=`grep -c 'TAF *.* ERROR ' taf_ad.log`
578              nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`          nwar=`grep -c 'TAF RECOMPUTATION *.* WARNING ' taf_ad.log`
579              echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \          if test -f taf_output ; then
580                n2er=`grep -c 'TAF *.* ERROR ' taf_output`
581                n3er=`grep -c '\*ERROR\* ' taf_output`
582                nerr=`expr $nerr + $n2er + $n3er`
583            fi
584            echo " TAF reports $nerr Errors and $nwar Recomputation Warnings" \
585                                  >> $CDIR"/summary.txt"                                  >> $CDIR"/summary.txt"
586      fi      fi
587      if test $mk_fail != 0 ; then return $mk_fail ; fi      if test $mk_fail != 0 ; then return $mk_fail ; fi
# Line 760  runmodel() Line 800  runmodel()
800          if test "x$MPI" != x0 ; then          if test "x$MPI" != x0 ; then
801              #- adjust the MPI run command with the right number of Procs              #- adjust the MPI run command with the right number of Procs
802              #echo '' ; echo "  COMMAND='$COMMAND'"              #echo '' ; echo "  COMMAND='$COMMAND'"
803              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC / $LOC_NPROC /"`              COMMAND=`echo $COMMAND | sed "s/ TR_NPROC/ $LOC_NPROC/"`
804              if test "x$MPI_MFILE" != x ; then              if test "x$MPI_MFILE" != x ; then
805                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`                COMMAND=`echo $COMMAND | sed "s/ TR_MFILE / ..\/..\/$LOC_MFILE /"`
806              fi              fi
# Line 788  runmodel() Line 828  runmodel()
828              # output do not exist or is older than executable:              # output do not exist or is older than executable:
829              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG              rm -f $OUTPUTFILE $RUNLOG ; touch $RUNLOG
830              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
831            #- Divided Adjoint Run:
832            #  get the number of additional runs (add_DIVA_runs) from file "run_ADM_DIVA"
833                if test $KIND = 2 -a -f run_ADM_DIVA ; then
834                  adm_diva_nb=`sed -n '/^ *add_DIVA_runs\>.*=/p' run_ADM_DIVA | sed 's/ //g'`
835                  echo " Divided Adjoint Run: $adm_diva_nb" >> $RUNLOG
836                  eval "let $adm_diva_nb"
837                  if [ $add_DIVA_runs -ge 1 ] ; then
838                    rm -f costf* divided.ctrl snapshot*
839                    echo -n "(add_DIVA_runs=$add_DIVA_runs) ... "
840                    for ii in `seq 1 $add_DIVA_runs` ; do
841                      ( eval $COMMAND ) >> $RUNLOG 2>&1
842                      echo " additional DIVA run # $ii : done" >> $RUNLOG
843                      mv -f $OUTPUTFILE ${OUTPUTFILE}.diva_${ii}
844                    done
845                  fi
846                fi
847            #- special DIVA processing ends here
848              ( eval $COMMAND ) >> $RUNLOG 2>&1              ( eval $COMMAND ) >> $RUNLOG 2>&1
849              RETVAL=$?              RETVAL=$?
850              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`              ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
# Line 809  runmodel() Line 866  runmodel()
866          if test -f $OUTPUTFILE ; then          if test -f $OUTPUTFILE ; then
867            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \            grep '(PID\.TID 0000\.0001)      n.. =' $OUTPUTFILE \
868                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
869            grep -A3 'Seconds in section "ALL' $OUTPUTFILE \  #         grep -A3 'Seconds in section "ALL' $OUTPUTFILE \
870                  | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"  #               | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
871    #         some implementations of grep cannot do contextual searches so we
872    #         replace the above with a sed command
873              cat $OUTPUTFILE | sed -n '/Seconds in section "ALL/{N
874              N
875              N
876              p
877              }' | sed 's/(PID.TID 0000.0001)   //' >> $CDIR"/summary.txt"
878          fi          fi
879          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
880          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
# Line 912  formatresults() Line 976  formatresults()
976          fi          fi
977      fi      fi
978      printf '  %s' $nm      printf '  %s' $nm
979        if test $KIND = 2 ; then
980            #-- apppend taf repport summary:
981            tafrep=`grep -c '^ TAF reports ' $CDIR/summary.txt`
982            if test $tafrep = 1 ; then
983                grep '^ TAF reports ' $CDIR/summary.txt | awk '{printf "  (e=%i, w=%i)",$3,$6}'
984            fi
985        fi
986      printf '\n'      printf '\n'
987    
988  }  }
# Line 997  SKIPDIRS= Line 1068  SKIPDIRS=
1068  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
1069  HAVE_MPACK=  HAVE_MPACK=
1070  MPACK=  MPACK=
1071    SENDCMD=
1072    SAVDIR='.'
1073  COMMAND=  COMMAND=
1074  MKDEPEND=  MKDEPEND=
1075  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
1076      MAKE=make      MAKE=make
1077  fi  fi
1078  REPLMAKE=  MAKE_CMD=
1079  if test "x$CC" = x ; then  if test "x$CC" = x ; then
1080      CC=cc      CC=cc
1081  fi  fi
# Line 1015  OUTDIR= Line 1088  OUTDIR=
1088  DELDIR=  DELDIR=
1089  USE_R4=  USE_R4=
1090  EXTRFLG=  EXTRFLG=
1091    NOCATAD=
1092    MKSMALLF=
1093    
1094  #- type of testing (KIND):  #- type of testing (KIND):
1095  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;  #   KIND=0 : forward (= default) ;  KIND=1 : Tangent Linear with TAF ;
# Line 1052  for ac_option ; do Line 1127  for ac_option ; do
1127          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;          -mpackdir | --mpackdir | -mpd | --mpd) ac_prev=MPACKDIR ;;
1128          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;          -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*) MPACKDIR=$ac_optarg ;;
1129    
1130            -send | --send ) ac_prev=SENDCMD ;;
1131            -send=* | --send=* ) SENDCMD=$ac_optarg ;;
1132            -savdir | --savdir | -sd | --sd ) ac_prev=SAVDIR ;;
1133            -savdir=* | --savdir=* | -sd=* | --sd=* ) SAVDIR=$ac_optarg ;;
1134    
1135          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;          -tdir | --tdir | -t | --t) ac_prev=TESTDIRS ;;
1136          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;          -tdir=* | --tdir=* | -t=* | --t=*) TESTDIRS=$ac_optarg ;;
1137          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;          -skipdir | --skipdir | -skd | --skd) ac_prev=SKIPDIRS ;;
# Line 1069  for ac_option ; do Line 1149  for ac_option ; do
1149          -make | --make | -m | --m) ac_prev=MAKE ;;          -make | --make | -m | --m) ac_prev=MAKE ;;
1150          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;          -make=* | --make=* | -m=* | --m=*) MAKE=$ac_optarg ;;
1151    
1152          -repl_mk | --repl_mk ) ac_prev=REPLMAKE ;;          -repl_mk | --repl_mk ) ac_prev=MAKE_CMD ;;
1153          -repl_mk=* | --repl_mk=*) REPLMAKE=$ac_optarg ;;          -repl_mk=* | --repl_mk=*) MAKE_CMD=$ac_optarg ;;
1154    
1155          -odir | --odir) ac_prev=OUTDIR ;;          -odir | --odir) ac_prev=OUTDIR ;;
1156          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;          -odir=* | --odir=*) OUTDIR=$ac_optarg ;;
# Line 1118  for ac_option ; do Line 1198  for ac_option ; do
1198          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else          -oad) if test $KIND = 0 ; then KIND=4 ; NODEPEND=t ; else
1199                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage                  echo "Error: '-tlm', '-adm' and '-oad' are exclusive" ; usage
1200                fi ;;                fi ;;
1201            -ncad) NOCATAD=t ;;
1202            -small_f) MKSMALLF=t ;;
1203    
1204          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"          -ieee)   echo "Warning: ignore option '-ieee' (already the default)"
1205                   printf " ... " ;;                   printf " ... " ;;
# Line 1137  for ac_option ; do Line 1219  for ac_option ; do
1219    
1220          -ts) TS=t;;          -ts) TS=t;;
1221          -papis) PAPIS=t;;          -papis) PAPIS=t;;
1222          -pcls) PCL=t;;          -pcls) PCLS=t;;
1223    
1224          -*) echo "Error: unrecognized option: "$ac_option          -*) echo "Error: unrecognized option: "$ac_option
1225              usage ;;              usage ;;
# Line 1153  if test "x$QUICK" = xt ; then Line 1235  if test "x$QUICK" = xt ; then
1235      NOCLEAN=t      NOCLEAN=t
1236      NODEPEND=t      NODEPEND=t
1237  fi  fi
1238    if test "x$MAKE_CMD" = x ; then MAKE_CMD=$MAKE ; fi
1239    
1240  #- check length of MPI machine file:  #- check length of MPI machine file:
1241  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then  if test "x$MPI" != x0 -a "x$MPI_MFILE" != x ; then
# Line 1191  elif test $KIND = 4 ; then Line 1274  elif test $KIND = 4 ; then
1274      ref_outp="output_oadm.txt"      ref_outp="output_oadm.txt"
1275      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
1276  else  else
     if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi  
1277      code_dir=code      code_dir=code
1278      inputdir=input      inputdir=input
1279      ref_outp="output.txt"      ref_outp="output.txt"
1280      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
1281  fi  fi
1282    if test "x$JOBS" != x ; then TARG="-j $JOBS $TARG" ; fi
1283    
1284  xx=`echo $TESTDIRS | awk '{print $1}'`  xx=`echo $TESTDIRS | awk '{print $1}'`
1285  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
# Line 1243  done Line 1326  done
1326  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi  if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1327  #echo 'TESTDIRS='${TESTDIRS}'<'  #echo 'TESTDIRS='${TESTDIRS}'<'
1328    
 if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  
     OPTFILE=$MITGCM_OF  
 fi  
   
1329  LOC_MFILE='tr_mpi_mfile'  LOC_MFILE='tr_mpi_mfile'
1330  RUNLOG="run.tr_log"  RUNLOG="run.tr_log"
1331  OUTPUTFILE=$ref_outp  if test "x$MPI" = x0 ; then
1332  if test "x$COMMAND" = x ; then    OUTPUTFILE=$ref_outp
1333      COMMAND="./$EXECUTABLE > $OUTPUTFILE"    if test "x$COMMAND" = x ; then COMMAND="./$EXECUTABLE > $OUTPUTFILE" ; fi
1334  fi  else
1335  if test "x$MPI" != x0 ; then    OUTPUTFILE="STDOUT.0000"
1336      OUTPUTFILE="STDOUT.0000"    if test "x$COMMAND" = x ; then COMMAND="mpirun -np TR_NPROC ./$EXECUTABLE" ; fi
1337  fi  fi
1338    
1339  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND='$COMMAND')"
1340    
1341    #TMP=./tr_$$
1342    #- try to put temporary files in system-local /tmp dir
1343    TMP=/tmp/tr_${USER}_$$
1344    touch $TMP ; retVal=$?
1345    if [ $retVal -eq 0 ] ; then
1346      if test ! -r $TMP ; then TMP=./tr_$$ ; fi
1347    else
1348      TMP=./tr_$$
1349    fi
1350    rm -f $TMP
1351    if [ $verbose -gt 1 ]; then echo " temp files: $TMP" ; fi
1352    
1353  # set the Default List of output variables to be checked:  # set the Default List of output variables to be checked:
1354  #  (use default or load experiment-specific list from file "tr_checklist")  #  (use default or load experiment-specific list from file "tr_checklist")
# Line 1287  else Line 1378  else
1378  fi  fi
1379    
1380  #  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)
1381  if test "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x -o "x$SENDCMD" != x ; then
1382      echo "skipping mpack build"      echo "skipping mpack build"
1383  else  else
1384      build_mpack      build_mpack
1385        if test "x$HAVE_MPACK" = xt ; then SENDCMD=$MPACK ; fi
1386  fi  fi
1387    
1388  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
# Line 1303  for xx in "$@" ; do nw=`echo $xx | wc -w Line 1395  for xx in "$@" ; do nw=`echo $xx | wc -w
1395                               CMDLINE="$CMDLINE $yy" ; fi                               CMDLINE="$CMDLINE $yy" ; fi
1396      fi      fi
1397  done  done
 #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  
1398  MACH=`hostname`  MACH=`hostname`
1399  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1400  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
# Line 1311  BASE="tr_"$MACH"_"$DATE"_" Line 1402  BASE="tr_"$MACH"_"$DATE"_"
1402  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1403      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1404  else  else
1405      short_name=`hostname | sed 's/\..*$//'`     #short_name=`hostname -s | tr '[:upper:]' '[:lower:]'`
1406       # hostname -s is not universal (does work on AIX system)
1407        short_name=`hostname | sed 's/\..*$//' | tr '[:upper:]' '[:lower:]'`
1408      BASE="tr_"$short_name"_"$DATE"_"      BASE="tr_"$short_name"_"$DATE"_"
1409  fi  fi
1410  DNUM=0  DNUM=0
# Line 1376  if test $KIND = 0 ; then Line 1469  if test $KIND = 0 ; then
1469  else  else
1470      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`      line_0=`printf '%s %2i' 'default   ' $MATCH_CRIT`
1471    if test $KIND = 1 ; then    if test $KIND = 1 ; then
1472      echo "TANGLIN=true" >> $SUMMARY     #echo "TANGLIN=true" >> $SUMMARY
1473        echo "TangLin generated by TAF" >> $SUMMARY
1474      elif test $KIND = 3 ; then
1475        echo "TangLin generated by OpenAD" >> $SUMMARY
1476      elif test $KIND = 2 ; then
1477       #echo "ADJOINT=true" >> $SUMMARY
1478        echo "Adjoint generated by TAF" >> $SUMMARY
1479      else
1480        echo "Adjoint generated by OpenAD" >> $SUMMARY
1481      fi
1482      if test $KIND = 1 -o $KIND = 3 ; then
1483      line_1="G D M    C  T  F"      line_1="G D M    C  T  F"
1484      line_2="e p a R  o  L  D"      line_2="e p a R  o  L  D"
1485    else    else
     echo "ADJOINT=true" >> $SUMMARY  
1486      line_1="G D M    C  A  F"      line_1="G D M    C  A  F"
1487      line_2="e p a R  o  d  D"      line_2="e p a R  o  d  D"
1488    fi    fi
# Line 1420  for dir in $TESTDIRS ; do Line 1522  for dir in $TESTDIRS ; do
1522              rm -f $EXECUTABLE *.bak              rm -f $EXECUTABLE *.bak
1523              rm -f genmake_state genmake_*optfile genmake.log              rm -f genmake_state genmake_*optfile genmake.log
1524              rm -f SIZE.h.mpi genmake.tr_log make.tr_log              rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1525                rm -rf mpi_headers
1526          )          )
1527          if test -d $dir/$rundir/CVS ; then          if test -d $dir/$rundir/CVS ; then
1528              echo -n '  --- dir:' $dir/$rundir ': '              echo -n '  --- dir:' $dir/$rundir ': '
# Line 1504  for dir in $TESTDIRS ; do Line 1607  for dir in $TESTDIRS ; do
1607      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1608      extra_runs=      extra_runs=
1609      if test "x$NORUN" = xf ; then      if test "x$NORUN" = xf ; then
1610          ex_run_dirs=`( cd $dir ; echo $inputdir.* )`          ex_run_dirs=`( cd $dir ; ls -d $inputdir.* 2> /dev/null )`
1611      fi      fi
1612      #echo "ex_run_dirs='$ex_run_dirs'"      #echo "ex_run_dirs='$ex_run_dirs'"
1613      for exd in $ex_run_dirs ; do      for exd in $ex_run_dirs ; do
1614          name=`echo $exd | sed -e "s/$inputdir\.//"`          name=`echo $exd | sed -e "s/$inputdir\.//"`
1615          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1616          outf="$dir/results/$refExOut"          outf="$dir/results/$refExOut"
         #if test -f $outf -a -r $outf ; then  
1617          if test -r $outf -o -r ${outf}.gz ; then          if test -r $outf -o -r ${outf}.gz ; then
1618            if test "x$MULTI_THREAD" = "xt" ; then            if test "x$MULTI_THREAD" = "xt" ; then
1619              if test -r $dir"/"$exd"/eedata.mth" ; then              if test -r $dir"/"$exd"/eedata.mth" ; then
# Line 1573  for dir in $TESTDIRS ; do Line 1675  for dir in $TESTDIRS ; do
1675      #echo "results='$results'"      #echo "results='$results'"
1676    
1677          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
         echo 1>&2  
1678          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1679          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1680    
# Line 1595  for dir in $TESTDIRS ; do Line 1696  for dir in $TESTDIRS ; do
1696              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1697              runmodel $dir/$pfxdir.$ex && run=Y \              runmodel $dir/$pfxdir.$ex && run=Y \
1698              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
1699              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`  
1700              fres="$fres.$ex"              fres=`formatresults $dir.$ex ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
             echo 1>&2  
1701              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1702              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1703              if test "x$POSTCLEAN" = x2 ; then              if test "x$POSTCLEAN" = x2 ; then
# Line 1609  for dir in $TESTDIRS ; do Line 1709  for dir in $TESTDIRS ; do
1709          if test -f $dir/$builddir/Makefile ; then          if test -f $dir/$builddir/Makefile ; then
1710              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/^# //'`
1711              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1712              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state  #           sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1713    # bsd-sed cannot do the above code
1714                cat $dir/$builddir/Makefile | \
1715                    sed -n '/^# executed by:/{N
1716                                              p
1717                                              }' >> $DRESULTS/genmake_state
1718              echo " $mkOpt" >> $DRESULTS/genmake_state              echo " $mkOpt" >> $DRESULTS/genmake_state
1719              if test "x$OPTFILE" = xNONE ; then              if test "x$OPTFILE" = xNONE ; then
1720                  eval $mkOpt                  eval $mkOpt
1721                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\  #               sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1722                          $SUMMARY > tmp.tr_log  #                       $SUMMARY > tmp.tr_log
1723    # bsd-sed requires a newline after "a\":
1724                    sed "/^No \"OPTFILE\" was specified ; genmake2/a\\
1725                             OPTFILE=${OPTFILE}" $SUMMARY > tmp.tr_log
1726                  RETVAL=$?                  RETVAL=$?
1727                  if test "x$RETVAL" = x0 ; then rm -f $SUMMARY                  if test "x$RETVAL" = x0 ; then
1728                          cp tmp.tr_log $SUMMARY                      cp -f tmp.tr_log $SUMMARY
                 else rm -f tmp.tr_log  
1729                  fi                  fi
1730                    rm -f tmp.tr_log
1731              fi              fi
1732              gmkLog=$dir/$builddir/genmake.log              gmkLog=$dir/$builddir/genmake.log
1733              if test -r $gmkLog ; then              if test -r $gmkLog ; then
# Line 1635  for dir in $TESTDIRS ; do Line 1743  for dir in $TESTDIRS ; do
1743                                           >> $DRESULTS/genmake_state                                           >> $DRESULTS/genmake_state
1744                    rm -f tmp.tr_log                    rm -f tmp.tr_log
1745                  fi                  fi
1746                  echo -n "from '$gmkLog', " >> $DRESULTS/genmake_state              fi
1747                  echo "get NETCDF & LAPACK settings:" >> $DRESULTS/genmake_state              gmkLog=$dir/$builddir/genmake_state
1748                  sed -n '/set HAVE_NETCDF=/p' $gmkLog >> $DRESULTS/genmake_state              if test -r $gmkLog ; then
1749                  sed -n '/set HAVE_LAPACK=/p' $gmkLog >> $DRESULTS/genmake_state                  echo -n "from '$gmkLog', "      >> $DRESULTS/genmake_state
1750                    echo "get genmake settings:"    >> $DRESULTS/genmake_state
1751                    sed -n '/^HAVE_/p' $gmkLog | sed 's/^./ &/' \
1752                                                    >> $DRESULTS/genmake_state
1753              fi              fi
1754          fi          fi
1755      fi      fi
# Line 1663  date >> $SUMMARY Line 1774  date >> $SUMMARY
1774  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
1775      echo "No results email was sent."      echo "No results email was sent."
1776  else  else
1777      if test "x$HAVE_MPACK" = xt ; then      if test "x$SENDCMD" != x ; then
1778          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          if [ $verbose -gt 1 ]; then
1779              && gzip $DRESULTS".tar" \             echo " run: $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES"
1780              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES          fi
1781            tar -cf ${SAVDIR}/${DRESULTS}".tar" $DRESULTS > /dev/null 2>&1 \
1782                && gzip ${SAVDIR}/${DRESULTS}".tar" \
1783                && $SENDCMD -s MITgcm-test -m 3555000 ${SAVDIR}/${DRESULTS}".tar.gz" $ADDRESSES
1784          RETVAL=$?          RETVAL=$?
1785          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1786              echo              echo
# Line 1679  else Line 1793  else
1793              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1794              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1795              echo              echo
1796              test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"              test -f ${SAVDIR}/${DRESULTS}".tar" &&  rm -f ${SAVDIR}/${DRESULTS}".tar"
1797              test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"              test -f ${SAVDIR}/${DRESULTS}".tar.gz" &&  rm -f ${SAVDIR}/${DRESULTS}".tar.gz"
1798          fi          fi
1799      fi      fi
1800  fi  fi

Legend:
Removed from v.1.180  
changed lines
  Added in v.1.209

  ViewVC Help
Powered by ViewVC 1.1.22