Index: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90
===================================================================
--- branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90	(revision 9389)
+++ branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/LIM_SRC_3/limrst.F90	(revision 9390)
@@ -23,4 +23,5 @@
    USE in_out_manager ! I/O manager
    USE iom            ! I/O library
+   USE ioipsl, ONLY : ju2ymds    ! for calendar
    USE lib_mpp        ! MPP library
    USE wrk_nemo       ! work arrays
@@ -53,4 +54,7 @@
       INTEGER, INTENT(in) ::   kt       ! number of iteration
       !
+      INTEGER             ::   iyear, imonth, iday
+      REAL (wp)           ::   zsec
+      REAL (wp)           ::   zfjulday
       CHARACTER(len=20)   ::   clkt     ! ocean time-step define as a character
       CHARACTER(len=50)   ::   clname   ! ice output restart file name
@@ -67,6 +71,13 @@
          IF( nitrst <= nitend .AND. nitrst > 0 ) THEN
             ! beware of the format used to write kt (default is i8.8, that should be large enough...)
-            IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
-            ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
+            IF ( ln_rstdate ) THEN
+               zfjulday = fjulday + rdttra(1) / rday
+               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(clkt, '(i4.4,2i2.2)') iyear, imonth, iday
+            ELSE
+               IF( nitrst > 99999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
+               ELSE                           ;   WRITE(clkt, '(i8.8)') nitrst
+               ENDIF
             ENDIF
             ! create the file
Index: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 9389)
+++ branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 9390)
@@ -285,5 +285,5 @@
          &             nn_it000, nn_itend , nn_date0    , nn_time0     , nn_leapy  , nn_istate ,     &
          &             nn_stock, nn_write , ln_mskland  , ln_clobber   , nn_chunksz, nn_euler  ,     &
-         &             ln_cfmeta, ln_iscpl
+         &             ln_cfmeta, ln_iscpl, ln_rstdate
       NAMELIST/namdom/ ln_linssh, nn_closea, nn_msh, rn_isfhmin, rn_rdt, rn_atfp, ln_crs
 #if defined key_netcdf4
@@ -329,4 +329,5 @@
          WRITE(numout,*) '      frequency of output file        nn_write   = ', nn_write
          WRITE(numout,*) '      mask land points                ln_mskland = ', ln_mskland
+         WRITE(numout,*) '      date-stamp restart files        ln_rstdate = ', ln_rstdate
          WRITE(numout,*) '      additional CF standard metadata ln_cfmeta  = ', ln_cfmeta
          WRITE(numout,*) '      overwrite an existing file      ln_clobber = ', ln_clobber
Index: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90
===================================================================
--- branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 9389)
+++ branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/ICB/icbrst.F90	(revision 9390)
@@ -25,4 +25,5 @@
    USE netcdf         ! netcdf routines for IO
    USE iom
+   USE ioipsl, ONLY : ju2ymds    ! for calendar
    USE icb_oce        ! define iceberg arrays
    USE icbutl         ! iceberg utility routines
@@ -158,4 +159,8 @@
       INTEGER ::   jn   ! dummy loop index
       INTEGER ::   ix_dim, iy_dim, ik_dim, in_dim
+      INTEGER             ::   iyear, imonth, iday
+      REAL (wp)           ::   zsec
+      REAL (wp)           ::   zfjulday
+      CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character
       CHARACTER(len=256)     :: cl_path
       CHARACTER(len=256)     :: cl_filename
@@ -167,8 +172,18 @@
       cl_path = TRIM(cn_ocerst_outdir)
       IF( cl_path(LEN_TRIM(cl_path):) /= '/' ) cl_path = TRIM(cl_path) // '/'
+      IF ( ln_rstdate ) THEN
+         zfjulday = fjulday + rdttra(1) / rday
+         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(clkt, '(i4.4,2i2.2)') iyear, imonth, iday
+      ELSE
+         IF( kt > 999999999 ) THEN   ;   WRITE(clkt, *       ) kt
+         ELSE                        ;   WRITE(clkt, '(i8.8)') kt
+         ENDIF
+      ENDIF
       IF( lk_mpp ) THEN
-         WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart_",I4.4,".nc")') TRIM(cexper), kt, narea-1
+         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart_",I4.4,".nc")') TRIM(cexper), TRIM(ADJUSTL(clkt)), narea-1
       ELSE
-         WRITE(cl_filename,'(A,"_icebergs_",I8.8,"_restart.nc")') TRIM(cexper), kt
+         WRITE(cl_filename,'(A,"_icebergs_",A,"_restart.nc")') TRIM(cexper), TRIM(ADJUSTL(clkt))
       ENDIF
       IF (nn_verbose_level >= 0) WRITE(numout,'(2a)') 'icebergs, write_restart: creating ',TRIM(cl_path)//TRIM(cl_filename)
Index: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90
===================================================================
--- branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 9389)
+++ branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/in_out_manager.F90	(revision 9390)
@@ -41,4 +41,5 @@
    INTEGER, DIMENSION(10) :: nn_stocklist  !: restart dump times
    LOGICAL       ::   ln_mskland       !: mask land points in NetCDF outputs (costly: + ~15%)
+   LOGICAL       ::   ln_rstdate       !: T=> stamp output restart files with date instead of timestep
    LOGICAL       ::   ln_cfmeta        !: output additional data to netCDF files required for compliance with the CF metadata standard
    LOGICAL       ::   ln_clobber       !: clobber (overwrite) an existing file
Index: branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
===================================================================
--- branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 9389)
+++ branches/UKMO/dev_r8864_restart_date/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 9390)
@@ -27,4 +27,5 @@
    USE in_out_manager  ! I/O manager
    USE iom             ! I/O module
+   USE ioipsl, ONLY : ju2ymds    ! for calendar
    USE diurnal_bulk
    
@@ -58,4 +59,7 @@
       INTEGER, INTENT(in) ::   kt     ! ocean time-step
       !!
+      INTEGER             ::   iyear, imonth, iday
+      REAL (wp)           ::   zsec
+      REAL (wp)           ::   zfjulday
       CHARACTER(LEN=20)   ::   clkt     ! ocean time-step deine as a character
       CHARACTER(LEN=50)   ::   clname   ! ocean output restart file name
@@ -85,6 +89,13 @@
          IF( nitrst <= nitend .AND. nitrst > 0 ) THEN 
             ! beware of the format used to write kt (default is i8.8, that should be large enough...)
-            IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
-            ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst
+            IF ( ln_rstdate ) THEN
+               zfjulday = fjulday + rdttra(1) / rday
+               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(clkt, '(i4.4,2i2.2)') iyear, imonth, iday
+            ELSE
+               IF( nitrst > 999999999 ) THEN   ;   WRITE(clkt, *       ) nitrst
+               ELSE                            ;   WRITE(clkt, '(i8.8)') nitrst
+               ENDIF
             ENDIF
             ! create the file
