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

Ignore:
Timestamp:
2015-08-14T18:05:48+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Correct all arithmetic tests, global readability improvment & format words list in loop

File:
1 edited

Legend:

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

    r5685 r5689  
    88NEMO_TRUS=$PWD 
    99DEBUG=0; PUBLISH=0; TIME_STEP=0 
    10 I_MODULE=0; ST='FAILED' ## No 'module' command & 'FAILED' status 
     10IMOD=0; ST='FAILED' ## No 'module' command & 'FAILED' status 
    1111xios_full='--full'; stderr_redir='>&' ## DEBUG options 
    1212 
     
    5050## Summary of trusting test context 
    5151##--------------------------------------------------- 
    52 printf "\n\ 
    53 NEMO Trusting test:\n\ 
    54 -------------------\n\ 
    55 Testing ${TEST_CONF} based on ${REFE_CONF} from ${NEMO_BRAN}\n\ 
    56 NEMO installation: ${NEMO_USER}\n\ 
    57 Computing architecture: ${NEMO_HPCC}\n\ 
    58 Trusting SVN version: $( svn info | awk '(NR == 9) {print $NF}' )\n" 
     52echo 'NEMO Trusting test:' 
     53echo '-------------------' 
     54echo 'Testing '${TEST_CONF}' based on '${REFE_CONF}' from '${NEMO_BRAN} 
     55echo 'NEMO installation: '${NEMO_USER} 
     56echo 'Computing architecture: '${NEMO_HPCC} 
     57echo 'Trusting SVN version: '$( svn info | awk '(NR == 9) {print $NF}' ) 
    5958 
    6059 
    6160## Making timestamped directory with messenger files 
    6261##--------------------------------------------------- 
    63 print_step 'Time-stamp generation & testing directory creation' 
    64 mkdir -p ${TEST_DIR} ${REFE_DIR} 
    65 echo ${TEST_DIR} && cd ${TEST_DIR} 
    66 init_files && get_date 
     62cd ${TEST_DIR} 
     63 
     64print_step 'Create timestamped testing directory' 
     65echo ${TEST_DIR} && init_files && get_date 
    6766 
    6867 
    6968## SVN action on XIOS & NEMO essentials directories 
    7069##--------------------------------------------------- 
    71 print_step 'SVN command on NEMO directories:' 
    72 get_nemo_rev 
     70print_step 'SVN command on NEMO directories:'; get_nemo_rev 
    7371 
    7472 
     
    7674##--------------------------------------------------- 
    7775print_step 'Get softwares releases' 
     76 
    7877[ -e ${ARCH_ENV} ] && . ${ARCH_ENV} > /dev/null 
    79 (( $? == 0  )) && export I_MODULE=1 
    80 get_soft_rel 
    81 cat model.log 
     78[ $? -eq 0 ] && export IMOD=1 
     79 
     80get_soft_rel; cat model.log 
    8281 
    8382 
    8483## XIOS compiling 
    8584##--------------------------------------------------- 
     85cd ${DIR_XIOS} 
     86 
    8687print_step 'Compile XIOS' 
    87 cd ${DIR_XIOS} 
    8888[ $DEBUG -eq 1 ] && xios_full='' && stderr_redir='>' 
    8989eval ./make_xios ${xios_full} --arch ${NEMO_HPCC} --job $NPROC \ 
     
    9393## NEMO config compiled from scratch 
    9494##--------------------------------------------------- 
    95 print_step "Compile ${REFE_CONF} configuration" 
    9695cd ${NEMO_CONF} 
    9796 
     97print_step "Compile ${REFE_CONF} configuration" 
     98 
    9899if [[ -d ${TEST_CONF} && $DEBUG -eq 0 ]]; then 
    99     eval ./makenemo -n ${TEST_CONF} clean_config > /dev/null <<EOF 
     100    ./makenemo -n ${TEST_CONF} clean_config > /dev/null <<EOF 
    100101y 
    101102EOF 
     
    103104 
    104105eval ./makenemo -n ${TEST_CONF} -r ${REFE_CONF} -m ${NEMO_HPCC} -j $NPROC \ 
    105                 ${KEYS_ADD} ${KEYS_DEL}                                   \ 
     106                   ${KEYS_ADD} ${KEYS_DEL}                                \ 
    106107    ${stderr_redir} /dev/null 
    107108[ ! -e ${TEST_CONF}/BLD/bin/nemo.exe ] && get_out 2 
     
    110111## Get namelists, xml & forcing files for running 
    111112##--------------------------------------------------- 
     113cd ${TEST_DIR} 
     114 
    112115print_step 'Set job (copying & extracting input files)' 
    113 cd ${TEST_DIR} 
    114116cp ${NEMO_CONF}/${TEST_CONF}/cpp_* . 
    115117find ${NEMO_CONF}/${TEST_CONF}/EXP00 -regex '.*\(_cfg\|.in\|opa\|_ref\|.xml\)' -exec cp {} . \; 
     118 
    116119get_inputs 
    117 (( $? != 0 )) && get_out 3 
     120[ $? -ne 0 ] && get_out 3 
    118121[ $( find . -name '*.gz' -print -quit ) ] && find . -name '*.gz' -exec gunzip {} \; 
    119122 
     
    121124## Check input files in all cases 
    122125##--------------------------------------------------- 
    123 print_step 'Compare with standard input files list' 
    124 diff_inputs 
     126print_step 'Compare with benchmark input files list'; diff_inputs 
    125127 
    126128 
    127129## Job submission & computing 
    128130##--------------------------------------------------- 
    129 print_step 'Submit job' 
    130 JOB_ID=$( eval ${JOB_SUBM} ) 
    131 (( $? != 0 )) && get_out 4 
    132 print_step 'Pending job' 
    133 job_pending 
     131print_step 'Submit job'; JOB_ID=$( eval ${JOB_SUBM} ) 
     132[ $? -ne 0 ] && get_out 4 
     133 
     134print_step 'Pending job'; job_pending 
     135 
    134136print_step 'Job finished' 
    135137 
    136138 
    137 ## Job state 
     139## Job state & get time computation if succeeded 
    138140##--------------------------------------------------- 
    139141print_step 'Test job state' 
    140142 
    141 if   [[ ! -e time.step || $( grep -q 'E R R O R' ocean.output ) ]]; then 
    142     echo 'Error' 
    143     comments 'E R R O R' 
     143if   [[ ! -e time.step || $( grep 'E R R O R' ocean.output ) ]]; then 
     144    echo 'Failure' 
    144145    get_out 5 
    145146else 
    146     echo 'Good' 
    147     ## Get time computation 
    148     ##--------------------------------------------------- 
    149     print_step 'Get real CPU time' 
    150     get_cpu_time 
     147    echo 'Success' 
    151148fi 
    152149 
     150print_step 'Get real CPU time'; get_cpu_time 
     151 
     152 
     153## Inspect outputs 
     154##--------------------------------------------------- 
    153155ST='OK' ## 'OK' by default 
    154156 
    155  
    156 ## Inspect output text files 
    157 ##--------------------------------------------------- 
    158 print_step 'Test output files diff' 
    159 diff_results 
    160  
    161  
    162 ## Inspect output NetCDF files 
    163 ##--------------------------------------------------- 
    164 print_step 'Test last restart files diff' 
    165 diff_restart 
     157print_step 'Compare new outputs to benchmark files'; diff_results; diff_restart 
    166158[ $ST == 'FAILED' ] && get_out 8 
    167  
    168  
    169 ## Get comments (ocean.output & diff model.log) 
    170 ##--------------------------------------------------- 
    171 comments 'W A R N I N G' 
    172159 
    173160 
Note: See TracChangeset for help on using the changeset viewer.