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

Ignore:
Timestamp:
2015-06-24T19:26:17+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Ping pong updates between Curie & Ada to finalize

File:
1 edited

Legend:

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

    r5472 r5483  
    77    if [ "$state" == 'E R R O R' ]; then 
    88   if [ -e ocean.output ]; then 
    9        last_time_step=$( cat ${TEST_DIR}/time.step | tr -d [:space:] ) 
     9       last_time_step=$( cat time.step | tr -d [:space:] ) 
    1010       STEP='nemo.exe crashed at '${last_time_step} && export STEP 
    1111       line=$( grep -m1 -A5 "$state" ocean.output | tr -d '\n' ) 
     
    3838    echo 'Last time step of standard run: '${last_time_step} 
    3939 
    40     if [ $( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit ) ]; then 
    41    base_name=$( find ${TEST_DIR} -name "*${last_time_step}_restart*.nc" -print -quit        \ 
    42                 | awk -F/ '{print $NF}' | sed "s/^\(.*\)$last_time_step.*/\1$last_time_step/"  ) 
     40    if [ $( find -name "*${last_time_step}_restart*.nc" -print -quit ) ]; then 
     41   base_name=$( find -name "*${last_time_step}_restart*.nc" -print -quit | awk -F/ '{print $NF}' \ 
     42                | sed "s/^\(.*\)$last_time_step\_restart.*/\1$last_time_step\_/"                  ) 
    4343 
    4444   for comp in restart restart_ice restart_trc; do 
    45        file=${base_name}'_'${comp} && printf "$file'.nc': " 
    46  
    47        nb_dom=$( find ${TEST_DIR} -name "${file}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
     45       file=${base_name}${comp} && printf "$file'.nc': " 
     46 
     47       nb_dom=$( find -name "${file}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
    4848       if [ ${nb_dom} -gt 1 ]; then 
    49       ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom} > /dev/null 
     49      ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom}  > /dev/null 
     50      [ $? -eq 0 ] && rm -f ${base_name}_${comp}_[0-9]*.nc > /dev/null 
    5051       fi 
    5152 
    5253       # UNIX `cmp` not suitable (filename & timestamp in .nc file) 
    53        nc_diff=$( $CDO diffn ${TEST_DIR}/$file'.nc' ${REFE_DIR}/$file'.nc' 2> /dev/null | tail -1 ) 
     54       nc_diff=$( $CDO diffn $file'.nc' ${REFE_DIR}/$file'.nc' 2> /dev/null | tail -1 ) 
    5455       if [ ! -z "${nc_diff}" ]; then 
    5556      export STATUS='FAILED' STEP='Restart files different' 
     
    5960       fi 
    6061 
    61        rm -f ${TEST_DIR}/${base_name}_${comp}_[0-9]*.nc &> /dev/null 
    6262   done 
    6363 
     
    6969} 
    7070 
     71diff_textfiles() { 
     72    for file in ocean.output $( ls *.stat ); do 
     73   diff $file ${REFE_DIR}/$file 
     74   [ $? -ne 0 ] && export STATUS='FAILED' STEP='ASCII output file diff' 
     75    done 
     76} 
     77 
    7178get_cpu_time() { 
    72     real_cpu_time=$( eval ${JOB_TIME} ) 
     79    real_cpu_time=$( eval "${JOB_INFO} ${JOB_ID} | ${JOB_TIME}" ) 
    7380    printf "Real CPU time\n${real_cpu_time}\n" | tee mesg_10_realcputime_${CFG_USER}_${CFG_ARCH}.txt 
    7481} 
     
    8390    ${cmd_iol} > inputs_list.txt 
    8491    ${cmd_iof} > /dev/null 
    85 } 
    86  
    87 diff_textfiles() { 
    88     for file in ocean.output $( ls *.stat ); do 
    89    diff $file ${REFE_DIR}/$file 
    90    [ $? -ne 0 ] && export STATUS='FAILED' STEP='ASCII output file diff' 
    91     done 
    9292} 
    9393 
     
    220220    if [ ${time_elapsed} -eq ${TIME_LIMI} ]; then 
    221221   STEP='Exceeded time limit' 
    222  
    223    if [ $( ${JOB_LIST} | grep ${JOB_ID} ) ]; then 
    224        STEP='Job not finished on time: '$(( ${TIME_LIMI}/3600 ))'h' 
    225    fi 
    226  
     222   [ $( ${JOB_LIST} | grep ${JOB_ID} ) ] && STEP='Job not finished on time: '$(( ${TIME_LIMI}/3600 ))'h' 
    227223   print_step 
    228224   ${JOB_DELE} ${JOB_ID} &> /dev/null 
Note: See TracChangeset for help on using the changeset viewer.