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 5629 for branches/2015/dev_r5092_CNRS_SETTE/NEMOGCM/TRUST/trusting_func.sh – NEMO

Ignore:
Timestamp:
2015-07-23T16:47:33+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Adjustements for running under CURIE cron

File:
1 edited

Legend:

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

    r5627 r5629  
    6161 
    6262       if [ -e ${REFE_DIR}/$file.nc ]; then 
    63        # UNIX `cmp` not suitable (filename & timestamp in .nc file) 
     63       ## UNIX `cmp` not suitable (filename & timestamp in .nc file) 
    6464      nc_diff=$( $CDO diffn $file.nc ${REFE_DIR}/$file.nc 2> /dev/null \ 
    6565                 | awk '/records/ {print $1}'                           ) 
     
    100100 
    101101get_soft_rel() { 
    102     for rel in $CDO $COMPILER $MPI $NETCDF; do 
    103                                      arch_rel=$( echo $LOADEDMODULES | sed  "s#.*$rel/\([^:]*\).*#\1#" ) 
    104    [ -z "${arch_rel}"  ]     && arch_rel=$( echo $PATH          | sed  "s#.*$rel/\([^/]*\).*#\1#" ) 
    105    [ "$rel" == "$COMPILER" ] && arch_rel=$( $rel --version      | grep -m1 -o ' [0-9.]* '         ) 
    106    echo $rel ${arch_rel} >> model.log 
     102    for soft in $CDO $COMPILER $MPI $NETCDF; do 
     103                                     soft_rel=$( echo $LOADEDMODULES | grep -o "$soft[^:]*"  ) 
     104   [ -z "${soft_rel}"  ]     && soft_rel=$( echo $PATH          | grep -o "$soft/[^/]*" ) 
     105   ## Not working inside CURIE cron (no modules command && cdo embedded in netcdf-*) 
     106   #[ "$soft" == "$COMPILER" ] && soft_rel=$( $soft --version      | grep -m1 -o ' [0-9.]* '         ) 
     107   [[ "$soft" == "$CDO"    && -z "${soft_rel}" ]] && soft_rel=$( echo $PATH | grep -o "netcdf-utils[^/]*" ) 
     108   [[ "$soft" == "$NETCDF" && -z "${soft_rel}" ]] && soft_rel=$( echo $PATH | grep -o "netcdf[^/]*"  | sort | head -1 ) 
     109   echo $soft ${soft_rel} >> model.log 
    107110    done 
    108111 
     
    115118    svn_opt='status' 
    116119 
    117     # If -v|--version option has been set, modify svn command 
     120    ## If -v|--version option has been set, modify svn command 
    118121    if   [ $( echo ${NEMO_VERS} | grep  "HEAD\|up\|update"                     ) ]; then 
    119122   svn_cmd='svn update -r HEAD' 
     
    132135          ${DIR_XIOS}                             ; do 
    133136 
    134    # For time being, just get revision number from XIOS 
     137   ## For time being, just get revision number from XIOS 
    135138   if [ "$dir" == "${DIR_XIOS}" ]; then 
    136139       rev_loc=$( svn info $dir | awk '(NR == 9) {print $NF}' ) 
     
    166169  $cmd trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.txt >> ${REFE_DIR}/trusting_${CFG_USER}_${CFG_ARCH}.txt 
    167170 
    168   # Send mail only when FAILED 
     171  ## Send mail only when FAILED 
    169172  if [[ ! -z $EMAIL && "$ST" == 'FAILED' ]]; then 
    170173      cat << END_MAIL > trusting.mail 
     
    206209   [ ! -e $file ] && printf "Comments\n\n"      > $file 
    207210 
    208         # Error identification 
     211        ## Error identification 
    209212   case $ERR in 
    210        # Compilation 
     213       ## Compilation 
    211214       1) ERR='XIOS compilation failed'             ;;  2) ERR='NEMO compilation failed'            ;; 
    212        # Submission 
     215       ## Submission 
    213216       3) ERR='Missing input files'                  ;;  4) ERR='Job submission error'               ;; 
    214        # Running 
     217       ## Running 
    215218       5) ERR='nemo.exe crashed at '${LAST_TIME_STEP};;  6) ERR='Exceeded time limit '${TIME_LIMI}'h';; 
    216        # Results 
     219       ## Results 
    217220       7) ERR='Missing previous outputs '            ;;  8) ERR='New outputs  differ/missing'        ;; 
    218221       9) ERR='Missing previous restarts'            ;; 10) ERR='New restarts differ/missing'        ;; 
    219        # Undefined 
     222       ## Undefined 
    220223       *) ERR='Unknown error'                        ;; 
    221224   esac 
     
    226229    printf "Result\n$ERR\n" > mesg_03_result_${CFG_USER}_${CFG_ARCH}.txt 
    227230 
    228     # Save tested configuration if trusting failed 
     231    ## Save tested configuration if trusting failed 
    229232    [[ "$ST" == 'FAILED' && $DEBUG -eq 0 ]] && tar -czf ${REFE_DIR}/trusting_${DATESTR}_${CFG_USER}_${CFG_ARCH}.tar.gz * 
    230233 
Note: See TracChangeset for help on using the changeset viewer.