--- MITgcm/verification/testscript 2001/08/10 16:49:51 1.10 +++ MITgcm/verification/testscript 2001/08/16 15:37:40 1.15 @@ -122,7 +122,11 @@ ( cd $1; if [ $quick -eq 0 -o ! -r Makefile ]; then printf 'genmake ... ' 1>&2 - ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 + if [ $ieee -eq 0 ]; then + ../../../tools/genmake -mods=../code > make.log 2>&1 + else + ../../../tools/genmake -ieee -mods=../code > make.log 2>&1 + fi if [ $? -ne 0 ]; then tail make.log echo genmakemodel: genmake failed 1>&2 @@ -139,6 +143,7 @@ # makedependmodel directory ( cd $1; if [ $clean -gt 0 ]; then + rm -f output.txt printf 'make clean ... ' 2>&1 make CLEAN >> make.log 2>&1 if [ $? -ne 0 ]; then @@ -199,6 +204,7 @@ if [ -x $2 ]; then if [ ! -r output.txt -o $quick -eq 0 ]; then echo runmodel: running... 1>&2 + rm -f output.txt ( ./$2 > output.txt 2>&1 ) && return 0 return 1 else @@ -282,12 +288,25 @@ -debug Produce even more output which will mean nothing to most -clean Do "make CLEAN" before compiling. This forces a complete rebuild. -longtest Compare numeric output for mean and s.d. of variables. + -noieee By default, $0 uses the -ieee option for genmake. This turns it off. Normal usage: $0 * Configure, compile, run and analyze in all experiment directories EOF } +scandirs() +{ +if [ $# -eq 0 ]; then + for arg in * + do + test -d $arg/input && echo $arg + done +else + echo $* +fi +} + ############################################################################### # Main function @@ -297,6 +316,7 @@ verbose=1 quick=0 clean=0 +ieee=1 longtest=0 expts='' @@ -308,21 +328,30 @@ -verbose) verbose=2;; -debug) debug=1;; -clean) clean=1;; + -noieee) ieee=0;; -longtest) longtest=1;; -quiet) verbose=0;; -help) show_help; exit 0;; + -*) echo Unrecognized option:$arg; exit 9;; *) test -d $arg && expts=`echo $expts $arg`;; esac done -if [ ${#expts} -eq 0 ]; then - echo Scanning all directories - for arg in * - do - test -d $arg && expts=`echo $expts $arg` - done +if [ $clean -gt 0 -a $quick -gt 0 ]; then + echo You specified -quick and -clean together which conflict. + echo Please specify either -quick or -clean or neither but not both. + exit 1 fi +#if [ ${#expts} -eq 0 ]; then +# echo Scanning all directories +# for arg in * +# do +# test -d $arg && expts=`echo $expts $arg` +# done +#fi +expts=`scandirs $expts` + createcodelet if [ $longtest -gt 0 ]; then @@ -354,8 +383,11 @@ echo Experiment: $dir echo unset genmake makedepend make run - results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' - results='-- -- -- -- -- -- -- -- --' + if [ $longtest -gt 0 ]; then + results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' + else + results='-- -- -- -- -- -- -- -- --' + fi genmakemodel $dir/input && genmake=Y \ && makeclean $dir/input \ && makedependmodel $dir/input && makedepend=Y \