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 15693 – NEMO

Changeset 15693


Ignore:
Timestamp:
2022-02-03T16:46:16+01:00 (2 years ago)
Author:
jcastill
Message:

Add date in the tracer restart file name if ln_rstdate=.true.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/AMM15_v3_6_STABLE_new_ersem/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r10162 r15693  
    2424   !!---------------------------------------------------------------------- 
    2525   USE oce_trc 
     26   USE dom_oce,        ONLY : fjulday 
    2627   USE trc 
    2728   USE trcnam_trp 
    2829   USE iom 
     30   USE ioipsl,         ONLY : ju2ymds     ! for calendar 
     31   USE in_out_manager, ONLY : ln_rstdate  ! I/O manager 
    2932   USE daymod 
    3033   ! +++>>> FABM 
     
    5154      !!---------------------------------------------------------------------- 
    5255      INTEGER, INTENT(in) ::   kt       ! number of iteration 
     56      INTEGER             ::   iyear, imonth, iday 
     57      REAL (wp)           ::   zsec 
     58      REAL (wp)           ::   zfjulday 
    5359      ! 
    5460      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character 
     
    8187      ! 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 
    8288      IF( kt == nitrst - 2*nn_dttrc .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
    83          ! beware of the format used to write kt (default is i8.8, that should be large enough) 
    84          IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
    85          ELSE                        ;   WRITE(clkt,'(i8.8)') nitrst 
     89         IF ( ln_rstdate ) THEN 
     90            zfjulday = fjulday + rdttra(1) / rday 
     91            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     92            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 
     93            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     94         ELSE 
     95            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
     96            IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     97            ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     98            ENDIF 
    8699         ENDIF 
    87100         ! create the file 
Note: See TracChangeset for help on using the changeset viewer.