515 |
# (where "$COMMAND" is relative to "directory") |
# (where "$COMMAND" is relative to "directory") |
516 |
( |
( |
517 |
cd $1 |
cd $1 |
518 |
printf 'runmodel ... ' 1>&2 |
printf 'runmodel in %s ...' $1 1>&2 |
519 |
# make output.txt |
# make output.txt |
520 |
echo |
echo |
521 |
rm -f run.log |
rm -f run.log |
522 |
|
if test output.txt -ot mitgcmuv ; then |
523 |
|
( eval $COMMAND ) > run.log 2>&1 |
524 |
|
RETVAL=$? |
525 |
|
else |
526 |
|
echo ' output.txt is up to date ' > run.log 2>&1 |
527 |
|
RETVAL=0 |
528 |
|
fi |
529 |
# echo "COMMAND='$COMMAND'" |
# echo "COMMAND='$COMMAND'" |
530 |
# echo "pwd='"`pwd`"'" |
# echo "pwd='"`pwd`"'" |
|
( eval $COMMAND ) > run.log 2>&1 |
|
|
RETVAL=$? |
|
531 |
if test "x$RETVAL" = x0 ; then |
if test "x$RETVAL" = x0 ; then |
532 |
tail run.log |
tail run.log |
533 |
echo successful 1>&2 |
echo successful 1>&2 |
816 |
fi |
fi |
817 |
|
|
818 |
if test "x$COMMAND" = x ; then |
if test "x$COMMAND" = x ; then |
819 |
COMMAND="$MAKE output.txt" |
COMMAND="./mitgcmuv > output.txt" |
820 |
fi |
fi |
821 |
|
|
822 |
echo "OK" |
echo "OK" |
996 |
echo "Experiment: $dir" |
echo "Experiment: $dir" |
997 |
echo |
echo |
998 |
unset genmake makedepend make run |
unset genmake makedepend make run |
999 |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
1000 |
|
|
1001 |
# Create an output dir for each OPTFILE/tdir combination |
# Create an output dir for each OPTFILE/tdir combination |
1002 |
rel_CDIR=$DRESULTS"/"$dir |
rel_CDIR=$DRESULTS"/"$dir |
1028 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
1029 |
|
|
1030 |
for ex in $extra_runs ; do |
for ex in $extra_runs ; do |
1031 |
|
unset run |
1032 |
|
results='-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --' |
1033 |
|
# Create an output dir for each OPTFILE/tdir.ex combination |
1034 |
|
rel_CDIR=$DRESULTS"/"$dir"."$ex |
1035 |
|
mkdir $rel_CDIR |
1036 |
|
CDIR=`pwd`"/$rel_CDIR" |
1037 |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
test ! -e "$dir/tr_run.$ex" && mkdir "$dir/tr_run.$ex" |
1038 |
for ldir in input.$ex input ; do |
for ldir in input.$ex input ; do |
1039 |
( |
( |
1053 |
done |
done |
1054 |
ldir=build |
ldir=build |
1055 |
( |
( |
1056 |
cd "$dir/$ldir" > /dev/null 2>&1 |
cd $dir/tr_run.$ex |
1057 |
ls -1 Makefile *.[fFhco] mitgcmuv 2>/dev/null \ |
test ! -e mitgcmuv && ln -s "../"$ldir"/"mitgcmuv . |
|
| 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 |
|
1058 |
) |
) |
|
test -e tr_exrun_links && rm -f tr_exrun_links |
|
1059 |
runmodel $dir/tr_run.$ex && run=Y \ |
runmodel $dir/tr_run.$ex && run=Y \ |
1060 |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
&& results=`testoutput $dir tr_run.$ex "."$ex` |
1061 |
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}` |
1067 |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
echo "MACH='$MACH'" >> $CDIR"/summary.txt" |
1068 |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
echo "UNAMEA='$UNAMEA'" >> $CDIR"/summary.txt" |
1069 |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
echo "DATE='$DATE'" >> $CDIR"/summary.txt" |
1070 |
echo "tdir='$dir'" >> $CDIR"/summary.txt" |
echo "tdir='$dir.$ex'" >> $CDIR"/summary.txt" |
1071 |
done |
done |
1072 |
else |
else |
1073 |
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}` |