294 |
if test "x$IEEE" != x ; then |
if test "x$IEEE" != x ; then |
295 |
command="$command -ieee" |
command="$command -ieee" |
296 |
fi |
fi |
297 |
|
if test "x$MPI" = xt ; then |
298 |
|
command="$command -mpi" |
299 |
|
fi |
300 |
printf 'genmake ... ' 1>&2 |
printf 'genmake ... ' 1>&2 |
301 |
$command > make.log 2>&1 |
$command > make.log 2>&1 |
302 |
RETVAL=$? |
RETVAL=$? |
453 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x ; then |
454 |
files=`( cd ../input ; ls -1 | grep -v CVS )` |
files=`( cd ../input ; ls -1 | grep -v CVS )` |
455 |
for i in $files ; do |
for i in $files ; do |
456 |
if test ! -d "../input/"$i ; then |
if test ! -d "../input/"$i -a ! -f $i ; then |
457 |
ln -sf "../input/"$i $i |
ln -sf "../input/"$i $i |
458 |
fi |
fi |
459 |
done |
done |
532 |
abave = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
533 |
if (abave > 0.0) { |
if (abave > 0.0) { |
534 |
relerr=fabs(a-b)/abave; |
relerr=fabs(a-b)/abave; |
535 |
if (relerr > 0.0) { linnum = (int)log10(relerr); } |
if (relerr > 0.0) { linnum = (int)rint(log10(relerr)); } |
536 |
else { linnum = -16 ; } |
else { linnum = -16 ; } |
537 |
best = (best > linnum) ? best : linnum; |
best = (best > linnum) ? best : linnum; |
538 |
} |
} |
542 |
return 0; |
return 0; |
543 |
} |
} |
544 |
EOF |
EOF |
545 |
cc -o tmp_cmpnum tmp_cmpnum.c -lm |
$CC -o tmp_cmpnum tmp_cmpnum.c -lm |
546 |
|
|
547 |
if [ -x ./tmp_cmpnum ]; then |
if [ -x ./tmp_cmpnum ]; then |
548 |
echo "OK" |
echo "OK" |
549 |
return 0 |
return 0 |
550 |
else |
else |
551 |
echo |
echo |
552 |
echo "ERROR: failed to compile comparison code" |
echo "ERROR: failed to compile comparison code -- please specify" |
553 |
|
echo " a C compiler using the CC environment variable." |
554 |
exit 1 |
exit 1 |
555 |
fi |
fi |
556 |
} |
} |
639 |
HAVE_MPACK= |
HAVE_MPACK= |
640 |
MPACK="$MPACKDIR/mpack" |
MPACK="$MPACKDIR/mpack" |
641 |
COMMAND= |
COMMAND= |
642 |
MAKE=make |
if test "x$MAKE" = x ; then |
643 |
|
MAKE=make |
644 |
|
fi |
645 |
|
if test "x$CC" = x ; then |
646 |
|
CC=cc |
647 |
|
fi |
648 |
JOBS= |
JOBS= |
649 |
MPI=f |
MPI=f |
650 |
DELDIR= |
DELDIR= |
878 |
if test -r $dir/input/Makefile ; then |
if test -r $dir/input/Makefile ; then |
879 |
( cd $dir/input ; make CLEAN ) |
( cd $dir/input ; make CLEAN ) |
880 |
fi |
fi |
881 |
|
( |
882 |
|
cd $dir |
883 |
|
rm -rf tr_run.* |
884 |
|
) |
885 |
continue |
continue |
886 |
fi |
fi |
887 |
|
|
978 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
979 |
|
|
980 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
981 |
test -e "$dir/tr_run.$ex" && rm -rf "$dir/tr_run.$ex" |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
982 |
mkdir "$dir/tr_run.$ex" |
for ldir in input.$ex input ; do |
983 |
links=`( cd "$dir/input" > /dev/null 2>&1 ; ls -1 | grep -v CVS )` |
( |
984 |
|
cd "$dir/$ldir" > /dev/null 2>&1 |
985 |
|
ls -1 2>/dev/null \ |
986 |
|
| sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' |
987 |
|
) > tr_exrun_links |
988 |
|
( |
989 |
|
cd "$dir/tr_run.$ex" |
990 |
|
cat ../../tr_exrun_links | while read i ; do |
991 |
|
if test ! "x$i" = x ; then |
992 |
|
test ! -r $i && ln -s "../"$ldir"/"$i $i |
993 |
|
fi |
994 |
|
done |
995 |
|
) |
996 |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
997 |
|
done |
998 |
|
ldir=build |
999 |
|
( |
1000 |
|
cd "$dir/$ldir" > /dev/null 2>&1 |
1001 |
|
ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ |
1002 |
|
| sed -e 's|^CVS$||g' | sed -e 's|^output.txt$||g' |
1003 |
|
) > tr_exrun_links |
1004 |
( |
( |
1005 |
cd "$dir/tr_run.$ex" |
cd "$dir/tr_run.$ex" |
1006 |
for i in $links; do |
cat ../../tr_exrun_links | while read i ; do |
1007 |
ln -s ../input/$i $i |
if test ! "x$i" = x ; then |
1008 |
done |
test ! -r $i && ln -s "../"$ldir"/"$i $i |
1009 |
) |
fi |
1010 |
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 |
|
1011 |
) |
) |
1012 |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
1013 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1014 |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
1015 |
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}` |
1075 |
rm -f tmp_cmpnum.c tmp_cmpnum |
rm -f tmp_cmpnum.c tmp_cmpnum |
1076 |
|
|
1077 |
if test "x$CLEANUP" != xt ; then |
if test "x$CLEANUP" != xt ; then |
1078 |
cat $SUMMARY |
cat $SUMMARY | sed 's/ -- -- -- --//g' |
1079 |
if test -e tr_out.txt ; then |
if test -e tr_out.txt ; then |
1080 |
mv tr_out.txt tr_out.txt.old |
mv tr_out.txt tr_out.txt.old |
1081 |
fi |
fi |
1082 |
cat $SUMMARY > tr_out.txt |
cat $SUMMARY | sed 's/ -- -- -- --//g' > tr_out.txt |
1083 |
fi |
fi |
1084 |
|
|
1085 |
if test "x$DELDIR" = xt ; then |
if test "x$DELDIR" = xt ; then |