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 9390 for branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90 – NEMO

Ignore:
Timestamp:
2018-03-09T14:41:46+01:00 (6 years ago)
Author:
davestorkey
Message:

UKMO/dev_r8864_restart_date branch: commit changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90

    r9235 r9390  
    2323   USE in_out_manager ! I/O manager 
    2424   USE iom            ! I/O library 
     25   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2526   USE lib_mpp        ! MPP library 
    2627   USE wrk_nemo       ! work arrays 
     
    5354      INTEGER, INTENT(in) ::   kt       ! number of iteration 
    5455      ! 
     56      INTEGER             ::   iyear, imonth, iday 
     57      REAL (wp)           ::   zsec 
     58      REAL (wp)           ::   zfjulday 
    5559      CHARACTER(len=20)   ::   clkt     ! ocean time-step define as a character 
    5660      CHARACTER(len=50)   ::   clname   ! ice output restart file name 
     
    6771         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
    6872            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    69             IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    70             ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     73            IF ( ln_rstdate ) THEN 
     74               zfjulday = fjulday + rdttra(1) / rday 
     75               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     76               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     77               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     78            ELSE 
     79               IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
     80               ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst 
     81               ENDIF 
    7182            ENDIF 
    7283            ! create the file 
Note: See TracChangeset for help on using the changeset viewer.