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 8834 for branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env – NEMO

Ignore:
Timestamp:
2017-11-28T15:01:16+01:00 (6 years ago)
Author:
nicolasmartin
Message:

Cleaning of main script 'trusting.sh': transfer code lines to 'trusting_func.sh' with new functions, improve overall readability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/dev_r5092_CNRS18_TRUST/NEMOGCM/TRUST/inc/trusting.env

    r8826 r8834  
    22 
    33 
     4##-------------------------------------------------------------------------------- 
    45## Defaults 
    56##-------------------------------------------------------------------------------- 
    67 
     8## Trusting result: 'FAILED' result for 'Unknown error' 
     9export TRUST_FLAG_RESULT='FAILED' TRUST_FLAG_ERROR='X' 
     10 
     11## Locked options from command line (export as of now to environment)  
     12##------------------------------------------------------------------- 
     13 
     14if [ ${TRUST_FLAG_DEBUG} == 'true' ]; then 
     15    ## debug mode (verbose output and skip XIOS compilation) 
     16    TRUST_IO_XIOS_MODE='' 
     17    TRUST_MAIN_STDOUT='1> /dev/null' 
     18else 
     19    ## std mode (merge stdout & stderr to /dev/null, XIOS compilation from scratch) 
     20    TRUST_IO_XIOS_MODE='--full' 
     21    TRUST_MAIN_STDOUT='>& /dev/null' 
     22fi 
     23 
     24export TRUST_IO_XIOS_MODE TRUST_MAIN_STDOUT 
     25 
     26## If '-v' arg. has been set, modify default SVN action on working copy 
     27if [ ${TRUST_SVN_REV} ]; then 
     28 
     29    if   [ $( echo ${TRUST_SVN_REV} | grep  "HEAD\|up\|update"                     ) ]; then 
     30   TRUST_SVN_ACTION='svn update -r HEAD --accept mine-conflict' 
     31    elif [ $( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) ]; then 
     32   TRUST_SVN_ACTION='svn update -r     '$( echo ${TRUST_SVN_REV} | grep -o '{[0-9]\{4\}-[0-9]\{2\}-[0-9]\{2\}}' ) 
     33    elif [ $( echo ${TRUST_SVN_REV} | grep -o '[0-9]*'                             ) ]; then 
     34   TRUST_SVN_ACTION='svn update -r     '$( echo ${TRUST_SVN_REV} | grep -o '[0-9]*' ) 
     35    fi 
     36 
     37else 
     38    ## By default, no update on SVN directories 
     39    TRUST_SVN_ACTION='svn status' 
     40fi 
     41 
     42export TRUST_SVN_ACTION 
     43 
     44 
     45## Options editable by .cfg files (no export at this time) 
     46##-------------------------------------------------------- 
     47 
     48## NEMO 'trunk' branch by default 
    749[ -z "${TRUST_SVN_BRANCH}" ] && TRUST_SVN_BRANCH='trunk' 
    850 
    951## Ref. cfg. unset or empty (mandatory) 
    10 if [[ -z "${TRUST_CFG_REF}" ]]; then 
     52if [ -z "${TRUST_CFG_REF}" ]; then 
    1153 
    1254    ## Default cfg from trunk excepting last stable 
    1355    TRUST_CFG_REF='ORCA2_LIM3_PISCES' 
    1456 
    15     if [[ ${TRUST_SVN_BRANCH} && ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE' ]]; then 
     57    if [[ ${TRUST_SVN_BRANCH}                          \ 
     58     && ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE'   ]]; then 
    1659   TRUST_CFG_REF='ORCA2_LIM_PISCES' 
    1760    fi 
     
    2063 
    2164 
     65##-------------------------------------------------------------------------------- 
    2266## Source user & (super)computer configurations 
    2367##-------------------------------------------------------------------------------- 
     
    2670 
    2771 
     72##-------------------------------------------------------------------------------- 
    2873## Checking and export environment variables 
    2974##-------------------------------------------------------------------------------- 
     
    4085##------------------------------------------ 
    4186 
    42 export TRUST_SVN_REPO='https://forge.ipsl.jussieu.fr/nemo/svn' 
     87export TRUST_SVN_REPO='https://forge.ipsl.jussieu.fr' 
    4388export TRUST_SVN_CO=( 'ARCH           CONFIG          NEMO               
    4489                       EXTERNAL/AGRIF EXTERNAL/fcm    EXTERNAL/IOIPSL    
     
    65110   [ ${TRUST_CFG_REF} == 'AMM12' ] && TRUST_IO_FORC_TAR='AMM12_v3.7.tar' 
    66111 
     112   ## Update forcing archive for stable 
    67113   if [ ${TRUST_SVN_BRANCH} == 'nemo_v3_6_STABLE' ]; then 
    68114       TRUST_IO_FORC_TAR='ORCA2_LIM_nemo_v3.6.tar' 
     
    97143##---------------------- 
    98144 
     145## Assuming the sourcing of XIOS arch .env file (modules) for setting  
    99146if [ -z "${TRUST_JOB_ENV}" ]; then 
    100147    TRUST_JOB_ENV=${TRUST_IO_XIOS}/arch/arch-${TRUST_MAIN_HPCC}.env 
     
    103150export TRUST_JOB_ENV 
    104151 
     152## Default parallel compilation on 4 procs 
    105153[ -z "${TRUST_COMPILE_NPROC}" ] && TRUST_COMPILE_NPROC='4' 
    106154export TRUST_COMPILE_NPROC 
    107155 
     156## Not mandatory 
    108157export TRUST_COMPILE_FORTRAN TRUST_COMPILE_MPI TRUST_COMPILE_NETCDF 
    109158 
     159## Assuming the job submit script is in './batch', if not  
    110160if [ -z "${TRUST_JOB_SCRIPT}" ]; then 
    111161    TRUST_JOB_SCRIPT=${TRUST_MAIN_DIR}/batch/${TRUST_MAIN_HPCC}.sh || get_out A 
     
    114164export TRUST_JOB_SCRIPT  
    115165 
    116  
     166## Mandatory job management cmds (submit, status checking and killing job) 
    117167if [[ -z "${TRUST_JOB_SUBMIT}" || -z "${TRUST_JOB_STATE}" \ 
    118168                               || -z "${TRUST_JOB_KILL}"    ]]; then 
     
    122172export TRUST_JOB_SUBMIT TRUST_JOB_STATE TRUST_JOB_KILL 
    123173 
     174## Default test timeout to 3h (pending AND running time) 
    124175[ -z "${TRUST_JOB_TIMEOUT}" ] && TRUST_JOB_TIMEOUT='10800' 
    125176export TRUST_JOB_TIMEOUT 
    126177 
     178## Job informations not mandatory 
    127179export TRUST_JOB_INFO TRUST_JOB_TIME TRUST_JOB_RAM_P TRUST_JOB_RAM_V 
    128180 
Note: See TracChangeset for help on using the changeset viewer.