/[MITgcm]/MITgcm/verification/testscript
ViewVC logotype

Diff of /MITgcm/verification/testscript

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.9 by adcroft, Mon Aug 6 15:11:03 2001 UTC revision 1.13 by adcroft, Tue Aug 14 18:29:43 2001 UTC
# Line 82  if [ $debug -gt 0 ]; then Line 82  if [ $debug -gt 0 ]; then
82   echo testoutput: cg2dres=$cg2dres 1>&2   echo testoutput: cg2dres=$cg2dres 1>&2
83  fi  fi
84    
85  if [ $testmore -gt 0 ]; then  if [ $longtest -gt 0 ]; then
86  testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$?  testoutput_for_prop $1 "dynstat_theta_min" "theta minimum"; tmin=$?
87  testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$?  testoutput_for_prop $1 "dynstat_theta_max" "theta maximum"; tmax=$?
88  testoutput_for_prop $1 "dynstat_theta_mean" "theta mean"; tmean=$?  testoutput_for_prop $1 "dynstat_theta_mean" "theta mean"; tmean=$?
# Line 122  genmakemodel() Line 122  genmakemodel()
122   ( cd $1;   ( cd $1;
123     if [ $quick -eq 0 -o ! -r Makefile ]; then     if [ $quick -eq 0 -o ! -r Makefile ]; then
124      printf 'genmake ... ' 1>&2      printf 'genmake ... ' 1>&2
125      ../../../tools/genmake -ieee -mods=../code > make.log 2>&1      if [ $ieee -eq 0 ]; then
126         ../../../tools/genmake -mods=../code > make.log 2>&1
127        else
128         ../../../tools/genmake -ieee -mods=../code > make.log 2>&1
129        fi
130      if [ $? -ne 0 ]; then      if [ $? -ne 0 ]; then
131       tail make.log       tail make.log
132       echo makemodel: genmake failed 1>&2       echo genmakemodel: genmake failed 1>&2
133       return 1       return 1
134      else      else
135        echo succesful 1>&2        echo succesful 1>&2
# Line 134  genmakemodel() Line 138  genmakemodel()
138   )   )
139  }  }
140    
141    makeclean()
142    {
143    # makedependmodel directory
144     ( cd $1;
145       if [ $clean -gt 0 ]; then
146        printf 'make clean ... ' 2>&1
147        make CLEAN >> make.log 2>&1
148        if [ $? -ne 0 ]; then
149          tail make.log
150          echo makeclean: make clean failed 1>&2
151          return 1
152        else
153          echo succesful 1>&2
154        fi
155       fi
156     )
157    }
158    
159  makedependmodel()  makedependmodel()
160  {  {
161  # makedependmodel directory  # makedependmodel directory
# Line 261  $0 [-help] [-quick] [-verbose] dir1 [dir Line 283  $0 [-help] [-quick] [-verbose] dir1 [dir
283   -quick     Skip "genmake" and "make depend" if the Makefile exists   -quick     Skip "genmake" and "make depend" if the Makefile exists
284   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
285   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
286     -debug     Produce even more output which will mean nothing to most
287     -clean     Do "make CLEAN" before compiling. This forces a complete rebuild.
288     -longtest  Compare numeric output for mean and s.d. of variables.
289    
290  Normal usage:  Normal usage:
291   $0 *       Configure, compile, run and analyze in all experiment directories   $0 *       Configure, compile, run and analyze in all experiment directories
292  EOF  EOF
293  }  }
294    
295    scandirs()
296    {
297    if [ $# -eq 0 ]; then
298     for arg in *
299      do
300       test -d $arg/input && echo $arg
301     done
302    else
303     echo $*
304    fi
305    }
306    
307  ###############################################################################  ###############################################################################
308    
309  # Main function  # Main function
# Line 275  EOF Line 312  EOF
312  debug=0  debug=0
313  verbose=1  verbose=1
314  quick=0  quick=0
315  testmore=0  clean=0
316    ieee=0
317    longtest=0
318  expts=''  expts=''
319    
320  # Process arguments  # Process arguments
# Line 285  do Line 324  do
324     -quick) quick=1;;     -quick) quick=1;;
325     -verbose) verbose=2;;     -verbose) verbose=2;;
326     -debug) debug=1;;     -debug) debug=1;;
327     -testmore) testmore=1;;     -clean) clean=1;;
328       -ieee) ieee=1;;
329       -longtest) longtest=1;;
330     -quiet) verbose=0;;     -quiet) verbose=0;;
331     -help) show_help; exit 0;;     -help) show_help; exit 0;;
332       -*) echo Unrecognized option:$arg; exit 9;;
333     *) test -d $arg && expts=`echo $expts $arg`;;     *) test -d $arg && expts=`echo $expts $arg`;;
334   esac   esac
335  done  done
336    
337  if [ ${#expts} -eq 0 ]; then  #if [ ${#expts} -eq 0 ]; then
338   echo Scanning all directories  # echo Scanning all directories
339   for arg in *  # for arg in *
340    do  #  do
341     test -d $arg && expts=`echo $expts $arg`  #   test -d $arg && expts=`echo $expts $arg`
342   done  # done
343  fi  #fi
344    expts=`scandirs $expts`
345    
346  createcodelet  createcodelet
347    
348  if [ $testmore -gt 0 ]; then  if [ $longtest -gt 0 ]; then
349  cat << EOF > summary.txt  cat << EOF > summary.txt
350                  T           S           U           V                  T           S           U           V
351  C D M    c        m  s        m  s        m  s        m  s  C D M    c        m  s        m  s        m  s        m  s
# Line 331  do Line 374  do
374   echo Experiment: $dir   echo Experiment: $dir
375   echo   echo
376   unset genmake makedepend make run   unset genmake makedepend make run
377   results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'   if [ $longtest -gt 0 ]; then
378   results='-- -- -- -- -- -- -- -- --'    results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
379     else
380      results='-- -- -- -- -- -- -- -- --'
381     fi
382   genmakemodel $dir/input && genmake=Y \   genmakemodel $dir/input && genmake=Y \
383     && makeclean $dir/input \
384   && makedependmodel $dir/input && makedepend=Y \   && makedependmodel $dir/input && makedepend=Y \
385   && makemodel $dir/input && make=Y \   && makemodel $dir/input && make=Y \
386   && runmodel $dir/input mitgcmuv && run=Y \   && runmodel $dir/input mitgcmuv && run=Y \

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.13

  ViewVC Help
Powered by ViewVC 1.1.22