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/branches/UKMO/r12083_restart_datestamp/src/ICE/icerst.F90 – 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)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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 
Note: See TracChangeset for help on using the changeset viewer.