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

Changeset 15701 for NEMO


Ignore:
Timestamp:
2022-02-16T13:08:58+01:00 (2 years ago)
Author:
jpalmier
Message:

enable TOP restart with date instead of time-step

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_GO8_paquage_branch/src/TOP/trcrst.F90

    r14075 r15701  
    4646      !! ** purpose  :   output of sea-trc variable in a netcdf file 
    4747      !!---------------------------------------------------------------------- 
     48      USE in_out_manager, ONLY : ln_rstdate  ! I/O manager 
     49      USE ioipsl,         ONLY : ju2ymds    ! for calendar 
     50      ! 
    4851      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    4952      ! 
     
    8083      IF( kt == nitrst - 2*nn_dttrc .OR. nn_stock == nn_dttrc .OR. ( kt == nitend - nn_dttrc .AND. .NOT. lrst_trc ) ) THEN 
    8184         ! 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 
     85         IF ( ln_rstdate ) THEN 
     86            zfjulday = fjulday + rdt / rday 
     87            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     88            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     89            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     90         ELSE        
     91            IF( nitrst > 1.0e9 ) THEN   ;   WRITE(clkt,*       ) nitrst 
     92            ELSE                        ;   WRITE(clkt,'(i8.8)') nitrst 
     93            ENDIF 
    8494         ENDIF 
    8595         ! create the file 
Note: See TracChangeset for help on using the changeset viewer.