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

Ignore:
Timestamp:
2015-07-02T10:52:12+02:00 (9 years ago)
Author:
nicolasmartin
Message:

dev_r5092_CNRS_SETTE Bugfixes

File:
1 edited

Legend:

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

    r5527 r5528  
    4444    echo 'Last time step of standard run: '${LAST_TIME_STEP} 
    4545 
    46     if [ $( find -name "*${LAST_TIME_STEP}_restart*.nc" -print -quit ) ]; then 
    47    base_name=$( find -name "*${LAST_TIME_STEP}_restart*.nc" -print -quit | awk -F/ '{print $NF}' \ 
    48                 | sed "s/^\(.*\)$LAST_TIME_STEP\_restart.*/\1$LAST_TIME_STEP\_/"                  ) 
     46#    if [ $( find -name "*${LAST_TIME_STEP}_restart*.nc" -print -quit ) ]; then 
     47    if [ $( find -regex ".*_0+${LAST_TIME_STEP}_restart.*\.nc" -print -quit ) ]; then 
     48#  base_name=$( find -name "*${LAST_TIME_STEP}_restart*.nc" -print -quit | awk -F/ '{print $NF}' \ 
     49#               | sed "s/^\(.*\)$LAST_TIME_STEP\_restart.*/\1$LAST_TIME_STEP\_/"                  ) 
     50   base_name=$( find -regex ".*_0+${LAST_TIME_STEP}_restart.*\.nc" -print -quit | awk -F/ '{print $NF}' \ 
     51                | sed "s/^\(.*\)$LAST_TIME_STEP\_restart.*/\1$LAST_TIME_STEP\_/"                         ) 
    4952 
    5053   for comp in restart restart_ice restart_trc; do 
     
    5356       nb_dom=$( find -name "${file}_[0-9]*.nc" | wc -l | awk '{print $1}' ) 
    5457       if   [ ${nb_dom} -gt 1 ]; then 
    55       ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom}  > /dev/null 
    56       [ $? -eq 0 ] && rm -f ${base_name}_${comp}_[0-9]*.nc > /dev/null 
     58      ${NEMO_TRBD}/rebuild_nemo -t $NPROC $file ${nb_dom} > /dev/null 
     59      [ $? -eq 0 ] && rm -f ${base_name}${comp}_[0-9]*.nc > /dev/null 
    5760       elif [ ${nb_dom} -eq 0 ]; then 
    5861      export ST='FAILED' && get_out 10 
     
    6164       if [ -e ${REFE_DIR}/$file.nc ]; then 
    6265       # UNIX `cmp` not suitable (filename & timestamp in .nc file) 
    63       nc_diff=$( $CDO diffn $file.nc ${REFE_DIR}/$file.nc 2> /dev/null | tail -1 ) 
    64  
    65       if [ ! -z "${nc_diff}" ]; then 
     66      nc_diff=$( $CDO diffn $file.nc ${REFE_DIR}/$file.nc 2> /dev/null \ 
     67                 | awk '/records/ {print $1}'                           ) 
     68 
     69      if [ ${nc_diff} -ne 0 ]; then 
    6670          export ST='FAILED' 
    6771          printf "$CDO ${nc_diff}\n" 
Note: See TracChangeset for help on using the changeset viewer.