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 6336 for branches/UKMO/restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90 – NEMO

Ignore:
Timestamp:
2016-02-19T14:53:05+01:00 (8 years ago)
Author:
mathiot
Message:

correction of truncation error for rst date stamp

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/restart_datestamp/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90

    r6305 r6336  
    5757      INTEGER             ::   iyear, imonth, iday 
    5858      REAL (wp)           ::   zsec 
     59      REAL (wp)           ::   zfjulday 
    5960      !! 
    6061      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
     
    8586         IF( nitrst <= nitend .AND. nitrst > 0 ) THEN  
    8687            IF ( ln_rstdate ) THEN 
    87                CALL ju2ymds( fjulday + ((kt-nit000)*rdttra(1)) / rday, iyear, imonth, iday, zsec )            
     88               zfjulday = fjulday + rdttra(1) / rday 
     89               IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     90               CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
    8891               WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
    8992            ELSE 
Note: See TracChangeset for help on using the changeset viewer.