Index: /trunk/NEMO/C1D_SRC/diawri_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 1333)
+++ /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 1334)
@@ -76,4 +76,5 @@
       INTEGER ::   ji, jj, ik                        ! dummy loop indices
       INTEGER ::   iimi, iima, ipk, it, ijmi, ijma   ! temporary integers
+      INTEGER ::   itmod                             ! 
       REAL(wp) ::   zsto, zout, zmax, zjulian, zdt   ! temporary scalars
       REAL(wp), DIMENSION(jpi,jpj) ::   zw2d         ! temporary workspace
@@ -109,5 +110,6 @@
 
       ! define time axis
-      it = kt - nit000 + 1
+      it = kt
+      itmod = kt - nit000 + 1
 
 
@@ -142,7 +144,7 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
+            &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
          CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
-            &           "m", ipk, gdept_0, nz_T )
+            &           "m", ipk, gdept_0, nz_T, "down" )
          !                                                            ! Index of ocean points
          CALL wheneq( jpi*jpj*ipk, tmask, 1, 1., ndex_T , ndim_T  )      ! volume
@@ -276,5 +278,5 @@
       ! donne le nombre d'elements, et ndex la liste des indices a sortir
 
-      IF( lwp .AND. MOD( it, nwrite ) == 0 ) THEN 
+      IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN 
          WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -344,5 +346,5 @@
 
       !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
-      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort' )
+      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort', kt )
 
       ! 3. Close all files
Index: /trunk/NEMO/C1D_SRC/step_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/step_c1d.F90	(revision 1333)
+++ /trunk/NEMO/C1D_SRC/step_c1d.F90	(revision 1334)
@@ -113,5 +113,5 @@
 
       IF( ninist == 1 ) THEN                          ! Output the initial state and forcings
-                        CALL dia_wri_state( 'output.init' )   ;   ninist = 0
+                        CALL dia_wri_state( 'output.init', kstp )   ;   ninist = 0
       ENDIF
 
Index: /trunk/NEMO/LIM_SRC_2/limwri_2.F90
===================================================================
--- /trunk/NEMO/LIM_SRC_2/limwri_2.F90	(revision 1333)
+++ /trunk/NEMO/LIM_SRC_2/limwri_2.F90	(revision 1334)
@@ -103,5 +103,5 @@
          ENDIF
          zout     = nwrite * rdt_ice / nn_fsbc
-         niter    = 0
+         niter    = nit000 - 1
          zdept(1) = 0.
          
@@ -110,6 +110,6 @@
          CALL dia_nam ( clhstnam, nwrite, 'icemod' )
          CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit,    &
-            &           1, jpi, 1, jpj, 0, zjulian, rdt_ice, nhorid, nice , domain_id=nidom)
-         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid)
+            &           1, jpi, 1, jpj, nit000-1, zjulian, rdt_ice, nhorid, nice , domain_id=nidom)
+         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid, "down")
          CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim)
          
@@ -182,5 +182,5 @@
       END DO
       
-      IF( ( nn_fsbc * niter + nit000 - 1 ) >= nitend )   CALL histclo( nice ) 
+      IF( ( nn_fsbc * niter ) >= nitend )   CALL histclo( nice ) 
       !
    END SUBROUTINE lim_wri_2
Index: /trunk/NEMO/LIM_SRC_3/limwri.F90
===================================================================
--- /trunk/NEMO/LIM_SRC_3/limwri.F90	(revision 1333)
+++ /trunk/NEMO/LIM_SRC_3/limwri.F90	(revision 1334)
@@ -112,5 +112,5 @@
          nice, nhorid, ndim, niter, ndepid
       INTEGER , SAVE ::      &
-         nicea, nhorida, nitera, ndimitd
+         nicea, nhorida, ndimitd
       INTEGER , DIMENSION( jpij ) , SAVE ::  &
          ndex51
@@ -141,5 +141,5 @@
          ENDIF
          zout     = nwrite * rdt_ice / nn_fsbc
-         niter    = 0
+         niter    = nit000 - 1
          zdept(1) = 0.
 
@@ -147,6 +147,7 @@
          zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
          CALL dia_nam ( clhstnam, nwrite, 'icemod' )
-         CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit, 1, jpi, 1, jpj, 0, zjulian, rdt_ice, nhorid, nice, domain_id=nidom )
-         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid)
+         CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit, 1, jpi, 1, jpj, nit000-1, zjulian, rdt_ice,   &
+            &           nhorid, nice, domain_id=nidom )
+         CALL histvert( nice, "deptht", "Vertical T levels", "m", 1, zdept, ndepid, "down")
          CALL wheneq  ( jpij , tmask(:,:,1), 1, 1., ndex51, ndim)
 
@@ -169,5 +170,4 @@
          clop     = "ave(x)"
          zout     = nwrite * rdt_ice / nn_fsbc
-         nitera   = 0
          zdept(1) = 0.
 
@@ -175,5 +175,5 @@
          CALL histbeg ( clhstnama, jpi, glamt, jpj, gphit,         &
             1, jpi, 1, jpj,        & ! zoom
-            0, zjulian, rdt_ice,   & ! time
+            nit000 -1, zjulian, rdt_ice,   & ! time
             nhorida,               & ! ? linked with horizontal ...
             nicea , domain_id=nidom)                  ! file 
@@ -316,5 +316,5 @@
       END DO
 
-      IF ( ( nn_fsbc * niter + nit000 - 1 ) >= nitend .OR. kindic < 0 ) THEN
+      IF ( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
          IF( lwp) WRITE(numout,*) ' Closing the icemod file '
          CALL histclo( nice )
@@ -375,5 +375,5 @@
          !     not yet implemented
 
-         IF ( ( nn_fsbc * niter + nit000 - 1 ) >= nitend .OR. kindic < 0 ) THEN
+         IF ( ( nn_fsbc * niter ) >= nitend .OR. kindic < 0 ) THEN
             IF(lwp) WRITE(numout,*) ' Closing the icemod file '
             CALL histclo( nicea ) 
Index: /trunk/NEMO/OPA_SRC/DIA/diagap.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diagap.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/DIA/diagap.F90	(revision 1334)
@@ -82,5 +82,5 @@
       !! * local declarations
       INTEGER ::   ji, jj, jk   ! dummy loop indices
-      INTEGER ::   it
+      INTEGER ::   it, itmod    ! time step indices
       CHARACTER (len=40) ::   clhstnam
       CHARACTER (len=40) ::   clop
@@ -170,8 +170,8 @@
          ! Horizontal grid : zphi()
          CALL histbeg( clhstnam, 1, zfoo, 1, zloo,   &
-                       1, 1, 1, 1, 0, zjulian, zdt, nhoridg, numgap, domain_id=nidom )
+                       1, 1, 1, 1, nit000-1, zjulian, zdt, nhoridg, numgap, domain_id=nidom )
          ! Vertical grids : gdept, gdepw
          CALL histvert( numgap, "deptht", "Vertical T levels",   &
-                         "m", jpk, gdept_0, ndepidg )
+                         "m", jpk, gdept_0, ndepidg, "down" )
 
          ! define fields to be stored
@@ -198,6 +198,7 @@
       ! ----------------------
 
-      it = kt - nit000 + 1       ! define time axis
-      IF( MOD( it, ngap ) == 0 ) THEN
+      itmod = kt - nit000 + 1       ! define time axis
+      it = kt 
+      IF( MOD( itmod, ngap ) == 0 ) THEN
 
          ! initialization
@@ -240,5 +241,5 @@
           ! ----------------------------======
 
-          IF( MOD( it, nprg ) == 0 ) THEN
+          IF( MOD( itmod, nprg ) == 0 ) THEN
               IF(lwp) THEN
                   WRITE(numout,*) 'dia_gap: time step = ', kt, 'model - data'
Index: /trunk/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1334)
@@ -418,5 +418,5 @@
 
       CHARACTER (len=40)       ::   clhstnam, clop                   ! temporary names
-      INTEGER                  ::   iline, it, ji                    !
+      INTEGER                  ::   iline, it, ji, itmod             !
       REAL(wp)                 ::   zsto, zout, zdt, zjulian   ! temporary scalars
       REAL(wp), DIMENSION(jpj) ::   zphi, zfoo
@@ -424,5 +424,6 @@
       
       ! define time axis
-      it = kt - nit000 + 1
+      it = kt
+      itmod = kt - nit000 + 1
 
       ! Initialization
@@ -481,10 +482,10 @@
          ! Horizontal grid : zphi()
          CALL histbeg(clhstnam, 1, zfoo, jpj, zphi,   &
-            1, 1, 1, jpj, 0, zjulian, zdt, nhoridz, numptr, domain_id=nidom )
+            1, 1, 1, jpj, nit000-1, zjulian, zdt, nhoridz, numptr, domain_id=nidom )
          ! Vertical grids : gdept_0, gdepw_0
          CALL histvert( numptr, "deptht", "Vertical T levels",   &
-            "m", jpk, gdept_0, ndepidzt )
+            "m", jpk, gdept_0, ndepidzt, "down" )
          CALL histvert( numptr, "depthw", "Vertical W levels",   &
-            "m", jpk, gdepw_0, ndepidzw )
+            "m", jpk, gdepw_0, ndepidzw, "down" )
          
          !  Zonal mean T and S
@@ -555,5 +556,5 @@
       ENDIF
 
-      IF( MOD( it, nf_ptr ) == 0 ) THEN
+      IF( MOD( itmod, nf_ptr ) == 0 ) THEN
 
          IF(lwp) THEN
Index: /trunk/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diawri.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/DIA/diawri.F90	(revision 1334)
@@ -109,5 +109,5 @@
       INTEGER ::   inum = 11             ! temporary logical unit
       INTEGER ::   &
-         iimi, iima, ipk, it,         &  ! temporary integers
+         iimi, iima, ipk, it, itmod,  &  ! temporary integers
          ijmi, ijma                      !    "          "
       REAL(wp) ::   &
@@ -148,5 +148,6 @@
 
       ! define time axis
-      it = kt - nit000 + 1
+      it = kt
+      itmod = kt - nit000 + 1
 
 
@@ -184,7 +185,7 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
+            &          nit000-1, zjulian, zdt, nh_T, nid_T, domain_id=nidom )
          CALL histvert( nid_T, "deptht", "Vertical T levels",      &  ! Vertical grid: gdept
-            &           "m", ipk, gdept_0, nz_T )
+            &           "m", ipk, gdept_0, nz_T, "down" )
          !                                                            ! Index of ocean points
          CALL wheneq( jpi*jpj*ipk, tmask, 1, 1., ndex_T , ndim_T  )      ! volume
@@ -197,7 +198,7 @@
          CALL histbeg( clhstnam, jpi, glamu, jpj, gphiu,           &  ! Horizontal grid: glamu and gphiu
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_U, nid_U, domain_id=nidom )
+            &          nit000-1, zjulian, zdt, nh_U, nid_U, domain_id=nidom )
          CALL histvert( nid_U, "depthu", "Vertical U levels",      &  ! Vertical grid: gdept
-            &           "m", ipk, gdept_0, nz_U )
+            &           "m", ipk, gdept_0, nz_U, "down" )
          !                                                            ! Index of ocean points
          CALL wheneq( jpi*jpj*ipk, umask, 1, 1., ndex_U , ndim_U  )      ! volume
@@ -210,7 +211,7 @@
          CALL histbeg( clhstnam, jpi, glamv, jpj, gphiv,           &  ! Horizontal grid: glamv and gphiv
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_V, nid_V, domain_id=nidom )
+            &          nit000-1, zjulian, zdt, nh_V, nid_V, domain_id=nidom )
          CALL histvert( nid_V, "depthv", "Vertical V levels",      &  ! Vertical grid : gdept
-            &          "m", ipk, gdept_0, nz_V )
+            &          "m", ipk, gdept_0, nz_V, "down" )
          !                                                            ! Index of ocean points
          CALL wheneq( jpi*jpj*ipk, vmask, 1, 1., ndex_V , ndim_V  )      ! volume
@@ -223,7 +224,7 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,           &  ! Horizontal grid: glamt and gphit
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,       &
-            &          0, zjulian, zdt, nh_W, nid_W, domain_id=nidom )
+            &          nit000-1, zjulian, zdt, nh_W, nid_W, domain_id=nidom )
          CALL histvert( nid_W, "depthw", "Vertical W levels",      &  ! Vertical grid: gdepw
-            &          "m", ipk, gdepw_0, nz_W )
+            &          "m", ipk, gdepw_0, nz_W, "down" )
 
 
@@ -406,5 +407,5 @@
       ! donne le nombre d'elements, et ndex la liste des indices a sortir
 
-      IF( lwp .AND. MOD( it, nwrite ) == 0 ) THEN 
+      IF( lwp .AND. MOD( itmod, nwrite ) == 0 ) THEN 
          WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -512,5 +513,5 @@
 
       !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
-      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort' )
+      IF( kindic < 0 )   CALL dia_wri_state( 'output.abort', kt )
 
       ! 3. Close all files
@@ -526,5 +527,5 @@
 
 
-   SUBROUTINE dia_wri_state( cdfile_name )
+   SUBROUTINE dia_wri_state( cdfile_name, kt )
       !!---------------------------------------------------------------------
       !!                 ***  ROUTINE dia_wri_state  ***
@@ -546,6 +547,6 @@
       !!----------------------------------------------------------------------
       !! * Arguments
-      CHARACTER (len=* ), INTENT( in ) ::   &
-         cdfile_name      ! name of the file created
+      CHARACTER (len=* ), INTENT( in ) ::   cdfile_name      ! name of the file created
+      INTEGER           , INTENT( in ) ::   kt               ! ocean time-step index
 
       !! * Local declarations
@@ -588,7 +589,7 @@
       zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
       CALL histbeg( clname, jpi, glamt, jpj, gphit,   &
-          1, jpi, 1, jpj, 0, zjulian, zdt, nh_i, id_i, domain_id=nidom )          ! Horizontal grid : glamt and gphit
+          1, jpi, 1, jpj, nit000-1, zjulian, zdt, nh_i, id_i, domain_id=nidom )          ! Horizontal grid : glamt and gphit
       CALL histvert( id_i, "deptht", "Vertical T levels",   &    ! Vertical grid : gdept
-          "m", jpk, gdept_0, nz_i)
+          "m", jpk, gdept_0, nz_i, "down")
 
       ! Declare all the output fields as NetCDF variables
@@ -634,20 +635,20 @@
 
       ! Write all fields on T grid
-      CALL histwrite( id_i, "votemper", 1, tn      , jpi*jpj*jpk, idex )    ! now temperature
-      CALL histwrite( id_i, "vosaline", 1, sn      , jpi*jpj*jpk, idex )    ! now salinity
-#if defined key_dynspg_rl
-      CALL histwrite( id_i, "sobarstf", 1, bsfn     , jpi*jpj    , idex )    ! barotropic streamfunction
+      CALL histwrite( id_i, "votemper", kt, tn      , jpi*jpj*jpk, idex )    ! now temperature
+      CALL histwrite( id_i, "vosaline", kt, sn      , jpi*jpj*jpk, idex )    ! now salinity
+#if defined key_dynspg_rl
+      CALL histwrite( id_i, "sobarstf", kt, bsfn     , jpi*jpj    , idex )    ! barotropic streamfunction
 #else
-      CALL histwrite( id_i, "sossheig", 1, sshn     , jpi*jpj    , idex )    ! sea surface height
-#endif
-      CALL histwrite( id_i, "vozocrtx", 1, un       , jpi*jpj*jpk, idex )    ! now i-velocity
-      CALL histwrite( id_i, "vomecrty", 1, vn       , jpi*jpj*jpk, idex )    ! now j-velocity
-      CALL histwrite( id_i, "vovecrtz", 1, wn       , jpi*jpj*jpk, idex )    ! now k-velocity
-      CALL histwrite( id_i, "sowaflup", 1, emp      , jpi*jpj    , idex )    ! freshwater budget
-      CALL histwrite( id_i, "sohefldo", 1, qsr + qns, jpi*jpj    , idex )    ! total heat flux
-      CALL histwrite( id_i, "soshfldo", 1, qsr      , jpi*jpj    , idex )    ! solar heat flux
-      CALL histwrite( id_i, "soicecov", 1, fr_i     , jpi*jpj    , idex )    ! ice fraction
-      CALL histwrite( id_i, "sozotaux", 1, utau     , jpi*jpj    , idex )    ! i-wind stress
-      CALL histwrite( id_i, "sometauy", 1, vtau     , jpi*jpj    , idex )    ! j-wind stress
+      CALL histwrite( id_i, "sossheig", kt, sshn     , jpi*jpj    , idex )    ! sea surface height
+#endif
+      CALL histwrite( id_i, "vozocrtx", kt, un       , jpi*jpj*jpk, idex )    ! now i-velocity
+      CALL histwrite( id_i, "vomecrty", kt, vn       , jpi*jpj*jpk, idex )    ! now j-velocity
+      CALL histwrite( id_i, "vovecrtz", kt, wn       , jpi*jpj*jpk, idex )    ! now k-velocity
+      CALL histwrite( id_i, "sowaflup", kt, emp      , jpi*jpj    , idex )    ! freshwater budget
+      CALL histwrite( id_i, "sohefldo", kt, qsr + qns, jpi*jpj    , idex )    ! total heat flux
+      CALL histwrite( id_i, "soshfldo", kt, qsr      , jpi*jpj    , idex )    ! solar heat flux
+      CALL histwrite( id_i, "soicecov", kt, fr_i     , jpi*jpj    , idex )    ! ice fraction
+      CALL histwrite( id_i, "sozotaux", kt, utau     , jpi*jpj    , idex )    ! i-wind stress
+      CALL histwrite( id_i, "sometauy", kt, vtau     , jpi*jpj    , idex )    ! j-wind stress
 
       ! 3. Close the file
Index: /trunk/NEMO/OPA_SRC/TRD/trdmld.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 1334)
@@ -230,5 +230,5 @@
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !!
-      INTEGER :: ji, jj, jk, jl, ik, it
+      INTEGER :: ji, jj, jk, jl, ik, it, itmod
       LOGICAL :: lldebug = .TRUE.
       REAL(wp) :: zavt, zfn, zfn2
@@ -389,7 +389,9 @@
       smltrd(:,:,:) = smltrd(:,:,:) * ucf   !  is no longer used, and is reset to 0. at next time step)
       
-      it = kt - nit000 + 1
-
-      MODULO_NTRD : IF( MOD( it, ntrd ) == 0 ) THEN        ! nitend MUST be multiple of ntrd
+      ! define time axis
+      it = kt
+      itmod = kt - nit000 + 1
+
+      MODULO_NTRD : IF( MOD( itmod, ntrd ) == 0 ) THEN        ! nitend MUST be multiple of ntrd
          !
          ztmltot (:,:) = 0.e0   ;   zsmltot (:,:) = 0.e0   ! reset arrays to zero
@@ -576,5 +578,5 @@
 #if defined key_dimgout
 
-      IF( MOD( it, ntrd ) == 0 ) THEN
+      IF( MOD( itmod, ntrd ) == 0 ) THEN
          iyear =  ndastp/10000
          imon  = (ndastp-iyear*10000)/100
@@ -593,5 +595,5 @@
       ! ----------------------------------
 
-      IF( lwp .AND. MOD( it , ntrd ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod , ntrd ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld : write trends in the NetCDF file :'
@@ -683,5 +685,5 @@
 #endif
 
-      IF( MOD( it, ntrd ) == 0 ) THEN
+      IF( MOD( itmod, ntrd ) == 0 ) THEN
          !
          ! III.5 Reset cumulative arrays to zero
@@ -876,5 +878,5 @@
       IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam
       CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            &
-      &             1, jpi, 1, jpj, 0, zjulian, rdt, nh_t, nidtrd, domain_id=nidom )
+      &             1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_t, nidtrd, domain_id=nidom )
 
       !-- Define the ML depth variable
Index: /trunk/NEMO/OPA_SRC/TRD/trdvor.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 1334)
@@ -312,5 +312,5 @@
       INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
       !!
-      INTEGER  ::   ji, jj, jk, jl, it
+      INTEGER  ::   ji, jj, jk, jl, it, itmod
       REAL(wp) ::   zmean
       REAL(wp), DIMENSION(jpi,jpj) ::   zun, zvn
@@ -406,5 +406,6 @@
 
       ! define time axis
-      it= kt - nit000 + 1
+      it = kt
+      itmod = kt - nit000 + 1
 
       IF( MOD( it, ntrd ) == 0 ) THEN
@@ -455,5 +456,5 @@
       IF( kt >=  nit000+1 ) THEN
 
-         IF( lwp .AND. MOD( it, ntrd ) == 0 ) THEN
+         IF( lwp .AND. MOD( itmod, ntrd ) == 0 ) THEN
             WRITE(numout,*) ''
             WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt
@@ -568,5 +569,5 @@
       IF(lwp) WRITE(numout,*) ' Name of NETCDF file ', clhstnam
       CALL histbeg( clhstnam, jpi, glamf, jpj, gphif,1, jpi,   &  ! Horizontal grid : glamt and gphit
-         &          1, jpj, 0, zjulian, rdt, nh_t, nidvor, domain_id=nidom )
+         &          1, jpj, nit000-1, zjulian, rdt, nh_t, nidvor, domain_id=nidom )
       CALL wheneq( jpi*jpj, fmask, 1, 1., ndexvor1, ndimvor1 )    ! surface
 
Index: /trunk/NEMO/OPA_SRC/step.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/step.F90	(revision 1333)
+++ /trunk/NEMO/OPA_SRC/step.F90	(revision 1334)
@@ -195,5 +195,5 @@
 
       IF( ninist == 1 ) THEN                       ! Output the initial state and forcings
-                        CALL dia_wri_state( 'output.init' )
+                        CALL dia_wri_state( 'output.init', kstp )
                         ninist = 0
       ENDIF
Index: /trunk/NEMO/TOP_SRC/SED/sedwri.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1333)
+++ /trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1334)
@@ -40,5 +40,5 @@
       INTEGER , DIMENSION(jpij) , SAVE :: ndext51
       REAL(wp) :: zsto,zout, zdt
-      INTEGER :: iimi, iima, ijmi, ijma,ipk, it
+      INTEGER :: iimi, iima, ijmi, ijma,ipk, it, itmod
       INTEGER :: jn
       CHARACTER(len = 20)  ::  cltra , cltrau
@@ -76,5 +76,6 @@
 
       ! define time axis
-      it = kt - nitsed000 + 1
+      it = kt
+      itmod = kt - nitsed000 + 1
 
 
@@ -185,6 +186,6 @@
          CALL histbeg ( clhstnam, jpi, glamt, jpj, gphit,     &
             &             iimi, iima-iimi+1, ijmi, ijma-ijmi+1,         &
-            &             0, zjulian, zdt,  nhorised, nised , domain_id=nidom )
-         CALL histvert( nised,'deptht','Vertic.sed.T levels','m',ipk, profsed, ndepsed )
+            &             nitsed000-1, zjulian, zdt,  nhorised, nised , domain_id=nidom )
+         CALL histvert( nised,'deptht','Vertic.sed.T levels','m',ipk, profsed, ndepsed, 'down' )
          CALL wheneq  ( jpi*jpj*ipk, tmasksed, 1, 1., ndext52, ndimt52 )
          CALL wheneq  ( jpi*jpj, tmasksed(:,:,1), 1, 1., ndext51, ndimt51 )
Index: /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 1333)
+++ /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 1334)
@@ -406,5 +406,5 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT( in ) ::   kt                               ! ocean time-step index
-      INTEGER ::   ji, jj, jk, jl, ik, it, jn
+      INTEGER ::   ji, jj, jk, jl, ik, it, jn, itmod
       REAL(wp) ::   zavt, zfn, zfn2
       !!
@@ -575,7 +575,9 @@
       tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * ucf_trc
 
-      it = kt - nit000 + 1
-
-      MODULO_NTRD : IF( MOD( it, ntrd_trc ) == 0 ) THEN           ! nitend MUST be multiple of ntrd_trc
+      ! define time axis
+      it = kt
+      itmod = kt - nit000 + 1
+
+      MODULO_NTRD : IF( MOD( itmod, ntrd_trc ) == 0 ) THEN           ! nitend MUST be multiple of ntrd_trc
          !
          ztmltot (:,:,:) = 0.e0                                   ! reset arrays to zero
@@ -819,5 +821,5 @@
       ! ----------------------------------
 
-      IF( lwp .AND. MOD( it , ntrd_trc ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod , ntrd_trc ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld_trc : write passive tracer trends in the NetCDF file :'
@@ -930,5 +932,5 @@
 # endif /* key_dimgout */
 
-      IF( MOD( it, ntrd_trc ) == 0 ) THEN
+      IF( MOD( itmod, ntrd_trc ) == 0 ) THEN
          !
          ! Reset cumulative arrays to zero
@@ -999,5 +1001,5 @@
       INTEGER, INTENT( in ) ::   kt                       ! ocean time-step index
 #if defined key_lobster
-      INTEGER  ::  jl, it
+      INTEGER  ::  jl, it, itmod
       LOGICAL  :: llwarn  = .TRUE., lldebug = .TRUE.
       REAL(wp), DIMENSION(jpi,jpj,jpdiabio) ::  ztmltrdbio2  ! only needed for mean diagnostics
@@ -1059,5 +1061,9 @@
       tmltrd_bio(:,:,:) = tmltrd_bio(:,:,:) * ucf_trc
 
-      MODULO_NTRD : IF( MOD( kt, ntrd_trc ) == 0 ) THEN      ! nitend MUST be multiple of ntrd
+      ! define time axis
+      it = kt
+      itmod = kt - nit000 + 1
+
+      MODULO_NTRD : IF( MOD( itmod, ntrd_trc ) == 0 ) THEN      ! nitend MUST be multiple of ntrd
          !
          zfn  = float(nmoymltrdbio)    ;    zfn2 = zfn * zfn
@@ -1132,7 +1138,8 @@
 
       ! define time axis
-      it = kt - nit000 + 1
-
-      IF( lwp .AND. MOD( it , ntrd_trc ) == 0 ) THEN
+      it = kt
+      itmod = kt - nit000 + 1
+
+      IF( lwp .AND. MOD( itmod , ntrd_trc ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld_bio : write ML bio trends in the NetCDF file :'
@@ -1174,5 +1181,5 @@
 # endif /* key_dimgout */
 
-      IF( MOD( it, ntrd_trc ) == 0 ) THEN
+      IF( MOD( itmod, ntrd_trc ) == 0 ) THEN
          !
          ! III.5 Reset cumulative arrays to zero
@@ -1455,5 +1462,5 @@
             CALL dia_nam( clhstnam, ntrd_trc, csuff )
             CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            &
-               &        1, jpi, 1, jpj, 0, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom )
+               &        1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom )
       
             !-- Define the ML depth variable
@@ -1468,5 +1475,5 @@
           CALL dia_nam( clhstnam, ntrd_trc, 'trdbio' )
           CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            &
-             &             1, jpi, 1, jpj, 0, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom )
+             &             1, jpi, 1, jpj, nit000-1, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom )
 #endif
 
Index: /trunk/NEMO/TOP_SRC/trcdia.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1333)
+++ /trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1334)
@@ -111,5 +111,5 @@
       CHARACTER (len=80) :: cltral
       REAL(wp) :: zsto, zout, zdt
-      INTEGER  :: iimi, iima, ijmi, ijma, ipk, it
+      INTEGER  :: iimi, iima, ijmi, ijma, ipk, it, itmod
       !!----------------------------------------------------------------------
 
@@ -141,5 +141,6 @@
 
       ! define time axis
-      it = kt - nittrc000 + 1
+      it = kt
+      itmod = kt - nittrc000 + 1
 
       ! Define NETCDF files and fields at beginning of first time step
@@ -168,8 +169,8 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,     &
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,         & 
-            &          0, xjulian, zdt, nhorit5, nit5 , domain_id=nidom)
+            &          nittrc000-1, xjulian, zdt, nhorit5, nit5 , domain_id=nidom)
 ! Vertical grid for tracer : gdept
          CALL histvert( nit5, 'deptht', 'Vertical T levels', &
-            &            'm', ipk, gdept_0, ndepit5)
+            &            'm', ipk, gdept_0, ndepit5, 'down')
 
 ! Index of ocean points in 3D and 2D (surface)
@@ -201,5 +202,5 @@
       ! ---------------------------------------
 
-      IF( lwp .AND. MOD( it, nwritetrc ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod, nwritetrc ) == 0 ) THEN
          WRITE(numout,*) 'trcdit_wr : write NetCDF passive tracer concentrations at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~~~~ '
@@ -246,5 +247,5 @@
       CHARACTER (len=10) ::   csuff
       INTEGER  ::   jn, jl
-      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it
+      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod
       REAL(wp) ::   zsto, zout, zdt
       !!----------------------------------------------------------------------
@@ -277,5 +278,6 @@
 
       ! define time axis
-      it = kt - nittrc000 + 1
+      it = kt
+      itmod = kt - nittrc000 + 1
 
       ! Define the NETCDF files (one per tracer)
@@ -298,10 +300,10 @@
                CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,       &
                   &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,   &
-                  &          0, xjulian, rdt, nhorit6(jn),           &
+                  &          nittrc000-1, xjulian, rdt, nhorit6(jn),           &
                   &          nit6(jn) , domain_id=nidom )
 
                ! Vertical grid for tracer trend - one per each tracer IF needed
                CALL histvert( nit6(jn), 'deptht', 'Vertical T levels',   &
-                  &           'm', ipk, gdept_0, ndepit6(jn) ) 
+                  &           'm', ipk, gdept_0, ndepit6(jn), 'down' ) 
              END IF
           END DO
@@ -411,5 +413,5 @@
       ! trends for tracer concentrations
 
-      IF( lwp .AND. MOD( it, nwritetrd ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod, nwritetrd ) == 0 ) THEN
          WRITE(numout,*) 'trcdid_wr : write NetCDF dynamical trends at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -485,5 +487,5 @@
       CHARACTER (len=80) ::   cltral
       INTEGER  ::   jn
-      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it
+      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod
       REAL(wp) ::   zsto, zout, zdt
       !!----------------------------------------------------------------------
@@ -516,5 +518,6 @@
 
       ! define time axis
-      it = kt - nittrc000 + 1
+      it = kt
+      itmod = kt - nittrc000 + 1
 
       ! 1. Define NETCDF files and fields at beginning of first time step
@@ -536,10 +539,10 @@
          CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,             &
             &          iimi, iima-iimi+1, ijmi, ijma-ijmi+1,         &
-            &          0, xjulian, zdt, nhoritd, nitd , domain_id=nidom )
+            &          nittrc000-1, xjulian, zdt, nhoritd, nitd , domain_id=nidom )
 
          ! Vertical grid for 2d and 3d arrays
 
          CALL histvert( nitd, 'deptht', 'Vertical T levels',   &
-            &           'm', ipk, gdept_0, ndepitd)
+            &           'm', ipk, gdept_0, ndepitd, 'down')
 
          ! Declare all the output fields as NETCDF variables
@@ -577,5 +580,5 @@
       ! ---------------------
 
-      IF( lwp .AND. MOD( it, nwritedia ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod, nwritedia ) == 0 ) THEN
          WRITE(numout,*) 'trcdii_wr : write NetCDF additional arrays at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -635,5 +638,5 @@
       CHARACTER (len=80) ::   cltral
       INTEGER  ::   ji, jj, jk, jn
-      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it
+      INTEGER  ::   iimi, iima, ijmi, ijma, ipk, it, itmod
       REAL(wp) ::   zsto, zout, zdt
       !!----------------------------------------------------------------------
@@ -666,5 +669,6 @@
 
       ! define time axis
-      it = kt - nittrc000 + 1
+      it = kt
+      itmod = kt - nittrc000 + 1
 
       ! Define NETCDF files and fields at beginning of first time step
@@ -680,10 +684,10 @@
          IF(lwp)WRITE(numout,*) " Name of NETCDF file for biological trends ", clhstnam
          ! Horizontal grid : glamt and gphit
-         CALL histbeg(clhstnam, jpi, glamt, jpj, gphit,      &
+	 CALL histbeg(clhstnam, jpi, glamt, jpj, gphit,      &
             &    iimi, iima-iimi+1, ijmi, ijma-ijmi+1,          &
-            &    0, xjulian, rdt, nhoritb, nitb , domain_id=nidom)
+            &    nittrc000-1, xjulian, rdt, nhoritb, nitb , domain_id=nidom)
          ! Vertical grid for biological trends
          CALL histvert(nitb, 'deptht', 'Vertical T levels',  &
-            &    'm', ipk, gdept_0, ndepitb)
+            &    'm', ipk, gdept_0, ndepitb, 'down')
 
          ! Declare all the output fields as NETCDF variables
@@ -710,5 +714,5 @@
 
       ! biological trends
-      IF( lwp .AND. MOD( it, nwritebio ) == 0 ) THEN
+      IF( lwp .AND. MOD( itmod, nwritebio ) == 0 ) THEN
          WRITE(numout,*) 'trcdit_wr : write NetCDF biological trends at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
