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 8859 for branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting_func.sh – NEMO

Ignore:
Timestamp:
2017-11-30T16:01:29+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Continuation of global refactoring of Trusting tool

  • Introduce new 'dev' mode beetween 'debug' and 'prod' modes to skip XIOS compilation from scratch and working in a solely testing directory (thanks Andrew for the suggestion)
  • Switch cfg files from 'svn:mime-type=text/x-shellscript' to 'svn:executable' trying to get syntax highlighting under Trac
  • Bugfixes: correct XIOS branch 'XIOS_DEV_CMIP6' for ORCA1 and remove remaining 'TRUST_DIR_BENCHMARK' (replace by TRUST_TEST_BENCHMARK)
  • Improve the workflow displayed in the terminal
File:
1 edited

Legend:

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

    • Property eol-style deleted
    • Property svn:keywords deleted
    r8843 r8859  
    1818##-------------------------------------------------------------------------------- 
    1919 
    20 print_step() { 
     20step() { 
    2121    local char_nb=$( echo "$1" | wc -c ) 
    2222    local outline=$( printf "%${char_nb}s" ) 
    2323 
    24     printf "\n\nStep.....\n%s\n%s\n\n" "$1" ${outline// /-} 
     24    printf "\n%s\n%s\n\n" "$1" ${outline// /-} 
    2525} 
    2626 
     
    152152    cd ${TRUST_SVN_NEMOGCM}/CONFIG 
    153153 
    154     ## Recompiling from scratch if not in debug mode 
    155     if [[ -d ${TRUST_CFG_NEW} && ${TRUST_FLAG_DEBUG} == 'false' ]]; then 
    156    ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 
    157        > /dev/null <<EOF 
     154    ## Recompiling from scratch if not in debug or dev mode 
     155    if [[ ${TRUST_FLAG_DEBUG} == 'false' && ${TRUST_FLAG_DEV} == 'false' ]]; then 
     156 
     157     if [[ -d ${TRUST_CFG_NEW} ]]; then 
     158         ./makenemo -n ${TRUST_CFG_NEW} clean_config \ 
     159         > /dev/null <<EOF 
    158160y 
    159161EOF 
     162     fi 
     163 
    160164    fi 
    161165 
     
    420424       if [ -e ${TRUST_TEST_BENCHMARK}/$filebase.nc ]; then 
    421425 
    422       #bcmk='true' 
    423426      cdo diffn $filebase.nc ${TRUST_TEST_BENCHMARK}/$filebase.nc \ 
    424427          > cdo_diff.out 2> /dev/null 
     
    574577 
    575578       ## Computing 
    576        'H') TRUST_FLAG_ERROR='Crashed at time step'              ;; 
    577        'I') TRUST_FLAG_ERROR='Exceeded time limit'               ;; 
     579       'H') TRUST_FLAG_ERROR='Crashed at time step ' 
     580      comments 'E R R O R' 
     581      [ -e time.step ] && time_step=$( cat time.step ) 
     582      TRUST_FLAG_ERROR+=${time_step:=0}                     ;; 
     583       'I') TRUST_FLAG_ERROR='Exceeded time limit of ' 
     584      TRUST_FLAG_ERROR+=$(( ${TRUST_JOB_TIMEOUT}/3600 ))'h' ;; 
    578585 
    579586       ## Results 
     
    592599 
    593600    ## Eventual comments from ocean.output 
    594     if [ ${TRUST_FLAG_ERROR} == 'Crashed at time step' ]; then 
    595    comments 'E R R O R' 
    596    [ -e time.step ] && time_step=$( cat time.step ) 
    597    TRUST_FLAG_ERROR+=' '${time_step:=0} 
    598     else 
    599    comments 'W A R N I N G' 
    600  
    601    if [ ${TRUST_FLAG_ERROR} == 'Exceeded time limit' ]; then 
    602        TRUST_FLAG_ERROR+=' '$(( ${TRUST_JOB_TIMEOUT}/3600 ))'h' 
    603    fi 
    604  
    605     fi 
     601    [[ ! ${TRUST_FLAG_ERROR} =~ 'Crashed at time step' ]] && comments 'W A R N I N G' 
    606602 
    607603    ## Last messenger files 
     
    609605    sed -i "2 s/.*/$TRUST_FLAG_ERROR/"  ${file_stat} 
    610606 
    611     ## Save tested configuration if trusting failed in production mode (-p|--prod) 
     607    ## Save tested configuration if trusting failed in production mode ('-p') 
    612608    if [[ ${TRUST_FLAG_RESULT} == 'FAILED' && ${TRUST_FLAG_PROD} == 'true' ]]; then 
    613609   echo 'Creating archive '${TRUST_TEST_BACKUP}' under '${TRUST_TEST_BENCHMARK} 
Note: See TracChangeset for help on using the changeset viewer.