/[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 by jmc, Mon Jun 23 22:13:48 2003 UTC revision 1.27 by adcroft, Wed Jan 21 20:38:22 2004 UTC
# Line 137  genmakemodel() Line 137  genmakemodel()
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      if [ $ieee -eq 0 ]; then      if [ $ieee -eq 0 ]; then
140       ../../../tools/genmake -mods=../code > make.log 2>&1       ../../../tools/genmake2 -mods=../code > make.log 2>&1
141      else      else
142       ../../../tools/genmake -ieee -mods=../code > make.log 2>&1       ../../../tools/genmake2 -ieee -mods=../code > make.log 2>&1
143      fi      fi
144      if [ $? -ne 0 ]; then      if [ $? -ne 0 ]; then
145       tail make.log       tail make.log
146       echo genmakemodel: genmake failed 1>&2       echo genmakemodel: $genmake failed 1>&2
147       return 1       return 1
148      else      else
149        echo succesful 1>&2        echo succesful 1>&2
# Line 229  makemodel() Line 229  makemodel()
229    
230  linkdata()  linkdata()
231  {  {
232  # linkdata flag      # linkdata flag
233  # symbolically link data files to run directory      #
234   if [ $1 -ne 0 ]; then      # symbolically link data files to run directory
235  # if [ ! -r $2 ]; then      if test "x$1" = x1 ; then
236  #  mkdir $2          (
237  # fi              cd $2
238    ( cd $2; ln -sf ../input/* .)              if test "x$ADM" = x ; then
239   fi                  files=`( cd ../input ; ls -1 | grep -v CVS )`
240                    for i in $files ; do
241                        if test ! -d "../input/"$i ; then
242                            ln -sf "../input/"$i $i
243                        fi
244                    done
245                else
246                    files=`( cd ../input ; ls -1 *.bin | grep -v CVS )`
247                    for i in $files ; do
248                        if test ! -d "../input/"$i ; then
249                            ln -sf "../input/"$i $i
250                        fi
251                    done
252                    files=`( cd ../input_ad ; ls -1 | grep -v CVS )`
253                    for i in $files ; do
254                        if test ! -d "../input_ad/"$i ; then
255                            ln -sf "../input_ad/"$i $i
256                        fi
257                    done
258                fi
259            )
260        fi
261  }  }
262    
263  runmodel()  runmodel()
# Line 250  runmodel() Line 271  runmodel()
271      if [ $quick -eq 0 ]; then      if [ $quick -eq 0 ]; then
272       rm -f output.txt       rm -f output.txt
273      fi      fi
274       if [ $debug -gt 0 ]; then
275        echo -n runmodel: pwd= 1>&2
276        pwd 1>&2
277       fi
278      printf 'runmodel: ' 1>&2      printf 'runmodel: ' 1>&2
279       make output.txt && return 0       make output.txt && return 0
280       return 1       return 1
# Line 257  runmodel() Line 282  runmodel()
282   )   )
283  }  }
284    
285    copynewresults()
286    {
287    # copynewresults directory
288    #
289    #  runs the model "exe" in "directory" (exe is relative to directory)
290    
291     ( cd $1
292       if [ $newresults -eq 1 ]; then
293        if [ -r output.txt ]; then
294         cp -f output.txt ../results/
295         return 0
296        fi
297       fi
298     )
299    }
300    
301  createcodelet()  createcodelet()
302  {  {
303  # create codelet for comparing model output  # create codelet for comparing model output
# Line 322  cat - << EOF Line 363  cat - << EOF
363  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]
364   -help      Show this help message   -help      Show this help message
365   -quick     Skip "genmake" and "make depend" if the Makefile exists   -quick     Skip "genmake" and "make depend" if the Makefile exists
366     -newresults Copy the output.txt into results/
367   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
368   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
369   -debug     Produce even more output which will mean nothing to most   -debug     Produce even more output which will mean nothing to most
# Line 370  done Line 412  done
412  debug=0  debug=0
413  verbose=1  verbose=1
414  quick=0  quick=0
415    newresults=0
416  force=0  force=0
417  clean=0  clean=0
418  ieee=1  ieee=1
419  longtest=1  longtest=1
420  expts=''  expts=''
421    genmake=genmake
422    
423  # Process arguments  # Process arguments
424  for arg in $@  for arg in $@
# Line 382  do Line 426  do
426   case $arg in   case $arg in
427     -cleanup) clean_up; exit 0;;     -cleanup) clean_up; exit 0;;
428     -quick) quick=1;;     -quick) quick=1;;
429       -newresults) newresults=1;;
430     -verbose) verbose=2;;     -verbose) verbose=2;;
431     -debug) debug=1;;     -debug) debug=1;;
432     -force) force=1;;     -force) force=1;;
# Line 441  do Line 486  do
486   echo   echo
487   echo Experiment: $dir   echo Experiment: $dir
488   echo   echo
489   unset genmake makedepend make run   unset genmakepass makedepend make run
490   if [ $longtest -gt 0 ]; then   if [ $longtest -gt 0 ]; then
491    results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'    results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --'
492   else   else
# Line 451  do Line 496  do
496    seperatebuilddir=1    seperatebuilddir=1
497    builddir=build    builddir=build
498    rundir=build    rundir=build
499    (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/* .)  
500   else   else
501    seperatebuilddir=0    seperatebuilddir=0
502    builddir=input    builddir=input
503    rundir=input    rundir=input
504   fi   fi
505   genmakemodel $dir/$builddir && genmake=Y \   genmakemodel $dir/$builddir && genmakepass=Y \
506   && makecleancompile $dir/$builddir \   && makecleancompile $dir/$builddir \
507   && makedependmodel $dir/$builddir && makedepend=Y \   && makedependmodel $dir/$builddir && makedepend=Y \
508   && makemodel $dir/$builddir && make=Y \   && makemodel $dir/$builddir && make=Y \
509   && linkdata $seperatebuilddir $dir/$rundir \   && linkdata $seperatebuilddir $dir/$rundir \
510   && runmodel $dir/$builddir mitgcmuv && run=Y \   && runmodel $dir/$builddir mitgcmuv && run=Y \
511   && results=`testoutput $dir $rundir` \   && results=`testoutput $dir $rundir` \
512     && copynewresults $dir/$rundir \
513   && makecleanupafter $dir/$builddir   && makecleanupafter $dir/$builddir
514   echo   echo
515   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results   formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results
516   echo   echo
517   formatresults $dir ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> summary.txt   formatresults $dir ${genmakepass:-N} ${makedepend:-N} ${make:-N} ${run:-N} $results >> summary.txt
518   fi   fi
519  done  done
520    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.27

  ViewVC Help
Powered by ViewVC 1.1.22