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 12410 for branches/UKMO/AMM15_v3_6_STABLE_package_collate_utils333 – NEMO

Ignore:
Timestamp:
2020-02-19T16:27:21+01:00 (5 years ago)
Author:
jcastill
Message:

Changes necessary for solving utils ticket #333: timestamp for bgc restart

File:
1 edited

Legend:

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

    r10162 r12410  
    2424   !!---------------------------------------------------------------------- 
    2525   USE oce_trc 
     26   USE dom_oce, ONLY: fjulday 
     27   USE phycst, ONLY: rday 
     28   USE in_out_manager, ONLY: ln_rstdate 
    2629   USE trc 
    2730   USE trcnam_trp 
    2831   USE iom 
     32   USE ioipsl, ONLY: ju2ymds 
    2933   USE daymod 
    3034   ! +++>>> FABM 
     
    5155      !!---------------------------------------------------------------------- 
    5256      INTEGER, INTENT(in) ::   kt       ! number of iteration 
     57      INTEGER             ::   iyear, imonth, iday 
     58      REAL (wp)           ::   zsec 
     59      REAL (wp)           ::   zfjulday 
    5360      ! 
    5461      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character 
     
    8087      ! we open and define the tracer restart file one tracer time step before writing the data (-> at nitrst - 2*nn_dttrc + 1) 
    8188      ! 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 
    82       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( kt == nitrst - 2*nn_dttrc + 1 .OR. nstock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
     90         if ( ln_rstdate ) THEN 
     91            zfjulday = fjulday + rdttrc(1) / rday 
     92            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     93            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 
     94            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     95         ELSE 
     96            ! beware of the format used to write kt (default is i8.8, that should be large enough) 
     97            IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     98            ELSE                        ;   WRITE(clkt,'(i8.8)') nitrst 
     99            ENDIF 
    86100         ENDIF 
    87101         ! create the file 
Note: See TracChangeset for help on using the changeset viewer.