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 14078 for NEMO/branches/UKMO/NEMO_4.0.4_GO8_package/src/OCE/ICB/icbrst.F90 – NEMO

Ignore:
Timestamp:
2020-12-04T11:17:01+01:00 (3 years ago)
Author:
cguiavarch
Message:

UKMO/NEMO_4.0.4_GO8_package: copy over changes from NEMO_4.0.3_GO8_package branch @13647.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • NEMO/branches/UKMO/NEMO_4.0.4_GO8_package/src/OCE/ICB/icbrst.F90

    r14075 r14078  
    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 
     
    191192      INTEGER ::   idg  ! number of digits 
    192193      INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim 
    193       CHARACTER(len=256)     :: cl_path 
    194       CHARACTER(len=256)     :: cl_filename 
    195       CHARACTER(len=8  )     :: cl_kt 
     194      INTEGER             ::   iyear, imonth, iday 
     195      REAL (wp)           ::   zsec 
     196      REAL (wp)           ::   zfjulday 
     197      CHARACTER(len=256)  :: cl_path 
     198      CHARACTER(len=256)  :: cl_filename 
     199      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character 
    196200      CHARACTER(LEN=12 )     :: clfmt            ! writing format 
    197201      TYPE(iceberg), POINTER :: this 
     
    209213         cl_path = TRIM(cn_ocerst_outdir) 
    210214         IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
    211          WRITE(cl_kt, '(i8.8)') kt 
    212          cl_filename = TRIM(cexper)//"_icebergs_"//cl_kt//"_restart" 
     215         IF ( ln_rstdate ) THEN 
     216            zfjulday = fjulday + rdt / rday 
     217            IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     218            CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )            
     219            WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday 
     220         ELSE 
     221            IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt 
     222            ELSE                        ;   WRITE(clkt, '(i8.8)') kt 
     223            ENDIF 
     224         ENDIF 
     225         cl_filename = TRIM(cexper)//"_icebergs_"//TRIM(ADJUSTL(clkt))//"_restart" 
    213226         IF( lk_mpp ) THEN 
    214227            idg = MAX( INT(LOG10(REAL(MAX(1,jpnij-1),wp))) + 1, 4 )          ! how many digits to we need to write? min=4, max=9 
Note: See TracChangeset for help on using the changeset viewer.