--- mitgcm.org/scripts/check_outp 2008/09/11 16:10:00 1.4 +++ mitgcm.org/scripts/check_outp 2009/05/02 14:37:05 1.9 @@ -1,6 +1,6 @@ #! /usr/bin/env bash -# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/check_outp,v 1.4 2008/09/11 16:10:00 jmc Exp $ +# $Header: /home/ubuntu/mnt/e9_copy/mitgcm.org/scripts/check_outp,v 1.9 2009/05/02 14:37:05 jmc Exp $ # # The purpose of this script is to compare # the latest output with the previous one (from the same platform with @@ -18,6 +18,7 @@ echo " (-l |-list )MACHINES check platforms from this list" echo " [def=\"$MACHINES\"]" echo " (-d |-day )FIRSTDAY select output from day=\"YYYYMMDD\"" + echo " (argument of \"date -d\" is allowed)" echo " [def=\"$FIRSTDAY\"]" echo " (-u |-upto )LASTDAY until last day=\"YYYYMMDD\" (=selected period)" echo " [def=\"FIRSTDAY\"]" @@ -101,6 +102,16 @@ esac done +#-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD +ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` +if test "x$ttt" != 'xyz' ; then + FIRSTDAY=`date -d "$FIRSTDAY" +%Y%m%d` +fi +ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` +if test "x$ttt" != 'xyz' ; then + echo "Error: FIRSTDAY='$FIRSDAY' not recognized" + exit 2 +fi if test $LASTDAY = "30000000" ; then LASTDAY=$FIRSTDAY ; fi CMDLINE=$0 for xx in "$@" ; do nw=`echo $xx | wc -w` @@ -144,7 +155,7 @@ fi else echo "$INDIR is not a directory" - exit + exit 3 fi #- a short summary of this checking : @@ -233,11 +244,13 @@ ADJOINT= RESTART=0 NOI3E=0 + MTH=0 if test -r $dir/summary.txt ; then comm=`grep 'ADJOINT=true' $dir/summary.txt 2>/dev/null` eval $comm RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` - NOI3E=`grep -c "^run: .*testreport .* '*-noieee'* " $dir/summary.txt` + NOI3E=`grep -c "^run: .*testreport.* '*-noieee'* " $dir/summary.txt` + MTH=`grep -c "^run: .*testreport.* -mth " $dir/summary.txt` fi if test "x$RESTART" = x0 ; then kind="forward" @@ -248,6 +261,10 @@ if test "x$NOI3E" = x1 ; then OPTFILE="${OPTFILE}.noieee" fi + if test "x$MTH" = x1 ; then + yy=`echo $OPTFILE | grep -c 'mth$'` + if test $yy = 0 ; then OPTFILE="${OPTFILE}+mth" ; fi + fi day=`echo $i | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'` ttt=`echo $day | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'` day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'` @@ -269,7 +286,7 @@ cat ./slist | tee -a $OUTPFIL fi echo ".... previous list (n=$n):" | tee -a $OUTPFIL - cat ./plist | tee -a $OUTPFIL + cat ./plist | tee -a $OUTPFIL | head -20 fi fi @@ -291,7 +308,9 @@ num=`grep -c "^$key" ./plist` #- discard unsafe test: dd=`echo $optf | grep -c 'gfortran.*mth'` - if [ $dd -ge 1 ] ; then num=-1 ; fi + if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi + if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi + if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi if test $num -gt 0 ; then pline=`grep "^$key " ./plist | head -1` if test $dBug = 't' ; then @@ -375,4 +394,4 @@ fi echo ".. cat $OUTPSUM" cat $OUTPSUM - +exit 0