Changeset 7674


Ignore:
Timestamp:
2017-02-13T16:14:20+01:00 (4 years ago)
Author:
mathiot
Message:

set the iceberg trajectory output to trajectory_icebergs_<date_ini (YYYYMMDD)>-<date_end (YYYYMMDD)>_????.nc (instead of trajectory_icebergs_<last time step (XXXXXX)>_????.nc)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/UKMO/dev_renaming_icb_traj_output/NEMOGCM/NEMO/OPA_SRC/ICB/icbtrj.F90

    r6486 r7674  
    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.