New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
Changeset 8808 for branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh – NEMO

Ignore:
Timestamp:
2017-11-24T15:03:07+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of the tool, in particular a intelligible variables namelist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh

    r8797 r8808  
    2020 
    2121init_files() { 
    22     echo 'Date'               > ${file_date}; echo 'Result'           > ${file_rslt} 
    23     echo 'Status'             > ${file_stat}; echo 'NEMOGCM rev.'     > ${file_nemo} 
    24     echo 'XIOS rev.'          > ${file_xios}; echo 'Fortran compiler' > ${file_cmpf} 
    25     echo 'MPI libs'           > ${file_lmpi}; echo 'NetCDF libs'      > ${file_ncdf} 
    26     echo 'Input files'        > ${file_inpt}; echo 'Elapsed time'     > ${file_time} 
    27     echo 'Memory usage (P/V)' > ${file_memy}; echo 'Comments'         > ${file_note} 
     22    echo 'Date'                > ${file_date} 
     23    echo 'Result'              > ${file_rslt} 
     24    echo 'Status'              > ${file_stat} 
     25    echo 'NEMOGCM rev.'        > ${file_nemo} 
     26    echo 'XIOS rev.'           > ${file_xios} 
     27    echo 'Fortran compiler'    > ${file_cmpf} 
     28    echo 'MPI libs'            > ${file_lmpi} 
     29    echo 'NetCDF libs'         > ${file_ncdf} 
     30    echo 'Input files'         > ${file_inpt} 
     31    echo 'Elapsed time'        > ${file_time} 
     32    echo 'Memory (Phy./Virt.)' > ${file_memy} 
     33    echo 'Comments'            > ${file_note} 
    2834 
    2935    ## 'Failed' status with 'Unknown error' by default 
    30     echo ${TRUS_RSLT}      \ 
     36    echo ${TRUST_FLAG_RESULT} \ 
    3137   >> ${file_rslt} 
    3238    echo 'Unknown error' \ 
     
    3642get_date() { 
    3743    ## UTC time zone for timestamping 
    38     local dat=$( date -ud "${TRUS_DATE}" +"%F %R %Z" ) 
     44    local dat=$( date -ud "${TRUST_TEST_DATE}" +"%F %R %Z" ) 
    3945 
    4046    echo $dat           \ 
     
    4753 
    4854    ## Loop on essential NEMO directories 
    49     for dir in ${TRUS_CKOT} ${TRUS_XIOS}; do 
     55    for dir in ${TRUST_SVN_CO} ${TRUST_DIR_XIOS}; do 
    5056 
    5157   ## For time being, just get revision from XIOS with no action on directory 
    52    if [ $dir == ${TRUS_XIOS} ]; then 
     58   if [ $dir == ${TRUST_DIR_XIOS} ]; then 
    5359       rev_loc=$( svn info $dir | awk '/Last Changed Rev/ {print $NF}' ) 
    5460       echo 'XIOS '${rev_loc} \ 
    5561      >> model.log 
    56        echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\">${rev_loc}</a>" \ 
     62       echo "<a href=\"https://forge.ipsl.jussieu.fr/ioserver/changeset/${rev_loc}\" target=\"_blank\"> \ 
     63        ${rev_loc}                                                                                 \ 
     64        </a>"                                                                                      \ 
    5765      >> ${file_xios} 
    5866       continue 
    5967   fi 
    6068 
    61    echo $dir && ${TRUS_SVNA} ${TRUS_NGCM}/$dir 
    62    rev_loc=$( svn info ${TRUS_NGCM}/$dir | awk '/Last Changed Rev/ {print $NF}' ) 
     69   echo $dir && ${TRUST_SVN_ACTION} ${TRUST_DIR_NEMOGCM}/$dir 
     70   rev_loc=$( svn info ${TRUST_DIR_NEMOGCM}/$dir  \ 
     71              | awk '/Last Changed Rev/ {print $NF}'   ) 
    6372 
    6473   ## Keep last rev. nb 
     
    6877    echo 'NEMOGCM '$rev \ 
    6978   >> model.log 
    70     echo "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\">$rev</a>" \ 
     79    echo "<a href=\"https://forge.ipsl.jussieu.fr/nemo/changeset/$rev\" target=\"_blank\"> \ 
     80     $rev                                                                             \ 
     81     </a> "                                                                           \ 
    7182   >> ${file_nemo} 
    7283} 
    7384 
    7485get_soft_rel() { 
    75     local soft_rel str 
     86    local ver str 
    7687 
    7788    ## Sourcing environment 
    78     if [ -n "${TRUS_ENVI}" ]; then 
    79    if [[  -e ${TRUS_ENVI}.env && $( declare -F | grep ' module' ) ]]; then 
    80             ## .env file if module function is available 
    81        . ${TRUS_ENVI}.env 
    82    else 
    83             ## .path file if existing, if not the given file 
    84        [ -e ${TRUS_ENVI}.path ] && . ${TRUS_ENVI}.path || . ${TRUS_ENVI} 
    85    fi 
    86     fi 
    87  
    88     ## Problem with `prepend-path` of modulefile that use ':' instead of ' ' as delimiter 
    89     [ $TRUS_HPCC == 'X64_ADA' ] && WRAPPER_LDFLAGS='-L/smplocal/pub/IdrMemMPI/1.4/lib -lidrmem '${WRAPPER_LDFLAGS} 
    90  
    91     for str in ${TRUS_CMPV} ${TRUS_MPIR} ${TRUS_CDFR} ${TRUS_CDOR}; do 
     89    . ${TRUST_JOB_ENV} 
     90 
     91    for str in ${TRUST_COMPILE_FORTRAN}                         \ 
     92          ${TRUST_COMPILE_MPI}     ${TRUST_COMPILE_NETCDF} \ 
     93          ${TRUST_CDO}                                      ; do 
    9294   [ -z "$str" ] && continue 
    93    soft_rel='' 
    94  
    95    ## Software release: next word after "$soft" in $PATH (case-insensitive) 
    96    soft_rel=$( echo $PATH | sed "s#.*$str\([0-9.a-z_]*\).*#\1#i" ) 
    97  
    98    ## option --version would work for main compilers (gfortran, intel, pgfortran, ...) 
    99    [ $str == ${TRUS_CMPV} ] && soft_rel=$( $str --version | grep -m1 -oe '\<[0-9. ]*\>' ) 
     95   ver='' 
     96 
     97   ## Extract version number after searching pattern in PATH env. variable 
     98   ver=$( echo $PATH | sed "s|.*\($str[0-9.]*\).*|\1|" ) 
     99 
     100   ## option --version would work for main Fortran compilers and CDO 
     101   if [[ $str =~ ${TRUST_COMPILE_FORTRAN}|${TRUST_CDO} ]]; then 
     102       ver=$( $str --version 2>&1 | grep -m1 -oe '\<[0-9. ]*\>' \ 
     103         | xargs echo $str                                   ) 
     104   fi 
    100105 
    101106   ## Cleaning characters string to display proper soft name 
    102    str=$( echo $str | sed 's#\\##g; s#[/-]$##' ) 
    103  
    104    echo $str ${soft_rel} \ 
     107   #str=$( echo $str | sed 's|[/-]||g'  ) 
     108   ver=$( echo $ver | sed 's|[/-]| |g' ) 
     109 
     110   echo $ver \ 
    105111       >> model.log 
    106112    done 
     
    116122get_inputs() { 
    117123    # List archive content & extract it by default 
    118     local get_iol=$( eval " 
    119    for archive in ${TRUS_TARF}; do 
    120        tar -tvf ${TRUS_FORC}/\$archive >> inputs_list.txt; 
     124    local inputs_list=$( eval " 
     125   for archive in ${TRUST_CFG_FORC}; do 
     126       tar -tvf ${TRUST_DIR_FORC}/\$archive >> inputs_list.txt; 
    121127   done 
    122128   " ) 
    123     local get_iof=$( eval " 
    124    for archive in ${TRUS_TARF}; do 
    125        tar -vxf ${TRUS_FORC}/\$archive > /dev/null; 
     129    local inputs_get=$( eval " 
     130   for archive in ${TRUST_CFG_FORC}; do 
     131       tar -vxf ${TRUST_DIR_FORC}/\$archive  >      /dev/null; 
    126132   done 
    127133   " ) 
    128134 
    129     ## List & copy files in case of personal inputs 
    130     if [ -z "${TRUS_TARF}" ]; then 
    131    get_iol="ls ${TRUS_FORC}/*" 
    132    get_iof="\cp ${TRUS_FORC}/* ." 
    133     fi 
    134  
    135     ${get_iol}; ${get_iof} 
    136  
    137     if [ `find -name '*.gz' -print -quit` ]; then 
     135    ## List & copy files without archive 
     136    if [ -z "${TRUST_CFG_FORC}" ]; then 
     137   inputs_list=" ls -lh ${TRUST_DIR_FORC}/* >> inputs_list.txt" 
     138   inputs_get=" \cp     ${TRUST_DIR_FORC}/* .                 " 
     139    fi 
     140 
     141    ${inputs_list}; ${inputs_get} 
     142 
     143    if [ $( find -name '*.gz' -print -quit ) ]; then 
    138144   find . -name '*.gz' -exec gzip -d {} \; 
    139145    fi 
     
    149155 
    150156   ## Continue even if input file is not in here (see after) 
    151    if [ -e ${TRUS_STOR}/$file ]; then dif=$( diff -q $file ${TRUS_STOR}/$file ); else dif=0; fi 
     157   if [ -e ${TRUST_DIR_STORE}/$file ]; then 
     158       dif=$( diff -q $file ${TRUST_DIR_STORE}/$file ) 
     159   else  
     160       dif=0 
     161   fi 
    152162 
    153163   ## Pass over useless file omission in benckmark directory 
    154    [[ -n "$dif" && "$dif" != '0' ]] && { mesg='Different'; echo $dif; files_list+=$file' '; } 
     164   if [[ -n "$dif" && "$dif" != '0' ]]; then 
     165       mesg='Different' 
     166       echo $dif 
     167       files_list+=$file' ' 
     168   fi 
     169 
    155170    done 
    156171 
     
    170185 
    171186    ## Append a log file while pending 
    172     while [[ $( eval ${TRUS_JSTA} ) && ${time_elapsed} -lt ${TRUS_TOUT} ]]; do 
    173    printf "\n%s\n" ${outline// /#}          \ 
     187    while [[ $( eval ${TRUST_JOB_STATE} )                \ 
     188        && ${time_elapsed} -lt ${TRUST_JOB_TIMEOUT}   ]]; do 
     189   printf "\n%s\n" ${outline// /#} \ 
    174190       >> computation.log 
    175    [ -n "${TRUS_JINF}" ] && eval ${TRUS_JINF} \ 
     191   [ -n "${TRUST_JOB_INFO}" ] && eval ${TRUST_JOB_INFO} \ 
    176192       >> computation.log 
    177193   sleep ${time_increment} 
     
    182198 
    183199    ## Kill remaining job & stop the test if it's too long 
    184     [ ${time_elapsed} -eq ${TRUS_TOUT} ] && { eval ${TRUS_JKIL} &> /dev/null; get_out 6; } 
     200    if [ ${time_elapsed} -eq ${TRUST_JOB_TIMEOUT} ]; then 
     201   eval ${TRUST_JOB_KILL} &> /dev/null 
     202   get_out 6 
     203    fi 
     204 
    185205} 
    186206 
     
    191211    ## Simple diff 
    192212    for file in 'ocean.output' *.stat; do 
    193    ## Stop if no benchmark files (ocean.output, eventual stat files) 
    194    [ ! -e ${TRUS_STOR}/$file ] && { TRUS_RSLT='FAILED'; get_out 7; } 
    195  
    196    diff -q $file ${TRUS_STOR}/$file 
     213   ## Stop if no minimal benchmark files (ocean.output, eventual stat files) 
     214   if [ ! -e ${TRUST_DIR_STORE}/$file ]; then 
     215       TRUST_FLAG_RESULT='FAILED' 
     216       get_out 7 
     217   fi 
     218 
     219   diff -q $file ${TRUST_DIR_STORE}/$file 
    197220 
    198221   ## Continue even if it differs 
    199    [ $? -ne 0 ] && { TRUS_RSLT='FAILED'; mesg='Different'; files_list+=$file' '; } 
     222   if [ $? -ne 0 ]; then 
     223       TRUST_FLAG_RESULT='FAILED' 
     224       mesg='Different' 
     225       files_list+=$file' ' 
     226   fi 
     227 
    200228    done 
    201229 
     
    207235} 
    208236 
    209 diff_restart() { 
     237diff_restarts() { 
    210238    local dif filebase filebases ndomain out 
    211     local files_list='' dif_sum='undef' 
     239    local files_list='' dif_sum='0' #bcmk='false' 
    212240 
    213241    ## Find all restart files to rebuild 
    214242    if [ $( find -regex ".*_restart.*[0-9]\.nc" -print -quit ) ]; then 
    215    filebases=$( find -regextype sed -regex ".*_[0-9]\{4\}\.nc" \ 
    216                 | sed 's/\(.*\)_.*/\1/' | sort -u                ) 
    217  
    218    for filebase in ${filebases}; do 
    219  
    220        ndomain=$( find -regex ".*${name}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
    221  
    222        [ ${ndomain} -eq 0 ] && TRUS_RSLT='FAILED' && get_out 8 
    223  
    224        ${TRUS_NGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo \ 
    225       -t ${TRUS_NPRO} $filebase ${ndomain}     \ 
     243        ################################################################ 
     244   ## Think to set the confgiguration name in the 'namelist_cfg' ## 
     245   ################################################################ 
     246   filebases=$( find -regextype sed -regex ".*${TRUST_CFG_NEW}.*_[0-9]\{4\}\.nc" \ 
     247                | sed 's/\(.*\)_.*/\1/' | sort -u                                  ) 
     248 
     249   for filebase in $filebases; do 
     250 
     251       ndomain=$( find -regex ".*${filebase}_[0-9]*.nc" \ 
     252             | wc -l | awk '{print $1}'              ) 
     253 
     254       [ $ndomain -eq 0 ] && TRUST_FLAG_RESULT='FAILED' && get_out 8 
     255 
     256       ${TRUST_DIR_NEMOGCM}/TOOLS/REBUILD_NEMO/rebuild_nemo \ 
     257      -t ${TRUST_COMPILE_NPROC} $filebase $ndomain       \ 
    226258      > /dev/null 
    227259 
    228260       ## Possibility of remaining decomposed restarts (even after rebuild) 
    229        [ $? -eq 0 ] && rm -f ${file}_[0-9]*.nc \ 
     261       [ $? -eq 0 ] && rm -f ${filebase}_[0-9]*.nc \ 
    230262                > /dev/null 
    231263 
    232        dif='' 
    233  
    234264            ## Stop if no benchmark files (restart file) 
    235        if [ -e ${TRUS_STOR}/$file.nc ]; then 
    236  
    237       out=$( $TRUS_CDOD $name.nc ${TRUS_STOR}/$name.nc 2>&1 ) 
    238       dif=$( echo $out | grep -o "[0-9]* of [0-9]* records" ) 
    239  
    240       ## Fix for cdo aborting on restarts with different inputs 
    241       if [[ $out =~ 'Abort' ]]; then 
    242           dif=$( echo $out | awk -F: '{print $NF}' ) 
     265       if [ -e ${TRUST_DIR_STORE}/$filebase.nc ]; then 
     266 
     267      #bcmk='true' 
     268      cdo diffn $filebase.nc ${TRUST_DIR_STORE}/$filebase.nc \ 
     269          > cdo_diff.out 2> /dev/null 
     270 
     271      ## Identical if cdo_diff.out is zero size 
     272      [ ! -s cdo_diff.out ] && continue 
     273 
     274      dif=$( grep -om1 '[0-9]* of [0-9]* records' cdo_diff.out ) 
     275 
     276      if [ -n "$dif" ]; then 
     277          export TRUST_FLAG_RESULT='FAILED' 
     278          files_list+=$filebase' ' && echo $filebase'.nc: '$dif 
     279          let dif_sum+=$( echo $dif | sed '|^\([0-9]*\).*|\1|' ) 
    243280      fi 
    244281 
    245       if [ -n "$dif" ]; then 
    246           export TRUS_RSLT='FAILED' 
    247           files_list+=$name' ' && echo $name'.nc: '$dif 
    248           let dif_sum+=$( echo $dif | awk '{print $1}' ) 
    249       fi 
     282       fi 
    250283 
    251284   done 
    252285 
    253     ## Stop if no benchmark files (ie time.step) 
    254    if   [ ${dif_sum} == 'undef' ]; then 
    255        TRUS_RSLT='FAILED' 
    256        get_out 7 
    257         ## List different files for web comment with sum of different records 
    258    elif [ ${dif_sum} -ne 0      ]; then 
     286        ## No benchmark files 
     287   #if   [ $bcmk == 'false' ]; then 
     288   #    TRUST_FLAG_RESULT='FAILED' 
     289   #    get_out 7 
     290   #fi 
     291 
     292        ## List modified restart(s) for web comment with sum of differences 
     293   if [ ${dif_sum} -ne 0 ]; then 
    259294       echo 'Restarts: '${files_list}${dif_sum}' record(s) differ<br>' \ 
    260295      >> temp_${file_note} 
     
    263298   fi 
    264299 
    265     else 
    266    TRUS_RSLT='FAILED' 
    267300    fi 
    268301 
     
    270303 
    271304get_time() { 
    272     [ -z "${TRUS_JTIM}" ] && return 
     305    [ -z "${TRUST_JOB_TIME}" ] && return 
    273306 
    274307    ## Interest for checking unusual time computation 
    275     local time_cpu=$( eval ${TRUS_JTIM} ) 
     308    local time_cpu=$( eval ${TRUST_JOB_TIME} ) 
    276309 
    277310    printf "Elapsed time: " 
     
    280313 
    281314get_memy() { 
    282     [[ -z "${TRUS_JPME}" && -z "${TRUS_JVME}" ]] && return 
     315    [[ -z "${TRUST_JOB_RAM_P}" && -z "${TRUST_JOB_RAM_V}" ]] && return 
    283316 
    284317    ## Interest for checking unusual memory usage 
    285     local memory_pmax=$( eval ${TRUS_JPME} ) memory_vmax=$( eval ${TRUS_JVME} ) 
     318    local memory_pmax=$( eval ${TRUST_JOB_RAM_P} ) 
     319    local memory_vmax=$( eval ${TRUST_JOB_RAM_V} ) 
    286320 
    287321    printf "Memory max usage (physical/virtual): " 
     
    308342log_make() { 
    309343    ## Format comments for web 
    310     [ -e temp_${file_note} ] && cat temp_${file_note} | tr -d '\n' | sed 's/<br>$//' \ 
    311    >> ${file_note} 
     344    if [ -e temp_${file_note} ]; then 
     345   cat temp_${file_note} | tr -d '\n' | sed 's/<br>$//' \ 
     346       >> ${file_note} 
     347    fi 
    312348 
    313349    ## Construct txt file with all messenger files 
    314     paste -d ';' mesg_*.txt | tee ${TRUS_FILE} 
     350    paste -d ';' mesg_*.txt | tee ${TRUST_TEST_SUMMARY} 
    315351} 
    316352 
     
    320356 
    321357    ## Production mode (-p|--prod) 
    322     if [ ${TRUS_PROD} -eq 1 ]; then 
     358    if [ ${TRUST_FLAG_PROD} -eq 1 ]; then 
    323359 
    324360   ## Create or append trusting logfile 
    325    if [ -f ${TRUS_HIST} ]; then cmd='tail -1'; else cmd='cat'; fi 
    326  
    327    $cmd ${TRUS_FILE}   \ 
    328        >> ${TRUS_HIST} 
     361   if [ -f ${TRUST_TEST_LOG} ]; then cmd='tail -1'; else cmd='cat'; fi 
     362 
     363   $cmd ${TRUST_TEST_SUMMARY}      \ 
     364       >> ${TRUST_TEST_LOG} 
    329365 
    330366        ## Send mail only when FAILED 
    331    if [[ ! -z "${TRUS_MAIL}" && ${TRUS_RSLT} == 'FAILED' ]]; then 
     367   if [[ ! -z "${TRUST_TEST_MAILING}" \ 
     368         && ${TRUST_FLAG_RESULT} == 'FAILED'   ]]; then 
    332369 
    333370       ## Content 
     
    337374 
    338375 
    339 The trusting sequence has not completed successfully on new configuration ${TRUS_CONF} based on ${TRUS_REFE}. 
    340  
    341 Here is the model summary: 
     376The following trusting sequence has not completed successfully: 
     377 
     378Testing configuration ${TRUST_CFG_NEW} based on ${TRUST_CFG_REF}. 
     379User installation ${TRUST_MAIN_USER} 
     380HPC environment ${TRUST_MAIN_HPCC} 
     381 
     382Here is the running environment summary: 
    342383`cat model.log` 
    343384 
    344 First checking would be on the trusting environment files: 
    345 ${TRUS_USER}.cfg & ${TRUS_HPCC}.cfg 
    346  
    347385For more details, look into the testing folder at: 
    348 ${TRUS_SCRA} 
    349  
    350 An archive has been created to share the questionable configuration for further studies: 
    351 ${TRUS_STOR}/${TRUS_ARCH} 
     386${TRUST_DIR_SCRATCH} 
     387An archive is also available to share the questionable configuration: 
     388${TRUST_DIR_STORE}/${TRUST_TEST_BACKUP} 
    352389 
    353390END_MAIL 
    354391 
    355392       ## Send with detailed subject 
    356        mail -s "[NEMO Trusting][$rev][${TRUS_BRAN}][${TRUS_REFE}] ${TRUS_RSLT} ${TRUS_RORR}" ${TRUS_MAIL} \ 
     393       mail -s "[NEMO Trusting][${TRUST_CFG_REF}][${TRUST_SVN_BRANCH}] \ 
     394           ${TRUST_FLAG_RESULT} ${TRUST_FLAG_ERROR}"               \ 
     395       ${TRUST_TEST_MAILING}                                \ 
    357396      <  trusting.mail 
    358397   fi 
     
    364403    local time_step=0 
    365404 
    366     TRUS_RORR=$1 
     405    TRUST_FLAG_ERROR=$1 
    367406 
    368407    printf "\n\nEnd of test\n" 
    369408 
    370409    ## In case of compilation error 
    371     cd ${TRUS_SCRA} 
    372  
    373     if [ ${TRUS_RSLT} == 'FAILED' ]; then 
     410    cd ${TRUST_DIR_SCRATCH} 
     411 
     412    if [ ${TRUST_FLAG_RESULT} == 'FAILED' ]; then 
    374413   echo 'Failure' 
    375414 
    376415        ## Error identification 
    377    case ${TRUS_RORR} in 
     416   case ${TRUST_FLAG_ERROR} in 
    378417            ## Compilation 
    379        '1') TRUS_RORR='XIOS compilation failed' ;; '2') TRUS_RORR='NEMO compilation failed';; 
     418       '1') TRUST_FLAG_ERROR='XIOS compilation failed' ;; 
     419       '2') TRUST_FLAG_ERROR='NEMO compilation failed' ;; 
    380420       ## Submission 
    381        '3') TRUS_RORR='Missing input files'     ;; '4') TRUS_RORR='Job submission error'   ;; 
    382        ## Computation 
    383        '5') TRUS_RORR='Crashed at time step'    ;; '6') TRUS_RORR='Exceeded time limit'    ;; 
     421       '3') TRUST_FLAG_ERROR='Missing input files'     ;; 
     422       '4') TRUST_FLAG_ERROR='Job submission error'    ;; 
     423       ## Computing 
     424       '5') TRUST_FLAG_ERROR='Crashed at time step'    ;; 
     425       '6') TRUST_FLAG_ERROR='Exceeded time limit'     ;; 
    384426       ## Results 
    385        '7') TRUS_RORR='Missing previous outputs';; '8') TRUS_RORR='New outputs differ'     ;; 
     427       '7') TRUST_FLAG_ERROR='Missing previous outputs';; 
     428       '8') TRUST_FLAG_ERROR='New outputs differ'      ;; 
    386429       ## Other 
    387        '*') TRUS_RORR='Unknown error'           ;; 
     430       '*') TRUST_FLAG_ERROR='Unknown error'           ;; 
    388431   esac 
    389432 
    390433    else 
    391    echo 'Success' && TRUS_RORR='Code is reliable' 
     434   echo 'Success' && TRUST_FLAG_ERROR='Code is reliable' 
    392435    fi 
    393436 
    394437    ## Eventual comments from ocean.output 
    395     if [ "${TRUS_RORR}" == 'Crashed at time step' ]; then 
     438    if [ "${TRUST_FLAG_ERROR}" == 'Crashed at time step' ]; then 
    396439   comments 'E R R O R' 
    397    [ -e time.step ] && time_step=$( grep -o [0-9]* time.step ) 
    398    TRUS_RORR+=' '$time_step 
     440   [ -e time.step ] && time_step=$( cat time.step ) 
     441   TRUST_FLAG_ERROR+=' '$time_step 
    399442    else 
    400443   comments 'W A R N I N G' 
    401    [ "${TRUS_RORR}" == 'Exceeded time limit' ] && TRUS_RORR+=' '$(( ${TRUS_TOUT}/3600 ))'h' 
     444 
     445   if [ "${TRUST_FLAG_ERROR}" == 'Exceeded time limit' ]; then 
     446       TRUST_FLAG_ERROR+=' '$(( ${TRUST_JOB_TIMEOUT}/3600 ))'h' 
     447   fi 
     448 
    402449    fi 
    403450 
    404451    ## Last messenger files 
    405     #export TRUS_RORR 
    406     sed -i "2 s/.*/$TRUS_RSLT/" ${file_rslt}; sed -i "2 s/.*/$TRUS_RORR/" ${file_stat} 
     452    sed -i "2 s/.*/$TRUST_RESULT/"     ${file_rslt} 
     453    sed -i "2 s/.*/$TRUST_FLAG_ERROR/" ${file_stat} 
    407454 
    408455    ## Save tested configuration if trusting failed in production mode (-p|--prod) 
    409     if [[ ${TRUS_RSLT} == 'FAILED' && ${TRUS_PROD} -eq 1 ]]; then 
    410    echo 'Creating archive '${TRUS_ARCH}' under '${TRUS_STOR} 
    411    tar -czf ${TRUS_STOR}/${TRUS_ARCH}               *                    \ 
    412        -C   ${TRUS_NGCM}/CONFIG/${TRUS_CONF}/MY_SRC .                    \ 
    413        -C   ${TRUS_NGCM}/CONFIG/${TRUS_CONF}        cpp_${TRUS_CONF}.fcm 
     456    if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} -eq 1 ]]; then 
     457   echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_DIR_STORE} 
     458   tar -czf ${TRUST_DIR_STORE}/${TRUST_TEST_BACKUP}                 * \ 
     459       -C   ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}/MY_SRC . \ 
     460       -C   ${TRUST_DIR_NEMOGCM}/CONFIG/${TRUST_CFG_NEW}          \ 
     461            cpp_${TRUST_CFG_NEW}.fcm 
    414462    fi 
    415463 
Note: See TracChangeset for help on using the changeset viewer.