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 7498 for branches/NERC – NEMO

Changeset 7498 for branches/NERC


Ignore:
Timestamp:
2016-12-15T10:44:37+01:00 (7 years ago)
Author:
timgraham
Message:

Fix for occasional truncation error in date in restart_trc filename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/NERC/dev_r5518_NOC_MEDUSA_Stable/NEMOGCM/NEMO/TOP_SRC/trcrst.F90

    r7017 r7498  
    6969      INTEGER             ::   iyear, imonth, iday 
    7070      REAL (wp)           ::   zsec 
     71      REAL (wp)           ::   zfjulday 
    7172      ! 
    7273      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step define as a character 
     
    112113            !!                     we call ju2ymds( fjulday + (2*rdttra(1))  
    113114            !!--------------------------------------------------------------------       
    114             CALL ju2ymds( fjulday + (2*rdttra(1)) / rday, iyear, imonth, iday, zsec ) 
     115            zfjulday = fjulday + (2*rdttra(1)) / rday 
     116            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     117            CALL ju2ymds( zfjulday + (2*rdttra(1)) / rday, iyear, imonth, iday, zsec ) 
    115118            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
    116119         ELSE 
Note: See TracChangeset for help on using the changeset viewer.