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/ICB/icbrst.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/ICB/icbrst.F90

    r5538 r6336  
    235235      INTEGER             ::   iyear, imonth, iday 
    236236      REAL (wp)           ::   zsec 
     237      REAL (wp)           ::   zfjulday 
    237238      CHARACTER(len=256)  :: cl_path 
    238239      CHARACTER(len=256)  :: cl_filename 
     
    246247      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
    247248      IF ( ln_rstdate ) THEN 
    248          CALL ju2ymds( fjulday + rdttra(1) / rday, iyear, imonth, iday, zsec )            
     249         zfjulday = fjulday + rdttra(1) / rday 
     250         IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     251         CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
    249252         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
    250253      ELSE 
Note: See TracChangeset for help on using the changeset viewer.