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" |
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 2>/dev/null |
test ! -e mitgcmuv && ln -s "../"$ldir"/"mitgcmuv . |
|
) > tr_exrun_tmp |
|
|
echo "Makefile" > tr_exrun_links |
|
|
echo "mitgcmuv" >> tr_exrun_links |
|
|
cat tr_exrun_tmp | grep '\.[fFhco]$' >> 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_tmp && rm -f tr_exrun_tmp |
|
|
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}` |