New URL for NEMO forge!

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.
#1845 (iceberg trajectory file name) – NEMO

Opened 7 years ago

Closed 7 years ago

#1845 closed Bug (fixed)

iceberg trajectory file name

Reported by: mathiot Owned by: mathiot
Priority: low Milestone:
Component: OCE Version: v3.6
Severity: Keywords: ICB



  • With eORCA025, after 30 years the trajectory data can’t be written anyway as it runs out of characters in its file name string. So in eORCA12, it could be about 10 years and in eORCA1 about 120 years.
  • The tag used in the iceberg trajectory file name is time step based. It makes it very hard not to overwrite the data when doing an NRUN (as Matthew Menary is doing now).
  • Complication to process these files later on.


This affect NEMO3.6_STABLE and the trunk when the iceberg model is used and the trajectory saved.


A possible fix could be to replace in icbtrj.F90:

       IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6,"_",I4.4,".nc")') ktend, narea-1
       ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",I6.6         ,".nc")') ktend

by something like this:

      ! compute initial time step date
      CALL ju2ymds( fjulday, iyear, imonth, iday, zsec )
      WRITE(cldate_ini, '(i4.4,2i2.2)') iyear, imonth, iday

      ! compute last time step date
      zfjulday = fjulday + rdttra(1) / rday * REAL( nitend - nit000 + 1 , wp)
      IF( ABS(zfjulday - REAL(NINT(zfjulday),wp)) < 0.1 / rday )   zfjulday = REAL(NINT(zfjulday),wp)   ! avoid truncation error
      CALL ju2ymds( zfjulday, iyear, imonth, iday, zsec )
      WRITE(cldate_end, '(i4.4,2i2.2)') iyear, imonth, iday

      ! define trajectory output name
      IF( lk_mpp ) THEN   ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A,"_",I4.4,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end)), narea-1
      ELSE                ;   WRITE(cl_filename,'("trajectory_icebergs_",A,"-",A         ,".nc")') TRIM(ADJUSTL(cldate_ini)), TRIM(ADJUSTL(cldate_end))
      IF ( lwp .AND. nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, icb_trj_init: creating ',TRIM(cl_filename)

Commit History (0)

(No commits)

Change History (2)

comment:1 Changed 7 years ago by clevy

  • Owner changed from nemo to mathiot

comment:2 Changed 7 years ago by mathiot

  • Resolution set to fixed
  • Status changed from new to closed

Change committed in revision 8080 and 8081.

Note: See TracTickets for help on using tickets.