--- MITgcm/verification/testreport 2004/12/09 15:52:33 1.55 +++ MITgcm/verification/testreport 2004/12/16 20:25:11 1.61 @@ -1,6 +1,6 @@ #! /usr/bin/env bash # -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.55 2004/12/09 15:52:33 edhill Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/verification/testreport,v 1.61 2004/12/16 20:25:11 edhill Exp $ # $Name: $ # @@ -450,7 +450,7 @@ if test "x$ADM" = x ; then files=`( cd ../input ; ls -1 | grep -v CVS )` for i in $files ; do - if test ! -d "../input/"$i ; then + if test ! -d "../input/"$i -a ! -f $i ; then ln -sf "../input/"$i $i fi done @@ -520,7 +520,7 @@ int main( int argc, char** argv ) { int linnum,best,lncnt; double a,b,abave,relerr; - best = -16; + best = -22; lncnt = 0; while( 1 & (lncnt+=1) < 999 ) { scanf("%d", &linnum); @@ -529,13 +529,9 @@ abave = 0.5*(fabs(a)+fabs(b)); if (abave > 0.0) { relerr=fabs(a-b)/abave; - if (relerr > 0.0) { - linnum = (int)log10(relerr); - best = (best > linnum) ? best : linnum; - } - } - else { - if (best == -16) best = -22; + 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= @@ -968,27 +970,25 @@ 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" - links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` - ( - cd "$dir/tr_run.$ex" - for i in $links; do - ln -s ../input/$i $i - done - ) - links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` - ( - cd "$dir/tr_run.$ex" - for i in $links; do - test -e $i && rm -f $i - ln -s ../input.$ex/$i $i - done - ln -s ../$builddir/mitgcmuv mitgcmuv - ) + test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" + for ldir in build input input.$ex ; do + ( + cd "$dir/$ldir" > /dev/null 2>&1 + ls -1 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 -e $i && rm -f $i + ln -s "../"$ldir"/"$i $i + fi + done + ) + test -e tr_exrun_links && rm -f tr_exrun_links + done 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}` @@ -1002,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"