Ignore:
Timestamp:
2019-03-15T13:14:30+01:00 (23 months ago)
Author:
jcastill
Message:

First set of changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/r8395_restart_datestamp/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90

    r10758 r10765  
    2020   !!---------------------------------------------------------------------- 
    2121   USE par_oce        ! NEMO parameters 
     22   USE phycst         ! for rday 
    2223   USE dom_oce        ! NEMO domain 
    2324   USE in_out_manager ! NEMO IO routines 
     25   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2426   USE lib_mpp        ! NEMO MPI library, lk_mpp in particular 
    2527   USE netcdf         ! netcdf routines for IO 
     
    161163      CHARACTER(len=256)     :: cl_filename 
    162164      TYPE(iceberg), POINTER :: this 
     165      INTEGER                :: iyear, imonth, iday  
     166      REAL (wp)              :: zsec  
     167      REAL (wp)              :: zfjulday  
     168      CHARACTER(LEN=20)      :: clkt     ! ocean time-step define as a character      TYPE(iceberg), POINTER :: this 
    163169      TYPE(point)  , POINTER :: pt 
    164170      !!---------------------------------------------------------------------- 
     
    167173      cl_path = TRIM(cn_ocerst_outdir) 
    168174      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
     175      IF ( ln_rstdate ) THEN  
     176         zfjulday = fjulday + rdt / rday  
     177         IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error  
     178         CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )             
     179         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     180      ELSE  
     181         IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt  
     182         ELSE                        ;   WRITE(clkt, '(i8.8)') kt  
     183         ENDIF  
     184      ENDIF 
     185 
    169186      IF( lk_mpp ) THEN 
    170          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     187         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 
    171188      ELSE 
    172          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     189         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 
    173190      ENDIF 
    174191      IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename) 
Note: See TracChangeset for help on using the changeset viewer.