--- MITgcm/verification/testscript 2001/03/09 17:56:37 1.1 +++ MITgcm/verification/testscript 2001/06/06 12:24:19 1.6 @@ -1,4 +1,4 @@ -#!/bin/csh +#!/bin/csh -f # Run this script from the verification directory # It will automatically configure, compile, run and verify all experiments @@ -8,9 +8,11 @@ # This is the number of least-significant digits allows to be # in error before the test is classified as a "fail". +set on_error_die set passaccuracy=7 -printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " > summary.txt -printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits experiment >> summary.txt +set SKIP=( ) +printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' " " Make " " " " Exact "# of" " " " " > summary.txt +printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' Config Depend Compile Execute Match Digits Status Experiment >> summary.txt # Pass any arguments foreach arg ($argv) @@ -30,20 +32,34 @@ end rm -f summary.txt exit 0 + breaksw + case -nodie: + unset on_error_die + breaksw + case -skip=*: + set SKIP = ( $SKIP `echo $arg | sed 's/-skip=//' | sed 's/,/ /g' `) + breaksw default: echo Unknown argument given to $0 exit 1 endsw end +# Need to make sure we don't meet non-model problems ... +unlimit + foreach dr ([a-zA-Z01-9]*) if (! -d $dr/input ) continue + foreach skip ($SKIP) + if ( `echo $dr | sed s/$skip.'*'//` == '' ) continue;continue + end set config=- set makedepend=- set compile=- set execute=- set exactmatch=- set accuracy=- + set pass=FAIL echo ============================================================================== echo Entering $dr cd $dr @@ -54,15 +70,11 @@ set untested=($untested $dr) else set config=NO - set makedepend=NO - set compile=NO - set execute=NO - set exactmatch=NO - set accuracy=- cd input echo -n " generating Makefile ..." ../../../tools/genmake -mods=../code >&! make.log if ($status == 0) set config=Yes + set makedepend=NO echo " done." echo -n " make depend ..." make cleanlinks depend >>& make.log @@ -73,17 +85,24 @@ if ($status) then echo " ***** An error occurred during make *****" cat make.log - exit 1 + echo The error during compilation occured in \"$dr\" + set compile=NO + if ($?on_error_die) exit 1 else set compile=Yes + set execute=NO endif echo " done." echo -n " running model ..." - ./mitgcmuv | & grep "D iters" > output.txt + if ($compile == 'Yes') then +# ./mitgcmuv | & grep "D iters" > output.txt + ./mitgcmuv > & output.txt if ($status == 0) then set execute=Yes + set exactmatch=NO + set accuracy=- echo " done." - sed 's/.*D iters, err =//' output.txt \ + grep "D iters" output.txt | sed 's/.*D iters, err =//' \ | grep " 0 " \ > high.txt grep "D iters" ../results/output.txt \ @@ -115,16 +134,19 @@ if ($?fail ) then if (! $?fails) set fails set fails=($fails $dr) + set pass=FAIL echo " ***** FAIL *****" else if (! $?passes) set passes set passes=($passes $dr) + set pass=Pass echo "" echo " ***** PASS (grade $lvl) *****" endif set accuracy=$lvl else set exactmatch=Yes + set pass=Pass echo "" echo Model passed at highest accuracy. echo "" @@ -134,16 +156,21 @@ endif else echo " error" - echo " ***** An error occured running the mode *****" + echo " ***** An error occured running the model *****" tail output.txt - exit 1 + echo The runtime error occured in \"$dr\" + if ($?on_error_die) exit 1 + set pass=- + endif + rm -f high.txt oldhigh.txt low.txt oldlow.txt output.txt make.log endif cd .. endif echo "" cd .. # Pretty summary - printf ' %s\t %s\t %s\t %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $dr >> summary.txt + printresults: + printf ' %s\t %s\t %s\t %s\t %s\t %s\t %s\t%s\n' $config $makedepend $compile $execute $exactmatch $accuracy $pass $dr >> summary.txt end echo ============================================================================== echo ""