Changeset 5525


Ignore:
Timestamp:
2015-07-01T12:25:53+02:00 (5 years ago)
Author:
dancopsey
Message:

Updated to include dates in iceberg restart files.

File:
1 edited

Legend:

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

    r5500 r5525  
    2424   USE icb_oce        ! define iceberg arrays 
    2525   USE icbutl         ! iceberg utility routines 
     26   USE ioipsl, ONLY : ju2ymds    ! convert julian to years,months,days  
     27   USE phycst, ONLY : rday       ! number of seconds in a day 
    2628 
    2729   IMPLICIT NONE 
     
    231233      INTEGER ::   jn   ! dummy loop index 
    232234      INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim 
     235      INTEGER                :: iyear, imonth, iday   
     236      REAL (wp)              :: zsec 
    233237      CHARACTER(len=256)     :: cl_path 
    234238      CHARACTER(len=256)     :: cl_filename 
     239      CHARACTER(LEN=20)      :: clkt     ! ocean time-step defined as a character 
    235240      TYPE(iceberg), POINTER :: this 
    236241      TYPE(point)  , POINTER :: pt 
    237242      !!---------------------------------------------------------------------- 
     243       
     244      ! Date or timestep in the filename 
     245      IF ( ln_rstdate ) THEN  
     246         CALL ju2ymds( fjulday + rdttra(1) / rday, iyear, imonth, iday, zsec )             
     247         WRITE(clkt, '(i4.4,2i2.2)') iyear, imonth, iday  
     248      ELSE  
     249         IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt  
     250         ELSE                            ;   WRITE(clkt, '(i8.8)') kt  
     251         ENDIF 
     252      ENDIF 
    238253 
    239254      ! Assume we write iceberg restarts to same directory as ocean restarts. 
     
    241256      IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/' 
    242257      IF( lk_mpp ) THEN 
    243          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1 
     258         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1 
    244259      ELSE 
    245          WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt 
     260         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)) 
    246261      ENDIF 
    247262      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.