/[MITgcm]/MITgcm/tools/do_tst_2+2
ViewVC logotype

Diff of /MITgcm/tools/do_tst_2+2

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.12 by jmc, Wed May 18 14:23:57 2011 UTC revision 1.15 by jmc, Sat Aug 18 18:59:14 2012 UTC
# Line 28  CLEAN=0 Line 28  CLEAN=0
28  TESTDIRS=  TESTDIRS=
29  SKIPDIRS=  SKIPDIRS=
30  SCRIPT='../tools/tst_2+2'  SCRIPT='../tools/tst_2+2'
31  LOGFILE='tst_2+2_outp.log'  LOGFILE='tst_2+2_out.log'
32  scrArg='All'  scrArg='All'
33  COMMAND=  COMMAND=
34  mpi=0  mpi=0
# Line 78  do Line 78  do
78    fi    fi
79  done  done
80    
 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 ""  
81  #------------------------  #------------------------
   
82  if test $CLEAN = 1 ; then  if test $CLEAN = 1 ; then
83     echo "clean output from script '$SCRIPT' for experiment in:"
84     echo " $LIST"
85     echo ""
86   for xx in $LIST   for xx in $LIST
87   do   do
88    listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )`    listD='run '`(cd $xx/results ; ls output.*.txt 2> /dev/null | sed 's/^output\./tr_run./g' | sed 's/\.txt$//g' )`
# Line 108  if test $CLEAN = 1 ; then Line 100  if test $CLEAN = 1 ; then
100   done   done
101   exit   exit
102  fi  fi
103    if test -x $SCRIPT ; then
104     echo "run script '$SCRIPT' for experiment in:"
105     echo " $LIST"
106     echo ""
107     yy=`echo $SCRIPT | grep -c '^\/'`
108     if test $yy = 0 ; then SCRIPT="../../$SCRIPT" ; fi
109    else
110     echo "ERROR: script '$SCRIPT' not found or not executable"
111     exit
112    fi
113    
114  #------------------------  #------------------------
115  #  Create a uniquely named directory to store results  #  Create a uniquely named directory to store results
116  CMDLINE=$0  CMDLINE=$0
# Line 116  for xx in "$@" ; do nw=`echo $xx | wc -w Line 119  for xx in "$@" ; do nw=`echo $xx | wc -w
119                          else CMDLINE="$CMDLINE '$xx'" ; fi                          else CMDLINE="$CMDLINE '$xx'" ; fi
120  done  done
121  #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done  #for xx in "$@" ; do CMDLINE="$CMDLINE '$xx'" ; done
122  DATE=`date +%Y%m%d`  DATE=''
123    if test -f tr_out.txt ; then
124    #  try to use the date corresponding to 'Start time:' in file "tr_out.txt" :
125      sTime=`grep '^Start time:  ' tr_out.txt 2>/dev/null | sed 's/Start time:  //'`
126      if test "x$sTime" != x ; then DATE=`date -d "$sTime" "+%Y%m%d" 2>/dev/null` ; fi
127    fi
128    #  otherwise, use current date:
129    if test "x$DATE" = x ; then DATE=`date +%Y%m%d`; fi
130  BASE="rs_"$OUTDIR"_"$DATE"_"  BASE="rs_"$OUTDIR"_"$DATE"_"
131  xx=0  xx=0
132  DRESULTS="$BASE$xx"  DRESULTS="$BASE$xx"
# Line 156  fi Line 166  fi
166    
167  for xx in $LIST  for xx in $LIST
168  do  do
169    echo ==============================================================================    echo '------------------------------------------------------------------------------'
170    if [ $mpi -le 0 ] ; then    if [ $mpi -le 0 ] ; then
171      rCommand=$COMMAND      rCommand=$COMMAND
172    else    else
# Line 279  cp -p $SUMMARY tst_2+2_out.txt Line 289  cp -p $SUMMARY tst_2+2_out.txt
289  if test "x$ADDRESS" = x ; then  if test "x$ADDRESS" = x ; then
290    rm -rf $DRESULTS    rm -rf $DRESULTS
291  fi  fi
   

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.15

  ViewVC Help
Powered by ViewVC 1.1.22