Ignore:
Timestamp:
2018-01-12T19:43:55+01:00 (3 years ago)
Author:
mathiot
Message:

add function to detect not-succesfull runs (E R R O R in ocean.output) in sette_rpt

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2017/dev_merge_2017/NEMOGCM/SETTE/new_sette_rpt.sh

    r9221 r9223  
    183183    fi 
    184184    rm f1.tmp$$ 
    185   else 
    186     printf "%-20s %s %s\n" $nam  " directory is MISSING : " $dorv 
    187185  fi 
    188186} 
     
    273271      fi 
    274272    fi 
     273  fi 
     274} 
     275 
     276function runtest(){ 
     277# 
     278# Run checks. 
     279# Check presence of E R R O R in ocean.output from each 
     280# 
     281  vdir=$1 
     282  nam=$2 
     283  pass=$3 
     284# 
     285  if [ -d $vdir/$nam ]; then 
     286    dorv=`ls -1rt $vdir/$nam/$mach/ | tail -1l ` 
     287    dorv=`echo $dorv | sed -e 's:.*/::'` 
     288    rep1=`ls -1rt $vdir/$nam/$mach/$dorv/ | grep REPRO | tail -2l | head -1 ` 
     289    f1o=$vdir/$nam/$mach/$dorv/$rep1/ocean.output 
     290    if  [ ! -f $f1o ] ; then 
     291      printf "%-20s %s\n" $nam " ocean.output is MISSING : " $dorv 
     292      return; 
     293    else 
     294      nerr=`grep 'E R R O R' $f1o | wc -l` 
     295      if [[ $nerr > 0 ]]; then 
     296        printf "%-20s %s %s\n" $nam " run FAILED : " $dorv 
     297        if [ $pass == 1 ]; then 
     298          echo "<return> to view end of ocean.output" 
     299          read y 
     300          tail -100 $f1o 
     301          echo '' 
     302          echo "full ocean.output available here: $f1o" 
     303        fi 
     304      fi 
     305    fi 
    275306  else 
    276     printf "%-20s %s %s\n" $nam  " directory is MISSING : " $dorv  
     307    printf "%-20s %s %s\n" $nam  " directory is MISSING : " $dorv 
    277308  fi 
    278309} 
     
    389420 do 
    390421   reprotest $NEMO_VALID $repro_test $pass 
     422   runtest $NEMO_VALID $repro_test $pass 
    391423 done 
    392424 
Note: See TracChangeset for help on using the changeset viewer.