| 39 | 
 make_resdir_list() | 
 make_resdir_list() | 
| 40 | 
 { | 
 { | 
| 41 | 
       if test $monthDir == 1 ; then | 
       if test $monthDir == 1 ; then | 
| 42 | 
         dir_list=`grep '.._'$mname ./dir_all` | 
         dir_list=`grep '.._'$mname $TMP.dir_all` | 
| 43 | 
       else | 
       else | 
| 44 | 
         dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/??_*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )` | 
         dir_list=`( cd $INDIR ; ls -1 -t ../$PREV_P/??_*${mname}*/summary.txt 2> /dev/null | sed 's/\/summary.txt//' )` | 
| 45 | 
         #echo "dir_list='$dir_list'" | 
         #echo "dir_list='$dir_list'" | 
| 104 | 
             ADJOINT=0 | 
             ADJOINT=0 | 
| 105 | 
             TANGLIN=0 | 
             TANGLIN=0 | 
| 106 | 
             OPENAD=0 | 
             OPENAD=0 | 
| 107 | 
  | 
             TAPENAD=0 | 
| 108 | 
             RESTART=0 | 
             RESTART=0 | 
| 109 | 
  | 
             Special=0 | 
| 110 | 
             EXTRA= | 
             EXTRA= | 
| 111 | 
             FAST=0 | 
             FAST=0 | 
| 112 | 
             DVLP=0 | 
             DVLP=0 | 
| 114 | 
             MTH=0 | 
             MTH=0 | 
| 115 | 
             UR4=0 | 
             UR4=0 | 
| 116 | 
             if test -r $dir/summary.txt ; then | 
             if test -r $dir/summary.txt ; then | 
| 117 | 
  | 
                 TAPENAD=`grep -c ' generated by Tapenade' $dir/summary.txt` | 
| 118 | 
                 ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt` | 
                 ADJOINT=`grep -c -i '^ADJOINT' $dir/summary.txt` | 
| 119 | 
  | 
                 TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt` | 
| 120 | 
                 if test "x$ADJOINT" = x1 ; then | 
                 if test "x$ADJOINT" = x1 ; then | 
| 121 | 
                   OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt` | 
                   OPENAD=`grep -c '^Adjoint .* OpenAD' $dir/summary.txt` | 
| 122 | 
                 fi | 
                 fi | 
 | 
                 TANGLIN=`grep -c -i '^TANGLIN' $dir/summary.txt` | 
  | 
 | 
                 if test "x$TANGLIN" = x1 ; then | 
  | 
 | 
                   OPENAD=`grep -c '^TangLin .* OpenAD' $dir/summary.txt` | 
  | 
 | 
                 fi | 
  | 
| 123 | 
                 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` | 
                 RESTART=`grep -c 'test 2+2=4 summary' $dir/summary.txt` | 
| 124 | 
  | 
                 #- special label for "darwin" test | 
| 125 | 
  | 
                 Special=`echo $i | grep -c '\-darwin[0-9]'` | 
| 126 | 
  | 
                 if test $Special != 0 ; then | 
| 127 | 
  | 
                     Special=`echo $i | sed -e "s/.*$mname/$mname/" -e "s/_/ /g" -e "s/-/ /g"` | 
| 128 | 
  | 
                     if test $dBug = 't' ; then echo -n " Special='$Special' ;" | tee -a $OUTPFIL ;  fi | 
| 129 | 
  | 
                     Special=`echo $Special | awk '{print $2}' | sed 's/darwin//'` | 
| 130 | 
  | 
                 fi | 
| 131 | 
                 comm=`grep '^run: .*testreport.* ' $dir/summary.txt` | 
                 comm=`grep '^run: .*testreport.* ' $dir/summary.txt` | 
| 132 | 
                 EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"` | 
                 EXTRA=`echo "$comm" | grep " -*-tdir\>" | sed -e "s/^.* -*-tdir\>//" -e "s/ -.*$//"` | 
| 133 | 
                 if test "x$EXTRA" = x ; then | 
                 if test "x$EXTRA" = x ; then | 
| 134 | 
                     EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"` | 
                     EXTRA=`echo "$comm" | grep " -*-t\>" | sed -e "s/^.*-*-t\>//" -e "s/ -.*$//"` | 
| 135 | 
                 fi | 
                 fi | 
| 136 | 
                 if test "x$EXTRA" = x ; then EXTRA=0 ; else | 
                 if test "x$EXTRA" = x ; then EXTRA=0 ; else | 
| 137 | 
                     #echo -n "EXTRA=$EXTRA" | 
                     #if test $dBug = 't' ; then echo -n " EXTRA='$EXTRA' ;" | tee -a $OUTPFIL ;  fi | 
| 138 | 
                     nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w` | 
                     nn0=`echo $EXTRA | sed "s/ *' *//g" | wc -w` | 
| 139 | 
                     nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"` | 
                     nn1=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"` | 
| 140 | 
                     nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<darwin_"` | 
                     nn2=`echo $EXTRA | sed "s/ *' *//g" | tr ' ' '\n' | grep -c "\<monod_"` | 
| 141 | 
                     EXTRA=1 | 
                     EXTRA=9 | 
| 142 | 
                     if [ $nn1 -ge 2 ] ; then EXTRA=2 ; fi | 
                     if [ $nn1 -ge 2 ] ; then EXTRA=1 ; fi | 
| 143 | 
                     if [ $nn2 -ge 2 ] ; then EXTRA=3 ; fi | 
                     if [ $nn2 -ge 2 ] ; then EXTRA=2 ; fi | 
| 144 | 
                     #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2" | 
                     #echo " : nn0=$nn0 ; nn1=$nn1 ; nn2=$nn2" | 
| 145 | 
                 fi | 
                 fi | 
| 146 | 
  | 
                 if test $dBug = 't' ; then if [ $Special -ne 0 -o $EXTRA -ne 0 ] ; then | 
| 147 | 
  | 
                     echo "      Special='$Special' ; EXTRA='$EXTRA'" | tee -a $OUTPFIL | 
| 148 | 
  | 
                 fi ; fi | 
| 149 | 
                 FAST=`echo "$comm" | grep -c " -*-fast\>"` | 
                 FAST=`echo "$comm" | grep -c " -*-fast\>"` | 
| 150 | 
                 if test "x$FAST" = x0 ; then | 
                 if test "x$FAST" = x0 ; then | 
| 151 | 
                    FAST=`echo "$comm" | grep -c " '*-noieee'*"` | 
                    FAST=`echo "$comm" | grep -c " '*-noieee'*"` | 
| 160 | 
                 if test "x$UR4" = x0 ; then | 
                 if test "x$UR4" = x0 ; then | 
| 161 | 
                    UR4=`echo "$comm" | grep -c " -*-ur4\>"` | 
                    UR4=`echo "$comm" | grep -c " -*-ur4\>"` | 
| 162 | 
                 fi | 
                 fi | 
| 163 | 
             fi | 
             else EXTRA=0 ; fi | 
| 164 | 
             if test "x$ADJOINT" = x1 ; then | 
             if test "x$ADJOINT" = x1 ; then | 
| 165 | 
                 kind="adm-TAF" ; order=0 | 
                 kind="adm-TAF" ; order=0 | 
| 166 | 
                 if test "x$OPENAD" = x1 ; then kind="adm-OAD" ; order=2 ; fi | 
                 if test "x$TAPENAD" = x1 ; then | 
| 167 | 
  | 
                    kind="adm-TAP" ; order=2 | 
| 168 | 
  | 
                 elif test "x$OPENAD" = x1 ; then | 
| 169 | 
  | 
                    kind="adm-OAD" ; order=4 | 
| 170 | 
  | 
                 fi | 
| 171 | 
             elif test "x$TANGLIN" = x1 ; then | 
             elif test "x$TANGLIN" = x1 ; then | 
| 172 | 
                 kind="tlm-TAF" ; order=1 | 
                 kind="tlm-TAF" ; order=1 | 
| 173 | 
                 if test "x$OPENAD" = x1 ; then kind="tlm-OAD" ; order=3 ; fi | 
                 if test "x$TAPENAD" = x1 ; then kind="tlm-TAP" ; order=3 ; fi | 
| 174 | 
             elif test "x$RESTART" = x0 ; then | 
             elif test "x$RESTART" = x0 ; then | 
| 175 | 
                 kind="forward" ; order=4 | 
                 kind="forward" ; order=6 | 
| 176 | 
             else | 
             else | 
| 177 | 
                 kind="restart" ; order=5 | 
                 kind="restart" ; order=7 | 
| 178 | 
             fi | 
             fi | 
 | 
             order=`expr $order + 10 \* $EXTRA` | 
  | 
 | 
             order=`printf '%3.3i' $order` | 
  | 
| 179 | 
             if test "x$UR4" = x1 ; then | 
             if test "x$UR4" = x1 ; then | 
| 180 | 
                 OPTFILE="${OPTFILE}.use_r4" | 
                 OPTFILE="${OPTFILE}.use_r4" | 
| 181 | 
             fi | 
             fi | 
| 182 | 
             if test "x$MPI" = x1 ; then | 
             if test "x$MPI" = x1 ; then | 
| 183 | 
                 yy=`echo $OPTFILE | grep -c '+mpi'` | 
                 yy=`echo $OPTFILE | grep -c '+mpi'` | 
| 184 | 
                 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" ; fi | 
                 if test $yy = 0 ; then yy=`echo $OPTFILE | grep -c '+impi'` ; fi | 
| 185 | 
  | 
                 if test $yy = 0 ; then OPTFILE="${OPTFILE}+mpi" | 
| 186 | 
  | 
                                 else order=`expr $order + 200` ; fi | 
| 187 | 
             fi | 
             fi | 
| 188 | 
             if test "x$MTH" = x1 ; then | 
             if test "x$MTH" = x1 ; then | 
| 189 | 
                 yy=`echo $OPTFILE | grep -c '+mth$'` | 
                 yy=`echo $OPTFILE | grep -c '+mth$'` | 
| 195 | 
             if test "x$DVLP" = x1 ; then | 
             if test "x$DVLP" = x1 ; then | 
| 196 | 
                 OPTFILE="${OPTFILE}.dvlp" | 
                 OPTFILE="${OPTFILE}.dvlp" | 
| 197 | 
             fi | 
             fi | 
| 198 | 
  | 
             if [ $Special -eq 0 ] ; then | 
| 199 | 
  | 
                 order=`expr $order + 10 \* $EXTRA` | 
| 200 | 
  | 
             else | 
| 201 | 
  | 
                 order=`expr $order + 10 \* $Special` | 
| 202 | 
  | 
             fi | 
| 203 | 
  | 
             order=`printf '%3.3i' $order` | 
| 204 | 
             day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'` | 
             day=`echo $i   | sed -e 's/_[0-9]$//' | sed -e 's/_[0-9][0-9]$//'` | 
| 205 | 
             ttt=`echo $day | 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]$//'` | 
| 206 | 
             day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'` | 
             day=`echo $ttt | sed -e 's|_| |g' |awk '{print $NF}'` | 
| 207 | 
  | 
  | 
| 208 | 
             if [ $day -lt $BEFORE ] ; then | 
             if [ $day -lt $BEFORE ] ; then | 
| 209 | 
                 echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./plist | 
                 echo "$OPTFILE$order $day $OPTFILE $kind $i" >> $TMP.plist | 
| 210 | 
             elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then | 
             elif [ $day -ge $FIRSTDAY -a $day -le $LASTDAY ] ; then | 
| 211 | 
                 echo "$OPTFILE$order $day $OPTFILE $kind $i" >> ./slist | 
                 echo "$OPTFILE$order $day $OPTFILE $kind $i" >> $TMP.slist | 
| 212 | 
             else | 
             else | 
| 213 | 
                 if test $dBug = 't' ; then | 
                 if test $dBug = 't' ; then | 
| 214 | 
                    echo "discard day='$day' from: $i" | tee -a $OUTPFIL | 
                    echo "discard day='$day' from: $i" | tee -a $OUTPFIL | 
| 219 | 
         if test $dBug = 't' ; then | 
         if test $dBug = 't' ; then | 
| 220 | 
           if test $monthDir == 1 ; then | 
           if test $monthDir == 1 ; then | 
| 221 | 
             echo "---- current list (n=$monthDir) :" | tee -a $OUTPFIL | 
             echo "---- current list (n=$monthDir) :" | tee -a $OUTPFIL | 
| 222 | 
                 cat ./slist | tee -a $OUTPFIL | 
                 cat $TMP.slist | tee -a $OUTPFIL | 
| 223 | 
           fi | 
           fi | 
| 224 | 
           num1=`wc -l ./slist | awk '{print $1}'` | 
           num1=`wc -l $TMP.slist | awk '{print $1}'` | 
| 225 | 
           if test $num1 -gt 0 ; then | 
           if test $num1 -gt 0 ; then | 
| 226 | 
           echo   ".... previous list (n=$monthDir):" | tee -a $OUTPFIL | 
           echo   ".... previous list (n=$monthDir):" | tee -a $OUTPFIL | 
| 227 | 
                 cat ./plist | tee -a $OUTPFIL | head -20 | 
                 cat $TMP.plist | tee -a $OUTPFIL | head -20 | 
| 228 | 
           fi | 
           fi | 
| 229 | 
           echo "----" | tee -a $OUTPFIL | 
           echo "----" | tee -a $OUTPFIL | 
| 230 | 
         fi | 
         fi | 
| 231 | 
 } | 
 } | 
| 232 | 
  | 
  | 
| 244 | 
 OUTPFIL=`basename $0`'.log' | 
 OUTPFIL=`basename $0`'.log' | 
| 245 | 
 NBLDIFF=5 | 
 NBLDIFF=5 | 
| 246 | 
 ADDRESS='none' | 
 ADDRESS='none' | 
| 247 | 
  | 
 MAILCMD="mail" | 
| 248 | 
 dBug=f | 
 dBug=f | 
| 249 | 
 t4update=0 | 
 t4update=0 | 
| 250 | 
 sTime=`date` | 
 sTime=`date` | 
| 263 | 
     fi | 
     fi | 
| 264 | 
  | 
  | 
| 265 | 
     ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` | 
     ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` | 
 | 
  | 
  | 
| 266 | 
     case $ac_option in | 
     case $ac_option in | 
| 267 | 
          | 
          | 
| 268 | 
         -help | --help | -h | --h) usage ;; | 
         -help | --help | -h | --h) usage ;; | 
| 292 | 
  | 
  | 
| 293 | 
         *) echo "Error: don't understand argument \"$ac_option\"" | 
         *) echo "Error: don't understand argument \"$ac_option\"" | 
| 294 | 
            usage ;; | 
            usage ;; | 
 | 
  | 
  | 
| 295 | 
      esac | 
      esac | 
| 296 | 
  | 
  | 
| 297 | 
 done | 
 done | 
| 298 | 
  | 
  | 
| 299 | 
  | 
 #TMP=./chkoutp_$$ | 
| 300 | 
  | 
 #- try to put temporary files in system-local /tmp dir | 
| 301 | 
  | 
 TMP=/tmp/chkoutp_$$ | 
| 302 | 
  | 
 touch $TMP ; retVal=$? | 
| 303 | 
  | 
 if [ $retVal -eq 0 ] ; then | 
| 304 | 
  | 
   if test ! -r $TMP ; then TMP=./chkoutp_$$ ; fi | 
| 305 | 
  | 
 else | 
| 306 | 
  | 
   TMP=./chkoutp_$$ | 
| 307 | 
  | 
 fi | 
| 308 | 
  | 
 rm -f $TMP | 
| 309 | 
  | 
 if test $dBug = 't' ; then echo "temp files: $TMP" ; fi | 
| 310 | 
  | 
  | 
| 311 | 
 #-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD | 
 #-- test FIRSTDAY content ; interpret as "date -d" arg. if not YYYYMMDD | 
| 312 | 
 ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` | 
 ttt=`echo "y$FIRSTDAY" | sed 's/[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/z/'` | 
| 313 | 
 if test "x$ttt" != 'xyz' ; then | 
 if test "x$ttt" != 'xyz' ; then | 
| 334 | 
 PREV_P="${PY}_${PM}"; | 
 PREV_P="${PY}_${PM}"; | 
| 335 | 
 PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9][0-9][0-9]/&_/'` | 
 PERIOD=`echo $PERIOD | sed 's/^[0-9][0-9][0-9][0-9]/&_/'` | 
| 336 | 
  | 
  | 
| 337 | 
 #INDIR="/net/orwell/export/export-9/mitgcm-testing/results/$PERIOD" | 
 #INDIR="/net/zany.mit.edu/data/ORWELL/export-9/mitgcm-testing/results/$PERIOD" | 
| 338 | 
 INDIR="/u/u0/httpd/html/testing/results/$PERIOD" | 
 INDIR="/u/u0/httpd/html/testing/results/$PERIOD" | 
| 339 | 
 #INDIR="/u/u2/jmc/mitgcm/test_web/results/$PERIOD" | 
 #INDIR="$HOME/mitgcm/test_web/results/$PERIOD" | 
| 340 | 
  | 
  | 
| 341 | 
 #- a short summary of this checking : | 
 #- a short summary of this checking : | 
| 342 | 
 OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'` | 
 OUTPSUM=`echo $LASTDAY | sed 's/^20../_/'` | 
| 351 | 
     if test $PRC_MAILS -ot $OUTPSUM ; then | 
     if test $PRC_MAILS -ot $OUTPSUM ; then | 
| 352 | 
       echo ' '$CMDLINE | tee -a $OUTPSUM | 
       echo ' '$CMDLINE | tee -a $OUTPSUM | 
| 353 | 
       echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM | 
       echo " t4update: skip "`basename $0`" ( $PRC_MAILS older than $OUTPSUM )" | tee -a $OUTPSUM | 
| 354 | 
       echo "End  time:   "`date` | tee -a $OUTPSUM | 
       echo " End  time:  "`date` | tee -a $OUTPSUM | 
| 355 | 
       exit 0 | 
       exit 0 | 
| 356 | 
     else | 
     else | 
| 357 | 
       if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi | 
       if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi | 
| 358 | 
       echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL | 
       echo " t4update: run "`basename $0`" ( $PRC_MAILS newer than $OUTPSUM )" | tee $OUTPFIL | 
| 359 | 
     fi | 
     fi | 
| 360 | 
  | 
   elif test -f $OUTPSUM -a $FIRSTDAY = $CURR_DAY ; then | 
| 361 | 
  | 
       echo ' '$CMDLINE | tee -a $OUTPSUM | 
| 362 | 
  | 
       echo " t4update: skip "`basename $0`" ( $PRC_MAILS missing )" | tee -a $OUTPSUM | 
| 363 | 
  | 
       echo " End  time:  "`date` | tee -a $OUTPSUM | 
| 364 | 
  | 
       exit 0 | 
| 365 | 
   else | 
   else | 
| 366 | 
       if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi | 
       if test -e $OUTPFIL ; then mv -f $OUTPFIL $OUTPFIL'_bak' ; fi | 
| 367 | 
       echo " t4update ignored (not current day or $PRC_MAILS or $OUTPSUM missing)" | tee $OUTPFIL | 
       echo " t4update ignored (not current day or $OUTPSUM missing)" | tee $OUTPFIL | 
| 368 | 
   fi | 
   fi | 
| 369 | 
 elif test -e $OUTPFIL ; then | 
 elif test -e $OUTPFIL ; then | 
| 370 | 
   mv -f $OUTPFIL $OUTPFIL'_bak' | 
   mv -f $OUTPFIL $OUTPFIL'_bak' | 
| 409 | 
 echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM | 
 echo "    Machine   Tot. Nb.   no    Nb with  Nb diff" >> $OUTPSUM | 
| 410 | 
 echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM | 
 echo "     name     checked   comp    Diff    lines"  >> $OUTPSUM | 
| 411 | 
  | 
  | 
| 412 | 
 ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > ./dir_all | 
 ( cd $INDIR ; ls -1 -t */summary.txt | sed 's/\/summary.txt//' ) > $TMP.dir_all | 
| 413 | 
  | 
  | 
| 414 | 
 if test "x$MACHINES" = "x_All_" ; then | 
 if test "x$MACHINES" = "x_All_" ; then | 
| 415 | 
   MACHINES="aces- acesgrid baudelaire dickens danton beagle" | 
   MACHINES="villon batsi engaging1 engaging- svante glacier" | 
| 416 | 
   MACHINES="$MACHINES pleiades iblade sx8 uv100 solasrv stomp weber" | 
   MACHINES="$MACHINES albedo pleiades archer" | 
| 417 | 
  | 
  | 
| 418 | 
   MALL=`cat ./dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` | 
   MALL=`cat $TMP.dir_all | sed -e 's|_| |g' | awk '{print $2}' | sort | uniq` | 
| 419 | 
   for madd in $MALL ; do | 
   for madd in $MALL ; do | 
| 420 | 
     present=0 | 
     present=0 | 
| 421 | 
     for m in $MACHINES ; do | 
     for m in $MACHINES ; do | 
| 444 | 
     echo " name='$pname'" >> $OUTPFIL | 
     echo " name='$pname'" >> $OUTPFIL | 
| 445 | 
     ctot=0 ; cmis=0 ; cdif=0 | 
     ctot=0 ; cmis=0 ; cdif=0 | 
| 446 | 
  | 
  | 
| 447 | 
     # put results from selected period in "slist", | 
     # put results from selected period in "TMP.slist", | 
| 448 | 
     #     results from previous period in "plist" | 
     #     results from previous period in "TMP.plist" | 
| 449 | 
     rm -f ./plist ./slist ; touch ./plist ./slist | 
     rm -f $TMP.plist $TMP.slist ; touch $TMP.plist $TMP.slist | 
| 450 | 
  | 
  | 
| 451 | 
     #- create list of results (slist & plist) from current month directory | 
     #- create list of results (slist & plist) from current month directory | 
| 452 | 
     monthDir=1 | 
     monthDir=1 | 
| 453 | 
     make_resdir_list | 
     make_resdir_list | 
| 454 | 
  | 
  | 
| 455 | 
     #  Do we have any data?  If so, create the latest pointer. | 
     #  Do we have any data?  If so, create the latest pointer. | 
| 456 | 
     num=`wc -l ./slist | awk '{print $1}'` | 
     num=`wc -l $TMP.slist | awk '{print $1}'` | 
| 457 | 
     if test $num -gt 0 ; then | 
     if test $num -gt 0 ; then | 
| 458 | 
  | 
  | 
| 459 | 
         keys=`cat ./slist | cut -d " " -f 1 | sort | uniq` | 
         keys=`cat $TMP.slist | cut -d " " -f 1 | sort | uniq` | 
| 460 | 
  | 
  | 
| 461 | 
         for key in $keys ; do | 
         for key in $keys ; do | 
| 462 | 
           ctot=`expr $ctot + 1` | 
           ctot=`expr $ctot + 1` | 
| 463 | 
           sline=`grep "^$key " ./slist | head -1` | 
           sline=`grep "^$key " $TMP.slist | head -1` | 
| 464 | 
           sdir=`echo $sline | cut -d " " -f 5` | 
           sdir=`echo $sline | cut -d " " -f 5` | 
| 465 | 
           type=`echo $sline | cut -d " " -f 4` | 
           type=`echo $sline | cut -d " " -f 4` | 
| 466 | 
           optf=`echo $sline | cut -d " " -f 3` | 
           optf=`echo $sline | cut -d " " -f 3` | 
| 467 | 
           num=`grep -c "^$key" ./plist` | 
           num=`grep -c "^$key" $TMP.plist` | 
| 468 | 
           if test $num = 0 -a $monthDir = 1 ; then | 
           if test $num = 0 -a $monthDir = 1 ; then | 
| 469 | 
           #- add results from previous month directory to "plist". | 
           #- add results from previous month directory to "plist". | 
| 470 | 
             monthDir=2 | 
             monthDir=2 | 
| 471 | 
             make_resdir_list | 
             make_resdir_list | 
| 472 | 
             num=`grep -c "^$key" ./plist` | 
             num=`grep -c "^$key" $TMP.plist` | 
| 473 | 
           fi | 
           fi | 
| 474 | 
           #- discard unsafe test: | 
           #- discard unsafe test: | 
| 475 | 
           dd=`echo $optf | grep -c 'gfortran+mth'` | 
           dd=`echo $optf | grep -c 'gfortran+mth'` | 
| 476 | 
           if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi | 
           #if test $mname = 'lagoon' -a $dd = 1 ; then num=-1 ; fi | 
| 477 | 
           if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi | 
           #if test $mname = 'harbor' -a $dd = 1 ; then num=-1 ; fi | 
| 478 | 
           #if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi | 
           #if test $mname = 'aces' -a $optf = 'linux_ia32_open64' ; then num=-1 ; fi | 
| 479 | 
           #if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi | 
           #if test $mname = 'aces' -a $optf = 'linux_ia32_g95' ; then num=-1 ; fi | 
| 480 | 
           dd=`echo $optf | grep -c 'bigred.*noieee'` | 
           dd=`echo $optf | grep -c 'bigred.*noieee'` | 
| 483 | 
             echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL | 
             echo "  discard $sdir : $type , of='$optf'" | tee -a $OUTPFIL | 
| 484 | 
             cmis=`expr $cmis + 1` | 
             cmis=`expr $cmis + 1` | 
| 485 | 
           elif test $num = '0' ; then | 
           elif test $num = '0' ; then | 
| 486 | 
             echo "no previous test for:" $key | tee -a $OUTPFIL | 
             echo "  dir='$sdir', type='$type', of='$optf':" | tee -a $OUTPFIL | 
| 487 | 
  | 
             echo "  --> no previous test matching key='$key'" | tee -a $OUTPFIL | 
| 488 | 
             cmis=`expr $cmis + 1` | 
             cmis=`expr $cmis + 1` | 
| 489 | 
           else | 
           else | 
| 490 | 
             pline=`grep "^$key " ./plist | head -1` | 
             pline=`grep "^$key " $TMP.plist | head -1` | 
| 491 | 
             if test $dBug = 't' ; then | 
             if test $dBug = 't' ; then | 
| 492 | 
                 echo "s='$sline'" | tee -a $OUTPFIL | 
                 echo "s='$sline'" | tee -a $OUTPFIL | 
| 493 | 
                 echo "p='$pline'" | tee -a $OUTPFIL | 
                 echo "p='$pline'" | tee -a $OUTPFIL | 
| 496 | 
             outs="$INDIR/$sdir/summary.txt" | 
             outs="$INDIR/$sdir/summary.txt" | 
| 497 | 
             xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1` | 
             xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outs ) | tail -1` | 
| 498 | 
             sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ | 
             sed "1,$xx d" $outs | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ | 
| 499 | 
                                 | grep -v '^[A-S][a-t]* time:  ' > tmpfs | 
                                 | grep -v '^[A-S][a-t]* time:  ' > $TMP.fs | 
| 500 | 
             outp="$INDIR/$pdir/summary.txt" | 
             outp="$INDIR/$pdir/summary.txt" | 
| 501 | 
             xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1` | 
             xx=`( echo 5 ; sed -n '/^  OPTFILE=/=' $outp ) | tail -1` | 
| 502 | 
             sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ | 
             sed "1,$xx d" $outp | sed '/^[YN] [YN] [YN] [YN]/ s/ \. //g' \ | 
| 503 | 
                                 | grep -v '^[A-S][a-t]* time:  ' > tmpfp | 
                                 | grep -v '^[A-S][a-t]* time:  ' > $TMP.fp | 
| 504 | 
             #-- check if list of exp are the same (and in the same order) | 
             #-- check if list of exp are the same (and in the same order) | 
| 505 | 
             sed 's/  (e=.*, w=.*)$//' tmpfs > tmpfn | 
             sed 's/  (e=.*, w=.*)$//' $TMP.fs > $TMP.fn | 
| 506 | 
             listDs=`grep '^[YN] [YN] [YN] [YN]' tmpfn | awk '{print $NF}'` | 
             listDs=`grep '^[YN] [YN] [YN] [YN]' $TMP.fn | awk '{print $NF}'` | 
| 507 | 
             #mv -f tmpfn tmpfs | 
             #mv -f $TMP.fn $TMP.fs | 
| 508 | 
             rm -f tmpfn | 
             rm -f $TMP.fn | 
| 509 | 
             sed 's/  (e=.*, w=.*)$//' tmpfp > tmpfn | 
             sed 's/  (e=.*, w=.*)$//' $TMP.fp > $TMP.fn | 
| 510 | 
             listDp=`grep '^[YN] [YN] [YN] [YN]' tmpfn | awk '{print $NF}'` | 
             listDp=`grep '^[YN] [YN] [YN] [YN]' $TMP.fn | awk '{print $NF}'` | 
| 511 | 
             #mv -f tmpfn tmpfp | 
             #mv -f $TMP.fn $TMP.fp | 
| 512 | 
             rm -f tmpfn | 
             rm -f $TMP.fn | 
| 513 | 
             #echo "listDs='$listDs'" ;  echo "listDp='$listDp'" | 
             #echo "listDs='$listDs'" ;  echo "listDp='$listDp'" | 
| 514 | 
             if test "$listDs" != "$listDp" ; then | 
             if test "$listDs" != "$listDp" ; then | 
| 515 | 
                 if test $dBug = 't' ; then echo ' -> re-order list of exp' ; fi | 
                 if test $dBug = 't' ; then echo ' -> re-order list of exp' ; fi | 
| 516 | 
                 #-- re-order list of exp (according to local "sort" order) | 
                 #-- re-order list of exp (according to local "sort" order) | 
| 517 | 
                 listDs=`echo "$listDs" | sort` | 
                 listDs=`echo "$listDs" | sort` | 
| 518 | 
                 for xx in $listDs ; do | 
                 for xx in $listDs ; do | 
| 519 | 
                     sed -e "/ $xx\$/d" -e "/ $xx /d" tmpfs > tmpfn | 
                     sed -e "/ $xx\$/d" -e "/ $xx /d" $TMP.fs > $TMP.fn | 
| 520 | 
                     sed -n -e "/ $xx\$/p" -e "/ $xx /p" tmpfs >> tmpfn | 
                     sed -n -e "/ $xx\$/p" -e "/ $xx /p" $TMP.fs >> $TMP.fn | 
| 521 | 
                     mv -f tmpfn tmpfs | 
                     mv -f $TMP.fn $TMP.fs | 
| 522 | 
                 done | 
                 done | 
| 523 | 
                 listDp=`echo "$listDp" | sort` | 
                 listDp=`echo "$listDp" | sort` | 
| 524 | 
                 for xx in $listDp ; do | 
                 for xx in $listDp ; do | 
| 525 | 
                     sed -e "/ $xx\$/d" -e "/ $xx /d" tmpfp > tmpfn | 
                     sed -e "/ $xx\$/d" -e "/ $xx /d" $TMP.fp > $TMP.fn | 
| 526 | 
                     sed -n -e "/ $xx\$/p" -e "/ $xx /p" tmpfp >> tmpfn | 
                     sed -n -e "/ $xx\$/p" -e "/ $xx /p" $TMP.fp >> $TMP.fn | 
| 527 | 
                     mv -f tmpfn tmpfp | 
                     mv -f $TMP.fn $TMP.fp | 
| 528 | 
                 done | 
                 done | 
| 529 | 
             #else | 
             #else | 
| 530 | 
             #   echo 'same list of exp => skip re-ordering' | 
             #   echo 'same list of exp => skip re-ordering' | 
| 531 | 
             fi | 
             fi | 
| 532 | 
             echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL | 
             echo -n "=== diff $sdir $pdir :" | tee -a $OUTPFIL | 
| 533 | 
             diff tmpfs tmpfp > tmpdf | 
             diff $TMP.fs $TMP.fp > $TMP.dif | 
| 534 | 
             yy=$? | 
             yy=$? | 
| 535 | 
             if test $yy != '0' ; then | 
             if test $yy != '0' ; then | 
| 536 | 
                 echo " $type , of='$optf'" | tee -a $OUTPFIL | 
                 echo " $type , of='$optf'" | tee -a $OUTPFIL | 
| 537 | 
                 #grep '^run: ' $outp | 
                 #grep '^run: ' $outp | 
| 538 | 
                 #grep '^run: ' $outs | 
                 #grep '^run: ' $outs | 
| 539 | 
                 #-- score for each test: | 
                 #-- score for each test: | 
| 540 | 
                 grep '^[YN] [YN] [YN] [YN]' tmpfs > tmploc 2>/dev/null | 
                 grep '^[YN] [YN] [YN] [YN]' $TMP.fs > tmploc 2>/dev/null | 
| 541 | 
                 t_tot=`cat tmploc | wc -l | sed -e 's| ||g'` | 
                 t_tot=`cat tmploc | wc -l | sed -e 's| ||g'` | 
| 542 | 
                 t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'` | 
                 t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'` | 
| 543 | 
                 score_s=`printf '%2i' $t_pass`":$t_tot" | 
                 score_s=`printf '%2i' $t_pass`":$t_tot" | 
| 544 | 
                 grep '^[YN] [YN] [YN] [YN]' tmpfp > tmploc 2>/dev/null | 
                 grep '^[YN] [YN] [YN] [YN]' $TMP.fp > tmploc 2>/dev/null | 
| 545 | 
                 t_tot=`cat tmploc | wc -l | sed -e 's| ||g'` | 
                 t_tot=`cat tmploc | wc -l | sed -e 's| ||g'` | 
| 546 | 
                 t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'` | 
                 t_pass=`grep '^Y Y Y Y' tmploc | grep 'pass ' | wc -l | sed -e 's| ||g'` | 
| 547 | 
                 score_p=`printf '%2i' $t_pass`":$t_tot" | 
                 score_p=`printf '%2i' $t_pass`":$t_tot" | 
| 548 | 
                 rm -f tmploc | 
                 rm -f tmploc | 
| 549 | 
                 #-- count Nb of different lines | 
                 #-- count Nb of different lines | 
| 550 | 
                 ndf=`wc -l tmpdf | awk '{print $1}'` | 
                 ndf=`wc -l $TMP.dif | awk '{print $1}'` | 
| 551 | 
  | 
                 nn=`grep -c ' generated by TAF Version ' $TMP.dif` | 
| 552 | 
  | 
                 ndf=`expr $ndf - $nn` | 
| 553 | 
                 ndf=`expr $ndf / 2` | 
                 ndf=`expr $ndf / 2` | 
| 554 | 
                 nn=`grep -c '^---' tmpdf` | 
                 nn=`grep -c '^---' $TMP.dif` | 
| 555 | 
                 ndf=`expr $ndf - $nn` | 
                 ndf=`expr $ndf - $nn` | 
| 556 | 
                 if [ $ndf -le $NBLDIFF ] ; then | 
                 if [ $ndf -le $NBLDIFF ] ; then | 
| 557 | 
                   cat tmpdf | 
                   cat $TMP.dif | 
| 558 | 
                 else | 
                 else | 
| 559 | 
                   echo " $ndf lines differ ( $score_s , $score_p )" | 
                   echo " $ndf lines differ ( $score_s , $score_p )" | 
| 560 | 
                 fi | 
                 fi | 
| 561 | 
                 echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL | 
                 echo "< "`head -1 $outs`" ( $score_s )" >> $OUTPFIL | 
| 562 | 
                 echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL | 
                 echo "> "`head -1 $outp`" ( $score_p )" >> $OUTPFIL | 
| 563 | 
                 cat tmpdf >> $OUTPFIL | 
                 cat $TMP.dif >> $OUTPFIL | 
| 564 | 
                 if [ $cdif -eq 0 ] ; then | 
                 if [ $cdif -eq 0 ] ; then | 
| 565 | 
                   clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p` | 
                   clin=`printf '%3i (%5s,%5s)' $ndf $score_s $score_p` | 
| 566 | 
                 else | 
                 else | 
| 571 | 
             else | 
             else | 
| 572 | 
                 echo " $type , of='$optf'" | tee -a $OUTPFIL | 
                 echo " $type , of='$optf'" | tee -a $OUTPFIL | 
| 573 | 
             fi | 
             fi | 
| 574 | 
             rm -f tmpfs tmpfp tmpdf | 
             rm -f $TMP.fs $TMP.fp $TMP.dif | 
| 575 | 
           fi | 
           fi | 
| 576 | 
         done | 
         done | 
| 577 | 
         if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi | 
         if [ $cmis -gt 0 ] ; then tmis='(-'$cmis')' ; else tmis='(--)' ; fi | 
| 584 | 
 done | 
 done | 
| 585 | 
  | 
  | 
| 586 | 
 echo "Start time:  $sTime" | tee -a $OUTPFIL | 
 echo "Start time:  $sTime" | tee -a $OUTPFIL | 
| 587 | 
 echo "End  time:   "`date` | tee -a $OUTPFIL | tee -a $OUTPSUM | 
 echo "End time:    "`date` | tee -a $OUTPFIL | tee -a $OUTPSUM | 
| 588 | 
  | 
  | 
| 589 | 
 rm -f ./dir_all ./slist ./plist | 
 rm -f $TMP.dir_all $TMP.slist $TMP.plist | 
| 590 | 
 if test $OUTPFIL = "TTT.$$" ; then rm -f $OUTPFIL ; fi | 
 if test $OUTPFIL = "TTT.$$" ; then rm -f $OUTPFIL ; fi | 
| 591 | 
 if test "x$ADDRESS" != 'xnone' ; then | 
 if test "x$ADDRESS" != 'xnone' ; then | 
| 592 | 
   echo ".. send $OUTPSUM to $ADDRESS" | 
   #- change default sender address ("From:") using "mail -r" option | 
| 593 | 
   mail -s $OUTPSUM $ADDRESS < $OUTPSUM | 
   #  since, by default, baudelaire uses USER@localhost.localdomain | 
| 594 | 
  | 
   #fullNam=`hostname -A | awk '{print $1}'` | 
| 595 | 
  | 
   #MAILCMD="$MAILCMD -r ${USER}@${fullNam}" | 
| 596 | 
  | 
   #--- | 
| 597 | 
  | 
   echo ".. send $OUTPSUM to '$ADDRESS' using '$MAILCMD'" | 
| 598 | 
  | 
   $MAILCMD -s 'check_outp summary' $ADDRESS < $OUTPSUM | 
| 599 | 
 fi | 
 fi | 
| 600 | 
 echo ".. cat $OUTPSUM" | 
 echo ".. cat $OUTPSUM" | 
| 601 | 
 cat $OUTPSUM | 
 cat $OUTPSUM |