450 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x ; then |
451 |
files=`( cd ../input ; ls -1 | grep -v CVS )` |
files=`( cd ../input ; ls -1 | grep -v CVS )` |
452 |
for i in $files ; do |
for i in $files ; do |
453 |
if test ! -d "../input/"$i ; then |
if test ! -d "../input/"$i -a ! -f $i ; then |
454 |
ln -sf "../input/"$i $i |
ln -sf "../input/"$i $i |
455 |
fi |
fi |
456 |
done |
done |
529 |
abave = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
530 |
if (abave > 0.0) { |
if (abave > 0.0) { |
531 |
relerr=fabs(a-b)/abave; |
relerr=fabs(a-b)/abave; |
532 |
if (relerr > 0.0) { linnum = (int)log10(relerr); } |
if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } |
533 |
else { linnum = -16 ; } |
else { linnum = -16 ; } |
534 |
best = (best > linnum) ? best : linnum; |
best = (best > linnum) ? best : linnum; |
535 |
} |
} |
539 |
return 0; |
return 0; |
540 |
} |
} |
541 |
EOF |
EOF |
542 |
cc -o tmp_cmpnum tmp_cmpnum.c -lm |
$CC -o tmp_cmpnum tmp_cmpnum.c -lm |
543 |
|
|
544 |
if [ -x ./tmp_cmpnum ]; then |
if [ -x ./tmp_cmpnum ]; then |
545 |
echo "OK" |
echo "OK" |
546 |
return 0 |
return 0 |
547 |
else |
else |
548 |
echo |
echo |
549 |
echo "ERROR: failed to compile comparison code" |
echo "ERROR: failed to compile comparison code -- please specify" |
550 |
|
echo " a C compiler using the CC environment variable." |
551 |
exit 1 |
exit 1 |
552 |
fi |
fi |
553 |
} |
} |
636 |
HAVE_MPACK= |
HAVE_MPACK= |
637 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
638 |
COMMAND= |
COMMAND= |
639 |
MAKE=make |
if test "x$MAKE" = x ; then |
640 |
|
MAKE=make |
641 |
|
fi |
642 |
|
if test "x$CC" = x ; then |
643 |
|
CC=cc |
644 |
|
fi |
645 |
JOBS= |
JOBS= |
646 |
MPI=f |
MPI=f |
647 |
DELDIR= |
DELDIR= |
875 |
if test -r $dir/input/Makefile ; then |
if test -r $dir/input/Makefile ; then |
876 |
( cd $dir/input ; make CLEAN ) |
( cd $dir/input ; make CLEAN ) |
877 |
fi |
fi |
878 |
|
( |
879 |
|
cd $dir |
880 |
|
rm -rf tr_run.* |
881 |
|
) |
882 |
continue |
continue |
883 |
fi |
fi |
884 |
|
|
975 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
976 |
|
|
977 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
978 |
test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex" |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
979 |
mkdir "$dir/tr_run.$ex" |
for ldir in input.$ex input ; do |
980 |
links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
( |
981 |
|
cd "$dir/$ldir" > /dev/null 2>&1 |
982 |
|
ls -1 2>/dev/null \ |
983 |
|
| sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' |
984 |
|
) > tr_exrun_links |
985 |
|
( |
986 |
|
cd "$dir/tr_run.$ex" |
987 |
|
cat ../../tr_exrun_links | while read i ; do |
988 |
|
if test ! "x$i" = x ; then |
989 |
|
test ! -r $i && ln -s "../"$ldir"/"$i $i |
990 |
|
fi |
991 |
|
done |
992 |
|
) |
993 |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
994 |
|
done |
995 |
|
ldir=build |
996 |
|
( |
997 |
|
cd "$dir/$ldir" > /dev/null 2>&1 |
998 |
|
ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ |
999 |
|
| sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' |
1000 |
|
) > tr_exrun_links |
1001 |
( |
( |
1002 |
cd "$dir/tr_run.$ex" |
cd "$dir/tr_run.$ex" |
1003 |
for i in $links; do |
cat ../../tr_exrun_links | while read i ; do |
1004 |
ln -s ../input/$i $i |
if test ! "x$i" = x ; then |
1005 |
done |
test ! -r $i && ln -s "../"$ldir"/"$i $i |
1006 |
) |
fi |
1007 |
links=`( cd "$dir/input.$ex" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
done |
|
( |
|
|
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 |
|
1008 |
) |
) |
1009 |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
1010 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1011 |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
1012 |
fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
fres=`printf '%s %s %s %s' ${genmake:-N} ${makedepend:-N} ${make:-N} ${run:-N}` |
1072 |
rm -f tmp_cmpnum.c tmp_cmpnum |
rm -f tmp_cmpnum.c tmp_cmpnum |
1073 |
|
|
1074 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1075 |
cat $SUMMARY |
cat $SUMMARY | sed 's/ -- -- -- --//g' |
1076 |
if test -e tr_out.txt ; then |
if test -e tr_out.txt ; then |
1077 |
mv tr_out.txt tr_out.txt.old |
mv tr_out.txt tr_out.txt.old |
1078 |
fi |
fi |
1079 |
cat $SUMMARY > tr_out.txt |
cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt |
1080 |
fi |
fi |
1081 |
|
|
1082 |
if test "x$DELDIR" = xt ; then |
if test "x$DELDIR" = xt ; then |