--- MITgcm/verification/testscript 2002/02/26 16:04:50 1.19.2.1 +++ MITgcm/verification/testscript 2002/12/05 08:06:18 1.19.2.2 @@ -21,6 +21,13 @@ fi if [ -r $1/input/output.txt ]; then grep "$2" $1/input/output.txt | sed 's/.*=//' | nl > tmp1.txt + lncnt=`wc -l tmp1.txt | awk '{print $1}' ` + if [ $lncnt -lt 3 ]; then + if [ $verbose -gt 0 ]; then + echo Not enough lines of output when searching for "$2" 1>&2 + fi + return 99 + fi else echo testoutput_for_prop: output.txt from model run was not readable 1>&2 return 99 @@ -29,6 +36,13 @@ echo testoutput_for_prop: grep "$2" $1/results/output.txt 1>&2 fi grep "$2" $1/results/output.txt | sed 's/.*=//' | nl > tmp2.txt + lncnt=`wc -l tmp2.txt | awk '{print $1}' ` + if [ $lncnt -lt 3 ]; then + if [ $verbose -gt 0 ]; then + echo Not enough lines of output when searching for "$2" 1>&2 + fi + return 99 + fi if [ $debug -gt 0 ]; then echo testoutput_for_prop: join tmp1.txt tmp2.txt 1>&2 fi @@ -316,6 +330,8 @@ -clean Do "make CLEAN" after compiling and testing. -shorttest Don't compare numeric output for mean and s.d. of variables. -noieee By default, $0 uses the -ieee option for genmake. This turns it off. + -cleanup Aggresively removes all model output, executables and object files + and then exits. Use with care. Normal usage: $0 * Configure, compile, run and analyze in all experiment directories @@ -334,6 +350,17 @@ fi } +clean_up() +{ +# Find all executables, object files, CPP'd source and model output +# and DELETE it. +for opt in '-name mitgcmuv*' '-name *.o' '-name *.f' '-name *.c' '-path *results -prune -o -name *.meta' '-path *results -prune -o -name *.data' '-type l' + do + echo Cleaning: find . $opt -exec rm {} \; + find . $opt -exec rm {} \; +done +} + ############################################################################### # Main function @@ -352,6 +379,7 @@ for arg in $@ do case $arg in + -cleanup) clean_up; exit 0;; -quick) quick=1;; -verbose) verbose=2;; -debug) debug=1;;