Changeset 3798


Ignore:
Timestamp:
05/02/18 11:50:27 (6 years ago)
Author:
mafoipsl
Message:

Consolidation of Reproducibility_after_restart ie it's now working for all PeriodLength?
and test included to verify start on XXXX0101.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CONFIG/UNIFORM/v6/IPSLCM6/GENERAL/DRIVER/opa9.driver

    r3788 r3798  
    121121      IGCM_debug_Print 1 'Reproducibility_after_Restart forced ie kt forced to kt red in restart file : ' ${opa9_UserChoices_Reproducibility_after_restart} 
    122122 
    123       ## This option is uncompatible with PeriodLength=1M. See later patch overwrite ndastp and kt in ocean restart file 
    124  
    125       if [ X${config_UserChoices_PeriodLength} != X"1Y" ] ; then 
    126         IGCM_debug_Exit " PeriodLength = ${config_UserChoices_PeriodLength} is uncompatible with Reproducibility_after_Restart=y, please use 1Y" 
    127       fi 
    128  
    129123    elif ( [ "${CumulPeriod}" -eq 1 ] && [ "${config_OCE_Restart}" = "n" ] ) ; then 
    130124      OPA_LRSTAR=.FALSE. 
     
    170164      ##-- Getting from restart file the last time step of the run at which we want to re-start 
    171165      NEMO_KT_FROM_RESTART=$(ncdump -v kt ${NEMO_RESTART_FILE}|grep 'kt ='|awk '{print $3}' ) 
    172       ## Force the date in the restart file to be the last day before the begiining of the new run 
    173       (( yearrst = year - 1 )) 
    174       IGCM_debug_Print 1 "cmd done to modify NEMO restartfile:   ncap2 -s ndastp=${yearrst}1231 ${NEMO_RESTART_FILE}  tmp.nc" 
    175       ## Take care : 1231 is forced here. Still to be done for monthly run or  
    176       ## make nrstdt=1 working for all NEMO component. Not done for sea ice yet. 
    177       ncap2 -s "ndastp=${yearrst}1231" ${NEMO_RESTART_FILE}  tmp.nc 
    178       mv tmp.nc ${NEMO_RESTART_FILE} 
     166 
     167      if ( [ "${CumulPeriod}" -eq 1 ] ) ; then 
     168        ## Force the date in the restart file to be the last day before the begining of the new run 
     169        (( yearrst = year - 1 )) 
     170        IGCM_debug_Print 1 "cmd done to modify NEMO restartfile:   ncap2 -s ndastp=${yearrst}1231 ${NEMO_RESTART_FILE}  tmp.nc" 
     171        ## Take care : 1231 is forced here. Still to be done for monthly run or  
     172        ## make nrstdt=1 working for all NEMO component. Not done for sea ice yet. 
     173        ncap2 -s "ndastp=${yearrst}1231" ${NEMO_RESTART_FILE}  tmp.nc 
     174        mv tmp.nc ${NEMO_RESTART_FILE} 
     175        ##-- Getting from restart file the "new" restart date of run at which we want to re-start 
     176        NEMO_NDASTP_FROM_RESTART=$(ncdump -v ndastp ${NEMO_RESTART_FILE}|grep 'ndastp ='|awk '{print $3}' ) 
     177        IGCM_debug_Print 1 "NEMO_NDASTP (from Restart) for 1st Period       : ${NEMO_NDASTP_FROM_RESTART}" 
     178 
     179        IGCM_date_GetYearMonthDay ${PeriodDateBegin} Verif_repro_year Verif_repro_month Verif_repro_day 
     180 
     181        if [ X${Verif_repro_month}${Verif_repro_day} != X"0101" ] ; then 
     182          IGCM_debug_Exit " PeriodDateBegin = ${PeriodDateBegin}is uncompatible with Reproducibility_after_Restart=y, please start on 0101" 
     183        fi 
     184 
     185      fi 
     186 
    179187      (( NEMO_NIT000 = NEMO_KT_FROM_RESTART + 1 )) 
    180188      (( NEMO_NITEND = NEMO_KT_FROM_RESTART + OPA_NITEND - OPA_NIT000 + 1 )) 
    181189      IGCM_debug_Print 1 "NEMO_NIT000 (from Restart)        : ${NEMO_NIT000}" 
    182190      IGCM_debug_Print 1 "NEMO_NITEND (from Restart + ... ) : ${NEMO_NITEND}" 
    183       ##-- Getting from restart file the "new" restart date of run at which we want to re-start 
    184       NEMO_NDASTP_FROM_RESTART=$(ncdump -v ndastp ${NEMO_RESTART_FILE}|grep 'ndastp ='|awk '{print $3}' ) 
    185       IGCM_debug_Print 1 "NEMO_NDASTP (from Restart)       : ${NEMO_NDASTP_FROM_RESTART}" 
    186191      ##-- We force one restart file at the end of the trunk 
    187192      OPA_NSTOCK="${NEMO_NITEND}" 
Note: See TracChangeset for help on using the changeset viewer.