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/OCE/IOM/restart.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/OCE/IOM/restart.F90

    r11715 r12477  
    2727   USE in_out_manager  ! I/O manager 
    2828   USE iom             ! I/O module 
     29   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2930   USE diurnal_bulk 
     31   USE sbc_oce         ! for icesheet freshwater input variables 
    3032   USE lib_mpp         ! distribued memory computing library 
    3133 
     
    4749CONTAINS 
    4850 
    49    SUBROUTINE rst_opn( kt ) 
     51   SUBROUTINE rst_opn( kt, ndastp ) 
    5052      !!--------------------------------------------------------------------- 
    5153      !!                   ***  ROUTINE rst_opn  *** 
     
    5860      !!---------------------------------------------------------------------- 
    5961      INTEGER, INTENT(in) ::   kt     ! ocean time-step 
     62      INTEGER, INTENT(in) ::   ndastp ! ocean date 
    6063      !! 
     64      INTEGER             ::   iyear, imonth, iday   
     65      REAL (wp)           ::   zsec   
     66      REAL (wp)           ::   zfjulday      !! 
    6167      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    6268      CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name 
    63       CHARACTER(lc)       ::   clpath   ! full path to ocean output restart file 
     69      CHARACTER(LEN=150)  ::   clpath   ! full path to ocean output restart file 
    6470      CHARACTER(LEN=52)   ::   clpname   ! ocean output restart file name including prefix for AGRIF 
    6571      CHARACTER(LEN=256)  ::   clinfo    ! info character 
     
    9096         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    9197            ! beware of the format used to write kt (default is i8.8, that should be large enough...) 
    92             IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst 
    93             ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst 
     98            IF ( ln_rstdate ) THEN   
     99               zfjulday = fjulday + rdt / rday   
     100               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error   
     101               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )              
     102               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday    
     103            ELSE   
     104               IF( nitrst > 999999999 ) THEN      
     105                  WRITE(clkt, *       ) nitrst   
     106               ELSE                 
     107                  WRITE(clkt, '(i8.8)') nitrst   
     108               ENDIF 
    94109            ENDIF 
    95110            ! create the file 
Note: See TracChangeset for help on using the changeset viewer.