/[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.26 by adcroft, Wed Dec 3 19:43:51 2003 UTC revision 1.28 by adcroft, Thu Mar 25 15:20:33 2004 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/genmake2 -mods=../code > make.log 2>&1       ../../../tools/genmake2 -mods=../code > make.log 2>&1
142      else      else
# 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/{eedata,data*,*.bin,POLY3*,pickup*} .)              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       make output.txt && return 0       make output.txt && return 0
281       return 1       return 1
# Line 257  runmodel() Line 283  runmodel()
283   )   )
284  }  }
285    
286    copynewresults()
287    {
288    # copynewresults directory
289    #
290    #  runs the model "exe" in "directory" (exe is relative to directory)
291    
292     ( cd $1
293       if [ $newresults -eq 1 ]; then
294        if [ -r output.txt ]; then
295         cp -f output.txt ../results/
296         return 0
297        fi
298       fi
299     )
300    }
301    
302  createcodelet()  createcodelet()
303  {  {
304  # create codelet for comparing model output  # create codelet for comparing model output
# Line 322  cat - << EOF Line 364  cat - << EOF
364  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]  $0 [-help] [-quick] [-verbose] dir1 [dir2] [...]
365   -help      Show this help message   -help      Show this help message
366   -quick     Skip "genmake" and "make depend" if the Makefile exists   -quick     Skip "genmake" and "make depend" if the Makefile exists
367     -newresults Copy the output.txt into results/
368   -quiet     Reduce the amount of output   -quiet     Reduce the amount of output
369   -verbose   Produce copious amounts of output   -verbose   Produce copious amounts of output
370   -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 413  done
413  debug=0  debug=0
414  verbose=1  verbose=1
415  quick=0  quick=0
416    newresults=0
417  force=0  force=0
418  clean=0  clean=0
419  ieee=1  ieee=1
# Line 383  do Line 427  do
427   case $arg in   case $arg in
428     -cleanup) clean_up; exit 0;;     -cleanup) clean_up; exit 0;;
429     -quick) quick=1;;     -quick) quick=1;;
430       -newresults) newresults=1;;
431     -verbose) verbose=2;;     -verbose) verbose=2;;
432     -debug) debug=1;;     -debug) debug=1;;
433     -force) force=1;;     -force) force=1;;
# Line 452  do Line 497  do
497    seperatebuilddir=1    seperatebuilddir=1
498    builddir=build    builddir=build
499    rundir=build    rundir=build
500    (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/* .)  
501   else   else
502    seperatebuilddir=0    seperatebuilddir=0
503    builddir=input    builddir=input
# Line 466  do Line 510  do
510   && linkdata $seperatebuilddir $dir/$rundir \   && linkdata $seperatebuilddir $dir/$rundir \
511   && runmodel $dir/$builddir mitgcmuv && run=Y \   && runmodel $dir/$builddir mitgcmuv && run=Y \
512   && results=`testoutput $dir $rundir` \   && results=`testoutput $dir $rundir` \
513     && copynewresults $dir/$rundir \
514   && makecleanupafter $dir/$builddir   && makecleanupafter $dir/$builddir
515   echo   echo
516   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.26  
changed lines
  Added in v.1.28

  ViewVC Help
Powered by ViewVC 1.1.22