Index: /trunk/CONFIG/GYRE/EXP00/namelist
===================================================================
--- /trunk/CONFIG/GYRE/EXP00/namelist	(revision 1316)
+++ /trunk/CONFIG/GYRE/EXP00/namelist	(revision 1317)
@@ -36,6 +36,6 @@
    nleapy      =      30   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =    4320   !  frequency of creation of a restart file
-   nwrite      =      60   !  frequency of write in the output file 
+   nstock      =    4320   !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =      60   !  frequency of write in the output file   (modulo referenced to nit000)
    ln_dimgnnn  = .false.   !  DIMG file format: 1 file for all processors (F) or by processor (T)
    ln_mskland  = .false.   !  mask land points (1.e+20) in NetCDF outputs (costly: + ~15%)
Index: /trunk/CONFIG/GYRE_LOBSTER/EXP00/namelist
===================================================================
--- /trunk/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 1316)
+++ /trunk/CONFIG/GYRE_LOBSTER/EXP00/namelist	(revision 1317)
@@ -36,6 +36,6 @@
    nleapy      =      30   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =    4320   !  frequency of creation of a restart file
-   nwrite      =     360   !  frequency of write in the output file 
+   nstock      =    4320   !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =     360   !  frequency of write in the output file   (modulo referenced to nit000)
    ln_dimgnnn  = .false.   !  DIMG file format: 1 file for all processors (F) or by processor (T)
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
Index: /trunk/CONFIG/ORCA2_LIM/EXP00/1_namelist
===================================================================
--- /trunk/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 1316)
+++ /trunk/CONFIG/ORCA2_LIM/EXP00/1_namelist	(revision 1317)
@@ -36,6 +36,6 @@
    nleapy      =       0   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =   10950   !  frequency of creation of a restart file
-   nwrite      =   10950   !  frequency of write in the output file 
+   nstock      =   10950   !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =   10950   !  frequency of write in the output file   (modulo referenced to nit000)
    ln_dimgnnn  = .false.   !  DIMG file format: 1 file for all processors (F) or by processor (T)
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
Index: /trunk/CONFIG/ORCA2_LIM/EXP00/namelist
===================================================================
--- /trunk/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 1316)
+++ /trunk/CONFIG/ORCA2_LIM/EXP00/namelist	(revision 1317)
@@ -36,6 +36,6 @@
    nleapy      =       0   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =    5475   !  frequency of creation of a restart file
-   nwrite      =    5475   !  frequency of write in the output file 
+   nstock      =    5475   !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =    5475   !  frequency of write in the output file   (modulo referenced to nit000)
    ln_dimgnnn  = .false.   !  DIMG file format: 1 file for all processors (F) or by processor (T)
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
Index: /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist
===================================================================
--- /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 1316)
+++ /trunk/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist	(revision 1317)
@@ -36,6 +36,6 @@
    nleapy      =       0   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =    5475   !  frequency of creation of a restart file
-   nwrite      =    5475   !  frequency of write in the output file 
+   nstock      =    5475   !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =    5475   !  frequency of write in the output file   (modulo referenced to nit000)
    ln_dimgnnn  = .false.   !  DIMG file format: 1 file for all processors (F) or by processor (T)
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
Index: /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist
===================================================================
--- /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 1316)
+++ /trunk/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist	(revision 1317)
@@ -28,6 +28,6 @@
    nleapy      =       0   !  Leap year calendar (1) or not (0)
    ninist      =       0   !  output the initial state (1) or not (0)
-   nstock      =     7300  !  frequency of creation of a restart file
-   nwrite      =     7300  !  frequency of write in the output file 
+   nstock      =     7300  !  frequency of creation of a restart file (modulo referenced to 1)
+   nwrite      =     7300  !  frequency of write in the output file   (modulo referenced to nit000)
    ln_mskland  = .false.   !  mask land points in NetCDF outputs (costly: + ~15%)
 /
Index: /trunk/NEMO/C1D_SRC/diawri_c1d.F90
===================================================================
--- /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 1316)
+++ /trunk/NEMO/C1D_SRC/diawri_c1d.F90	(revision 1317)
@@ -276,5 +276,5 @@
       ! donne le nombre d'elements, et ndex la liste des indices a sortir
 
-      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
+      IF( lwp .AND. MOD( it, nwrite ) == 0 ) THEN 
          WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -345,5 +345,5 @@
       ! 3. Synchronise and close all files
       ! ---------------------------------------
-      IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 )   CALL histsync( nid_T )
+      IF( MOD( it, nwrite ) == 0 .OR. kindic < 0 )   CALL histsync( nid_T )
 
       !  Create an output files (output.abort.nc) if S < 0 or u > 20 m/s
Index: /trunk/NEMO/OPA_SRC/DIA/diagap.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diagap.F90	(revision 1316)
+++ /trunk/NEMO/OPA_SRC/DIA/diagap.F90	(revision 1317)
@@ -198,5 +198,6 @@
       ! ----------------------
 
-      IF( MOD( kt, ngap ) == 0 ) THEN
+      it = kt - nit000 + 1       ! define time axis
+      IF( MOD( it, ngap ) == 0 ) THEN
 
          ! initialization
@@ -239,5 +240,5 @@
           ! ----------------------------======
 
-          IF( MOD( kt, nprg ) == 0 ) THEN
+          IF( MOD( it, nprg ) == 0 ) THEN
               IF(lwp) THEN
                   WRITE(numout,*) 'dia_gap: time step = ', kt, 'model - data'
@@ -259,5 +260,4 @@
 
           IF (lwp ) THEN   ! Ok even in mpp after the call to mpp_sum
-             it = kt - nit000 + 1       ! define time axis
              CALL histwrite( numgap, "motempda", it, tdtag, jpk, ndex )
              CALL histwrite( numgap, "mosalida", it, sdtag, jpk, ndex )
Index: /trunk/NEMO/OPA_SRC/DIA/diaptr.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1316)
+++ /trunk/NEMO/OPA_SRC/DIA/diaptr.F90	(revision 1317)
@@ -245,5 +245,5 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 .OR. MOD( kt, nf_ptr ) == 0 )   THEN
+      IF( kt == nit000 .OR. MOD( kt - nit000 + 1, nf_ptr ) == 0 )   THEN
 
          zsverdrup = 1.e-6
@@ -551,10 +551,9 @@
          ENDIF
          
-
          CALL histend( numptr )
 
       ENDIF
 
-      IF( MOD( kt, nf_ptr ) == 0 ) THEN
+      IF( MOD( it, nf_ptr ) == 0 ) THEN
 
          IF(lwp) THEN
@@ -565,6 +564,4 @@
          ENDIF
 
-         ! define time axis
-         it= kt - nit000 + 1
          ndex(1) = 0
          CALL histwrite( numptr, "zotemglo", it, tn_jk    , jpj*jpk, ndex )
Index: /trunk/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/DIA/diawri.F90	(revision 1316)
+++ /trunk/NEMO/OPA_SRC/DIA/diawri.F90	(revision 1317)
@@ -406,5 +406,5 @@
       ! donne le nombre d'elements, et ndex la liste des indices a sortir
 
-      IF( lwp .AND. MOD( kt, nwrite ) == 0 ) THEN 
+      IF( lwp .AND. MOD( it, nwrite ) == 0 ) THEN 
          WRITE(numout,*) 'dia_wri : write model outputs in NetCDF files at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -513,5 +513,5 @@
       ! 3. Synchronise and close all files
       ! ---------------------------------------
-      IF( MOD( kt, nwrite ) == 0 .OR. kindic < 0 ) THEN
+      IF( MOD( it, nwrite ) == 0 .OR. kindic < 0 ) THEN
          CALL histsync( nid_T )
          CALL histsync( nid_U )
Index: /trunk/NEMO/OPA_SRC/TRD/trdmld.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 1316)
+++ /trunk/NEMO/OPA_SRC/TRD/trdmld.F90	(revision 1317)
@@ -389,5 +389,7 @@
       smltrd(:,:,:) = smltrd(:,:,:) * ucf   !  is no longer used, and is reset to 0. at next time step)
       
-      MODULO_NTRD : IF( MOD( kt, ntrd ) == 0 ) THEN        ! nitend MUST be multiple of ntrd
+      it = kt - nit000 + 1
+
+      MODULO_NTRD : IF( MOD( it, ntrd ) == 0 ) THEN        ! nitend MUST be multiple of ntrd
          !
          ztmltot (:,:) = 0.e0   ;   zsmltot (:,:) = 0.e0   ! reset arrays to zero
@@ -574,5 +576,5 @@
 #if defined key_dimgout
 
-      IF( MOD( kt, ntrd ) == 0 ) THEN
+      IF( MOD( it, ntrd ) == 0 ) THEN
          iyear =  ndastp/10000
          imon  = (ndastp-iyear*10000)/100
@@ -591,5 +593,5 @@
       ! ----------------------------------
 
-      IF( lwp .AND. MOD( kt , ntrd ) == 0 ) THEN
+      IF( lwp .AND. MOD( it , ntrd ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld : write trends in the NetCDF file :'
@@ -600,6 +602,4 @@
       END IF
          
-      it = kt - nit000 + 1
-
       !-- Write the trends for T/S instantaneous diagnostics 
       IF( ln_trdmld_instant ) THEN           
@@ -683,5 +683,5 @@
 #endif
 
-      IF( MOD( kt , ntrd ) == 0 ) THEN
+      IF( MOD( it, ntrd ) == 0 ) THEN
          !
          ! III.5 Reset cumulative arrays to zero
Index: /trunk/NEMO/OPA_SRC/TRD/trdvor.F90
===================================================================
--- /trunk/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 1316)
+++ /trunk/NEMO/OPA_SRC/TRD/trdvor.F90	(revision 1317)
@@ -405,5 +405,8 @@
       !  =============================================
 
-      IF( MOD( kt - nit000+1, ntrd ) == 0 ) THEN
+      ! define time axis
+      it= kt - nit000 + 1
+
+      IF( MOD( it, ntrd ) == 0 ) THEN
 
          ! III.1 compute total trend
@@ -452,7 +455,5 @@
       IF( kt >=  nit000+1 ) THEN
 
-         ! define time axis
-         it= kt-nit000+1
-         IF( lwp .AND. MOD( kt, ntrd ) == 0 ) THEN
+         IF( lwp .AND. MOD( it, ntrd ) == 0 ) THEN
             WRITE(numout,*) ''
             WRITE(numout,*) 'trd_vor : write trends in the NetCDF file at kt = ', kt
@@ -481,5 +482,5 @@
       ENDIF
       !
-      IF( MOD( kt - nit000+1, ntrd ) == 0 ) rotot(:,:)=0
+      IF( MOD( it, ntrd ) == 0 ) rotot(:,:)=0
       !
       IF( kt == nitend )   CALL histclo( nidvor )
Index: /trunk/NEMO/TOP_SRC/SED/sedwri.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1316)
+++ /trunk/NEMO/TOP_SRC/SED/sedwri.F90	(revision 1317)
@@ -251,5 +251,5 @@
          !! synchronise FILE
          !
-         IF( MOD( kt, nwrised ) == 0 ) THEN
+         IF( MOD( it, nwrised ) == 0 ) THEN
               WRITE(numsed,*)  '**** sedwri : write NetCDF aditional arrays'
               CALL histsync( nised )
Index: /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 1316)
+++ /trunk/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 1317)
@@ -575,5 +575,7 @@
       tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * ucf_trc
 
-      MODULO_NTRD : IF( MOD( kt, ntrd_trc ) == 0 ) THEN           ! nitend MUST be multiple of ntrd_trc
+      it = kt - nit000 + 1
+
+      MODULO_NTRD : IF( MOD( it, ntrd_trc ) == 0 ) THEN           ! nitend MUST be multiple of ntrd_trc
          !
          ztmltot (:,:,:) = 0.e0                                   ! reset arrays to zero
@@ -817,5 +819,5 @@
       ! ----------------------------------
 
-      IF( lwp .AND. MOD( kt , ntrd_trc ) == 0 ) THEN
+      IF( lwp .AND. MOD( it , ntrd_trc ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld_trc : write passive tracer trends in the NetCDF file :'
@@ -826,6 +828,4 @@
       ENDIF
          
-      it = kt - nit000 + 1
-
       NETCDF_OUTPUT : IF( ln_trdmld_trc_instant ) THEN            ! <<< write the trends for passive tracer instant. diags
          !
@@ -930,5 +930,5 @@
 # endif /* key_dimgout */
 
-      IF( MOD( kt, ntrd_trc ) == 0 ) THEN
+      IF( MOD( it, ntrd_trc ) == 0 ) THEN
          !
          ! Reset cumulative arrays to zero
@@ -1131,5 +1131,8 @@
       ! ----------------------------------
 
-      IF( lwp .AND. MOD( kt , ntrd_trc ) == 0 ) THEN
+      ! define time axis
+      it = kt - nit000 + 1
+
+      IF( lwp .AND. MOD( it , ntrd_trc ) == 0 ) THEN
          WRITE(numout,*) ' '
          WRITE(numout,*) 'trd_mld_bio : write ML bio trends in the NetCDF file :'
@@ -1141,8 +1144,4 @@
 
 
-      ! define time axis
-      it = kt - nit000 + 1
-
-
       ! 2. Start writing data
       ! ---------------------
@@ -1175,5 +1174,5 @@
 # endif /* key_dimgout */
 
-      IF( MOD( kt, ntrd_trc ) == 0 ) THEN
+      IF( MOD( it, ntrd_trc ) == 0 ) THEN
          !
          ! III.5 Reset cumulative arrays to zero
Index: /trunk/NEMO/TOP_SRC/trcdia.F90
===================================================================
--- /trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1316)
+++ /trunk/NEMO/TOP_SRC/trcdia.F90	(revision 1317)
@@ -201,5 +201,5 @@
       ! ---------------------------------------
 
-      IF( lwp .AND. MOD( kt, nwritetrc ) == 0 ) THEN
+      IF( lwp .AND. MOD( it, nwritetrc ) == 0 ) THEN
          WRITE(numout,*) 'trcdit_wr : write NetCDF passive tracer concentrations at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~~~~ '
@@ -214,5 +214,5 @@
 
       ! synchronise file
-      IF( MOD( kt, nwritetrc ) == 0 .OR. kindic < 0 )   CALL histsync( nit5 )
+      IF( MOD( it, nwritetrc ) == 0 .OR. kindic < 0 )   CALL histsync( nit5 )
 
 
@@ -415,5 +415,5 @@
       ! trends for tracer concentrations
 
-      IF( lwp .AND. MOD( kt, nwritetrd ) == 0 ) THEN
+      IF( lwp .AND. MOD( it, nwritetrd ) == 0 ) THEN
          WRITE(numout,*) 'trcdid_wr : write NetCDF dynamical trends at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -446,5 +446,5 @@
 
       ! synchronise FILE
-      IF( MOD( kt, nwritetrd ) == 0 .OR. kindic < 0 ) THEN
+      IF( MOD( it, nwritetrd ) == 0 .OR. kindic < 0 ) THEN
          DO jn = 1, jptra
             IF (luttrd(jn))   CALL histsync( nit6(jn) )
@@ -588,5 +588,5 @@
       ! ---------------------
 
-      IF( lwp .AND. MOD( kt, nwritedia ) == 0 ) THEN
+      IF( lwp .AND. MOD( it, nwritedia ) == 0 ) THEN
          WRITE(numout,*) 'trcdii_wr : write NetCDF additional arrays at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -606,5 +606,5 @@
 
       ! synchronise FILE
-      IF( MOD( kt, nwritedia ) == 0 .OR. kindic < 0 )   CALL histsync( nitd )
+      IF( MOD( it, nwritedia ) == 0 .OR. kindic < 0 )   CALL histsync( nitd )
 
       ! Closing all files
@@ -724,5 +724,5 @@
 
       ! biological trends
-      IF( lwp .AND. MOD( kt, nwritebio ) == 0 ) THEN
+      IF( lwp .AND. MOD( it, nwritebio ) == 0 ) THEN
          WRITE(numout,*) 'trcdit_wr : write NetCDF biological trends at ', kt, 'time-step'
          WRITE(numout,*) '~~~~~~ '
@@ -735,5 +735,5 @@
 
       ! synchronise FILE
-      IF( MOD( kt, nwritebio ) == 0 .OR. kindic < 0 )   CALL histsync( nitb )
+      IF( MOD( it, nwritebio ) == 0 .OR. kindic < 0 )   CALL histsync( nitb )
 
       ! Closing all files
