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

Ignore:
Timestamp:
2018-03-09T14:41:46+01:00 (6 years ago)
Author:
davestorkey
Message:

UKMO/dev_r8864_restart_date branch: commit changes.

File:
1 edited

Legend:

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

    r9235 r9390  
    2525   USE netcdf         ! netcdf routines for IO 
    2626   USE iom 
     27   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2728   USE icb_oce        ! define iceberg arrays 
    2829   USE icbutl         ! iceberg utility routines 
     
    158159      INTEGER ::   jn   ! dummy loop index 
    159160      INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim 
     161      INTEGER             ::   iyear, imonth, iday 
     162      REAL (wp)           ::   zsec 
     163      REAL (wp)           ::   zfjulday 
     164      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    160165      CHARACTER(len=256)     :: cl_path 
    161166      CHARACTER(len=256)     :: cl_filename 
     
    167172      cl_path = TRIM(cn_ocerst_outdir) 
    168173      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
     174      IF ( ln_rstdate ) THEN 
     175         zfjulday = fjulday + rdttra(1) / rday 
     176         IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     177         CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     178         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     179      ELSE 
     180         IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt 
     181         ELSE                        ;   WRITE(clkt, '(i8.8)') kt 
     182         ENDIF 
     183      ENDIF 
    169184      IF( lk_mpp ) THEN 
    170          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     185         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 
    171186      ELSE 
    172          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     187         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 
    173188      ENDIF 
    174189      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.