--- MITgcm/tools/do_tst_2+2 2011/05/18 14:23:57 1.12 +++ MITgcm/tools/do_tst_2+2 2012/08/18 18:59:14 1.15 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/do_tst_2+2,v 1.12 2011/05/18 14:23:57 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/MITgcm/tools/do_tst_2+2,v 1.15 2012/08/18 18:59:14 jmc Exp $ # $Name: $ usage() @@ -28,7 +28,7 @@ TESTDIRS= SKIPDIRS= SCRIPT='../tools/tst_2+2' -LOGFILE='tst_2+2_outp.log' +LOGFILE='tst_2+2_out.log' scrArg='All' COMMAND= mpi=0 @@ -78,19 +78,11 @@ fi done -if test -x $SCRIPT ; then - echo "run script '$SCRIPT' for experiment in:" - echo " $LIST" - yy=`echo $SCRIPT | grep -c '^\/'` - if test $yy = 0 ; then SCRIPT="../../$SCRIPT" ; fi -else - echo "ERROR: script '$SCRIPT' not found or not executable" - exit -fi -echo "" #------------------------ - if test $CLEAN = 1 ; then + echo "clean output from script '$SCRIPT' for experiment in:" + echo " $LIST" + echo "" for xx in $LIST do listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )` @@ -108,6 +100,17 @@ done exit fi +if test -x $SCRIPT ; then + echo "run script '$SCRIPT' for experiment in:" + echo " $LIST" + echo "" + yy=`echo $SCRIPT | grep -c '^\/'` + if test $yy = 0 ; then SCRIPT="../../$SCRIPT" ; fi +else + echo "ERROR: script '$SCRIPT' not found or not executable" + exit +fi + #------------------------ # Create a uniquely named directory to store results CMDLINE=$0 @@ -116,7 +119,14 @@ else CMDLINE="$CMDLINE '$xx'" ; fi done #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done -DATE=`date +%Y%m%d` +DATE='' +if test -f tr_out.txt ; then +# try to use the date corresponding to 'Start time:' in file "tr_out.txt" : + sTime=`grep '^Start time: ' tr_out.txt 2>/dev/null | sed 's/Start time: //'` + if test "x$sTime" != x ; then DATE=`date -d "$sTime" "+%Y%m%d" 2>/dev/null` ; fi +fi +# otherwise, use current date: +if test "x$DATE" = x ; then DATE=`date +%Y%m%d`; fi BASE="rs_"$OUTDIR"_"$DATE"_" xx=0 DRESULTS="$BASE$xx" @@ -156,7 +166,7 @@ for xx in $LIST do - echo ============================================================================== + echo '------------------------------------------------------------------------------' if [ $mpi -le 0 ] ; then rCommand=$COMMAND else @@ -279,4 +289,3 @@ if test "x$ADDRESS" = x ; then rm -rf $DRESULTS fi -