--- MITgcm/verification/testreport 2005/08/16 17:12:46 1.71 +++ MITgcm/verification/testreport 2006/03/20 21:50:36 1.77 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.71 2005/08/16 17:12:46 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.77 2006/03/20 21:50:36 jmc Exp $ # $Name: $ # @@ -125,9 +125,14 @@ fi return 99 fi - non_real_numb=`egrep -c -i 'NAN|INF' tmp1.txt` - if [ $non_real_numb -gt 0 ]; then - echo testoutput_for_prop: output.txt has $non_real_numb not real numbers 1>&2 + has_nan=`cat tmp1.txt | grep -i nan | wc -l` + if [ $has_nan -gt 0 ] ; then + echo testoutput_for_prop: output.txt contains $has_nan NaN values 1>&2 + return 99 + fi + has_inf=`cat tmp1.txt | grep -i inf | wc -l` + if [ $has_inf -gt 0 ] ; then + echo testoutput_for_prop: output.txt contains $has_inf Inf values 1>&2 return 99 fi if [ $debug -gt 0 ]; then @@ -510,14 +515,19 @@ # (where "$COMMAND" is relative to "directory") ( cd $1 - printf 'runmodel ... ' 1>&2 + printf 'runmodel in %s ...' $1 1>&2 # make output.txt echo rm -f run.log + if test $OUTPUTFILE -ot $EXECUTABLE ; then + ( eval $COMMAND ) > run.log 2>&1 + RETVAL=$? + else + echo " $OUTPUTFILE is up to date " > run.log 2>&1 + RETVAL=0 + fi # echo "COMMAND='$COMMAND'" # echo "pwd='"`pwd`"'" - ( eval $COMMAND ) > run.log 2>&1 - RETVAL=$? if test "x$RETVAL" = x0 ; then tail run.log echo successful 1>&2 @@ -801,15 +811,24 @@ OPTFILE=$MITGCM_OF fi +if test "x$ADM" = xt ; then + EXECUTABLE="mitgcmuv_ad" + OUTPUTFILE="output.txt_adm" +else + EXECUTABLE="mitgcmuv" + OUTPUTFILE="output.txt" +fi + if test "x$ADM" = xt -a "x$COMMAND" = x ; then - COMMAND="./mitgcmuv_ad > output.txt_adm 2>&1" + COMMAND="./$EXECUTABLE > $OUTPUTFILE" fi if test "x$COMMAND" = x ; then - COMMAND="$MAKE output.txt" + COMMAND="./$EXECUTABLE > $OUTPUTFILE" fi -echo "OK" +#echo "OK" +echo "OK (COMMAND= $COMMAND )" # create the FORTRAN comparison code createcodelet @@ -986,7 +1005,7 @@ echo "Experiment: $dir" echo unset genmake makedepend make run - results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' + results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' # Create an output dir for each OPTFILE/tdir combination rel_CDIR=$DRESULTS"/"$dir @@ -1018,6 +1037,12 @@ echo "tdir='$dir'" >> $CDIR"/summary.txt" for ex in $extra_runs ; do + unset run + results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' + # Create an output dir for each OPTFILE/tdir.ex combination + rel_CDIR=$DRESULTS"/"$dir"."$ex + mkdir $rel_CDIR + CDIR=`pwd`"/$rel_CDIR" test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" for ldir in input.$ex input ; do ( @@ -1037,19 +1062,9 @@ done ldir=build ( - cd "$dir/$ldir" > /dev/null 2>&1 - ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ - | sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' - ) > tr_exrun_links - ( - cd "$dir/tr_run.$ex" - cat ../../tr_exrun_links | while read i ; do - if test ! "x$i" = x ; then - test ! -r $i && ln -s "../"$ldir"/"$i $i - fi - done + cd $dir/tr_run.$ex + test ! -e mitgcmuv && ln -s "../"$ldir"/"mitgcmuv . ) - test -e tr_exrun_links && rm -f tr_exrun_links runmodel $dir/tr_run.$ex && run=Y \ && results=`testoutput $dir tr_run.$ex "."$ex` fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` @@ -1061,7 +1076,7 @@ echo "MACH='$MACH'" >> $CDIR"/summary.txt" echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" echo "DATE='$DATE'" >> $CDIR"/summary.txt" - echo "tdir='$dir'" >> $CDIR"/summary.txt" + echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" done else fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` @@ -1073,6 +1088,8 @@ echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" + grep -A3 'Seconds in section "ALL' $dir/$rundir/$OUTPUTFILE \ + >> $CDIR"/summary.txt" fi postclean $dir/$builddir