--- MITgcm/verification/testreport 2004/11/24 17:06:07 1.50 +++ MITgcm/verification/testreport 2004/12/11 02:48:45 1.59 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.50 2004/11/24 17:06:07 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.59 2004/12/11 02:48:45 edhill Exp $ # $Name: $ # @@ -519,23 +519,19 @@ #include int main( int argc, char** argv ) { int linnum,best,lncnt; - double a,b,diff; - best = -16; + double a,b,abave,relerr; + best = -22; lncnt = 0; while( 1 & (lncnt+=1) < 999 ) { scanf("%d", &linnum); if (linnum == -1) break; scanf("%lf", &a); scanf("%lf", &b); - diff = 0.5*(fabs(a)+fabs(b)); - if (diff > 1.e-12) { - diff=fabs(a-b)/diff; - if (diff > 0.0) { - linnum = (int)log10(diff); - best = (best > linnum) ? best : linnum; - } - else { - if (best == -16 && diff != 0) best = -22; - } + abave = 0.5*(fabs(a)+fabs(b)); + if (abave > 0.0) { + relerr=fabs(a-b)/abave; + if (relerr > 0.0) { linnum = (int)log10(relerr); } + else { linnum = -16 ; } + best = (best > linnum) ? best : linnum; } } if (lncnt == 999) best=-29; @@ -543,14 +539,15 @@ return 0; } EOF - cc -o tmp_cmpnum tmp_cmpnum.c -lm + $CC -o tmp_cmpnum tmp_cmpnum.c -lm if [ -x ./tmp_cmpnum ]; then echo "OK" return 0 else echo - echo "ERROR: failed to compile comparison code" + echo "ERROR: failed to compile comparison code -- please specify" + echo " a C compiler using the CC environment variable." exit 1 fi } @@ -639,7 +636,12 @@ HAVE_MPACK= MPACK="$MPACKDIR/mpack" COMMAND= -MAKE=make +if test "x$MAKE" = x ; then + MAKE=make +fi +if test "x$CC" = x ; then + CC=cc +fi JOBS= MPI=f DELDIR= @@ -881,7 +883,6 @@ fout= if test "x$ADM" = x ; then fout=$dir"/results/output.txt" - check_for_add_mon_output $fout else fout=$dir"/results_ad/output.txt_adm" fi @@ -889,6 +890,9 @@ echo "can't read \"$fout\" -- skipping $dir" continue fi + if test "x$ADM" = x ; then + check_for_add_mon_output $fout + fi # Check for additional types of monitor output @@ -966,8 +970,6 @@ echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" - OLD_COMMAND=$COMMAND - COMMAND="./mitgcmuv > output.txt" for ex in $extra_runs ; do test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex" mkdir "$dir/tr_run.$ex" @@ -1000,7 +1002,6 @@ echo "DATE='$DATE'" >> $CDIR"/summary.txt" echo "tdir='$dir'" >> $CDIR"/summary.txt" done - COMMAND=$OLD_COMMAND else fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` fres=$fres"$results $dir"