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 12477 for NEMO – NEMO

Changeset 12477 for NEMO


Ignore:
Timestamp:
2020-02-27T13:20:58+01:00 (4 years ago)
Author:
jcastill
Message:

Changes as in the original branch, plus changes for bgc restart (in branch AMM15_v3_6_STABLE_package_collate)

Location:
NEMO/branches/UKMO/r12083_restart_datestamp
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r12083_restart_datestamp/cfgs/SHARED/namelist_ref

    r12083 r12477  
    4242   nn_leapy    =       0   !  Leap year calendar (1) or not (0) 
    4343   ln_rstart   = .false.   !  start from rest (F) or from a restart file (T) 
     44   ln_rstdate  = .false.   !  add a datestamp in the restart file name 
    4445      nn_euler    =    1      !  = 0 : start with forward time step if ln_rstart=T 
    4546      nn_rstctl   =    0      !  restart control ==> activated only if ln_rstart=T 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/ICE/icerst.F90

    r11715 r12477  
    2323   USE in_out_manager ! I/O manager 
    2424   USE iom            ! I/O manager library 
     25   USE ioipsl  , ONLY : ju2ymds    ! for calendar 
    2526   USE lib_mpp        ! MPP library 
    2627   USE lib_fortran    ! fortran utilities (glob_sum + no signed zero) 
     
    4647      !! ** purpose  :   open restart file 
    4748      !!---------------------------------------------------------------------- 
     49      INTEGER             ::   iyear, imonth, iday   
     50      REAL (wp)           ::   zsec   
     51      REAL (wp)           ::   zfjulday      !! 
    4852      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    4953      ! 
     
    6367         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
    6468            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    65             IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    66             ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     69            IF ( ln_rstdate ) THEN   
     70               zfjulday = fjulday + rdt / rday   
     71               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error   
     72               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )              
     73               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday    
     74            ELSE   
     75              IF( nitrst > 999999999 ) THEN      
     76                WRITE(clkt, *       ) nitrst   
     77              ELSE                 
     78                WRITE(clkt, '(i8.8)') nitrst   
     79              ENDIF 
    6780            ENDIF 
    6881            ! create the file 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/DOM/daymod.F90

    r11715 r12477  
    282282      ENDIF 
    283283 
    284       IF( .NOT. l_offline ) CALL rst_opn( kt )               ! Open the restart file if needed and control lrst_oce 
     284      IF( .NOT. l_offline ) CALL rst_opn( kt, ndastp )        ! Open the restart file if needed and control lrst_oce 
    285285      IF( lrst_oce         ) CALL day_rst( kt, 'WRITE' )      ! write day restart information 
    286286      ! 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/DOM/domain.F90

    r11715 r12477  
    292292         &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     & 
    293293         &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     & 
    294          &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios 
     294         &             ln_cfmeta, ln_iscpl, ln_xios_read, nn_wxios     , ln_rstdate 
    295295      NAMELIST/namdom/ ln_linssh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs, ln_meshmask 
    296296#if defined key_netcdf4 
     
    323323         WRITE(numout,*) '      restart output directory        cn_ocerst_outdir= ', TRIM( cn_ocerst_outdir ) 
    324324         WRITE(numout,*) '      restart logical                 ln_rstart       = ', ln_rstart 
     325         WRITE(numout,*) '      use date in restart name        ln_rstdate      = ', ln_rstdate 
    325326         WRITE(numout,*) '      start with forward time step    nn_euler        = ', nn_euler 
    326327         WRITE(numout,*) '      control of time step            nn_rstctl       = ', nn_rstctl 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/IOM/in_out_manager.F90

    r11715 r12477  
    7878   INTEGER       ::   nitend                      !: index of the last time step 
    7979   INTEGER       ::   ndate0                      !: initial calendar date aammjj 
     80   LOGICAL       ::   ln_rstdate = .FALSE.        !: Use calendar date rather than time-step in restart 
    8081   INTEGER       ::   nleapy                      !: Leap year calendar flag (0/1 or 30) 
    8182   INTEGER       ::   ninist                      !: initial state output flag (0/1) 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/OCE/IOM/restart.F90

    r11715 r12477  
    2727   USE in_out_manager  ! I/O manager 
    2828   USE iom             ! I/O module 
     29   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2930   USE diurnal_bulk 
     31   USE sbc_oce         ! for icesheet freshwater input variables 
    3032   USE lib_mpp         ! distribued memory computing library 
    3133 
     
    4749CONTAINS 
    4850 
    49    SUBROUTINE rst_opn( kt ) 
     51   SUBROUTINE rst_opn( kt, ndastp ) 
    5052      !!--------------------------------------------------------------------- 
    5153      !!                   ***  ROUTINE rst_opn  *** 
     
    5860      !!---------------------------------------------------------------------- 
    5961      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
     62      INTEGER, INTENT(in) ::   ndastp ! ocean date 
    6063      !! 
     64      INTEGER             ::   iyear, imonth, iday   
     65      REAL (wp)           ::   zsec   
     66      REAL (wp)           ::   zfjulday      !! 
    6167      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6268      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
    63       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
     69      CHARACTER(LEN=150)  ::   clpath   ! full path to ocean output restart file 
    6470      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    6571      CHARACTER(LEN=256)  ::   clinfo    ! info character 
     
    9096         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    9197            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    92             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    93             ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     98            IF ( ln_rstdate ) THEN   
     99               zfjulday = fjulday + rdt / rday   
     100               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error   
     101               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )              
     102               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday    
     103            ELSE   
     104               IF( nitrst > 999999999 ) THEN      
     105                  WRITE(clkt, *       ) nitrst   
     106               ELSE                 
     107                  WRITE(clkt, '(i8.8)') nitrst   
     108               ENDIF 
    94109            ENDIF 
    95110            ! create the file 
  • NEMO/branches/UKMO/r12083_restart_datestamp/src/TOP/trcrst.F90

    r11715 r12477  
    2020   !!---------------------------------------------------------------------- 
    2121   USE oce_trc 
     22   USE dom_oce, ONLY: fjulday  
     23   USE phycst, ONLY: rday  
     24   USE in_out_manager, ONLY: ln_rstdate 
    2225   USE trc 
    2326   USE iom 
     27   USE ioipsl, ONLY: ju2ymds 
    2428   USE daymod 
    2529   USE lib_mpp 
     
    4751      !!---------------------------------------------------------------------- 
    4852      INTEGER, INTENT(in) ::   kt       ! number of iteration 
     53      INTEGER             ::   iyear, imonth, iday  
     54      REAL (wp)           ::   zsec  
     55      REAL (wp)           ::   zfjulday 
    4956      ! 
    5057      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character 
     
    7885      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    7986      ! except if we write tracer restart files every tracer time step or if a tracer restart file was writen at nitend - 2*nn_dttrc + 1 
    80       IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
    81          ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    82          IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
    83          ELSE                        ;   WRITE(clkt,'(i8.8)') nitrst 
     87      IF( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN  
     88         if ( ln_rstdate ) THEN  
     89            zfjulday = fjulday + rdttrc(1) / rday  
     90            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error  
     91            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )  
     92            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     93         ELSE  
     94            ! beware of the format used to write kt (default is i8.8, that should be large enough)  
     95            IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst  
     96            ELSE                        ;   WRITE(clkt,'(i8.8)') nitrst  
     97            ENDIF 
    8498         ENDIF 
    8599         ! create the file 
Note: See TracChangeset for help on using the changeset viewer.