/[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.77 by jmc, Mon Mar 20 21:50:36 2006 UTC revision 1.154 by jmc, Fri Jan 14 23:55:00 2011 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 "  (-ieee|-noieee)          if possible, use IEEE compiler flags"      echo "  (-mpi)                   use MPI to compile and run on 2 processors"
16        echo "  (-MPI)  NUMBER           use MPI to compile and run on max NUMBER procs"
17        echo "  (-ieee/-noieee)          if possible, use IEEE compiler flags"
18      echo "                             (DEF=\"-ieee\")"      echo "                             (DEF=\"-ieee\")"
19      echo "  (-optfile=|-of=)STRING   list of optfiles to use"      echo "  (-gsl)                   compile with \"-gsl\" flag"
20      echo "  (-a|-addr) STRING        list of email recipients"      echo "  (-use_r4|-ur4)           if allowed, use real*4 type for '_RS' variable"
21      echo "                             (DEF=\"edhill@mitgcm.org\")"      echo "  (-optfile|-of) STRING    list of optfiles to use"
22      echo "  (-t|-tdir) STRING        list of test dirs to use"      echo "  (-addr|-a) STRING        list of email recipients"
23      echo "                             (DEF=\"\" which builds all)"      echo "                             (DEF=\"\" no email is sent)"
24      echo "  (-b|-bash) STRING        preferred location of a \"bash\" or"      echo "  (-mpackdir|-mpd) DIR     location of the mpack utility"
25        echo "                             (DEF=\"../tools/mpack-1.6\")"
26        echo "  (-tdir|-t) STRING        list of group and/or exp. dirs to test"
27        echo "                             (recognized groups: basic, tutorials)"
28        echo "                             (DEF=\"\" which test all)"
29        echo "                             (if list= 'start_from THIS_EXP' then"
30        echo "                              test THIS_EXP + all the following)"
31        echo "  (-skipdir|-skd) STRING   list of exp. dirs to skip"
32        echo "                             (DEF=\"\" which test all)"
33        echo "  (-bash|-b) STRING        preferred location of a \"bash\" or"
34      echo "                             Bourne-compatible \"sh\" shell"      echo "                             Bourne-compatible \"sh\" shell"
35      echo "                             (DEF=\"\" for \"bash\")"      echo "                             (DEF=\"\" for \"bash\")"
36      echo "  (-adm|-ad)               perform an adjoint run"      echo "  (-adm|-ad)               perform an adjoint run"
37      echo "  (-command) STRING        command to run"      echo "  (-oad)                   perform an OpenAD adjoint run"
38      echo "                             (DEF=\"make output.txt\")"      echo "  (-command|-c) STRING     command to run"
39      echo "  (-m|-make) STRING        command to use for \"make\""      echo "  (-makedepend|-md) STRING command to use for \"makedepend\""
40        echo "  (-make|-m) STRING        command to use for \"make\""
41      echo "                             (DEF=\"make\")"      echo "                             (DEF=\"make\")"
42      echo "  (-odir) STRING           used to build output directory name"      echo "  (-odir) STRING           used to build output directory name"
43      echo "                             (DEF=\"hostname\")"      echo "                             (DEF=\"hostname\")"
44      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"      echo "  (-ptracers|-ptr) STRING  specify which ptracers to test"
45      echo "                             (DEF=\"1 2 3 4 5\")"      echo "                             (DEF=\"1 2 3 4 5\")"
46        echo "  (-match) NUMBER          Matching Criteria (number of digits)"
47        echo "                             (DEF=\"$MATCH_CRIT\")"
48      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"      echo "  (-j) JOBS                use \"make -j JOBS\" for parallel builds"
49      echo "  (-clean)                 *ONLY* run \"make CLEAN\""      echo "  (-clean)                 *ONLY* run \"make CLEAN\""
50        echo "  (-norun|-nr)             skip the \"runmodel\" stage (stop after make)"
51        echo "  (-runonly|-ro)           *ONLY* run stage (=\"-quick\" without make)"
52      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""      echo "  (-quick|-q)              same as \"-nogenmake -noclean -nodepend\""
53      echo "  (-nogenmake|-ng)         skip the genmake stage"      echo "  (-nogenmake|-ng)         skip the genmake stage"
54      echo "  (-noclean|-nc)           skip the \"make clean\" stage"      echo "  (-noclean|-nc)           skip the \"make clean\" stage"
55      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"      echo "  (-nodepend|-nd)          skip the \"make depend\" stage"
56      echo "  (-deldir|-dd)            on success, delete the output directory"      echo "  (-deldir|-dd)            on success, delete the output directory"
57        echo "  (-ts)                    provide timing information per timestep"
58        echo "  (-papis)                 provide MFlop/s per timestep using PAPI"
59        echo "  (-pcls)                  provide MFlop/s per timestep using PCL"
60      echo      echo
61      echo "and where STRING can be a whitespace-delimited list"      echo "and where STRING can be a whitespace-delimited list"
62      echo "such as:"      echo "such as:"
# Line 55  usage() Line 74  usage()
74  build_mpack()  build_mpack()
75  {  {
76      printf "building the mpack utility...  "      printf "building the mpack utility...  "
77      if test ! -x "$MPACKDIR/mpack" ; then      MPACK="$MPACKDIR/mpack"
78        if test ! -x $MPACK ; then
79          if test ! -d $MPACKDIR ; then          if test ! -d $MPACKDIR ; then
80              echo              echo
81              echo "Error: can't find \"$MPACKDIR\""              echo "Error: can't find \"$MPACKDIR\""
# Line 64  build_mpack() Line 84  build_mpack()
84              echo              echo
85              HAVE_MPACK=f              HAVE_MPACK=f
86          fi          fi
         printf "building mpack...  "  
87          if test "x$CC" = x ; then          if test "x$CC" = x ; then
88              export CC=cc              export CC=cc
89          fi          fi
90            printf "building mpack (using CC=$CC)...  "
91          ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1          ( cd $MPACKDIR && ./configure && $MAKE ) > tr_build_mpack.out 2>&1
92          RETVAL=$?          RETVAL=$?
93          if test "x$RETVAL" != x0 ; then          if test "x$RETVAL" != x0 ; then
# Line 78  build_mpack() Line 98  build_mpack()
98          else          else
99              rm -f tr_build_mpack.out              rm -f tr_build_mpack.out
100              HAVE_MPACK=t              HAVE_MPACK=t
101                echo "done"
102          fi          fi
103      else      else
104          HAVE_MPACK=t          HAVE_MPACK=t
105            echo "already exist"
106      fi      fi
     echo "OK"  
107  }  }
108    
109  testoutput_for_prop()  testoutput_var()
110  {  {
111      # testoutput_for_prop dir s1 label subdir extension      # testoutput_var dir s1 label subdir reference_output
112      #      #
113      #  compares files in $dir/$subdir/output.txt and $dir/results/output.txt      #  compares 1 variable output selected from file $dir/$subdir/$OUTPUTFILE
114      #  using search strings s1 and text label      #     with same output from reference file $dir/results/$reference_output
115        #  using search strings s1 and text label
116    
117      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
118          echo testoutput_for_prop: grep "$2" $1/$4/output.txt 1>&2          echo testoutput_var: grep "$2" $1/$4/$OUTPUTFILE 1>&2
119      fi      fi
120      if [ -r $1/$4/output.txt ]; then      if [ -r $1/$4/$OUTPUTFILE ]; then
121          grep "$2" $1/$4/output.txt | sed 's/.*=//' | cat -n > tmp1.txt          grep "$2" $1/$4/$OUTPUTFILE | sed 's/.*=//' | cat -n > tmp1.txt
122          lncntA=`wc -l tmp1.txt | awk '{print $1}' `          lncntA=`wc -l tmp1.txt | awk '{print $1}' `
123          if [ $lncntA -lt 3 ]; then          if [ $lncntA -lt 2 ]; then
124              if [ $verbose -gt 0 ]; then              if [ $verbose -gt 0 ]; then
125                  echo Not enough lines of output when searching for "$2" 1>&2                  echo Not enough lines of output when searching for "$2" 1>&2
126              fi              fi
127              return 99              return 99
128          fi          fi
129      else      else
130          echo testoutput_for_prop: output.txt from model run was not readable 1>&2          echo testoutput_var: $OUTPUTFILE from model run was not readable 1>&2
131          return 99          return 99
132      fi      fi
133      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
134          echo testoutput_for_prop: grep "$2" $1/results/output.txt$5 1>&2          echo testoutput_var: grep "$2" $1/results/$5 1>&2
135      fi      fi
136      grep "$2" $1/results/output.txt$5 | sed 's/.*=//' | cat -n > tmp2.txt      grep "$2" $1/results/$5 | sed 's/.*=//' | cat -n > tmp2.txt
137      lncntB=`wc -l tmp2.txt | awk '{print $1}' `      lncntB=`wc -l tmp2.txt | awk '{print $1}' `
138      if [ $lncntB -lt 3 ]; then      if [ $lncntB -lt 2 ]; then
139          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
140              echo Not enough lines of output when searching for "$2" 1>&2              echo Not enough lines of output when searching for "$2" 1>&2
141          fi          fi
# Line 127  testoutput_for_prop() Line 149  testoutput_for_prop()
149      fi      fi
150      has_nan=`cat tmp1.txt | grep -i nan | wc -l`      has_nan=`cat tmp1.txt | grep -i nan | wc -l`
151      if [ $has_nan -gt 0  ] ; then      if [ $has_nan -gt 0  ] ; then
152          echo testoutput_for_prop: output.txt contains $has_nan NaN values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_nan NaN values  1>&2
153          return 99          return 99
154      fi      fi
155      has_inf=`cat tmp1.txt | grep -i inf | wc -l`      has_inf=`cat tmp1.txt | grep -i inf | wc -l`
156      if [ $has_inf -gt 0  ] ; then      if [ $has_inf -gt 0  ] ; then
157          echo testoutput_for_prop: output.txt contains $has_inf Inf values  1>&2          echo testoutput_var: $OUTPUTFILE contains $has_inf Inf values  1>&2
158          return 99          return 99
159      fi      fi
160      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
161          echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2          echo testoutput_var: join tmp1.txt tmp2.txt 1>&2
162      fi      fi
163      join tmp1.txt tmp2.txt | awk '{print $1 " " $2 " " $3}' > tmp3.txt      join tmp1.txt tmp2.txt | awk '{print $1 " " $2 " " $3}' > tmp3.txt
164      if [ $debug -gt 0 ]; then      if [ $debug -gt 0 ]; then
165          echo testoutput_for_prop: compare_lines 1>&2          echo testoutput_var: compare_lines 1>&2
166      fi      fi
167      if [ $verbose -gt 1 ]; then      if [ $verbose -gt 1 ]; then
168          cat tmp3.txt 1>&2          cat tmp3.txt 1>&2
# Line 148  testoutput_for_prop() Line 170  testoutput_for_prop()
170      echo "-1" >> tmp3.txt      echo "-1" >> tmp3.txt
171      # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number      # On the SGI O3K (*not* the O2K), "cat -n" inserts a ":" after the line number
172      cat tmp3.txt | sed -e 's|:||g' > tmp4.txt      cat tmp3.txt | sed -e 's|:||g' > tmp4.txt
173      digits_of_similarity=`./tmp_cmpnum < tmp4.txt`      digits_of_similarity=`./tr_cmpnum < tmp4.txt`
174      if [ $digits_of_similarity -eq 99 ]; then      if [ $digits_of_similarity -eq 99 ]; then
175          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
176              echo testoutput_for_prop: No comparison was available for \"$2\" 1>&2              echo testoutput_var: No comparison was available for \"$3\" 1>&2
177          fi          fi
178          digits_of_similarity=99          digits_of_similarity=99
179      else      else
180          if [ $verbose -gt 0 ]; then          if [ $verbose -gt 0 ]; then
181              echo There were $digits_of_similarity decimal places of similarity for \"$2\" 1>&2              echo There were $digits_of_similarity decimal places of similarity for \"$3\" 1>&2
182          fi          fi
183      fi      fi
184      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt      rm -f tmp1.txt tmp2.txt tmp3.txt tmp4.txt
       
     return $digits_of_similarity  
 }  
   
 dashnum()  
 {  
     # dashnum n1 n2 n3 ...  
     #  
     #  print numbers using %3i format or "--" if number = 99  
   
     for num in $@ ; do  
         if [ $num = 99 ]; then  
             printf ' --'  
         else  
             printf '%3i' $num  
         fi  
     done  
 }  
   
 testoutput_ad()  
 {  
     grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $5}' > t05.txt  
     grep $3 $1/$2/output.txt_adm | awk '{print NR " " $5}' > t15.txt  
     grep $3 $1/results_ad/output.txt_adm | awk '{print NR " " $6}' > t06.txt  
     grep $3 $1/$2/output.txt_adm | awk '{print NR " " $6}' > t16.txt  
     join t05.txt t15.txt > t5.txt  
     join t06.txt t16.txt > t6.txt  
     echo "-1" >> t5.txt  
     echo "-1" >> t6.txt  
     digits_5=`./tmp_cmpnum < t5.txt`  
     digits_6=`./tmp_cmpnum < t6.txt`  
     dashnum $digits_5 $digits_6  
     rm -f t[01][56].txt t[56].txt  
 }  
   
 check_for_add_mon_output()  
 {  
     # Check for additional types of monitor output  
     if test "x$1" = x ; then  
         return  
     fi  
   
     for ii in $PTRACERS_NUM ; do  
         eval "HAVE_PTR0"$ii"=f"  
     done  
185    
186      ptr_add="trcstat_ptracerXX_min trcstat_ptracerXX_max"      return $digits_of_similarity
     ptr_add="$ptr_add trcstat_ptracerXX_mean trcstat_ptracerXX_sd"  
     for ii in $PTRACERS_NUM ; do  
         for jj in $ptr_add ; do  
             name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`  
             tst=`grep $name $1 | wc -l | awk '{print $1}'`  
             if test ! "x$tst" = x0 ; then  
                 eval "HAVE_PTR0"$ii"=t"  
             fi  
         done  
         #  eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"'  
     done  
187  }  }
188    
189  testoutput()  testoutput_run()
190  {  {
191      # testoutput directory subdir extension      # testoutput_run directory subdir reference_output
192      #      #
193      #  test output in "directory"      #  test output from 1 run in "directory"
194      if test "x$ADM" = x ; then  # --> same processing for adjoint & forward test
195          if [ $debug -gt 0 ]; then          # default list of output variables to be checked:
196              echo testoutput: testoutput_for_prop $1 cg2d_init_res 1>&2          #  1rst : main variable used to decide if it pass or FAIL
197          fi          #  others : number of matching digits to be printed in summary.txt
198          testoutput_for_prop $1 "cg2d_init_res" "cg2d init. residual" $2 $3; cg2dres=$?          listChk=$DEF_CHECK_LIST
199          if [ $debug -gt 0 ]; then          #  load experiment-specific list from file "tr_checklist" (if it exist)
200              echo testoutput: cg2dres=$cg2dres 1>&2          if test -r $1/$2/tr_checklist ; then listChk=`cat $1/$2/tr_checklist` ; fi
201          fi          sVar=`echo $listChk | awk '{print $1}'`
202          testoutput_for_prop $1 "dynstat_theta_min" "theta minimum" $2 $3; tmin=$?          # remove 1rst var and expand the list: + => min max mean s.d
203          testoutput_for_prop $1 "dynstat_theta_max" "theta maximum" $2 $3; tmax=$?          listVar=`echo $listChk | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' \
204          testoutput_for_prop $1 "dynstat_theta_mean" "theta mean" $2 $3; tmean=$?                                 | sed 's/+//g' | sed "s/^$sVar//"`
205          testoutput_for_prop $1 "dynstat_theta_sd" "theta s.d." $2 $3; tsd=$?          if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(I)='$listVar'" 1>&2 ; fi
206          testoutput_for_prop $1 "dynstat_salt_min" "salt minimum" $2 $3; smin=$?          # check for ptracer output in reference_output file :
207          testoutput_for_prop $1 "dynstat_salt_max" "salt maximum" $2 $3; smax=$?          outpref=$1/results/$3
208          testoutput_for_prop $1 "dynstat_salt_mean" "salt mean" $2 $3; smean=$?          ptr_mon="trcstat_ptracerXX_min trcstat_ptracerXX_max"
209          testoutput_for_prop $1 "dynstat_salt_sd" "salt s.d." $2 $3; ssd=$?          ptr_mon="$ptr_mon trcstat_ptracerXX_mean trcstat_ptracerXX_sd"
         testoutput_for_prop $1 "dynstat_uvel_min" "U minimum" $2 $3; umin=$?  
         testoutput_for_prop $1 "dynstat_uvel_max" "U maximum" $2 $3; umax=$?  
         testoutput_for_prop $1 "dynstat_uvel_mean" "U mean" $2 $3; umean=$?  
         testoutput_for_prop $1 "dynstat_uvel_sd" "U s.d." $2 $3; usd=$?  
         testoutput_for_prop $1 "dynstat_vvel_min" "V minimum" $2 $3; vmin=$?  
         testoutput_for_prop $1 "dynstat_vvel_max" "V maximum" $2 $3; vmax=$?  
         testoutput_for_prop $1 "dynstat_vvel_mean" "V mean" $2 $3; vmean=$?  
         testoutput_for_prop $1 "dynstat_vvel_sd" "V s.d." $2 $3; vsd=$?  
   
         #  This is for PTRACERS  
210          for ii in $PTRACERS_NUM ; do          for ii in $PTRACERS_NUM ; do
211              eval `echo "p0"$ii"_min=99"`              ptrfound=0
212              eval `echo "p0"$ii"_max=99"`              for jj in $ptr_mon ; do
213              eval `echo "p0"$ii"_mean=99"`                  name=`eval "echo $jj | sed -e 's|XX|0"$ii"|g'"`
214              eval `echo "p0"$ii"_sd=99"`                  tst=`grep $name $outpref | wc -l | awk '{print $1}'`
215              tst=`eval 'echo "$HAVE_PTR0'$ii'"'`                  if test ! "x$tst" = x0 ; then ptrfound=1 ; fi
216              #echo 'tst = '$tst              done
217              if test "x$tst" = xt ; then              if test $ptrfound = '1' ; then
218                  a="trcstat_ptracer0"                  eval "HAVE_PTR0"$ii"=t"
219                  testoutput_for_prop $1 "$a"$ii"_min"  "p0"$ii"_min"  $2 $3              else
220                  RETVAL=$? ; eval `echo "p0"$ii"_min="$RETVAL`                  eval "HAVE_PTR0"$ii"=f"
221                  testoutput_for_prop $1 "$a"$ii"_max"  "p0"$ii"_max"  $2 $3                if test "x$ADM" = x -a "x$OADM" = x; then
222                  RETVAL=$? ; eval `echo "p0"$ii"_max="$RETVAL`                # remove this ptr from the list of output variable to check
223                  testoutput_for_prop $1 "$a"$ii"_mean" "p0"$ii"_mean" $2 $3                # echo "-- ptr test=" $tst "number of var=" `echo $listVar | awk '{print NF}'` 1>&2
224                  RETVAL=$? ; eval `echo "p0"$ii"_mean="$RETVAL`                  listVar=`echo "$listVar" | sed "s/ pt$ii..//g"`
225                  testoutput_for_prop $1 "$a"$ii"_sd"   "p0"$ii"_sd"   $2 $3                fi
                 RETVAL=$? ; eval `echo "p0"$ii"_sd="$RETVAL`  
226              fi              fi
227            #   eval 'echo "HAVE_PTR0'$ii' = $HAVE_PTR0'$ii'"' 1>&2
228          done          done
229            tst=`echo $sVar $listVar | awk '{ for(i=2;i<=NF;i++){if($i==$1)t+=1}; print t }'`
230          allargs="$cg2dres $tmin $tmax $tmean $tsd $smin $smax $smean $ssd"          if test $tst != 1 ; then
231          allargs="$allargs $umin $umax $umean $usd $vmin $vmax $vmean $vsd"            if test $tst = 0 ; then echo "==> WARNING: selected var >$sVar< not found" 1>&2
232          allargs="$allargs $p01_min $p01_max $p01_mean $p01_sd"                   else echo "==> WARNING: found selected var >$sVar< $tst times" 1>&2 ; fi
233          allargs="$allargs $p02_min $p02_max $p02_mean $p02_sd"            echo "==> WARNING: in checked list:" $listVar 1>&2
234          allargs="$allargs $p03_min $p03_max $p03_mean $p03_sd"          #- put it back once:
235          allargs="$allargs $p04_min $p04_max $p04_mean $p04_sd"            listVar=" $sVar "`echo "$listVar " | sed "s/ $sVar / /g"`
236          allargs="$allargs $p05_min $p05_max $p05_mean $p05_sd"          fi
237            if [ $debug -gt 0 ]; then echo "testoutput_run: listVar(M)='$listVar'" 1>&2 ; fi
238          eval "dashnum $allargs"          #- report to this experiment local summary file ---
239            echo "MACH='$MACH'" > $locDIR"/summary.txt"
240      else          echo "UNAMEA='$UNAMEA'" >> $locDIR"/summary.txt"
241          testoutput_ad $1 $2 "precision_grdchk_result"          echo "DATE='$DATE'" >> $locDIR"/summary.txt"
242      fi          grep '(PID\.TID 0000\.0001)      n.. =' $1/$2/$OUTPUTFILE \
243             | sed 's/(PID.TID 0000.0001)     //' >> $locDIR"/summary.txt"
244            echo "listVar='$listVar'" >> $locDIR"/summary.txt"
245            #---
246            allargs=""
247            for xx in $listVar
248            do
249              case $xx in
250               'PS')  if [ $debug -gt 0 ]
251                      then echo testoutput_run: testoutput_var $1 cg2d_init_res 1>&2 ; fi
252                      testoutput_var $1 "cg2d_init_res" "Press. Solver (cg2d)" $2 $3; yy=$?
253                      if [ $debug -gt 0 ] ; then echo testoutput_run: cg2dres=$yy 1>&2 ; fi ;;
254              'Cost') testoutput_var $1 "ADM  precision_derivative_cost" "ADM Cost" $2 $3; yy=$? ;;
255              'Grad') testoutput_var $1 "ADM  precision_derivative_grad" "ADM Grad" $2 $3; yy=$? ;;
256               'Tmn') testoutput_var $1 "dynstat_theta_min"  "Theta minimum"  $2 $3; yy=$? ;;
257               'Tmx') testoutput_var $1 "dynstat_theta_max"  "Theta maximum"  $2 $3; yy=$? ;;
258               'Tav') testoutput_var $1 "dynstat_theta_mean" "Theta mean"     $2 $3; yy=$? ;;
259               'Tsd') testoutput_var $1 "dynstat_theta_sd"   "Theta Std.Dev"  $2 $3; yy=$? ;;
260               'Smn') testoutput_var $1 "dynstat_salt_min"  "Salt minimum"    $2 $3; yy=$? ;;
261               'Smx') testoutput_var $1 "dynstat_salt_max"  "Salt maximum"    $2 $3; yy=$? ;;
262               'Sav') testoutput_var $1 "dynstat_salt_mean" "Salt mean"       $2 $3; yy=$? ;;
263               'Ssd') testoutput_var $1 "dynstat_salt_sd"   "Salt Std.Dev"    $2 $3; yy=$? ;;
264               'Umn') testoutput_var $1 "dynstat_uvel_min"  "U minimum"       $2 $3; yy=$? ;;
265               'Umx') testoutput_var $1 "dynstat_uvel_max"  "U maximum"       $2 $3; yy=$? ;;
266               'Uav') testoutput_var $1 "dynstat_uvel_mean" "U mean"          $2 $3; yy=$? ;;
267               'Usd') testoutput_var $1 "dynstat_uvel_sd"   "U Std.Dev"       $2 $3; yy=$? ;;
268               'Vmn') testoutput_var $1 "dynstat_vvel_min"  "V minimum"       $2 $3; yy=$? ;;
269               'Vmx') testoutput_var $1 "dynstat_vvel_max"  "V maximum"       $2 $3; yy=$? ;;
270               'Vav') testoutput_var $1 "dynstat_vvel_mean" "V mean"          $2 $3; yy=$? ;;
271               'Vsd') testoutput_var $1 "dynstat_vvel_sd"   "V Std.Dev"       $2 $3; yy=$? ;;
272            'pt1mn'|'pt2mn'|'pt3mn'|'pt4mn'|'pt5mn') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
273               testoutput_var $1 "trcstat_ptracer0"$ii"_min"  "p0"$ii"_min"   $2 $3; yy=$? ;;
274            'pt1mx'|'pt2mx'|'pt3mx'|'pt4mx'|'pt5mx') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
275               testoutput_var $1 "trcstat_ptracer0"$ii"_max"  "p0"$ii"_max"   $2 $3; yy=$? ;;
276            'pt1av'|'pt2av'|'pt3av'|'pt4av'|'pt5av') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
277               testoutput_var $1 "trcstat_ptracer0"$ii"_mean" "p0"$ii"_mean" $2 $3; yy=$? ;;
278            'pt1sd'|'pt2sd'|'pt3sd'|'pt4sd'|'pt5sd') ii=`echo $xx | sed 's/pt//' | sed 's/..$//'`
279               testoutput_var $1 "trcstat_ptracer0"$ii"_sd"   "p0"$ii"_StDv"  $2 $3; yy=$? ;;
280             'Qntmn') testoutput_var $1 "forcing_qnet_min" "Qnet minimum"  $2 $3; yy=$? ;;
281             'Qntmx') testoutput_var $1 "forcing_qnet_max" "Qnet maximum"  $2 $3; yy=$? ;;
282             'Qntav') testoutput_var $1 "forcing_qnet_mean" "Qnet mean"       $2 $3; yy=$? ;;
283             'Qntsd') testoutput_var $1 "forcing_qnet_sd"  "Qnet Std.Dev"  $2 $3; yy=$? ;;
284             'aSImn') testoutput_var $1 "seaice_area_min"   "SIce Area min"   $2 $3; yy=$? ;;
285             'aSImx') testoutput_var $1 "seaice_area_max"   "SIce Area max"   $2 $3; yy=$? ;;
286             'aSIav') testoutput_var $1 "seaice_area_mean"  "SIce Area mean"  $2 $3; yy=$? ;;
287             'aSIsd') testoutput_var $1 "seaice_area_sd"    "SIce Area StDv"  $2 $3; yy=$? ;;
288             'hSImn') testoutput_var $1 "seaice_heff_min"   "SIce Heff min"   $2 $3; yy=$? ;;
289             'hSImx') testoutput_var $1 "seaice_heff_max"   "SIce Heff max"   $2 $3; yy=$? ;;
290             'hSIav') testoutput_var $1 "seaice_heff_mean"  "SIce Heff mean"  $2 $3; yy=$? ;;
291             'hSIsd') testoutput_var $1 "seaice_heff_sd"    "SIce Heff StDv"  $2 $3; yy=$? ;;
292            'AthSiG') testoutput_var $1 "thSI_Ice_Area_G" "thSIc Area Global" $2 $3; yy=$? ;;
293            'AthSiS') testoutput_var $1 "thSI_Ice_Area_S" "thSIc Area South"  $2 $3; yy=$? ;;
294            'AthSiN') testoutput_var $1 "thSI_Ice_Area_N" "thSIc Area North"  $2 $3; yy=$? ;;
295            'HthSiG') testoutput_var $1 "thSI_IceH_ave_G" "thSIc H Global"    $2 $3; yy=$? ;;
296            'HthSiS') testoutput_var $1 "thSI_IceH_ave_S" "thSIc H South"     $2 $3; yy=$? ;;
297            'HthSiN') testoutput_var $1 "thSI_IceH_ave_N" "thSIc H North"     $2 $3; yy=$? ;;
298                  *) yy=99; echo "WARNING: asking for var=$xx : not recognized !" 1>&2 ;;
299              esac
300              if test $xx = $sVar
301              then allargs="$allargs > $yy <"
302              else allargs="$allargs $yy"
303              fi
304            done
305    
306            nbVar=`echo $listVar | awk '{print NF}'`
307            if [ $nbVar -lt $LEN_CHECK_LIST ] ; then
308            #-- fill line (up to standard length) with dot:
309              adNul=`expr $LEN_CHECK_LIST - $nbVar | awk '{for(i=1;i<=$1;i++){print "."}}'`
310              echo $allargs $adNul
311            else
312              echo $allargs
313            fi
314    # <-- same processing for adjoint & forward test
315  }  }
316    
317  genmakemodel()  genmakemodel()
# Line 300  genmakemodel() Line 328  genmakemodel()
328          (          (
329              cd $1;              cd $1;
330              command="$GENMAKE2  -ds -m $MAKE"              command="$GENMAKE2  -ds -m $MAKE"
331              if test "x$ADM" = x ; then              if test "x$MKDEPEND" != x ; then
332                  command="$command --mods=../code"                  command="$command -makedepend=$MKDEPEND"
333              else              fi
334                if test "x$ADM" = xt ; then
335                  command="$command --mods=../code_ad"                  command="$command --mods=../code_ad"
336                  command="$command -adof=../../../tools/adjoint_options/adjoint_staf"              elif test "x$OADM" = xt ; then
337                    command="$command -adof ../../../tools/adjoint_options/adjoint_oad -mods '../code_oad ../../OpenAD/code_oad_all'"
338                else
339                    command="$command -mods=../code"
340              fi              fi
341              if test "x$OPTFILE" != xNONE ; then              if test "x$OPTFILE" != xNONE ; then
342                  command="$command --optfile=$OPTFILE"                  command="$command -optfile=$OPTFILE"
343              fi              fi
344              if test "x$IEEE" != x ; then              if test "x$IEEE" != x ; then
345                  command="$command -ieee"                  command="$command -ieee"
346              fi              fi
347              if test "x$MPI" = xt ; then              if test "x$GSL" = xt ; then
348                    command="$command -gsl"
349                fi
350                if test "x$MPI" != x0 ; then
351                  command="$command -mpi"                  command="$command -mpi"
352              fi              fi
353              printf 'genmake ... ' 1>&2              if test "x$MULTI_THREAD" = xt ; then
354              $command > make.log 2>&1              #- run multi-threaded using OpenMP:
355                    command="$command -omp"
356                fi
357                if test "x$USE_R4" = xt ; then
358                    command="$command -use_r4"
359                fi
360                if test "x$TS" = xt ; then
361                    command="$command -ts"
362                fi
363                if test "x$PAPIS" = xt ; then
364                    command="$command -papis"
365                else
366                if test "x$PCLS" = xt ; then
367                    command="$command -pcls"
368                fi
369                fi
370                printf 'genmake ... '
371                eval $command > genmake.tr_log 2>&1
372              RETVAL=$?              RETVAL=$?
373              #  Reduce the size of the testing emails!              #  Reduce the size of the testing emails!
374              head -100 Makefile > $CDIR/Makefile_head              head -100 Makefile > $CDIR/Makefile_head
375              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
376                  tail make.log                  tail genmake.tr_log
377                  echo "genmakemodel: genmake failed" 1>&2                  echo "genmakemodel: genmake failed"
378                  cp genmake_* make.log $CDIR                  cp genmake.log genmake_* genmake.tr_log $CDIR
379                  return 1                  return 1
380              else              else
381                  echo "successful" 1>&2                  echo "successful"
382              fi              fi
383          )          )
384      fi      fi
# Line 335  genmakemodel() Line 387  genmakemodel()
387  makeclean()  makeclean()
388  {  {
389      # makeclean directory      # makeclean directory
390        if test "x$NODEPEND" = xf ; then rm -f $1/make.tr_log ; fi
391      if test "x$NOCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
392          echo "make CLEAN skipped!"          echo "make Clean skipped!"
393      else      else
394          (          (
395              cd $1;              cd $1;
396              if test -e output.txt ; then              #if test -e $OUTPUTFILE ; then rm -f $OUTPUTFILE ; fi
                 rm -f output.txt  
             fi  
             printf 'make CLEAN ... ' 2>&1  
397              if test -r Makefile ; then              if test -r Makefile ; then
398                  $MAKE CLEAN >> make.log 2>&1                  printf 'clean build-dir: make Clean ... '
399                    $MAKE Clean >> make.tr_log 2>&1
400                  RETVAL=$?                  RETVAL=$?
401                  if test "x$RETVAL" != x0 ; then                  if test "x$RETVAL" != x0 ; then
402                      tail make.log                      tail make.tr_log
403                      echo "makeclean: \"make CLEAN\" failed" 1>&2                      echo "makeclean: \"make Clean\" failed"
404                      cp make.log $CDIR"/make.log"                      cp make.tr_log genmake.log genmake.tr_log $CDIR
405                      return 1                      return 1
406                  fi                  fi
407                    echo successful
408                else
409                    echo ''
410              fi              fi
             echo successful 1>&2  
411              exit 0              exit 0
412          )          )
413      fi      fi
414  }  }
415    
416  postclean()  run_clean()
417  {  {
418      # postclean directory      # run_clean directory
419      if test "x$POSTCLEAN" = xt ; then      if test "x$NOCLEAN" = xt ; then
420            echo "run_clean skipped!"
421        else
422          (          (
423              cd $1;              cd $1;
424              if test -r Makefile ; then              printf 'clean run-dir ... '
425                  $MAKE CLEAN >> /dev/null 2>&1              # part of what is done after "make clean" when doing "make CLEAN"
426              fi              find . -name "*.meta" -exec rm {} \;
427                find . -name "*.data" -exec rm {} \;
428                find . -name "fort.*" -exec rm {} \;
429                find . -type l -exec rm {} \;
430                rm -f $EXECUTABLE $RUNLOG *.txt STD* *diagnostics.log datetime
431                rm -rf mnc_test_*
432                rm -f *_MIT_CE_000.opt0000 costfunction*0000
433                echo successful
434              exit 0              exit 0
435          )          )
436      fi      fi
# Line 382  makedependmodel() Line 444  makedependmodel()
444      else      else
445          (          (
446              cd $1;              cd $1;
447              printf 'make depend ... ' 1>&2              printf 'make depend ... '
448              $MAKE depend >> make.log 2>&1              $MAKE depend >> make.tr_log 2>&1
449              RETVAL=$?              RETVAL=$?
450              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
451                  tail make.log                  tail make.tr_log
452                  echo "makedependmodel: make depend failed" 1>&2                  echo "makedependmodel: make depend failed"
453                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
454                  return 1                  return 1
455              else              else
456                  echo successful 1>&2                  echo successful
457              fi              fi
458          )          )
459      fi      fi
# Line 401  makemodel() Line 463  makemodel()
463  {  {
464      # makemodel directory      # makemodel directory
465      (      (
466        if test "x$NOMAKE" = xt ; then
467            cd $1;
468            if test -x $EXECUTABLE ; then
469                echo "make skipped!"
470            else
471                echo "no executable!"
472                return 2
473            fi
474        else
475          cd $1;          cd $1;
476          if test -r Makefile ; then          if test -r Makefile ; then
477              printf 'make ... ' 1>&2              printf 'make ... '
478              if test "x$ADM" = x ; then              if test "x$ADM" = xt ; then
479                    $MAKE adall >> make.tr_log 2>&1
480                elif test "x$OADM" = xt ; then
481                    $MAKE adAll >> make.tr_log 2>&1
482                else
483                  if test "x$JOBS" = x ; then                  if test "x$JOBS" = x ; then
484                      $MAKE >> make.log 2>&1                      $MAKE >> make.tr_log 2>&1
485                  else                  else
486                      $MAKE -j $JOBS >> make.log 2>&1                      $MAKE -j $JOBS >> make.tr_log 2>&1
487                  fi                  fi
             else  
                 $MAKE adall >> make.log 2>&1  
488              fi              fi
489              RETVAL=$?              RETVAL=$?
490              if test "x$RETVAL" != x0 ; then              if test "x$RETVAL" != x0 ; then
491                  tail make.log                  tail make.tr_log
492                  echo failed 1>&2                  echo failed
493                  cp make.log $CDIR"/make.log"                  cp make.tr_log genmake.log genmake.tr_log $CDIR
494                    rm -f $EXECUTABLE
495                  return 1                  return 1
496              else              else
497                  echo successful 1>&2                  echo successful
498              fi              fi
499          fi          fi
500        fi
501      )      )
502  }  }
503    
504    mk_mpi_size()
505    {
506        # mk_mpi_size input_file output_file proc_Nb
507        #
508        # make new SIZE.h (=output_file) from SIZE.h_mpi (=input_file)
509        #     for an MPI build with no more than proc_Nb processors ;
510        # return the effective number of processors.
511    
512        inp=$1
513        out=$2
514        np=$3
515        tmp=TTT.$$
516    
517        px=`grep "^     & *nPx *=" $inp | sed "s/^     & *nPx *= *//" | sed 's/, *$//'`
518        py=`grep "^     & *nPy *=" $inp | sed "s/^     & *nPy *= *//" | sed 's/, *$//'`
519        sx=`grep "^     & *nSx *=" $inp | sed "s/^     & *nSx *= *//" | sed 's/, *$//'`
520        sy=`grep "^     & *nSy *=" $inp | sed "s/^     & *nSy *= *//" | sed 's/, *$//'`
521    
522        #- find the largest divisor of input_file proc Nb, but not larger than $np
523        pp=0
524        for i in `seq 1 $px` ; do
525          if [ `expr $px % $i` -eq 0 ] ; then
526            for j in `seq 1 $py` ; do
527              if [ `expr $py % $j` -eq 0 ] ; then
528                ij=`expr $i \* $j`
529                if [ $ij -gt $pp ] ; then
530                  if [ $ij -le $np ] ; then
531                    ix=$i ; jy=$j ; pp=$ij
532                    #echo "  ix,jy= $ix,$jy"
533                  fi
534                fi
535              fi
536            done
537          fi
538        done
539    
540        #- create new SIZE.h type file:
541        sx=`expr $sx \* $px / $ix`
542        sy=`expr $sy \* $py / $jy`
543        if [ $verbose -gt 1 ]; then
544            echo " px,py,np= $px,$py,$np : New MPI size: px,py= $ix,$jy : sx,sy= $sx,$sy"
545        fi
546        sed "/^     \& *nPx *=/s/[0-9]*,/$ix,/" $inp > $tmp
547        sed "/^     \& *nPy *=/s/[0-9]*,/$jy,/" $tmp > $out
548        sed "/^     \& *nSx *=/s/[0-9]*,/$sx,/" $out > $tmp
549        sed "/^     \& *nSy *=/s/[0-9]*,/$sy,/" $tmp > $out
550        rm -f $tmp
551        return $pp
552    }
553    
554  symlink_mpifiles()  symlink_mpifiles()
555  {  {
556      # Put special links so that MPI specific files are used      # Put special links so that MPI specific files are used
# Line 434  symlink_mpifiles() Line 559  symlink_mpifiles()
559    
560      dir=$1      dir=$1
561      code_dir=$2      code_dir=$2
562      BUILD_DIR=$dir/$3      build_dir=$dir/$3
563      CODE_DIR=$dir/$code_dir  
       
564      # These are files that should replace their counter-part when using -mpi      # These are files that should replace their counter-part when using -mpi
565      MPI_FILES=`(cd $CODE_DIR; find . -name "*_mpi")`      MPI_FILES=`(cd $dir/$code_dir; find . -name "*_mpi" -print)`
566    
567      #  Is this an MPI run?      for ii in $MPI_FILES ; do
568      if test "x$MPI" = xt ; then          i=`echo $ii | sed 's:^\./::'`
569          # YES: We symbolically link these files to the build          name=`echo $i | sed 's:_mpi::'`
570          # dir so long as there is no real file in place          file="../$code_dir/$i"
571          for ii in $MPI_FILES ; do          if test $name = 'SIZE.h' ; then file="SIZE.h.mpi" ; fi
572              i=`echo $ii | sed 's:^\./::'`  
573              name=`echo $i | sed 's:_mpi::' `          #  Is this an MPI run?
574              cmp $CODE_DIR/$i $BUILD_DIR/$name > /dev/null 2>&1          if test "x$MPI" = x0 ; then
575              RETVAL=$?              # NO: We undo any _mpi symbolically linked files
576              if test "x$RETVAL" != x0 ; then              if test -L $build_dir/$name ; then
577                  if ! test -f $BUILD_DIR/$i ; then                  ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
                     #echo Linking $name to $i  
                     (cd $BUILD_DIR; ln -sf ../$code_dir/$i $name)  
                 fi  
             fi  
         done  
     else  
         # NO: We undo any _mpi symbolically linked files  
         for ii in $MPI_FILES ; do  
             i=`echo $ii | sed 's:^\./::'`  
             name=`echo $i | sed 's:_mpi::' `  
             if test -L $BUILD_DIR/$name ; then  
                 cmp $BUILD_DIR/$name "../$code_dir/$name"_mpi > /dev/null 2>&1  
578                  RETVAL=$?                  RETVAL=$?
579                  if test "x$RETVAL" = x0 ; then                  if test "x$RETVAL" = x0 ; then
580                      #echo Un-linking $name from $linktarg                      if [ $verbose -gt 1 ]; then
581                      rm -f $BUILD_DIR/$name                          echo "  Un-linking $name from ../$code_dir" ; fi
582                        rm -f $build_dir/$name
583                  fi                  fi
584              fi              fi
585          done          else
586      fi              # YES: We symbolically link these files to the build
587                    # dir so long as there is no real file in place
588                ( cd $build_dir ; cmp $name $file > /dev/null 2>&1 )
589                RETVAL=$?
590                if [ $verbose -gt 1 ]; then echo "  cmp $name $file returns: $RETVAL" ; fi
591                if test "x$RETVAL" != x0 ; then
592                    if test -h $build_dir/$name ; then rm -f $build_dir/$name ; fi
593                    if test ! -r $build_dir/$name ; then
594                        if [ $verbose -gt 1 ]; then echo "  Linking $name to $file" ; fi
595                        (cd $build_dir; ln -sf $file $name)
596                    fi
597                fi
598            fi
599        done
600  }  }
601    
602  linkdata()  linkdata()
603  {  {
604      # linkdata flag      # linkdata run_dir input_dir_1 input_dir_2 ...
605      #      #
606      # symbolically link data files to run directory      # symbolically link data files to run directory
607      if test "x$1" = x1 ; then      if test -d $1 ; then
608          (          (
609              cd $2              cd $1 ; shift
610              if test "x$ADM" = x ; then              echo 'linkdata from dirs:' $*
611                  files=`( cd ../input ; ls -1 | grep -v CVS )`              inpMPI=`(cd ../$1 ; find . -name "*.mpi" -print | sed 's:^\./::')`
612                  for i in $files ; do              for xx in $inpMPI ; do
613                      if test ! -d "../input/"$i -a ! -f $i ; then                if test -r "../"$1"/"$xx ; then
614                          ln -sf "../input/"$i $i                  # found 1 _mpi sfx file in 1rst input dir and it is readable
615                      fi                  yy=`echo $xx | sed 's:\.mpi$::'`
616                  done                  if test "x$MPI" = "x0" ; then
617              else                      # not mpi test: remove symbolic link
618                  files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`                      if test -h $yy ; then rm -f $yy ; fi
619                  for i in $files ; do                  else
620                      if test ! -d "../input/"$i ; then                      # mpi test: remove symbolic link & link .mpi sfx file
621                          ln -sf "../input/"$i $i                      if test -h $yy ; then rm -f $yy ; fi
622                        if test ! -r $yy ; then
623                            ln -sf "../"$1"/"$xx $yy ;
624                            printf " $xx" 1>&2
625                      fi                      fi
626                  done                  fi
627                  files=`( cd ../input_ad ; ls -1 | grep -v CVS )`                fi
628                  for i in $files ; do              done
629                      if test ! -d "../input_ad/"$i ; then              if test -r "../"$1"/eedata.mth" ; then
630                          ln -sf "../input_ad/"$i $i              # found eedata.mth in 1rst input dir and it is readable
631                    if test "x$MULTI_THREAD" = "xt" ; then
632                    # multi-threaded test: remove symbolic link & link eedata.mth
633                        if test -h eedata ; then rm -f eedata ; fi
634                        if test ! -r eedata ; then
635                            ln -sf "../"$1"/eedata.mth" eedata ;
636                            printf ' eedata.mth' 1>&2
637                      fi                      fi
638                  done                  else
639                    # not multi-threaded test: remove eedata symbolic link
640                        if test -h eedata ; then rm -f eedata ; fi
641                    fi
642              fi              fi
643                prevDir='NONE'
644                for ldir in $* ; do
645                    if test -d "../"$ldir -a $ldir != $prevDir ; then
646                        printf " ldir=${ldir}:" 1>&2
647                        files=`( cd "../"$ldir ; ls -1 | grep -v CVS )`
648                        for i in $files ; do
649                            if test ! -d "../"$ldir/$i ; then
650                                if test ! -r $i  ; then
651                                    printf ' '$i 1>&2
652                                    ln -sf "../"$ldir"/"$i $i
653                                fi
654                            fi
655                        done
656                        printf ' ;' 1>&2
657                        if test -x "../"$ldir"/"prepare_run ; then
658                            "../"$ldir"/"prepare_run 1>&2
659                        else
660                            echo '' 1>&2
661                        fi
662                    fi
663                    prevDir=$ldir
664                done
665          )          )
666      fi      fi
667  }  }
# Line 511  runmodel() Line 670  runmodel()
670  {  {
671      # runmodel directory      # runmodel directory
672      #      #
673      #  runs "$COMMAND in "directory"      #  runs $COMMAND in "directory"
674      #  (where "$COMMAND" is relative to "directory")      #  (where "$COMMAND" is relative to "directory")
675      (      (
676          cd $1          cd $1
677          printf 'runmodel in %s ...' $1 1>&2          printf 'runmodel in %s ... ' $1
678          # make output.txt          if test -L $EXECUTABLE ; then
679          echo            if test -x "../"$builddir"/"$EXECUTABLE ; then
680          rm -f run.log              cmp $EXECUTABLE "../"$builddir"/"$EXECUTABLE > /dev/null 2>&1
681          if test $OUTPUTFILE -ot $EXECUTABLE ; then              outD=$? ; if test "x$outD" != x0 ; then rm -f $EXECUTABLE ; fi
682             ( eval $COMMAND ) > run.log 2>&1            else rm -f $EXECUTABLE
683             RETVAL=$?            fi
684            fi
685            if test ! -x $EXECUTABLE -a -x "../"$builddir"/"$EXECUTABLE ; then
686                echo " link" $EXECUTABLE "from dir ../"$builddir > run.log_tmp
687                ln -sf "../"$builddir"/"$EXECUTABLE .
688            fi
689            if test "x$MPI" != x0 ; then
690                #- adjust the MPI run command with the right number of Procs
691                #echo "COMMAND='$COMMAND'"
692                COMMAND=`echo $COMMAND | sed "s/-np * XX /-np $NPROC_MPI /"`
693                #echo "COMMAND='$COMMAND'"
694            fi
695            if test ! -x $EXECUTABLE ; then
696                    rm -f $RUNLOG ; touch $RUNLOG
697                    if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
698                    echo " no executable:" $EXECUTABLE >> $RUNLOG
699                    RETVAL=8
700                    ENDVAL=-1
701          else          else
702             echo " $OUTPUTFILE is up to date " > run.log 2>&1              if test ! -f $OUTPUTFILE -o $OUTPUTFILE -ot $EXECUTABLE ; then
703             RETVAL=0                # output do not exist or is older than executable:
704                    rm -f $RUNLOG ; touch $RUNLOG
705                    if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
706                    ( eval $COMMAND ) >> $RUNLOG 2>&1
707                    RETVAL=$?
708                else
709                    RETVAL=0
710                    if test -f $RUNLOG ; then
711                        if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
712                        echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
713                    else
714                        touch $RUNLOG
715                        if test -f run.log_tmp ; then cat run.log_tmp >> $RUNLOG ; fi
716                        echo "---------->> $OUTPUTFILE is up to date " >> $RUNLOG 2>&1
717                        echo " no previous $RUNLOG: assume NORMAL END" >> $RUNLOG 2>&1
718                    fi
719                fi
720                #ENDVAL=`cat $RUNLOG | grep -v 'ABNORMAL END' | grep -c 'NORMAL END'`
721                ENDVAL=`tail $OUTPUTFILE | grep -c 'PROGRAM MAIN: Execution ended Normally'`
722          fi          fi
723          # echo "COMMAND='$COMMAND'"          rm -f run.log_tmp
724          # echo "pwd='"`pwd`"'"          if [ $RETVAL -eq 0 -a $ENDVAL -gt 0 ] ; then
725          if test "x$RETVAL" = x0 ; then              echo successful
726              tail run.log              printf '=> output from running in %s :\n' $1 1>&2
727              echo successful 1>&2              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
728              # === Reduce the size of the testing emails!              # === Reduce the size of the testing emails!
729              # if test "x$ADM" = x ; then              #cp $OUTPUTFILE $CDIR"/"$OUTPUTFILE
             #   cp output.txt $CDIR"/output.txt"  
             # else  
             #   cp output.txt_adm $CDIR"/output.txt_adm"  
             # fi  
730              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
731              return 0              return 0
732            elif [ $RETVAL -ne 0 -a $ENDVAL -gt 0 ] ; then
733                #-- for some weird cases (run is finihed but with error code)
734                echo 'finished with error (run:' $RETVAL ' end:' $ENDVAL ')'
735                printf '=> output from running in %s :\n' $1 1>&2
736                tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
737                return 0
738          else          else
739              tail run.log              echo 'failed (run:' $RETVAL ' end:' $ENDVAL ')'
740              echo failed 1>&2              printf '=> output from running in %s :\n' $1 1>&2
741              cp run.log $CDIR"/run.log"              tail $RUNLOG | sed 's/^.*/> &/g' 1>&2
742                cp $RUNLOG $CDIR"/"$RUNLOG
743              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
744              return 1              return 1
745          fi          fi
# Line 553  createcodelet() Line 750  createcodelet()
750  {  {
751      # create codelet for comparing model output      # create codelet for comparing model output
752    
753      printf "creating the comparison code...  "      printf "creating the comparison code (using CC=$CC)...  "
754      cat > tmp_cmpnum.c <<EOF      cat > tr_cmpnum.c <<EOF
755  #include <stdio.h>  #include <stdio.h>
756  #include <math.h>  #include <math.h>
757  int main( int argc, char** argv )  {  int main( int argc, char** argv )  {
758    int linnum,best,lncnt;    int linnum,cmplin,best,lncnt;
759    double a,b,abave,relerr;    double a,b,abave,relerr;
760    best = -22;    best = -22;
761    lncnt = 0;    lncnt = 0;
762    while( 1 & (lncnt+=1) < 999 )  {    while( 1 & ( (lncnt+=1) < 999 ) )  {
763      scanf("%d", &linnum);      scanf("%d", &linnum);
764      if (linnum == -1)  break;      if (linnum == -1)  break;
765      scanf("%lf", &a);  scanf("%lf", &b);      scanf("%lf", &a);  scanf("%lf", &b);
766      abave = 0.5*(fabs(a)+fabs(b));      abave = 0.5*(fabs(a)+fabs(b));
767      if (abave > 0.0) {      if ( abave == abave ) {
768        relerr=fabs(a-b)/abave;        if (abave > 0.0) {
769        if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); }          relerr=fabs(a-b)/abave;
770        else { linnum = -16 ; }          if (relerr > 0.0) { cmplin = (int)rint(log10(relerr)); }
771        best = (best > linnum) ? best : linnum;          else { cmplin = -16 ; }
772      }          best = (best > cmplin) ? best : cmplin; }
773          else { cmplin = -22 ; }
774       /* printf("%d ; %lf ; %lf\n",cmplin,a,b); */
775          }
776       else {
777       /* printf("%lf ; %lf ; %lf\n",abave,a,b); */
778          break; }
779    }    }
780    if (lncnt == 999) best=-29;    if (lncnt == 999) best=-29;
781      if (linnum != -1) best=-99;
782    printf("%d\n", -best);    printf("%d\n", -best);
783    return 0;    return 0;
784  }  }
785  EOF  EOF
786      $CC -o tmp_cmpnum tmp_cmpnum.c -lm      $CC -o tr_cmpnum tr_cmpnum.c -lm
787    
788      if [ -x ./tmp_cmpnum ]; then      if [ -x ./tr_cmpnum ]; then
789          echo "OK"          echo "OK"
790          return 0          return 0
791      else      else
792          echo          echo
793          echo "ERROR: failed to compile comparison code -- please specify"          echo "ERROR: failed to compile comparison code -- please specify"
794          echo "  a C compiler using the CC environment variable."          echo "  a C compiler using the CC environment variable."
795          exit 1          exit 1
796      fi      fi
# Line 599  formatresults() Line 803  formatresults()
803      nm=$1      nm=$1
804      printf '%s %s %s %s' $2 $3 $4 $5      printf '%s %s %s %s' $2 $3 $4 $5
805      shift; shift; shift; shift; shift;      shift; shift; shift; shift; shift;
806      printf '%3s' $@      listPrt=$@
807            listRes=`echo $listPrt | sed 's/>//' | sed 's/<//'`
808      if [ $1 = '--' ]; then      xx=`echo $listPrt | sed 's/.*>//' | sed 's/<.*//' | awk '{print $1}'`
809        printf '%3s' $listPrt
810    #   line below does not work on hp-ux_ia64 : do those substitutions later on
811    #   printf '%3s' $listPrt | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</'
812    
813        if [ $xx = '..' ]; then
814            printf ' N/O '
815        elif [ $xx = '--' ]; then
816            printf ' N/O '
817        elif [ $xx = 99 ]; then
818          printf ' N/O '          printf ' N/O '
819      else      else
820          if [ $1 -gt 12 ]; then          if [ $xx -ge $MATCH_CRIT ]; then
821              printf ' pass'              printf ' pass'
822          else          else
823              printf ' FAIL'              printf ' FAIL'
# Line 612  formatresults() Line 825  formatresults()
825      fi      fi
826      printf '  %s' $nm      printf '  %s' $nm
827      printf '\n'      printf '\n'
       
 }  
   
 show_help()  
 {  
     cat - << EOF  
 $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  
   
  -help|-h      Show this help message  
  -quiet     Reduce the amount of output  
  -verbose   Produce copious amounts of output  
  -debug     Produce even more output which will mean nothing to most  
  -force     Do "make CLEAN" before compiling. This forces a complete rebuild.  
  -clean     Do "make CLEAN" after compiling and testing.  
  -cleanup   Aggresively removes all model output, executables and object files  
             and then exits. Use with care.  
828    
 Normal usage:  
  $0 *       Configure, compile, run and analyze in all experiment directories  
 EOF  
829  }  }
830    
831  scandirs()  scandirs()
832  {  {
833      if [ $# -eq 0 ]; then      if [ $# -eq 1 ]; then
834          for arg in * ; do          for arg in * ; do
835              test -d $arg/input && echo $arg              test -f $arg/$1 && echo $arg
836          done          done
837      else      else
838          echo $*          echo $*
839      fi      fi
840  }  }
841    
842    
843    check_eedata()
844    {
845        # check_eedata size.h eedata
846        if [ $# -eq 2 ] ; then
847          if test -f $1 -a -f $2 ; then
848          sx=`grep "^     & *nSx *=" $1 | sed "s/^     & *nSx *=//" | sed 's/, *$//'`
849          nx=`grep "^ *nTx *=" $2 | tail -1 | sed 's/^ *nTx *= *//' | sed "s/, *$//"`
850          if test "x$nx" = x ; then
851            rx=10
852          else
853            rx=`expr $sx % $nx`
854          fi
855          sy=`grep "^     & *nSy *=" $1 | sed "s/^     & *nSy *=//" | sed 's/, *$//'`
856          ny=`grep "^ *nTy *=" $2 | tail -1 | sed 's/^ *nTy *= *//' | sed "s/, *$//"`
857          if test "x$ny" = x ; then
858            ry=20
859          else
860            ry=`expr $sy % $ny`
861          fi
862          echo `expr $rx + $ry`
863        else
864          echo '-1'
865          fi
866        else
867          echo '-2'
868        fi
869    
870    }
871    
872  ###############################################################################  ###############################################################################
873    
874    
# Line 653  scandirs() Line 876  scandirs()
876  debug=0  debug=0
877  verbose=1  verbose=1
878  clean=0  clean=0
 expts=''  
 # ieee=1  
879    
880  IEEE=true  IEEE=true
881  if test "x$MITGCM_IEEE" != x ; then  if test "x$MITGCM_IEEE" != x ; then
882      IEEE=$MITGCM_IEEE      IEEE=$MITGCM_IEEE
883  fi  fi
884    GSL=f
885    
886  CLEANUP=f  CLEANUP=f
887    NORUN=f
888  QUICK=f  QUICK=f
889    NOMAKE=f
890  NOGENMAKE=f  NOGENMAKE=f
891  NOCLEAN=f  NOCLEAN=f
892  NODEPEND=f  NODEPEND=f
# Line 673  BASH= Line 896  BASH=
896  OPTFILE=NONE  OPTFILE=NONE
897  ADDRESSES=  ADDRESSES=
898  TESTDIRS=  TESTDIRS=
899    SKIPDIRS=
900  MPACKDIR="../tools/mpack-1.6"  MPACKDIR="../tools/mpack-1.6"
901  HAVE_MPACK=  HAVE_MPACK=
902  MPACK="$MPACKDIR/mpack"  MPACK=
903  COMMAND=  COMMAND=
904    MKDEPEND=
905  if test "x$MAKE" = x ; then  if test "x$MAKE" = x ; then
906      MAKE=make      MAKE=make
907  fi  fi
# Line 684  if test "x$CC" = x ; then Line 909  if test "x$CC" = x ; then
909      CC=cc      CC=cc
910  fi  fi
911  JOBS=  JOBS=
912  MPI=f  MPI=0
913    MULTI_THREAD=f
914  OUTDIR=  OUTDIR=
915  DELDIR=  DELDIR=
916    USE_R4=
917    
918  ADM=  ADM=
919    OADM=
920    
921  # Additional monitor types  # list of pTracers to check for monitor output
922  PTRACERS_NUM="1 2 3 4 5"  PTRACERS_NUM="1 2 3 4 5"
923    
924    MATCH_CRIT=10
925    
926  printf "parsing options...  "  printf "parsing options...  "
927    
928  ac_prev=  ac_prev=
# Line 706  for ac_option ; do Line 936  for ac_option ; do
936      fi      fi
937    
938      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`      ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
939        
940      case $ac_option in      case $ac_option in
941                    
942          -help | --help | -h | --h)          -help | --help | -h | --h)
# Line 719  for ac_option ; do Line 949  for ac_option ; do
949                    
950          -addr | --addr | -a | --a)          -addr | --addr | -a | --a)
951              ac_prev=ADDRESSES ;;              ac_prev=ADDRESSES ;;
952          -addr=* | --addr=*)          -addr=* | --addr=* | -a=* | --a=*)
953              ADDRESSES=$ac_optarg ;;              ADDRESSES=$ac_optarg ;;
954            -mpackdir | --mpackdir | -mpd | --mpd)
955                ac_prev=MPACKDIR ;;
956            -mpackdir=* | --mpackdir=* | -mpd=* | --mpd=*)
957                MPACKDIR=$ac_optarg ;;
958    
959          -tdir | --tdir | -t | --t)          -tdir | --tdir | -t | --t)
960              ac_prev=TESTDIRS ;;              ac_prev=TESTDIRS ;;
961          -tdir=* | --tdir=*)          -tdir=* | --tdir=* | -t=* | --t=*)
962              TESTDIRS=$ac_optarg ;;              TESTDIRS=$ac_optarg ;;
963    
964            -skipdir | --skipdir | -skd | --skd)
965                ac_prev=SKIPDIRS ;;
966            -skipdir=* | --skipdir=* | -skd=* | --skd=*)
967                SKIPDIRS=$ac_optarg ;;
968    
969          -bash | --bash | -b | --b)          -bash | --bash | -b | --b)
970              ac_prev=BASH ;;              ac_prev=BASH ;;
971          -bash=* | --bash=*)          -bash=* | --bash=* | -b=* | --b=*)
972              BASH=$ac_optarg ;;              BASH=$ac_optarg ;;
973    
974          -command | --command | -c | --c)          -command | --command | -c | --c)
975              ac_prev=COMMAND ;;              ac_prev=COMMAND ;;
976          -command=* | --command=*)          -command=* | --command=* | -c=* | --c=*)
977              COMMAND=$ac_optarg ;;              COMMAND=$ac_optarg ;;
978    
979            -makedepend | --makedepend | -md | --md)
980                ac_prev=MKDEPEND ;;
981            -makedepend=* | --makedepend=* | -md=* | --md=*)
982                MKDEPEND=$ac_optarg ;;
983    
984          -make | --make | -m | --m)          -make | --make | -m | --m)
985              ac_prev=MAKE ;;              ac_prev=MAKE ;;
986          -make=* | --make=*)          -make=* | --make=* | -m=* | --m=*)
987              MAKE=$ac_optarg ;;              MAKE=$ac_optarg ;;
988    
989          -odir | --odir)          -odir | --odir)
# Line 752  for ac_option ; do Line 996  for ac_option ; do
996          -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)          -ptracers=* | --ptracers=* | -ptr=* | --ptr=*)
997              PTRACERS_NUM=$ac_optarg ;;              PTRACERS_NUM=$ac_optarg ;;
998    
999          -j) ac_prev=JOBS ;;          -match | --match ) ac_prev=MATCH_CRIT ;;
1000          -j=*) JOBS=$ac_optarg ;;          -match=* | --match=* ) MATCH_CRIT=$ac_optarg ;;
1001    
1002            -j | --j) ac_prev=JOBS ;;
1003            -j=* | --j=*) JOBS=$ac_optarg ;;
1004    
1005          -clean | --clean)          -clean | --clean)
1006              CLEANUP=t ; DELDIR=t ;;              CLEANUP=t ; DELDIR=t ;;
1007    
1008            -norun | --norun | -nr | --nr)
1009                NORUN=t ;;
1010            -runonly | --runonly | -ro | --ro)
1011                QUICK=t ; NOMAKE=t ;;
1012          -quick | --quick | -q | --q)          -quick | --quick | -q | --q)
1013              QUICK=t ;;              QUICK=t ;;
1014          -nogenmake | --nogenmake | -ng | --ng)          -nogenmake | --nogenmake | -ng | --ng)
# Line 770  for ac_option ; do Line 1021  for ac_option ; do
1021          -postclean | --postclean | -pc | --pc)          -postclean | --postclean | -pc | --pc)
1022              POSTCLEAN=t ;;              POSTCLEAN=t ;;
1023    
1024          -mpi) MPI=t ;;          -mpi | --mpi) MPI=2 ;;
1025            -MPI | --MPI) ac_prev=MPI ;;
1026            -MPI=* | --MPI=*) MPI=$ac_optarg ;;
1027    
1028            -mth) MULTI_THREAD=t ;;
1029    
1030          -adm | -ad) ADM=t ;;          -adm | -ad) ADM=t ;;
1031    
1032            -oad) OADM=t; NODEPEND=t ;;
1033    
1034          -ieee) IEEE=true ;;          -ieee) IEEE=true ;;
1035          -noieee) IEEE= ;;          -noieee) IEEE= ;;
1036            -gsl) GSL=t ;;
1037    
1038          -verbose) verbose=2 ;;          -verbose) verbose=2 ;;
1039          -debug) debug=1 ;;          -debug) debug=1 ;;
# Line 783  for ac_option ; do Line 1041  for ac_option ; do
1041    
1042          -deldir | -dd) DELDIR=t ;;          -deldir | -dd) DELDIR=t ;;
1043    
1044            -use_r4|-ur4) USE_R4=t ;;
1045    
1046            -ts) TS=t;;
1047            -papis) PAPIS=t;;
1048            -pcls) PCL=t;;
1049    
1050          -*)          -*)
1051              echo "Error: unrecognized option: "$ac_option              echo "Error: unrecognized option: "$ac_option
1052              usage              usage
1053              ;;              ;;
1054            
1055          *)          *)
1056              echo "Error: unrecognized argument: "$ac_option              echo "Error: unrecognized argument: "$ac_option
1057              usage              usage
1058              ;;              ;;
1059            
1060       esac       esac
1061        
1062  done  done
1063    
1064  if test "x$QUICK" = xt ; then  if test "x$QUICK" = xt ; then
# Line 803  if test "x$QUICK" = xt ; then Line 1067  if test "x$QUICK" = xt ; then
1067      NODEPEND=t      NODEPEND=t
1068  fi  fi
1069    
1070  if test "x$TESTDIRS" = x ; then  #- setting for forward or ADM testing
     TESTDIRS=`scandirs`  
 fi  
   
 if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then  
     OPTFILE=$MITGCM_OF  
 fi  
   
1071  if test "x$ADM" = xt ; then  if test "x$ADM" = xt ; then
1072        code_dir=code_ad
1073        inputdir=input_ad
1074        ref_outp="output_adm.txt"
1075        EXECUTABLE="mitgcmuv_ad"
1076    elif test "x$OADM" = xt ; then
1077        code_dir=code_oad
1078        inputdir=input_oad
1079        ref_outp="output_oadm.txt"
1080      EXECUTABLE="mitgcmuv_ad"      EXECUTABLE="mitgcmuv_ad"
     OUTPUTFILE="output.txt_adm"  
1081  else  else
1082        code_dir=code
1083        inputdir=input
1084        ref_outp="output.txt"
1085      EXECUTABLE="mitgcmuv"      EXECUTABLE="mitgcmuv"
     OUTPUTFILE="output.txt"  
1086  fi  fi
1087    
1088  if test "x$ADM" = xt -a "x$COMMAND" = x ; then  xx=`echo $TESTDIRS | awk '{print $1}'`
1089      COMMAND="./$EXECUTABLE > $OUTPUTFILE"  if test "x$TESTDIRS" = x ; then
1090        LIST=`scandirs results/$ref_outp`
1091    elif test $xx = 'start_from' ; then
1092        xx=`echo $TESTDIRS | awk '{print $2}'`
1093        LIST=`scandirs results/$ref_outp | sed -n "/$xx/,$ p"`
1094    else
1095        #- expand group of experiments:
1096        LIST=" "
1097        for xx in $TESTDIRS
1098        do
1099          case $xx in
1100            'basic') LIST=${LIST}" aim.5l_cs hs94.128x64x5 ideal_2D_oce"
1101                     LIST=${LIST}" lab_sea tutorial_baroclinic_gyre"
1102                     LIST=${LIST}" tutorial_global_oce_latlon tutorial_plume_on_slope"
1103                    ;;
1104            'tutorials')
1105                     LIST=${LIST}" "`ls | grep 'tutorial_'` ;;
1106            *)       LIST=${LIST}" "$xx ;;
1107          esac
1108        done
1109    fi
1110    #echo 'LIST='${LIST}'<'
1111    #- skip dirs, remove duplicate and non-directory:
1112    TESTDIRS=" "
1113    count=0
1114    for xx in $LIST
1115    do
1116        yy=`echo $SKIPDIRS | grep -c $xx`
1117        if test $yy = 0 ; then
1118            if test -d $xx ; then
1119                yy=`echo $TESTDIRS | grep -c $xx`
1120                if test $yy = 0 ; then TESTDIRS=${TESTDIRS}" "$xx ; fi
1121            else count=1 ;
1122                echo ""; echo -n " -- skip \"$xx\" (not a directory !)"
1123            fi
1124        else
1125            if test $count = 1 ; then echo -n ", \"$xx\""
1126            else count=1 ; echo "" ;  echo -n " skip: \"$xx\""
1127            fi
1128        fi
1129    done
1130    if test $count = 1 ; then echo "" ; echo -n " ... " ; fi
1131    #echo 'TESTDIRS='${TESTDIRS}'<'
1132    
1133    if test "x$OPTFILE" = xNONE -a "x$MITGCM_OF" != x ; then
1134        OPTFILE=$MITGCM_OF
1135  fi  fi
1136    
1137    RUNLOG="run.tr_log"
1138    OUTPUTFILE=$ref_outp
1139  if test "x$COMMAND" = x ; then  if test "x$COMMAND" = x ; then
1140      COMMAND="./$EXECUTABLE > $OUTPUTFILE"      COMMAND="./$EXECUTABLE > $OUTPUTFILE"
1141  fi  fi
1142    if test "x$MPI" != x0 ; then
1143        OUTPUTFILE="STDOUT.0000"
1144    fi
1145    
 #echo "OK"  
1146  echo "OK (COMMAND= $COMMAND )"  echo "OK (COMMAND= $COMMAND )"
1147    
1148    # set the Default List of output variables to be checked:
1149    #  (use default or load experiment-specific list from file "tr_checklist")
1150    # content : 1rst = main variable used to decide if it pass or FAIL
1151    #         others = number of matching digits to be printed in summary.txt
1152    if test "x$ADM" = x -a "x$OADM" = x; then
1153        DEF_CHECK_LIST='PS PS T+ S+ U+ V+ pt1+ pt2+ pt3+ pt4+ pt5+'
1154        EMPTY_RESULTS='.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ..'
1155        LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
1156        ii=`echo $EMPTY_RESULTS | awk '{print NF}'`
1157        EMPTY_RESULTS=$EMPTY_RESULTS`expr $LEN_CHECK_LIST - $ii | awk 'BEGIN{FS=":"}{for(i=1;i<=$1;i++){printf "  ."}}'`
1158    else
1159        DEF_CHECK_LIST='Grad Cost Grad'
1160        EMPTY_RESULTS='.. ..'
1161        LEN_CHECK_LIST=`echo $DEF_CHECK_LIST | sed 's/ [a-zA-Z0-9]*+/&mn &mx &av &sd/g' | awk '{print NF-1}'`
1162    fi
1163    
1164  #  create the FORTRAN comparison code  #  create the FORTRAN comparison code
1165  createcodelet  if test -x tr_cmpnum ; then
1166        echo "skipping comparison code build"
1167    else
1168        createcodelet
1169    fi
1170    
1171  #  build the mpack utility  #  build the mpack utility (if ADDRESSES = NONE, do it to test the build)
1172  if test "x$ADDRESSES" = xNONE -o "x$ADDRESSES" = x ; then  if test "x$ADDRESSES" = x ; then
1173      echo "skipping mpack build"      echo "skipping mpack build"
1174  else  else
1175      build_mpack      build_mpack
1176  fi  fi
1177    
1178  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
1179    CMDLINE=$0
1180    for xx in "$@" ; do nw=`echo $xx | wc -w`
1181        if test $nw = '1' ; then CMDLINE="$CMDLINE $xx"
1182                            else CMDLINE="$CMDLINE '$xx'" ; fi
1183    done
1184    #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done
1185  MACH=`hostname`  MACH=`hostname`
1186  UNAMEA=`uname -a`  UNAMEA=`uname -a`
1187  DATE=`date +%Y%m%d`  DATE=`date +%Y%m%d`
1188  BASE="tr_"$MACH"_"$DATE"_"  BASE="tr_"$MACH"_"$DATE"_"
1189  if test "x$OUTDIR" != x ; then  if test "x$OUTDIR" != x ; then
1190      BASE="tr_"$OUTDIR"_"$DATE"_"      BASE="tr_"$OUTDIR"_"$DATE"_"
1191    else
1192        short_name=`hostname | sed 's/\..*$//'`
1193        BASE="tr_"$short_name"_"$DATE"_"
1194  fi  fi
1195  DNUM=0  DNUM=0
1196  DRESULTS="$BASE$DNUM"  DRESULTS="$BASE$DNUM"
# Line 861  if test "x$RETVAL" != x0 ; then Line 1205  if test "x$RETVAL" != x0 ; then
1205      exit 1      exit 1
1206  fi  fi
1207  SUMMARY="$DRESULTS/summary.txt"  SUMMARY="$DRESULTS/summary.txt"
 printf "Start time:  " >> $SUMMARY  
1208  start_date=`date`  start_date=`date`
1209  echo $start_date > $SUMMARY  echo $start_date > $SUMMARY
1210    echo 'run:' $CMDLINE >> $SUMMARY
1211    echo 'on :' $UNAMEA  >> $SUMMARY
1212    
1213  of_path=  of_path=
1214  if test "x$OPTFILE" != xNONE ; then  if test "x$OPTFILE" != xNONE ; then
# Line 887  if test "x$OPTFILE" != xNONE ; then Line 1232  if test "x$OPTFILE" != xNONE ; then
1232      fi      fi
1233  else  else
1234      echo >> $SUMMARY      echo >> $SUMMARY
1235      echo "No \"OPTFILE\" was explicitly specified by testreport," >> $SUMMARY      echo "No \"OPTFILE\" was specified ; genmake2 found and uses:" >> $SUMMARY
1236      echo "   so the genmake default will be used." >> $SUMMARY      #-note: to be filled later after 1rst run
1237  fi  fi
1238  echo  echo
1239  echo >> $SUMMARY  echo >> $SUMMARY
1240  if test "x$ADM" = x ; then  if test "x$ADM" = x -a "x$OADM" = x; then
1241      line_0="            ----T-----  ----S-----  ----U-----  ----V-----"      if [ $MATCH_CRIT -lt 10 ] ;
1242        then line_0="default  "$MATCH_CRIT ;
1243        else line_0="default "$MATCH_CRIT ; fi
1244           line_0="$line_0  ----T-----  ----S-----  ----U-----  ----V-----"
1245      line_1="G D M    c        m  s        m  s        m  s        m  s"      line_1="G D M    c        m  s        m  s        m  s        m  s"
1246      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."      line_2="E p a R  g  m  m  e  .  m  m  e  .  m  m  e  .  m  m  e  ."
1247      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"      line_3="N n k u  2  i  a  a  d  i  a  a  d  i  a  a  d  i  a  a  d"
1248      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."      line_4="2 d e n  d  n  x  n  .  n  x  n  .  n  x  n  .  n  x  n  ."
1249      for ii in $PTRACERS_NUM ; do      for ii in $PTRACERS_NUM ; do
         #  tst=`eval 'echo $HAVE_PTR0'$ii`  
         #  if test "x$tst" = xt ; then  
1250          line_0="$line_0  --PTR 0"$ii"--"          line_0="$line_0  --PTR 0"$ii"--"
1251          line_1="$line_1        m  s"          line_1="$line_1        m  s"
1252          line_2="$line_2  m  m  e  ."          line_2="$line_2  m  m  e  ."
1253          line_3="$line_3  i  a  a  d"          line_3="$line_3  i  a  a  d"
1254          line_4="$line_4  n  x  n  ."          line_4="$line_4  n  x  n  ."
         #  fi  
1255      done      done
1256      echo "$line_0" | tee -a $SUMMARY      echo "$line_0" | tee -a $SUMMARY
1257      echo "$line_1" | tee -a $SUMMARY      echo "$line_1" | tee -a $SUMMARY
# Line 917  if test "x$ADM" = x ; then Line 1262  if test "x$ADM" = x ; then
1262  else  else
1263      echo "ADJOINT=true" >> $SUMMARY      echo "ADJOINT=true" >> $SUMMARY
1264      echo >> $SUMMARY      echo >> $SUMMARY
1265        if [ $MATCH_CRIT -lt 10 ] ;
1266        then line_0="default     "$MATCH_CRIT ;
1267        else line_0="default    "$MATCH_CRIT ; fi
1268        echo "$line_0" | tee -a $SUMMARY
1269      cat << EOF | tee -a $SUMMARY      cat << EOF | tee -a $SUMMARY
1270  G D M    C  G  G D M    C  G
1271  E p a R  o  r  E p a R  o  r
# Line 925  N n k u  s  a Line 1274  N n k u  s  a
1274    
1275  EOF  EOF
1276  fi  fi
1277    echo "-------------------------------------------------------------------------------"
1278    
1279  #  ...and each test directory...  #  ...and each test directory...
1280  for dir in $TESTDIRS ; do  for dir in $TESTDIRS ; do
1281        
1282        # set builddir & rundir:
1283        builddir="build"
1284        if test ! -d $dir/$builddir ; then mkdir $dir/$builddir ; fi
1285        rundir="run"
1286        pfxdir="tr_$rundir"
1287        if test ! -d $dir/$rundir ; then
1288            rundir=$builddir
1289        fi
1290        CODE_DIR=$dir/$code_dir
1291        BUILD_DIR=$dir/$builddir
1292    
1293      #  Cleanup only!      #  Cleanup only!
1294      if test "x$CLEANUP" = xt ; then      if test "x$CLEANUP" = xt ; then
1295          if test -r $dir/build/Makefile ; then          echo -n '  --- dir:' $BUILD_DIR ': '
1296              ( cd $dir/build ; make CLEAN )          makeclean $BUILD_DIR
1297            (   cd $BUILD_DIR
1298                rm -f $EXECUTABLE *.bak
1299                rm -f genmake_state genmake_*optfile genmake.log
1300                rm -f SIZE.h.mpi genmake.tr_log make.tr_log
1301            )
1302            if test -d $dir/$rundir/CVS ; then
1303                echo -n '  --- dir:' $dir/$rundir ': '
1304                run_clean $dir/$rundir
1305          fi          fi
1306          if test -r $dir/input/Makefile ; then          trdir=`( cd $dir ; find . -type d -name "$pfxdir.*" -print | sed 's/^.\///')`
1307              ( cd $dir/input ; make CLEAN )          ttd=`echo $trdir | wc -w`
1308            if test $ttd != 0 ; then
1309                echo '  --- rm dir:' $trdir
1310                ( cd $dir ; rm -rf $trdir )
1311          fi          fi
         (  
             cd $dir  
             rm -rf tr_run.*  
         )  
1312          continue          continue
1313      fi      fi
1314    
1315      #  Verify that the testdir exists and contains previous      #  Verify that the testdir exists and contains previous
1316      #  results in the correct location--or skip this directory!      #  results in the correct location--or skip this directory!
1317      fout=      fout=$dir"/results/"$ref_outp
     if test "x$ADM" = x ; then  
         fout=$dir"/results/output.txt"  
     else  
         fout=$dir"/results_ad/output.txt_adm"  
     fi  
1318      if test ! -r $fout ; then      if test ! -r $fout ; then
1319          echo "can't read \"$fout\" -- skipping $dir"          echo "can't read \"$fout\" -- skipping $dir"
1320          continue          continue
1321      fi      fi
     if test "x$ADM" = x ; then  
         check_for_add_mon_output  $fout  
     fi  
1322    
1323      # Check for additional types of monitor output      # Check for specific files for particular type of run
1324    
1325      builddir="input"      if test "x$MPI" != "x0" ; then
1326      rundir="input"          if test -r $CODE_DIR"/SIZE.h_mpi" ; then
1327      use_seperate_build=0              #- create new SIZE.h with no more than '$MPI' Procs
1328      if test -d $dir/build -a -r $dir/build ; then              mk_mpi_size $CODE_DIR"/SIZE.h_mpi" $BUILD_DIR"/tr_size.mpi" $MPI
1329          builddir="build"              NPROC_MPI=$?
1330          rundir="build"              (   cd $BUILD_DIR
1331          use_seperate_build=1                  if test -r SIZE.h.mpi ; then
1332          linkdata $use_seperate_build $dir/$rundir                      cmp tr_size.mpi SIZE.h.mpi > /dev/null 2>&1 ; RETVAL=$?
1333                    else RETVAL=1
1334                    fi
1335                    if test "x$RETVAL" = x0 ; then
1336                        rm -f tr_size.mpi
1337                    else
1338                        rm -f SIZE.h.mpi ; mv tr_size.mpi SIZE.h.mpi
1339                    fi
1340                )
1341            else
1342                echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"
1343                continue
1344            fi
1345        fi
1346        if test ! -r $dir"/input/eedata.mth" -a "x$MULTI_THREAD" = "xt" ; then
1347            echo "can't find \"$dir/input/eedata.mth\" -- skipping $dir"
1348            continue
1349      fi      fi
1350            if test "x$MPI" != "x0" -a "x$MULTI_THREAD" = "xt" ; then
1351            retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/input/eedata.mth"`
1352            if test $retv != 0 ; then
1353                echo "input/eedata.mth tiling misfit -- skipping $dir"
1354                continue
1355            fi
1356        fi
1357    
1358      #  Check whether there are "extra runs" for this testdir      #  Check whether there are "extra runs" for this testdir
1359      extra_runs=      extra_runs=
1360      if test "x$ADM" = x -a "x$use_seperate_build" = x1 ; then      if test "x$NORUN" = xf ; then
1361          ex_run_dirs=`( cd $dir ; echo input.* )`          ex_run_dirs=`( cd $dir ; echo $inputdir.* )`
1362          echo "ex_run_dirs='$ex_run_dirs'"      fi
1363          for exd in $ex_run_dirs ; do      #echo "ex_run_dirs='$ex_run_dirs'"
1364              name=`echo $exd | sed -e 's/input.//g'`      for exd in $ex_run_dirs ; do
1365              outf="$dir/results/output.txt.$name"          name=`echo $exd | sed -e "s/$inputdir\.//"`
1366              if test -f $outf -a -r $outf ; then          refExOut=`echo $ref_outp | sed "s/\./.${name}./"`
1367            outf="$dir/results/$refExOut"
1368            if test -f $outf -a -r $outf ; then
1369              if test "x$MULTI_THREAD" = "xt" ; then
1370                if test -r $dir"/"$exd"/eedata.mth" ; then
1371                  if test "x$MPI" = "x0" ; then
1372                  extra_runs="$extra_runs $name"                  extra_runs="$extra_runs $name"
1373                  else
1374                    retv=`check_eedata $BUILD_DIR"/SIZE.h.mpi" $dir"/"$exd"/eedata.mth"`
1375                    if test $retv = 0 ; then
1376                        extra_runs="$extra_runs $name"
1377                    else
1378                        echo $exd"/eedata.mth tiling misfit -- skipping $dir"
1379                    fi
1380                  fi
1381                #else echo $dir"/"$exd"/eedata.mth: not found"
1382              fi              fi
1383          done            else
1384      fi              extra_runs="$extra_runs $name"
1385              fi
1386            fi
1387        done
1388    
1389      if test "x$ADM" = x ; then      echo
1390          code_dir=code      if test "x$extra_runs" = "x" ; then
1391          CODE_DIR=$dir/code         echo "Experiment:  $dir"
1392      else      else
1393          code_dir=code_ad         echo "Experiment:  $dir ; extra_runs=$extra_runs"
         CODE_DIR=$dir/code_ad  
1394      fi      fi
     BUILD_DIR=$dir/$builddir  
   
     if test ! -r $CODE_DIR"/SIZE.h_mpi" -a "x$MPI" = "xt" ; then  
         echo "can't find \"$CODE_DIR/SIZE.h_mpi\" -- skipping $dir"  
         continue  
     fi  
   
     echo "-------------------------------------------------------------------------------"  
     echo  
     echo "Experiment:  $dir"  
1395      echo      echo
1396      unset genmake makedepend make run      unset genmake makedepend make run
1397      results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'      results=$EMPTY_RESULTS
1398    
1399      #  Create an output dir for each OPTFILE/tdir combination      #  Create an output dir for each OPTFILE/tdir combination
1400      rel_CDIR=$DRESULTS"/"$dir      locDIR=$DRESULTS"/"$dir
1401      mkdir $rel_CDIR      mkdir $locDIR
1402      CDIR=`pwd`"/$rel_CDIR"      CDIR=`pwd`"/$locDIR"
1403        
1404      if test "x$CLEANUP" = xt ; then      if test "x$NORUN" = xt ; then
1405          makeclean $dir/$builddir              run=N
1406            genmakemodel $dir/$builddir && genmake=Y \
1407                && makeclean $dir/$builddir \
1408                && symlink_mpifiles $dir $code_dir $builddir \
1409                && makedependmodel $dir/$builddir && makedepend=Y \
1410                && makemodel $dir/$builddir && make=Y
1411      else      else
1412          genmakemodel $dir/$builddir && genmake=Y \          genmakemodel $dir/$builddir && genmake=Y \
1413              && makeclean $dir/$builddir \              && makeclean $dir/$builddir \
1414              && symlink_mpifiles $dir $code_dir $builddir \              && symlink_mpifiles $dir $code_dir $builddir \
1415              && makedependmodel $dir/$builddir && makedepend=Y \              && makedependmodel $dir/$builddir && makedepend=Y \
1416              && makemodel $dir/$builddir && make=Y \              && makemodel $dir/$builddir && make=Y \
1417              && linkdata $use_seperate_build $dir/$rundir \              && run_clean $dir/$rundir \
1418                && linkdata $dir/$rundir $inputdir \
1419              && runmodel $dir/$rundir && run=Y \              && runmodel $dir/$rundir && run=Y \
1420              && results=`testoutput $dir $rundir`              && results=`testoutput_run $dir $rundir $ref_outp`
1421      fi      fi
1422            #echo "results='$results'"
1423      echo  
     if test "x$ADM" = x ; then  
1424          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`          fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1425          echo          echo 1>&2
1426          echo "$fres" >> $SUMMARY          echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1427          echo "fresults='$fres'" > $CDIR"/summary.txt"          touch $locDIR"/summary.txt"
1428          echo "MACH='$MACH'" >> $CDIR"/summary.txt"          echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1429          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"          echo "tdir='$dir'" >> $locDIR"/summary.txt"
1430          echo "DATE='$DATE'" >> $CDIR"/summary.txt"          if test "x$ADM" = xt ; then
1431          echo "tdir='$dir'" >> $CDIR"/summary.txt"              head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
1432                grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \
1433                                    >> $locDIR"/summary.txt"
1434            fi
1435    
1436          for ex in $extra_runs ; do          for ex in $extra_runs ; do
1437              unset run              unset run
1438              results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'              results=$EMPTY_RESULTS
1439                #  reference output file
1440                refExOut=`echo $ref_outp | sed "s/\./.${ex}./g"`
1441              #  Create an output dir for each OPTFILE/tdir.ex combination              #  Create an output dir for each OPTFILE/tdir.ex combination
1442              rel_CDIR=$DRESULTS"/"$dir"."$ex              locDIR=$DRESULTS"/"$dir"."$ex
1443              mkdir $rel_CDIR              mkdir $locDIR
1444              CDIR=`pwd`"/$rel_CDIR"              CDIR=`pwd`"/$locDIR"
1445              test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex"              test ! -e "$dir/$pfxdir.$ex" && mkdir "$dir/$pfxdir.$ex"
1446              for ldir in input.$ex input ; do              run_clean $dir/$pfxdir.$ex
1447                  (              linkdata $dir/$pfxdir.$ex $inputdir.$ex $inputdir
1448                      cd "$dir/$ldir" > /dev/null 2>&1              runmodel $dir/$pfxdir.$ex && run=Y \
1449                      ls -1 2>/dev/null \              && results=`testoutput_run $dir $pfxdir.$ex $refExOut`
                         | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g'  
                 ) > tr_exrun_links  
                 (  
                     cd "$dir/tr_run.$ex"  
                     cat ../../tr_exrun_links | while read i ; do  
                         if test ! "x$i" = x ; then  
                             test ! -r $i  &&  ln -s "../"$ldir"/"$i $i  
                         fi  
                     done  
                 )  
                 test -e tr_exrun_links  &&  rm -f tr_exrun_links  
             done  
             ldir=build  
             (  
                 cd $dir/tr_run.$ex  
                 test ! -e mitgcmuv  &&  ln -s "../"$ldir"/"mitgcmuv .  
             )  
             runmodel $dir/tr_run.$ex && run=Y \  
                 && results=`testoutput $dir tr_run.$ex "."$ex`  
             fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`  
1450              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`              fres=`formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results`
1451              fres="$fres.$ex"              fres="$fres.$ex"
1452              echo              echo 1>&2
1453              echo "$fres" >> $SUMMARY              echo "$fres" | sed 's/ 99/ --/g' | sed 's/  > />/' | sed 's/  < /</' >> $SUMMARY
1454              echo "fresults='$fres'" > $CDIR"/summary.txt"              touch $locDIR"/summary.txt"
1455              echo "MACH='$MACH'" >> $CDIR"/summary.txt"              echo "fresults='$fres'" | sed 's/ 99/ --/g' >> $locDIR"/summary.txt"
1456              echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"              echo "tdir='$dir.$ex'" >> $locDIR"/summary.txt"
1457              echo "DATE='$DATE'" >> $CDIR"/summary.txt"              if test "x$ADM" = xt ; then
1458              echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt"                  head -1 $dir/$builddir/taf_ad.log >> $locDIR"/summary.txt"
1459                    grep -A3 'Seconds in section "ALL' $dir/$pfxdir.$ex/$OUTPUTFILE \
1460                                       >> $locDIR"/summary.txt"
1461                fi
1462                if test "x$POSTCLEAN" = xt ; then
1463                    run_clean $dir/$pfxdir.$ex
1464                fi
1465          done          done
1466      else  
1467          fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}`      if test -f $DRESULTS"/"genmake_state ; then : ; else
1468          fres=$fres"$results   $dir"          if test -f $dir/$builddir/Makefile ; then
1469          echo              mkOpt=`grep '^# OPTFILE=' $dir/$builddir/Makefile 2>/dev/null | head -1 | sed 's/^# //'`
1470          echo "$fres" >> $SUMMARY              echo "from '$dir/$builddir/Makefile', extract:" > $DRESULTS/genmake_state
1471          echo "fresults='$fres'" > $CDIR"/summary.txt"              sed -n '/^# executed by:/,+1 p' $dir/$builddir/Makefile >> $DRESULTS/genmake_state
1472          echo "MACH='$MACH'" >> $CDIR"/summary.txt"              echo " $mkOpt" >> $DRESULTS/genmake_state
1473          echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt"              if test "x$OPTFILE" = xNONE ; then
1474          echo "DATE='$DATE'" >> $CDIR"/summary.txt"                  eval $mkOpt
1475          echo "tdir='$dir'" >> $CDIR"/summary.txt"                  sed "/^No \"OPTFILE\" was specified ; genmake2/a\  OPTFILE=${OPTFILE}"\
1476          grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \                          $SUMMARY > tr_0.tmp_log
1477                             >> $CDIR"/summary.txt"                  RETVAL=$?
1478                    if test "x$RETVAL" = x0 ; then rm -f $SUMMARY
1479                            cp tr_0.tmp_log $SUMMARY
1480                    else rm -f tr_0.tmp_log
1481                    fi
1482                fi
1483                gmkLog=$dir/$builddir/genmake.log
1484                grep '^Get compiler version using:' $gmkLog > /dev/null 2>&1
1485                RETVAL=$?
1486                if test "x$RETVAL" = x0 ; then
1487                    echo "from '$gmkLog', extract compiler version:" >> $DRESULTS/genmake_state
1488                    sed -n '/Get compiler version/,/<-- compiler version/p' $gmkLog \
1489                           | grep -v '^... compiler version ' > tr_1.tmp_log
1490                    sed -n '1,/^$/p' tr_1.tmp_log | sed '/^$/d' | sed 's/^./ &/' \
1491                            >> $DRESULTS/genmake_state
1492                    rm -f tr_1.tmp_log
1493                fi
1494            fi
1495        fi
1496        #postclean $dir/$builddir
1497        if test "x$POSTCLEAN" = xt ; then
1498            makeclean $dir/$builddir \
1499                && run_clean $dir/$rundir
1500      fi      fi
1501    
     postclean $dir/$builddir  
       
1502      echo "-------------------------------------------------------------------------------"      echo "-------------------------------------------------------------------------------"
1503        
1504  done  done
1505    
1506  printf "Start time:  " >> $SUMMARY  printf "Start time:  " >> $SUMMARY
1507  echo $start_date >> $SUMMARY  echo "$start_date" >> $SUMMARY
1508  printf "End time:    " >> $SUMMARY  printf "End time:    " >> $SUMMARY
1509  date >> $SUMMARY  date >> $SUMMARY
1510    
# Line 1124  else Line 1529  else
1529              echo "An email containing results was sent to the following addresses:"              echo "An email containing results was sent to the following addresses:"
1530              echo "  \"$ADDRESSES\""              echo "  \"$ADDRESSES\""
1531              echo              echo
1532                test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"
1533                test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"
1534          fi          fi
         test -f $DRESULTS".tar"  &&  rm -f $DRESULTS".tar"  
         test -f $DRESULTS".tar.gz"  &&  rm -f $DRESULTS".tar.gz"  
1535      fi      fi
1536  fi  fi
1537    
1538  # rm -f tmp_cmpnum.f a.out  if test "x$QUICK" = xf -a "x$NORUN" = xf ; then
1539  rm -f tmp_cmpnum.c tmp_cmpnum      rm -f tr_cmpnum.c tr_cmpnum
1540    fi
1541    
1542  if test "x$CLEANUP" != xt ; then  if test "x$CLEANUP" != xt ; then
1543      cat $SUMMARY | sed 's/ -- -- -- --//g'      cat $SUMMARY | sed 's/ \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \.  \. //'
1544      if test -e tr_out.txt ; then      if test -e tr_out.txt ; then
1545          mv tr_out.txt tr_out.txt.old          mv tr_out.txt tr_out.txt.old
1546      fi      fi
1547      cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt      cat $SUMMARY | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' > tr_out.txt
1548  fi  fi
1549    
1550  if test "x$DELDIR" = xt ; then  if test "x$DELDIR" = xt ; then

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.154

  ViewVC Help
Powered by ViewVC 1.1.22