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 8953 for branches/UKMO/dev_r8183_ICEMODEL_rstdate_test/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90 – NEMO

Ignore:
Timestamp:
2017-12-08T12:05:11+01:00 (6 years ago)
Author:
frrh
Message:

First working version relative to NEMOv4.0+LIM3

File:
1 edited

Legend:

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

    r6623 r8953  
    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 deine 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.