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 8081 – NEMO

Changeset 8081


Ignore:
Timestamp:
2017-05-26T12:42:03+02:00 (7 years ago)
Author:
mathiot
Message:

modification of iceberg trajectory file name (from time step based to date based)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2015/nemo_v3_6_STABLE/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90

    r5215 r8081  
    1818   USE lib_mpp        ! NEMO MPI library, lk_mpp in particular 
    1919   USE in_out_manager ! NEMO IO, numout in particular 
     20   USE ioipsl, ONLY : ju2ymds    ! for calendar 
    2021   USE netcdf 
    2122   ! 
     
    6061      ! 
    6162      INTEGER                               :: iret 
     63      INTEGER                               :: iyear, imonth, iday 
     64      REAL(wp)                              :: zfjulday, zsec 
    6265      CHARACTER(len=80)                     :: cl_filename 
    6366      TYPE(iceberg), POINTER                :: this 
    6467      TYPE(point)  , POINTER                :: pt 
    65       !!---------------------------------------------------------------------- 
    66  
    67       IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6,"_",I4.4,".nc")') ktend, narea-1 
    68       ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6         ,".nc")') ktend 
     68      CHARACTER(LEN=20)                     :: cldate_ini, cldate_end 
     69      !!---------------------------------------------------------------------- 
     70 
     71      ! compute initial time step date 
     72      CALL ju2ymds( fjulday, iyear, imonth, iday, zsec ) 
     73      WRITE(cldate_ini, '(i4.4,2i2.2)') iyear, imonth, iday 
     74 
     75      ! compute end time step date 
     76      zfjulday = fjulday + rdttra(1) / rday * REAL( nitend - nit000 + 1 , wp) 
     77      IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error 
     78      CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec ) 
     79      WRITE(cldate_end, '(i4.4,2i2.2)') iyear, imonth, iday 
     80 
     81      ! define trajectory output name 
     82      IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A,"_",I4.4,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)), narea-1 
     83      ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A         ,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)) 
    6984      ENDIF 
    7085      IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename) 
Note: See TracChangeset for help on using the changeset viewer.