/[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.24.2.1 by adcroft, Wed Oct 1 19:04:01 2003 UTC revision 1.30 by jmc, Thu Aug 30 16:51:50 2007 UTC
# Line 136  genmakemodel() Line 136  genmakemodel()
136   ( cd $1;   ( cd $1;
137     if [ $quick -eq 0 -o ! -r Makefile ]; then     if [ $quick -eq 0 -o ! -r Makefile ]; then
138      printf 'genmake ... ' 1>&2      printf 'genmake ... ' 1>&2
139        find . -type l -exec rm {} \;
140      if [ $ieee -eq 0 ]; then      if [ $ieee -eq 0 ]; then
141       ../../../tools/$genmake -mods=../code > make.log 2>&1       ../../../tools/genmake2 -mods=../code > make.log 2>&1
142      else      else
143       ../../../tools/$genmake -ieee -mods=../code > make.log 2>&1       ../../../tools/genmake2 -ieee -mods=../code > make.log 2>&1
144      fi      fi
145      if [ $? -ne 0 ]; then      if [ $? -ne 0 ]; then
146       tail make.log       tail make.log
# Line 229  makemodel() Line 230  makemodel()
230    
231  linkdata()  linkdata()
232  {  {
233  # linkdata flag      # linkdata flag
234  # symbolically link data files to run directory      #
235   if [ $1 -ne 0 ]; then      # symbolically link data files to run directory
236  # if [ ! -r $2 ]; then      if test "x$1" = x1 ; then
237  #  mkdir $2          (
238  # fi              cd $2
239    ( cd $2; ln -sf ../input/* .)              if test "x$ADM" = x ; then
240   fi                  files=`( cd ../input ; ls -1 | grep -v CVS )`
241                    for i in $files ; do
242                        if test ! -d "../input/"$i ; then
243                            ln -sf "../input/"$i $i
244                        fi
245                    done
246                else
247                    files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`
248                    for i in $files ; do
249                        if test ! -d "../input/"$i ; then
250                            ln -sf "../input/"$i $i
251                        fi
252                    done
253                    files=`( cd ../input_ad ; ls -1 | grep -v CVS )`
254                    for i in $files ; do
255                        if test ! -d "../input_ad/"$i ; then
256                            ln -sf "../input_ad/"$i $i
257                        fi
258                    done
259                fi
260            )
261        fi
262  }  }
263    
264  runmodel()  runmodel()
# Line 250  runmodel() Line 272  runmodel()
272      if [ $quick -eq 0 ]; then      if [ $quick -eq 0 ]; then
273       rm -f output.txt       rm -f output.txt
274      fi      fi
275       if [ $debug -gt 0 ]; then
276        echo -n runmodel: pwd= 1>&2
277        pwd 1>&2
278       fi
279      printf 'runmodel: ' 1>&2      printf 'runmodel: ' 1>&2
280         rm -f *.nc
281       make output.txt && return 0       make output.txt && return 0
282       return 1       return 1
283     fi     fi
284   )   )
285  }  }
286    
287    copynewresults()
288    {
289    # copynewresults directory
290    #
291    #  runs the model "exe" in "directory" (exe is relative to directory)
292    
293     ( cd $1
294       if [ $newresults -eq 1 ]; then
295        if [ -r output.txt ]; then
296         cp -f output.txt ../results/
297         return 0
298        fi
299       fi
300     )
301    }
302    
303  createcodelet()  createcodelet()
304  {  {
305  # create codelet for comparing model output  # create codelet for comparing model output
# Line 322  cat - << EOF Line 365  cat - << EOF
365  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]
366   -help      Show this help message   -help      Show this help message
367   -quick     Skip "genmake" and "make depend" if the Makefile exists   -quick     Skip "genmake" and "make depend" if the Makefile exists
368     -newresults Copy the output.txt into results/
369   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
370   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
371   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
# Line 331  $0 [-help] [-quick] [-verbose] dir1 [dir Line 375  $0 [-help] [-quick] [-verbose] dir1 [dir
375   -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.   -noieee    By default, $0 uses the -ieee option for genmake. This turns it off.
376   -cleanup   Aggresively removes all model output, executables and object files   -cleanup   Aggresively removes all model output, executables and object files
377              and then exits. Use with care.              and then exits. Use with care.
  -2        Use genmake2 rather than genmake  
378    
379  Normal usage:  Normal usage:
380   $0 *       Configure, compile, run and analyze in all experiment directories   $0 *       Configure, compile, run and analyze in all experiment directories
# Line 371  done Line 414  done
414  debug=0  debug=0
415  verbose=1  verbose=1
416  quick=0  quick=0
417    newresults=0
418  force=0  force=0
419  clean=0  clean=0
420  ieee=1  ieee=1
# Line 384  do Line 428  do
428   case $arg in   case $arg in
429     -cleanup) clean_up; exit 0;;     -cleanup) clean_up; exit 0;;
430     -quick) quick=1;;     -quick) quick=1;;
431       -newresults) newresults=1;;
432     -verbose) verbose=2;;     -verbose) verbose=2;;
433     -debug) debug=1;;     -debug) debug=1;;
434     -force) force=1;;     -force) force=1;;
435     -clean) clean=1;;     -clean) clean=1;;
    -2) genmake=genmake2;;  
436     -noieee) ieee=0;;     -noieee) ieee=0;;
437     -shorttest) longtest=0;;     -shorttest) longtest=0;;
438     -quiet) verbose=0;;     -quiet) verbose=0;;
# Line 454  do Line 498  do
498    seperatebuilddir=1    seperatebuilddir=1
499    builddir=build    builddir=build
500    rundir=build    rundir=build
501    (cd $dir/input; rm -f *.{o,f,c,F} work* output.txt Make* make.log; )    (cd $dir/input; rm -f *.{o,f,c,F,h} work* output.txt Make* make.log; )
   (cd $dir/build; ln -sf ../input/* .)  
502   else   else
503    seperatebuilddir=0    seperatebuilddir=0
504    builddir=input    builddir=input
# Line 468  do Line 511  do
511   && linkdata $seperatebuilddir $dir/$rundir \   && linkdata $seperatebuilddir $dir/$rundir \
512   && runmodel $dir/$builddir mitgcmuv && run=Y \   && runmodel $dir/$builddir mitgcmuv && run=Y \
513   && results=`testoutput $dir $rundir` \   && results=`testoutput $dir $rundir` \
514     && copynewresults $dir/$rundir \
515   && makecleanupafter $dir/$builddir   && makecleanupafter $dir/$builddir
516   echo   echo
517   formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results   formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results

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

  ViewVC Help
Powered by ViewVC 1.1.22