/[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.17 by heimbach, Tue Aug 21 15:21:10 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        rm -f output.txt
147        printf 'make clean ... ' 2>&1
148        make CLEAN >> make.log 2>&1
149        if [ $? -ne 0 ]; then
150          tail make.log
151          echo makeclean: make clean failed 1>&2
152          return 1
153        else
154          echo succesful 1>&2
155        fi
156       fi
157     )
158    }
159    
160  makedependmodel()  makedependmodel()
161  {  {
162  # makedependmodel directory  # makedependmodel directory
# Line 179  runmodel() Line 202  runmodel()
202    
203   ( cd $1   ( cd $1
204     if [ -x $2 ]; then     if [ -x $2 ]; then
205      if [ ! -r output.txt -o $quick -eq 0 ]; then      if [ $quick -eq 0 ]; then
206       echo runmodel: running... 1>&2       rm -f output.txt
      ( ./$2 > output.txt 2>&1 ) && return 0  
      return 1  
     else  
      echo runmodel: output.txt is newer than executable 1>&2  
      return 0  
207      fi      fi
208     else      echo -n "runmodel: " 1>&2
209      echo runmodel: executable \"$1/$2\" is missing 1>&2      make output.txt && return 0
210      return 1  #   if [ ! -r output.txt -o $quick -eq 0 ]; then
211    #    echo runmodel: running... 1>&2
212    #    ( ./$2 > output.txt 2>&1 ) && return 0
213    #    rm -f output.txt
214    #    ( make output.txt ) && return 0
215    #    return 1
216    #   else
217    #    echo runmodel: output.txt is newer than executable 1>&2
218    #    ( make output.txt ) && return 0
219    #    return 0
220    #   fi
221    #  else
222    #   echo runmodel: executable \"$1/$2\" is missing 1>&2
223    #   return 1
224     fi     fi
225   )   )
226  }  }
# Line 261  $0 [-help] [-quick] [-verbose] dir1 [dir Line 292  $0 [-help] [-quick] [-verbose] dir1 [dir
292   -quick     Skip "genmake" and "make depend" if the Makefile exists   -quick     Skip "genmake" and "make depend" if the Makefile exists
293   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
294   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
295     -debug     Produce even more output which will mean nothing to most
296     -clean     Do "make CLEAN" before compiling. This forces a complete rebuild.
297     -longtest  Compare numeric output for mean and s.d. of variables.
298     -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.
299    
300  Normal usage:  Normal usage:
301   $0 *       Configure, compile, run and analyze in all experiment directories   $0 *       Configure, compile, run and analyze in all experiment directories
302  EOF  EOF
303  }  }
304    
305    scandirs()
306    {
307    if [ $# -eq 0 ]; then
308     for arg in *
309      do
310       test -d $arg/input && echo $arg
311     done
312    else
313     echo $*
314    fi
315    }
316    
317  ###############################################################################  ###############################################################################
318    
319  # Main function  # Main function
# Line 275  EOF Line 322  EOF
322  debug=0  debug=0
323  verbose=1  verbose=1
324  quick=0  quick=0
325  testmore=0  clean=0
326    ieee=1
327    longtest=0
328  expts=''  expts=''
329    
330  # Process arguments  # Process arguments
# Line 285  do Line 334  do
334     -quick) quick=1;;     -quick) quick=1;;
335     -verbose) verbose=2;;     -verbose) verbose=2;;
336     -debug) debug=1;;     -debug) debug=1;;
337     -testmore) testmore=1;;     -clean) clean=1;;
338       -noieee) ieee=0;;
339       -longtest) longtest=1;;
340     -quiet) verbose=0;;     -quiet) verbose=0;;
341     -help) show_help; exit 0;;     -help) show_help; exit 0;;
342       -*) echo Unrecognized option:$arg; exit 9;;
343     *) test -d $arg && expts=`echo $expts $arg`;;     *) test -d $arg && expts=`echo $expts $arg`;;
344   esac   esac
345  done  done
346    
347  if [ ${#expts} -eq 0 ]; then  if [ $clean -gt 0 -a $quick -gt 0 ]; then
348   echo Scanning all directories   echo You specified -quick and -clean together which conflict.
349   for arg in *   echo Please specify either -quick or -clean or neither but not both.
350    do   exit 1
    test -d $arg && expts=`echo $expts $arg`  
  done  
351  fi  fi
352    
353    #if [ ${#expts} -eq 0 ]; then
354    # echo Scanning all directories
355    # for arg in *
356    #  do
357    #   test -d $arg && expts=`echo $expts $arg`
358    # done
359    #fi
360    expts=`scandirs $expts`
361    
362  createcodelet  createcodelet
363    
364  if [ $testmore -gt 0 ]; then  if [ $longtest -gt 0 ]; then
365  cat << EOF > summary.txt  cat << EOF > summary.txt
366                  T           S           U           V                  T           S           U           V
367  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 390  do
390   echo Experiment: $dir   echo Experiment: $dir
391   echo   echo
392   unset genmake makedepend make run   unset genmake makedepend make run
393   results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'   if [ $longtest -gt 0 ]; then
394   results='-- -- -- -- -- -- -- -- --'    results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
395     else
396      results='-- -- -- -- -- -- -- -- --'
397     fi
398   genmakemodel $dir/input && genmake=Y \   genmakemodel $dir/input && genmake=Y \
399     && makeclean $dir/input \
400   && makedependmodel $dir/input && makedepend=Y \   && makedependmodel $dir/input && makedepend=Y \
401   && makemodel $dir/input && make=Y \   && makemodel $dir/input && make=Y \
402   && runmodel $dir/input mitgcmuv && run=Y \   && runmodel $dir/input mitgcmuv && run=Y \
403   && results=`testoutput $dir`   && results=`testoutput $dir` \
404     && makeclean $dir/input
405   echo   echo
406   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results
407   echo   echo

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

  ViewVC Help
Powered by ViewVC 1.1.22