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

Ignore:
Timestamp:
2015-07-02T16:06:34+02:00 (9 years ago)
Author:
davestorkey
Message:

This the functional change for this branch!

File:
1 edited

Legend:

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

    r5462 r5538  
    1818   !!---------------------------------------------------------------------- 
    1919   USE par_oce        ! NEMO parameters 
     20   USE phycst         ! for rday 
    2021   USE dom_oce        ! NEMO domain 
    2122   USE in_out_manager ! NEMO IO routines 
     23   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2224   USE lib_mpp        ! NEMO MPI library, lk_mpp in particular 
    2325   USE netcdf         ! netcdf routines for IO 
     
    231233      INTEGER ::   jn   ! dummy loop index 
    232234      INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim 
    233       CHARACTER(len=256)     :: cl_path 
    234       CHARACTER(len=256)     :: cl_filename 
     235      INTEGER             ::   iyear, imonth, iday 
     236      REAL (wp)           ::   zsec 
     237      CHARACTER(len=256)  :: cl_path 
     238      CHARACTER(len=256)  :: cl_filename 
     239      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    235240      TYPE(iceberg), POINTER :: this 
    236241      TYPE(point)  , POINTER :: pt 
     
    240245      cl_path = TRIM(cn_ocerst_outdir) 
    241246      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
     247      IF ( ln_rstdate ) THEN 
     248         CALL ju2ymds( fjulday + rdttra(1) / rday, iyear, imonth, iday, zsec )            
     249         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     250      ELSE 
     251         IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt 
     252         ELSE                        ;   WRITE(clkt, '(i8.8)') kt 
     253         ENDIF 
     254      ENDIF 
    242255      IF( lk_mpp ) THEN 
    243          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     256         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 
    244257      ELSE 
    245          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     258         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 
    246259      ENDIF 
    247260      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.