/[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.30 by edhill, Fri Dec 5 17:46:32 2003 UTC revision 1.83 by jmc, Wed Jul 5 22:39:57 2006 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 "  (-mpi)                   use MPI input files"      echo "  (-mth)                   run multi threaded (using eedata.mth)"
15        echo "  (-mpi)                   compile and run using MPI"
16      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-ieee|-noieee)          if possible, use IEEE compiler flags"
17      echo "                             (DEF=\"noieee\")"      echo "                             (DEF=\"-ieee\")"
18      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-optfile=|-of=)STRING   list of optfiles to use"
19      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-a|-addr) STRING        list of email recipients"
20      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "                             (DEF=\"edhill@mitgcm.org\")"
# Line 27  usage() Line 28  usage()
28      echo "                             (DEF=\"make output.txt\")"      echo "                             (DEF=\"make output.txt\")"
29      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-m|-make) STRING        command to use for \"make\""
30      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
31        echo "  (-odir) STRING           used to build output directory name"
32        echo "                             (DEF=\"hostname\")"
33        echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
34        echo "                             (DEF=\"1 2 3 4 5\")"
35        echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
36      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
37      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
38      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
39      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
40      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
41        echo "  (-deldir|-dd)            on success, delete the output directory"
42      echo      echo
43      echo "and where STRING follows a whitespace-delimited format"      echo "and where STRING can be a whitespace-delimited list"
44      echo "such as:"      echo "such as:"
45        echo
46      echo "  -t 'exp0 exp2 exp3' "      echo "  -t 'exp0 exp2 exp3' "
47      echo "  -addr='abc@123.com testing@home.org'"      echo "  -addr='abc@123.com testing@home.org'"
48      echo      echo
49        echo "provided that the expression is properly quoted within the current"
50        echo "shell (note the use of single quotes to protect white space)."
51        echo
52      exit 1      exit 1
53  }  }
54    
55  #  build the mpack utility  #  build the mpack utility
56  build_mpack()  build_mpack()
57  {  {
58      echo -n "building the mpack utility...  "      printf "building the mpack utility...  "
59      if test ! -x "$MPACKDIR/mpack" ; then      if test ! -x "$MPACKDIR/mpack" ; then
60          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
61              echo              echo
# Line 54  build_mpack() Line 65  build_mpack()
65              echo              echo
66              HAVE_MPACK=f              HAVE_MPACK=f
67          fi          fi
68          echo -n "building mpack...  "          printf "building mpack...  "
69          if test "x$CC" = x ; then          if test "x$CC" = x ; then
70              export CC=cc              export CC=cc
71          fi          fi
# Line 77  build_mpack() Line 88  build_mpack()
88    
89  testoutput_for_prop()  testoutput_for_prop()
90  {  {
91      # testoutput_for_prop dir s1 label subdir      # testoutput_for_prop dir s1 label subdir extension
92      #      #
93      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt
94      #  using search strings s1 and text label      #  using search strings s1 and text label
# Line 87  testoutput_for_prop() Line 98  testoutput_for_prop()
98      fi      fi
99      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/output.txt ]; then
100          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt
101          lncnt=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
102          if [ $lncnt -lt 3 ]; then          if [ $lncntA -lt 3 ]; then
103              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
104                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
105              fi              fi
# Line 99  testoutput_for_prop() Line 110  testoutput_for_prop()
110          return 99          return 99
111      fi      fi
112      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
113          echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2
114      fi      fi
115      grep "$2" $1/results/output.txt | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt
116      lncnt=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
117      if [ $lncnt -lt 3 ]; then      if [ $lncntB -lt 3 ]; then
118          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
119              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
120          fi          fi
121          return 99          return 99
122      fi      fi
123        if [ $lncntA -ne $lncntB ]; then
124            if [ $verbose -gt 0 ]; then
125                echo Not same Nb of lines when searching for "$2" ":" $lncntA $lncntB 1>&2
126            fi
127            return 99
128        fi
129        has_nan=`cat tmp1.txt | grep -i nan | wc -l`
130        if [ $has_nan -gt 0  ] ; then
131            echo testoutput_for_prop: output.txt contains $has_nan NaN values  1>&2
132            return 99
133        fi
134        has_inf=`cat tmp1.txt | grep -i inf | wc -l`
135        if [ $has_inf -gt 0  ] ; then
136            echo testoutput_for_prop: output.txt contains $has_inf Inf values  1>&2
137            return 99
138        fi
139      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
140          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2
141      fi      fi
# Line 155  dashnum() Line 182  dashnum()
182    
183  testoutput_ad()  testoutput_ad()
184  {  {
185      grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt      grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $5}' > t05.txt
186      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt      grep $3 $1/$2/output_adm.txt | awk '{print NR " " $5}' > t15.txt
187      grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt      grep $3 $1/results_ad/output_adm.txt | awk '{print NR " " $6}' > t06.txt
188      grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt      grep $3 $1/$2/output_adm.txt | awk '{print NR " " $6}' > t16.txt
189      join t05.txt t15.txt > t5.txt      join t05.txt t15.txt > t5.txt
190      join t06.txt t16.txt > t6.txt      join t06.txt t16.txt > t6.txt
191      echo "-1" >> t5.txt      echo "-1" >> t5.txt
# Line 169  testoutput_ad() Line 196  testoutput_ad()
196      rm -f t[01][56].txt t[56].txt      rm -f t[01][56].txt t[56].txt
197  }  }
198    
199    check_for_add_mon_output()
200    {
201        # Check for additional types of monitor output
202        if test "x$1" = x ; then
203            return
204        fi
205    
206        for ii in $PTRACERS_NUM ; do
207            eval "HAVE_PTR0"$ii"=f"
208        done
209    
210        ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"
211        ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
212        for ii in $PTRACERS_NUM ; do
213            for jj in $ptr_add ; do
214                name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
215                tst=`grep $name $1 | wc -l | awk '{print $1}'`
216                if test ! "x$tst" = x0 ; then
217                    eval "HAVE_PTR0"$ii"=t"
218                fi
219            done
220            #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'
221        done
222    }
223    
224  testoutput()  testoutput()
225  {  {
226      # testoutput directory subdir      # testoutput directory subdir extension
227      #      #
228      #  test output in "directory"      #  test output in "directory"
229      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
230          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
231              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2
232          fi          fi
233          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2; cg2dres=$?          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2 $3; cg2dres=$?
234          if [ $debug -gt 0 ]; then          if [ $debug -gt 0 ]; then
235              echo testoutput: cg2dres=$cg2dres 1>&2              echo testoutput: cg2dres=$cg2dres 1>&2
236          fi          fi
237          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2; tmin=$?          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2 $3; tmin=$?
238          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2; tmax=$?          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2 $3; tmax=$?
239          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2; tmean=$?          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2 $3; tmean=$?
240          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2; tsd=$?          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2 $3; tsd=$?
241          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2; smin=$?          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2 $3; smin=$?
242          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2; smax=$?          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2 $3; smax=$?
243          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2; smean=$?          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2 $3; smean=$?
244          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2; ssd=$?          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2 $3; ssd=$?
245          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2; umin=$?          testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2 $3; umin=$?
246          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2; umax=$?          testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2 $3; umax=$?
247          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2; umean=$?          testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2 $3; umean=$?
248          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2; usd=$?          testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2 $3; usd=$?
249          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2; vmin=$?          testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2 $3; vmin=$?
250          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2; vmax=$?          testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?
251          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2; vmean=$?          testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?
252          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2; vsd=$?          testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?
253          dashnum $cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd \  
254              $umin $umax $umean $usd $vmin $vmax $vmean $vsd          #  This is for PTRACERS
255            for ii in $PTRACERS_NUM ; do
256                eval `echo "p0"$ii"_min=99"`
257                eval `echo "p0"$ii"_max=99"`
258                eval `echo "p0"$ii"_mean=99"`
259                eval `echo "p0"$ii"_sd=99"`
260                tst=`eval 'echo "$HAVE_PTR0'$ii'"'`
261                #echo 'tst = '$tst
262                if test "x$tst" = xt ; then
263                    a="trcstat_ptracer0"
264                    testoutput_for_prop $1 "$a"$ii"_min"  "p0"$ii"_min"  $2 $3
265                    RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`
266                    testoutput_for_prop $1 "$a"$ii"_max"  "p0"$ii"_max"  $2 $3
267                    RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`
268                    testoutput_for_prop $1 "$a"$ii"_mean" "p0"$ii"_mean" $2 $3
269                    RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`
270                    testoutput_for_prop $1 "$a"$ii"_sd"   "p0"$ii"_sd"   $2 $3
271                    RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`
272                fi
273            done
274    
275            allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"
276            allargs="$allargs $umin $umax $umean $usd $vmin $vmax $vmean $vsd"
277            allargs="$allargs $p01_min $p01_max $p01_mean $p01_sd"
278            allargs="$allargs $p02_min $p02_max $p02_mean $p02_sd"
279            allargs="$allargs $p03_min $p03_max $p03_mean $p03_sd"
280            allargs="$allargs $p04_min $p04_max $p04_mean $p04_sd"
281            allargs="$allargs $p05_min $p05_max $p05_mean $p05_sd"
282    
283            eval "dashnum $allargs"
284    
285      else      else
286          testoutput_ad $1 $2 "precision_grdchk_result"          testoutput_ad $1 $2 "precision_grdchk_result"
287      fi      fi
# Line 211  genmakemodel() Line 293  genmakemodel()
293      if test "x$NOGENMAKE" = xt ; then      if test "x$NOGENMAKE" = xt ; then
294          echo "genmake skipped!"          echo "genmake skipped!"
295      else      else
296          GENMAKE2="$BASH ../../../tools/genmake2"          if test "x$BASH" = x ; then
297                GENMAKE2="../../../tools/genmake2"
298            else
299                GENMAKE2="$BASH ../../../tools/genmake2 -bash $BASH"
300            fi
301          (          (
302              cd $1;              cd $1;
303              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
# Line 219  genmakemodel() Line 305  genmakemodel()
305                  command="$command --mods=../code"                  command="$command --mods=../code"
306              else              else
307                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
                 command="$command -adof=../../../tools/adjoint_options/adjoint_staf"  
308              fi              fi
309              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
310                  command="$command --optfile=$OPTFILE"                  command="$command --optfile=$OPTFILE"
# Line 227  genmakemodel() Line 312  genmakemodel()
312              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
313                  command="$command -ieee"                  command="$command -ieee"
314              fi              fi
315                if test "x$MPI" = xt ; then
316                    command="$command -mpi"
317                fi
318              printf 'genmake ... ' 1>&2              printf 'genmake ... ' 1>&2
319              $command > make.log 2>&1              $command > make.log 2>&1
320              RETVAL=$?              RETVAL=$?
321              cp Makefile $CDIR              #  Reduce the size of the testing emails!
322                head -100 Makefile > $CDIR/Makefile_head
323              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
324                  tail make.log                  tail make.log
325                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed" 1>&2
# Line 247  makeclean() Line 336  makeclean()
336  {  {
337      # makeclean directory      # makeclean directory
338      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
339          echo "make CLEAN skipped!"          echo "make Clean skipped!"
340      else      else
341          (          (
342              cd $1;              cd $1;
343              if test -e output.txt ; then              #if test -e output.txt ; then rm -f output.txt ; fi
                 rm -f output.txt  
             fi  
             printf 'make CLEAN ... ' 2>&1  
344              if test -r Makefile ; then              if test -r Makefile ; then
345                  $MAKE CLEAN >> make.log 2>&1                  printf 'clean build-dir: make Clean ... ' 2>&1
346                    $MAKE Clean >> make.log 2>&1
347                  RETVAL=$?                  RETVAL=$?
348                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
349                      tail make.log                      tail make.log
350                      echo "makeclean: \"make CLEAN\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed" 1>&2
351                      cp make.log $CDIR"/make.log"                      cp make.log $CDIR"/make.log"
352                      return 1                      return 1
353                  fi                  fi
# Line 271  makeclean() Line 358  makeclean()
358      fi      fi
359  }  }
360    
361    run_clean()
362    {
363        # run_clean directory
364        if test "x$NOCLEAN" = xt ; then
365            echo "run_clean skipped!"
366        else
367            (
368                cd $1;
369                printf 'clean run-dir ... ' 2>&1
370                # part of what is done after "make clean" when doing "make CLEAN"
371                find . -name "*.meta" -exec rm {} \;
372                find . -name "*.data" -exec rm {} \;
373                find . -name "fort.*" -exec rm {} \;
374                find . -type l -exec rm {} \;
375                rm -f $EXECUTABLE *.txt STD* *diagnostics.log datetime
376                rm -rf mnc_test_*
377                echo successful 1>&2
378                exit 0
379            )
380        fi
381    }
382    
383  makedependmodel()  makedependmodel()
384  {  {
385      # makedependmodel directory      # makedependmodel directory
# Line 302  makemodel() Line 411  makemodel()
411          if test -r Makefile ; then          if test -r Makefile ; then
412              printf 'make ... ' 1>&2              printf 'make ... ' 1>&2
413              if test "x$ADM" = x ; then              if test "x$ADM" = x ; then
414                  $MAKE >> make.log 2>&1                  if test "x$JOBS" = x ; then
415                        $MAKE >> make.log 2>&1
416                    else
417                        $MAKE -j $JOBS >> make.log 2>&1
418                    fi
419              else              else
420                  $MAKE adall >> make.log 2>&1                  $MAKE adall >> make.log 2>&1
421              fi              fi
# Line 329  symlink_mpifiles() Line 442  symlink_mpifiles()
442      code_dir=$2      code_dir=$2
443      BUILD_DIR=$dir/$3      BUILD_DIR=$dir/$3
444      CODE_DIR=$dir/$code_dir      CODE_DIR=$dir/$code_dir
445        
446      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
447      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`
448    
# Line 344  symlink_mpifiles() Line 457  symlink_mpifiles()
457              RETVAL=$?              RETVAL=$?
458              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
459                  if ! test -f $BUILD_DIR/$i ; then                  if ! test -f $BUILD_DIR/$i ; then
460                  #echo Linking $name to $i                      #echo Linking $name to $i
461                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)                      (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)
462                  fi                  fi
463              fi              fi
464          done          done
465      else      else
466      # NO: We undo any _mpi symbolically linked files          # NO: We undo any _mpi symbolically linked files
467          for ii in $MPI_FILES ; do          for ii in $MPI_FILES ; do
468              i=`echo $ii | sed 's:^\./::'`              i=`echo $ii | sed 's:^\./::'`
469              name=`echo $i | sed 's:_mpi::' `              name=`echo $i | sed 's:_mpi::' `
470              if test -L $BUILD_DIR/$name ; then              if test -L $BUILD_DIR/$name ; then
471                  linktarg=`(cd $BUILD_DIR; readlink $name)`                  cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1
472                  if test $linktarg = "../$code_dir/$name"_mpi ; then                  RETVAL=$?
473                  #echo Un-linking $name from $linktarg                  if test "x$RETVAL" = x0 ; then
474                        #echo Un-linking $name from $linktarg
475                      rm -f $BUILD_DIR/$name                      rm -f $BUILD_DIR/$name
476                  fi                  fi
477              fi              fi
# Line 368  symlink_mpifiles() Line 482  symlink_mpifiles()
482    
483  linkdata()  linkdata()
484  {  {
485      # linkdata flag      # linkdata run_dir input_dir_1 input_dir_2 ...
486      #      #
487      # symbolically link data files to run directory      # symbolically link data files to run directory
488      if test "x$1" = x1 ; then      if test -d $1 ; then
489          (          (
490              cd $2              cd $1 ; shift
491              if test "x$ADM" = x ; then              if test -r "../"$1"/eedata.mth" ; then
492                  files=`( cd ../input ; ls -1 | grep -v CVS )`              # found eedata.mth in 1rst input dir and it is readable
493                  for i in $files ; do                  if test "x$MULTI_THREAD" = "xt" ; then
494                      if test ! -d "../input/"$i ; then                  # multi-threaded test: remove symbolic link & link eedata.mth
495                          ln -sf "../input/"$i $i                      if test -h eedata ; then rm -f eedata ; fi
496                        if test ! -r eedata ; then
497                            ln -sf "../"$1"/eedata.mth" eedata ;
498                            printf 'eedata.mth ' 1>&2
499                      fi                      fi
500                  done                  else
501              else                  # not multi-threaded test: remove eedata symbolic link
502                  files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`                      if test -h eedata ; then rm -f eedata ; fi
503                  for i in $files ; do                  fi
                     if test ! -d "../input/"$i ; then  
                         ln -sf "../input/"$i $i  
                     fi  
                 done  
                 files=`( cd ../input_ad ; ls -1 | grep -v CVS )`  
                 for i in $files ; do  
                     if test ! -d "../input_ad/"$i ; then  
                         ln -sf "../input_ad/"$i $i  
                     fi  
                 done  
504              fi              fi
505                for ldir in $* ; do
506                    if test -d "../"$ldir ; then
507                        printf 'ldir='${ldir} 1>&2
508                        files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
509                        for i in $files ; do
510                            if test ! -d "../"$ldir/$i ; then
511                                if test ! -r $i  ; then
512                                    printf ' '$i 1>&2
513                                    ln -sf "../"$ldir"/"$i $i
514                                fi
515                            fi
516                        done
517                        if test -x "../"$ldir"/"prepare_run ; then
518                            "../"$ldir"/"prepare_run
519                        fi
520                        printf ' ; ' 1>&2
521                    fi
522                done
523          )          )
524      fi      fi
525  }  }
# Line 407  runmodel() Line 532  runmodel()
532      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
533      (      (
534          cd $1          cd $1
535          printf 'runmodel ... ' 1>&2          printf 'runmodel in %s ...' $1 1>&2
536          # make output.txt          # make output.txt
537          $COMMAND >> run.log 2>&1          echo
538          RETVAL=$?          rm -f run.log
539          if test "x$RETVAL" = x0 ; then          if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
540              echo successful 1>&2              echo " link" $EXECUTABLE "from dir ../"$builddir > run.log
541              if test "x$ADM" = x ; then              ln -sf "../"$builddir"/"$EXECUTABLE .
542                  cp output.txt $CDIR"/output.txt"          else
543                touch run.log
544            fi
545            if test ! -x $EXECUTABLE ; then
546                    echo " no executable:" $EXECUTABLE >> run.log
547                    RETVAL=8
548            else
549                if test $OUTPUTFILE -ot $EXECUTABLE ; then
550                    ( eval $COMMAND ) >> run.log 2>&1
551                    RETVAL=$?
552              else              else
553                  cp output.txt_adm $CDIR"/output.txt_adm"                  echo " $OUTPUTFILE is up to date " >> run.log 2>&1
554                    RETVAL=0
555              fi              fi
556            fi
557            # echo "COMMAND='$COMMAND'"
558            # echo "pwd='"`pwd`"'"
559            if test "x$RETVAL" = x0 ; then
560                tail run.log
561                echo successful 1>&2
562                # === Reduce the size of the testing emails!
563                # if test "x$ADM" = x ; then
564                #   cp output.txt $CDIR"/output.txt"
565                # else
566                #   cp output_adm.txt $CDIR"/output_adm.txt"
567                # fi
568                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
569              return 0              return 0
570          else          else
571              tail run.log              tail run.log
572              echo failed 1>&2              echo failed 1>&2
573              cp run.log $CDIR"/run.log"              cp run.log $CDIR"/run.log"
574                if test -s STDERR.0000 ; then cp STDERR.0000 $CDIR"/STDERR.0000" ; fi
575              return 1              return 1
576          fi          fi
577      )      )
# Line 432  createcodelet() Line 581  createcodelet()
581  {  {
582      # create codelet for comparing model output      # create codelet for comparing model output
583    
584      echo -n "creating the comparison code...  "      printf "creating the comparison code...  "
585      cat > tmp_cmpnum.c <<EOF      cat > tmp_cmpnum.c <<EOF
586  #include <stdio.h>  #include <stdio.h>
587  #include <math.h>  #include <math.h>
588  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
589    int linnum,best;    int linnum,best,lncnt;
590    double a,b,diff;    double a,b,abave,relerr;
591    best = -16;    best = -22;
592    while( 1 )  {    lncnt = 0;
593      while( 1 & (lncnt+=1) < 999 )  {
594      scanf("%d", &linnum);      scanf("%d", &linnum);
595      if (linnum == -1)  break;      if (linnum == -1)  break;
596      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
597      diff = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
598      if (diff > 1.e-12) {      if (abave > 0.0) {
599        diff=fabs(a-b)/diff;        relerr=fabs(a-b)/abave;
600        if (diff > 0.0) {        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }
601          linnum = (int)log10(diff);        else { linnum = -16 ; }
602          best = (best > linnum) ? best : linnum;        best = (best > linnum) ? best : linnum;
       }  
       else {  
         if (best == -16 && diff != 0)  best = -22;  
       }  
603      }      }
604    }    }
605      if (lncnt == 999) best=-29;
606    printf("%d\n", -best);    printf("%d\n", -best);
607    return 0;    return 0;
608  }  }
609  EOF  EOF
610      cc -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tmp_cmpnum tmp_cmpnum.c -lm
611    
612      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tmp_cmpnum ]; then
613          echo "OK"          echo "OK"
614          return 0          return 0
615      else      else
616          echo          echo
617          echo "ERROR: failed to compile comparison code"          echo "ERROR: failed to compile comparison code -- please specify"
618            echo "  a C compiler using the CC environment variable."
619          exit 1          exit 1
620      fi      fi
621  }  }
# Line 516  EOF Line 664  EOF
664    
665  scandirs()  scandirs()
666  {  {
667      if [ $# -eq 0 ]; then      if [ $# -eq 1 ]; then
668          for arg in * ; do          for arg in * ; do
669              test -d $arg/input && echo $arg              test -d $arg/$1 && echo $arg
670          done          done
671      else      else
672          echo $*          echo $*
673      fi      fi
674  }  }
675    
# Line 536  clean=0 Line 684  clean=0
684  expts=''  expts=''
685  # ieee=1  # ieee=1
686    
687  IEEE=  IEEE=true
688  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
689      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
690  fi  fi
# Line 547  QUICK=f Line 695  QUICK=f
695  NOGENMAKE=f  NOGENMAKE=f
696  NOCLEAN=f  NOCLEAN=f
697  NODEPEND=f  NODEPEND=f
698    POSTCLEAN=f
699    
700  BASH=  BASH=
701  OPTFILE=NONE  OPTFILE=NONE
# Line 556  MPACKDIR="../tools/mpack-1.6" Line 705  MPACKDIR="../tools/mpack-1.6"
705  HAVE_MPACK=  HAVE_MPACK=
706  MPACK="$MPACKDIR/mpack"  MPACK="$MPACKDIR/mpack"
707  COMMAND=  COMMAND=
708  MAKE=make  if test "x$MAKE" = x ; then
709        MAKE=make
710    fi
711    if test "x$CC" = x ; then
712        CC=cc
713    fi
714    JOBS=
715  MPI=f  MPI=f
716    MULTI_THREAD=f
717    OUTDIR=
718    DELDIR=
719    
720  ADM=  ADM=
721    
722  echo -n "parsing options...  "  # Additional monitor types
723    PTRACERS_NUM="1 2 3 4 5"
724    
725    printf "parsing options...  "
726    
727  ac_prev=  ac_prev=
728  for ac_option ; do  for ac_option ; do
# Line 610  for ac_option ; do Line 771  for ac_option ; do
771          -make=* | --make=*)          -make=* | --make=*)
772              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
773    
774            -odir | --odir)
775                ac_prev=OUTDIR ;;
776            -odir=* | --odir=*)
777                OUTDIR=$ac_optarg ;;
778    
779            -ptracers | --ptracers | -ptr | --ptr)
780                ac_prev=PTRACERS_NUM ;;
781            -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)
782                PTRACERS_NUM=$ac_optarg ;;
783    
784            -j) ac_prev=JOBS ;;
785            -j=*) JOBS=$ac_optarg ;;
786    
787          -clean | --clean)          -clean | --clean)
788              CLEANUP=t ;;              CLEANUP=t ; DELDIR=t ;;
789    
790          -quick | --quick | -q | --q)          -quick | --quick | -q | --q)
791              QUICK=t ;;              QUICK=t ;;
# Line 622  for ac_option ; do Line 796  for ac_option ; do
796          -nodepend | --nodepend | -nd | --nd)          -nodepend | --nodepend | -nd | --nd)
797              NODEPEND=t ;;              NODEPEND=t ;;
798    
799            -postclean | --postclean | -pc | --pc)
800                POSTCLEAN=t ;;
801    
802          -mpi) MPI=t ;;          -mpi) MPI=t ;;
803    
804            -mth) MULTI_THREAD=t ;;
805    
806          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
807    
808          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
# Line 633  for ac_option ; do Line 812  for ac_option ; do
812          -debug) debug=1 ;;          -debug) debug=1 ;;
813          -quiet) verbose=0 ;;          -quiet) verbose=0 ;;
814    
815            -deldir | -dd) DELDIR=t ;;
816    
817          -*)          -*)
818              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
819              usage              usage
# Line 654  if test "x$QUICK" = xt ; then Line 835  if test "x$QUICK" = xt ; then
835  fi  fi
836    
837  if test "x$TESTDIRS" = x ; then  if test "x$TESTDIRS" = x ; then
838      TESTDIRS=`scandirs`      if test "x$ADM" = xt ; then
839            TESTDIRS=`scandirs results_ad`
840        else
841            TESTDIRS=`scandirs results`
842        fi
843  fi  fi
844    
845  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
846      OPTFILE=$MITGCM_OF      OPTFILE=$MITGCM_OF
847  fi  fi
848    
849    if test "x$ADM" = xt ; then
850        EXECUTABLE="mitgcmuv_ad"
851        OUTPUTFILE="output_adm.txt"
852    else
853        EXECUTABLE="mitgcmuv"
854        OUTPUTFILE="output.txt"
855    fi
856    
857  if test "x$ADM" = xt -a "x$COMMAND" = x ; then  if test "x$ADM" = xt -a "x$COMMAND" = x ; then
858      COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
859  fi  fi
860    
861  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
862      COMMAND="make output.txt"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
863  fi  fi
864    
865  echo "OK"  #echo "OK"
866    echo "OK (COMMAND= $COMMAND )"
867    
868  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
869  createcodelet  createcodelet
870    
871  #  build the mpack utility  #  build the mpack utility
872  build_mpack  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then
873        echo "skipping mpack build"
874    else
875        build_mpack
876    fi
877    
878  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
879  MACH=`hostname`  MACH=`hostname`
880  UNAMEA=`uname -a`  UNAMEA=`uname -a`
881  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
882  BASE="tr_"$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
883    if test "x$OUTDIR" != x ; then
884        BASE="tr_"$OUTDIR"_"$DATE"_"
885    fi
886  DNUM=0  DNUM=0
887  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
888  while test -e $DRESULTS ; do  while test -e $DRESULTS ; do
# Line 695  if test "x$RETVAL" != x0 ; then Line 896  if test "x$RETVAL" != x0 ; then
896      exit 1      exit 1
897  fi  fi
898  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
899  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
900  start_date=`date`  start_date=`date`
901  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
902    
# Line 727  fi Line 928  fi
928  echo  echo
929  echo >> $SUMMARY  echo >> $SUMMARY
930  if test "x$ADM" = x ; then  if test "x$ADM" = x ; then
931      cat << EOF | tee -a $SUMMARY      line_0="            ----T-----  ----S-----  ----U-----  ----V-----"
932                  T           S           U           V      line_1="G D M    c        m  s        m  s        m  s        m  s"
933  G D M    c        m  s        m  s        m  s        m  s      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
934  E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  .      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
935  N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
936  2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  .      for ii in $PTRACERS_NUM ; do
937            #  tst=`eval 'echo $HAVE_PTR0'$ii`
938  EOF          #  if test "x$tst" = xt ; then
939            line_0="$line_0  --PTR 0"$ii"--"
940            line_1="$line_1        m  s"
941            line_2="$line_2  m  m  e  ."
942            line_3="$line_3  i  a  a  d"
943            line_4="$line_4  n  x  n  ."
944            #  fi
945        done
946        echo "$line_0" | tee -a $SUMMARY
947        echo "$line_1" | tee -a $SUMMARY
948        echo "$line_2" | tee -a $SUMMARY
949        echo "$line_3" | tee -a $SUMMARY
950        echo "$line_4" | tee -a $SUMMARY
951        echo " "       | tee -a $SUMMARY
952  else  else
953      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
954      echo >> $SUMMARY      echo >> $SUMMARY
# Line 753  for dir in $TESTDIRS ; do Line 967  for dir in $TESTDIRS ; do
967      #  Cleanup only!      #  Cleanup only!
968      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
969          if test -r $dir/build/Makefile ; then          if test -r $dir/build/Makefile ; then
970                echo '  ------  clean dir:' $dir/build
971              ( cd $dir/build ; make CLEAN )              ( cd $dir/build ; make CLEAN )
972          fi          fi
973          if test -r $dir/input/Makefile ; then          if test -d $dir/run/CVS ; then
974              ( cd $dir/input ; make CLEAN )              echo '  ------  clean dir:' $dir/run
975                run_clean $dir/run
976          fi          fi
977            (
978                cd $dir
979                rm -rf tr_run.*
980            )
981          continue          continue
982      fi      fi
983    
# Line 767  for dir in $TESTDIRS ; do Line 987  for dir in $TESTDIRS ; do
987      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
988          fout=$dir"/results/output.txt"          fout=$dir"/results/output.txt"
989      else      else
990          fout=$dir"/results_ad/output.txt_adm"          fout=$dir"/results_ad/output_adm.txt"
991      fi      fi
992      if test ! -r $fout ; then      if test ! -r $fout ; then
993          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
994          continue          continue
995      fi      fi
996        if test "x$ADM" = x ; then
997            check_for_add_mon_output  $fout
998        fi
999    
1000        # Check for additional types of monitor output
1001    
1002      builddir="input"      builddir="build"
1003      rundir="input"      if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1004      use_seperate_build=0      rundir="run"
1005      if test -d $dir/build -a -r $dir/build ; then     #rundir=$builddir
1006          builddir="build"      if test ! -d $dir/$rundir ; then
1007          rundir="build"          rundir=$builddir
         use_seperate_build=1  
         linkdata $use_seperate_build $dir/$rundir  
1008      fi      fi
1009            
1010      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1011          code_dir=code          code_dir=code
1012          CODE_DIR=$dir/code          CODE_DIR=$dir/code
1013            input_dirs='input'
1014      else      else
1015          code_dir=code_ad          code_dir=code_ad
1016          CODE_DIR=$dir/code_ad          CODE_DIR=$dir/code_ad
1017            input_dirs='input_ad input'
1018      fi      fi
1019      BUILD_DIR=$dir/$builddir      BUILD_DIR=$dir/$builddir
1020    
# Line 797  for dir in $TESTDIRS ; do Line 1022  for dir in $TESTDIRS ; do
1022          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"          echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1023          continue          continue
1024      fi      fi
1025        if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1026            echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1027            continue
1028        fi
1029    
1030        #  Check whether there are "extra runs" for this testdir
1031        extra_runs=
1032        if test "x$ADM" = x ; then
1033            ex_run_dirs=`( cd $dir ; echo input.* )`
1034            #echo "ex_run_dirs='$ex_run_dirs'"
1035            for exd in $ex_run_dirs ; do
1036                name=`echo $exd | sed -e 's/input.//g'`
1037                outf="$dir/results/output.txt.$name"
1038                if test -f $outf -a -r $outf ; then
1039                    if test "x$MULTI_THREAD" = "xt" ; then
1040                        if test -r $dir"/"$exd"/eedata.mth" ; then
1041                            extra_runs="$extra_runs $name"
1042                        #else echo $dir"/"$exd"/eedata.mth: not found"
1043                        fi
1044                    else
1045                        extra_runs="$extra_runs $name"
1046                    fi
1047                fi
1048            done
1049        fi
1050    
1051      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1052      echo      echo
1053      echo "Experiment:  $dir"      if test "x$extra_runs" = "x" ; then
1054           echo "Experiment:  $dir"
1055        else
1056           echo "Experiment:  $dir ; extra_runs=$extra_runs"
1057        fi
1058      echo      echo
1059      unset genmake makedepend make run      unset genmake makedepend make run
1060      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
1061    
1062      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
1063      rel_CDIR=$DRESULTS"/"$dir      rel_CDIR=$DRESULTS"/"$dir
# Line 811  for dir in $TESTDIRS ; do Line 1065  for dir in $TESTDIRS ; do
1065      CDIR=`pwd`"/$rel_CDIR"      CDIR=`pwd`"/$rel_CDIR"
1066            
1067      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1068          makeclean $dir/$builddir          echo '====>>> this is to check that we never go through this part <<< ==='
1069            makeclean $dir/$builddir \
1070                && run_clean $dir/$rundir
1071      else      else
1072          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1073              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
1074                && run_clean $dir/$rundir \
1075              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1076              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1077              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1078              && linkdata $use_seperate_build $dir/$rundir \              && linkdata $dir/$rundir $input_dirs \
1079              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1080              && results=`testoutput $dir $rundir`              && results=`testoutput $dir $rundir`
1081      fi      fi
# Line 826  for dir in $TESTDIRS ; do Line 1083  for dir in $TESTDIRS ; do
1083      echo      echo
1084      if test "x$ADM" = x ; then      if test "x$ADM" = x ; then
1085          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1086            echo
1087            echo "$fres" >> $SUMMARY
1088            echo "fresults='$fres'" > $CDIR"/summary.txt"
1089            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1090            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1091            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1092            echo "tdir='$dir'" >> $CDIR"/summary.txt"
1093    
1094            for ex in $extra_runs ; do
1095                unset run
1096                results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
1097                #  Create an output dir for each OPTFILE/tdir.ex combination
1098                rel_CDIR=$DRESULTS"/"$dir"."$ex
1099                mkdir $rel_CDIR
1100                CDIR=`pwd`"/$rel_CDIR"
1101                test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"
1102                run_clean $dir/tr_run.$ex
1103                linkdata $dir/tr_run.$ex input.$ex input
1104                runmodel $dir/tr_run.$ex && run=Y \
1105                    && results=`testoutput $dir tr_run.$ex "."$ex`
1106                fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
1107                fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1108                fres="$fres.$ex"
1109                echo
1110                echo "$fres" >> $SUMMARY
1111                echo "fresults='$fres'" > $CDIR"/summary.txt"
1112                echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1113                echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1114                echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1115                echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"
1116                if test "x$POSTCLEAN" = xt ; then
1117                    run_clean $dir/tr_run.$ex
1118                fi
1119            done
1120      else      else
1121          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`
1122          fres=$fres"$results   $dir"          fres=$fres"$results   $dir"
1123            echo
1124            echo "$fres" >> $SUMMARY
1125            echo "fresults='$fres'" > $CDIR"/summary.txt"
1126            echo "MACH='$MACH'" >> $CDIR"/summary.txt"
1127            echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"
1128            echo "DATE='$DATE'" >> $CDIR"/summary.txt"
1129            echo "tdir='$dir'" >> $CDIR"/summary.txt"
1130            grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1131                               >> $CDIR"/summary.txt"
1132        fi
1133    
1134        #postclean $dir/$builddir
1135        if test "x$POSTCLEAN" = xt ; then
1136            makeclean $dir/$builddir \
1137                && run_clean $dir/$rundir
1138      fi      fi
     echo  
     echo "$fres" >> $SUMMARY  
     echo "fresults='$fres'" > $CDIR"/summary.txt"  
     echo "MACH='$MACH'" >> $CDIR"/summary.txt"  
     echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"  
     echo "DATE='$DATE'" >> $CDIR"/summary.txt"  
     echo "tdir='$dir'" >> $CDIR"/summary.txt"  
1139            
1140      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1141            
1142  done  done
1143    
1144  echo -n "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
1145  echo $start_date >> $SUMMARY  echo $start_date >> $SUMMARY
1146  echo -n "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
1147  date >> $SUMMARY  date >> $SUMMARY
1148    
1149  #  If addresses were supplied and mpack built successfully, then try  #  If addresses were supplied and mpack built successfully, then try
# Line 855  else Line 1154  else
1154      if test "x$HAVE_MPACK" = xt ; then      if test "x$HAVE_MPACK" = xt ; then
1155          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \          tar -cf $DRESULTS".tar" $DRESULTS > /dev/null 2>&1 \
1156              && gzip $DRESULTS".tar" \              && gzip $DRESULTS".tar" \
1157              && $MPACK -s MITgcm-test -m 1500000 $DRESULTS".tar.gz" $ADDRESSES              && $MPACK -s MITgcm-test -m 3555000 $DRESULTS".tar.gz" $ADDRESSES
1158          RETVAL=$?          RETVAL=$?
1159          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
1160              echo              echo
# Line 878  fi Line 1177  fi
1177  rm -f tmp_cmpnum.c tmp_cmpnum  rm -f tmp_cmpnum.c tmp_cmpnum
1178    
1179  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1180      cat $SUMMARY      cat $SUMMARY | sed 's/ -- -- -- --//g'
1181      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1182          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1183      fi      fi
1184      cat $SUMMARY > tr_out.txt      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt
1185    fi
1186    
1187    if test "x$DELDIR" = xt ; then
1188        rm -rf $DRESULTS
1189  fi  fi
1190    

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.83

  ViewVC Help
Powered by ViewVC 1.1.22