Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen2.F90	(revision 2830)
@@ -32,4 +32,7 @@
    USE trc_oce         ! share passive tracers/Ocean variables
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -131,9 +134,13 @@
       !!----------------------------------------------------------------------
 
-      IF( wrk_in_use(2, 1) .OR. wrk_in_use(3, 1,2) ) THEN
+      IF( wrk_in_use(2, 35) .OR. wrk_in_use(3, 14,15) ) THEN
          CALL ctl_stop('tra_adv_cen2: requested workspace arrays unavailable')   ;   RETURN
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv_cen2 : 2nd order centered advection scheme on ', cdtype
@@ -141,6 +148,9 @@
          IF(lwp) WRITE(numout,*)
          !
-         ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
-         IF( ierr /= 0 )   CALL ctl_stop('STOP', 'tra_adv_cen2: unable to allocate array')
+         IF (.not. ALLOCATED(upsmsk))THEN
+             ALLOCATE( upsmsk(jpi,jpj), STAT=ierr )
+             IF( ierr /= 0 )   CALL ctl_stop('STOP', 'tra_adv_cen2: unable to allocate array')
+         ENDIF
+
          !
          upsmsk(:,:) = 0._wp                             ! not upstream by default
@@ -275,6 +285,6 @@
       ENDIF
       !
-      IF( wrk_not_released(2, 1)   .OR.   &
-          wrk_not_released(3, 1,2) )   CALL ctl_stop('tra_adv_cen2: failed to release workspace arrays')
+      IF( wrk_not_released(2, 35)   .OR.   &
+          wrk_not_released(3, 14,15) )   CALL ctl_stop('tra_adv_cen2: failed to release workspace arrays')
       !
    END SUBROUTINE tra_adv_cen2
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl.F90	(revision 2830)
@@ -25,4 +25,7 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
 
@@ -83,5 +86,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv : MUSCL advection scheme on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_muscl2.F90	(revision 2830)
@@ -23,4 +23,7 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
 
@@ -81,5 +84,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv_muscl2 : MUSCL2 advection scheme on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 2830)
@@ -26,4 +26,7 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -90,5 +93,9 @@
       !!----------------------------------------------------------------------
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv_qck : 3rd order quickest advection scheme on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_tvd.F90	(revision 2830)
@@ -32,4 +32,7 @@
    USE diaptr          ! poleward transport diagnostics
    USE trc_oce         ! share passive tracers/Ocean variables
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
 
@@ -89,5 +92,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv_tvd : TVD advection scheme on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 2830)
@@ -22,4 +22,7 @@
    USE dynspg_oce      ! choice/control of key cpp for surface pressure gradient
    USE trc_oce         ! share passive tracers/Ocean variables
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -97,5 +100,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_adv_ubs :  horizontal UBS advection scheme on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 2830)
@@ -34,4 +34,7 @@
    USE lbclnk         ! ocean lateral boundary conditions
    USE prtctl         ! Print control
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -389,5 +392,9 @@
       ENDIF
      
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp)  WRITE(numout,*)
          IF(lwp)  WRITE(numout,*) 'trabbl:bbl : Compute bbl velocities and diffusive coefficients in ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilap.F90	(revision 2830)
@@ -29,4 +29,7 @@
    USE trc_oce         ! share passive tracers/Ocean variables
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -93,5 +96,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_ldf_bilap : iso-level biharmonic operator on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_bilapg.F90	(revision 2830)
@@ -25,4 +25,7 @@
    USE trc_oce         ! share passive tracers/Ocean variables
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -82,5 +85,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_ldf_bilapg : horizontal biharmonic operator in s-coordinate on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso.F90	(revision 2830)
@@ -32,4 +32,7 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
 #endif
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -121,4 +124,11 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
       ENDIF
+#if defined key_top
+      IF( kt == nittrc000 .AND. cdtype == 'TRC' )  THEN
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'tra_ldf_iso : rotated laplacian diffusion operator on ', cdtype
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+      ENDIF
+#endif
       !
       !                                                          ! ===========
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/traldf_iso_grif.F90	(revision 2830)
@@ -26,4 +26,7 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -127,16 +130,24 @@
       !zdkt(1:jpi,1:jpj,0:1) => wrk_3d_9(:,:,1:2)
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_ldf_iso_grif : rotated laplacian diffusion operator on ', cdtype
          IF(lwp) WRITE(numout,*) '                   WARNING: STILL UNDER TEST, NOT RECOMMENDED. USE AT YOUR OWN PERIL'
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
-         ALLOCATE( ah_wslp2(jpi,jpj,jpk) , zdkt(jpi,jpj,0:1), STAT=ierr )
+         IF (.not. ALLOCATED(ah_wslp2))THEN
+             ALLOCATE( ah_wslp2(jpi,jpj,jpk) , zdkt(jpi,jpj,0:1), STAT=ierr )
+         ENDIF
          IF( lk_mpp   )   CALL mpp_sum ( ierr )
          IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate arrays')
          IF( ln_traldf_gdia ) THEN
-            ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr )
-            IF( lk_mpp   )   CALL mpp_sum ( ierr )
-            IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate diagnostics')
+            IF (.not. ALLOCATED(psix_eiv))THEN
+                ALLOCATE( psix_eiv(jpi,jpj,jpk) , psiy_eiv(jpi,jpj,jpk) , STAT=ierr )
+                IF( lk_mpp   )   CALL mpp_sum ( ierr )
+                IF( ierr > 0 )   CALL ctl_stop('STOP', 'tra_ldf_iso_grif: unable to allocate diagnostics')
+            ENDIF
          ENDIF
       ENDIF
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 2830)
@@ -48,4 +48,7 @@
    USE agrif_opa_interp
 #endif
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -214,7 +217,11 @@
       !!----------------------------------------------------------------------
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping'
+         IF(lwp) WRITE(numout,*) 'tra_nxt_fix : time stepping', cdtype
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
       ENDIF
@@ -282,7 +289,11 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
+      IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
-         IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping'
+         IF(lwp) WRITE(numout,*) 'tra_nxt_vvl : time stepping', cdtype
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
       ENDIF
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 2830)
@@ -31,4 +31,7 @@
    USE in_out_manager  ! I/O manager
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -93,5 +96,9 @@
       ENDIF
 
+#if defined key_top
+      IF( kt == nit000 .OR. (kt == nittrc000 .AND. cdtype == 'TRC'))  THEN
+#else
       IF( kt == nit000 )  THEN
+#endif
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'tra_zdf_exp : explicit vertical mixing on ', cdtype
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 2830)
@@ -35,4 +35,7 @@
    USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
    USE lib_mpp         ! MPP library
+#if defined key_top
+   USE trc, ONLY: nittrc000  !get first time step for passive tracers
+#endif
 
    IMPLICIT NONE
@@ -102,4 +105,15 @@
          ENDIF
       ENDIF
+#if defined key_top
+      IF( kt == nittrc000 .AND. cdtype == 'TRC' )  THEN
+         IF(lwp)WRITE(numout,*)
+         IF(lwp)WRITE(numout,*) 'tra_zdf_imp : implicit vertical mixing on ', cdtype
+         IF(lwp)WRITE(numout,*) '~~~~~~~~~~~ '
+         !
+         IF( lk_vvl ) THEN   ;    r_vvl = 1._wp       ! Variable volume indicator
+         ELSE                ;    r_vvl = 0._wp       
+         ENDIF
+      ENDIF
+#endif
       !
       !                                               ! ============= !
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/C14b/trcsms_c14b.F90	(revision 2830)
@@ -119,5 +119,5 @@
       ENDIF
 
-      IF( kt == nit000 )  THEN         ! Computation of decay coeffcient
+      IF( kt == nittrc000 )  THEN         ! Computation of decay coeffcient
          zdemi   = 5730._wp
          xlambda = LOG(2.) / zdemi / ( nyear_len(1) * rday )
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcnam_cfc.F90	(revision 2830)
@@ -37,5 +37,5 @@
       !!
       !! ** Method  :   Read the namcfc namelist and check the parameter 
-      !!       values called at the first timestep (nit000)
+      !!       values called at the first timestep (nittrc000)
       !!
       !! ** input   :   Namelist namcfc
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/CFC/trcsms_cfc.F90	(revision 2830)
@@ -97,5 +97,5 @@
       ENDIF
 
-      IF( kt == nit000 )   CALL trc_cfc_cst
+      IF( kt == nittrc000 )   CALL trc_cfc_cst
 
       ! Temporal interpolation
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcbio.F90	(revision 2830)
@@ -95,5 +95,5 @@
 #endif
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) ' trc_bio: LOBSTER bio-model'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcexp.F90	(revision 2830)
@@ -61,5 +61,5 @@
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) ' trc_exp: LOBSTER export'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcopt.F90	(revision 2830)
@@ -72,5 +72,5 @@
       END IF
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) ' trc_opt : LOBSTER optic-model'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/LOBSTER/trcsed.F90	(revision 2830)
@@ -74,5 +74,5 @@
       END IF
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) ' trc_sed: LOBSTER sedimentation'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/p4zsed.F90	(revision 2830)
@@ -329,7 +329,7 @@
 
       ! Calendar computation
-      IF( kt == nit000 .OR. imois /= nflx1 ) THEN
-
-         IF( kt == nit000 )  nflx1  = 0
+      IF( kt == nittrc000 .OR. imois /= nflx1 ) THEN
+
+         IF( kt == nittrc000 )  nflx1  = 0
 
          ! nflx1 number of the first file record used in the simulation
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcrst_pisces.F90	(revision 2830)
@@ -245,5 +245,5 @@
 #if defined key_dtatrc
       ! Restore close seas values to initial data
-      CALL trc_dta( nit000 ) 
+      CALL trc_dta( nittrc000 ) 
       DO jn = 1, jptra
          IF( lutini(jn) ) THEN
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/PISCES/trcsms_pisces.F90	(revision 2830)
@@ -72,5 +72,5 @@
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only)
+      IF( kt == nittrc000 )   CALL trc_sms_pisces_init    ! Initialization (first time-step only)
 
       IF( wrk_in_use(3,1) )  THEN
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedini.F90	(revision 2830)
@@ -449,5 +449,5 @@
 
       dtsed = rdt
-      nitsed000 = nit000
+      nitsed000 = nittrc000
       nitsedend = nitend
 #if ! defined key_sed_off
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedmodel.F90	(revision 2830)
@@ -35,5 +35,5 @@
 
 
-      IF( kt == nit000 ) CALL sed_init       ! Initialization of sediment model
+      IF( kt == nittrc000 ) CALL sed_init       ! Initialization of sediment model
 
                          CALL sed_stp( kt )  ! Time stepping of Sediment model
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/SED/sedwri.F90	(revision 2830)
@@ -56,5 +56,5 @@
       ! Initialisation
       ! ----------------- 
-      IF( kt == nit000 )   ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) )
+      IF( kt == nittrc000 )   ALLOCATE( ndext52(jpij*jpksed), ndext51(jpij) )
 
       ! Define frequency of output and means
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 2830)
@@ -35,5 +35,5 @@
    INTEGER ::   nadv   ! choice of the type of advection scheme
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::   r2dt  ! vertical profile time-step, = 2 rdttra
-   !                                                    ! except at nit000 (=rdttra) if neuler=0
+   !                                                    ! except at nitrrc000 (=rdttra) if neuler=0
 
    !! * Substitutions
@@ -80,10 +80,10 @@
       ENDIF
 
-      IF( kt == nit000 )   CALL trc_adv_ctl          ! initialisation & control of options
+      IF( kt == nittrc000 )   CALL trc_adv_ctl          ! initialisation & control of options
 
 #if ! defined key_pisces
-      IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
+      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
          r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
-      ELSEIF( kt <= nit000 + nn_dttrc ) THEN          ! at nit000 or nit000+1
+      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+1
          r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
       ENDIF
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcdmp.F90	(revision 2830)
@@ -94,5 +94,5 @@
       ! 0. Initialization (first time-step only)
       !    --------------
-      IF( kt == nit000 ) CALL trc_dmp_init
+      IF( kt == nittrc000 ) CALL trc_dmp_init
 
       IF( l_trdtrc )   ALLOCATE( ztrtrd(jpi,jpj,jpk) )   ! temporary save of trends
@@ -173,5 +173,5 @@
       !!
       !! ** Method  :   read the nammbf namelist and check the parameters
-      !!              called by trc_dmp at the first timestep (nit000)
+      !!              called by trc_dmp at the first timestep (nittrc000)
       !!----------------------------------------------------------------------
 
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcldf.F90	(revision 2830)
@@ -59,5 +59,5 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 )   CALL ldf_ctl          ! initialisation & control of options
+      IF( kt == nittrc000 )   CALL ldf_ctl          ! initialisation & control of options
 
       IF( l_trdtrc )  THEN 
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 2830)
@@ -96,5 +96,5 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 .AND. lwp ) THEN
+      IF( kt == nittrc000 .AND. lwp ) THEN
          WRITE(numout,*)
          WRITE(numout,*) 'trc_nxt : time stepping on passive tracers'
@@ -119,6 +119,6 @@
 
       ! set time step size (Euler/Leapfrog)
-      IF( neuler == 0 .AND. kt ==  nit000) THEN  ;  r2dt(:) =     rdttrc(:)   ! at nit000             (Euler)
-      ELSEIF( kt <= nit000 + 1 )           THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog)
+      IF( neuler == 0 .AND. kt ==  nittrc000) THEN  ;  r2dt(:) =     rdttrc(:)   ! at nittrc000             (Euler)
+      ELSEIF( kt <= nittrc000 +  nn_dttrc )           THEN  ;  r2dt(:) = 2.* rdttrc(:)   ! at nit000 or nit000+1 (Leapfrog)
       ENDIF
 
@@ -129,6 +129,6 @@
       ENDIF
       ! Leap-Frog + Asselin filter time stepping
-      IF( neuler == 0 .AND. kt == nit000 ) THEN        ! Euler time-stepping at first time-step
-         !                                             ! (only swap)
+      IF( neuler == 0 .AND. kt == nittrc000 ) THEN        ! Euler time-stepping at first time-step
+         !                                                ! (only swap)
          DO jn = 1, jptra
             DO jk = 1, jpkm1
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcrad.F90	(revision 2830)
@@ -53,5 +53,5 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'trc_rad : Correct artificial negative concentrations '
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 2830)
@@ -72,5 +72,5 @@
       END IF
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
          IF(lwp) WRITE(numout,*)
          IF(lwp) WRITE(numout,*) 'trc_sbc : Passive tracers surface boundary condition'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 2830)
@@ -32,5 +32,5 @@
       !                                ! defined from ln_zdf...  namlist logicals)
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:) ::  r2dt   ! vertical profile time-step, = 2 rdttra
-      !                                                 ! except at nit000 (=rdttra) if neuler=0
+      !                                                 ! except at nittrc000 (=rdttra) if neuler=0
 
    !! * Substitutions
@@ -69,10 +69,10 @@
       !!---------------------------------------------------------------------
 
-      IF( kt == nit000 )   CALL zdf_ctl          ! initialisation & control of options
+      IF( kt == nittrc000 )   CALL zdf_ctl          ! initialisation & control of options
 
 #if ! defined key_pisces
-      IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
+      IF( neuler == 0 .AND. kt == nittrc000 ) THEN     ! at nittrc000
          r2dt(:) =  rdttrc(:)           ! = rdttrc (restarting with Euler time stepping)
-      ELSEIF( kt <= nit000 + nn_dttrc ) THEN          ! at nit000 or nit000+1
+      ELSEIF( kt <= nittrc000 + nn_dttrc ) THEN          ! at nittrc000 or nittrc000+nn_dttrc
          r2dt(:) = 2. * rdttrc(:)       ! = 2 rdttrc (leapfrog)
       ENDIF
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmld_trc.F90	(revision 2830)
@@ -475,5 +475,5 @@
       ! II.1 Set before values of vertically averages passive tracers
       ! -------------------------------------------------------------
-      IF( kt > nit000 ) THEN
+      IF( kt > nittrc000 ) THEN
          DO jn = 1, jptra
             IF( ln_trdtrc(jn) ) THEN
@@ -497,5 +497,5 @@
       ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window    
       ! ------------------------------------------------------------------------
-      IF( kt == 2 ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)    ???
+      IF( kt == nittrc000 + nn_dttrc ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)    ???
          !
          DO jn = 1, jptra
@@ -560,5 +560,5 @@
       tmltrd_trc(:,:,:,:) = tmltrd_trc(:,:,:,:) * rn_ucf_trc
 
-      itmod = kt - nit000 + 1
+      itmod = kt - nittrc000 + 1
       it    = kt
 
@@ -980,5 +980,5 @@
       ! II.3 Initialize mixed-layer "before" arrays for the 1rst analysis window
       ! ------------------------------------------------------------------------
-      IF( kt == 2 ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)
+      IF( kt == nittrc000 + nn_dttrc ) THEN  !  i.e. ( .NOT. ln_rstart ).AND.( kt == nit000 + 1)
          !
          tmltrd_csum_ub_bio (:,:,:) = 0.e0
@@ -1086,5 +1086,5 @@
 
       ! define time axis
-      itmod = kt - nit000 + 1
+      itmod = kt - nittrc000 + 1
       it    = kt
 
@@ -1331,5 +1331,5 @@
       zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
       IF(lwp) WRITE(numout,*)' '  
-      IF(lwp) WRITE(numout,*)' Date 0 used :', nit000                  &
+      IF(lwp) WRITE(numout,*)' Date 0 used :', nittrc000               &
            &   ,' YEAR ', nyear, ' MONTH ', nmonth,' DAY ', nday       &
            &   ,'Julian day : ', zjulian
@@ -1360,5 +1360,5 @@
             CALL dia_nam( clhstnam, nn_trd_trc, csuff )
             CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            &
-               &        1, jpi, 1, jpj, nit000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set )
+               &        1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_t(jn), nidtrd(jn), domain_id=nidom, snc4chunks=snc4set )
       
             !-- Define the ML depth variable
@@ -1373,5 +1373,5 @@
           CALL dia_nam( clhstnam, nn_trd_trc, 'trdbio' )
           CALL histbeg( clhstnam, jpi, glamt, jpj, gphit,                                            &
-             &             1, jpi, 1, jpj, nit000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set )
+             &             1, jpi, 1, jpj, nittrc000, zjulian, rdt, nh_tb, nidtrdbio, domain_id=nidom, snc4chunks=snc4set )
 #endif
 
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/TRP/trdmod_trc.F90	(revision 2830)
@@ -50,5 +50,5 @@
       !!----------------------------------------------------------------------
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
 !         IF(lwp)WRITE(numout,*)
 !         IF(lwp)WRITE(numout,*) 'trd_mod_trc:'
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/oce_trc.F90	(revision 2830)
@@ -192,4 +192,18 @@
    USE oce , ONLY :   rhd     =>    rhd     !: in situ density anomalie rhd=(rho-rau0)/rau0 (no units)
    USE oce , ONLY :   hdivn   =>    hdivn   !: horizontal divergence (1/s)
+   USE oce , ONLY :   rotn    =>    rotn    !: relative vorticity    [s-1]
+   USE oce , ONLY :   hdivb   =>    hdivb   !: horizontal divergence (1/s)
+   USE oce , ONLY :   rotb    =>    rotb    !: relative vorticity    [s-1]
+   USE oce , ONLY :   sshn    =>    sshn    !: sea surface height at t-point [m]   
+   USE oce , ONLY :   sshb    =>    sshb    !: sea surface height at t-point [m]   
+   USE oce , ONLY :   ssha    =>    ssha    !: sea surface height at t-point [m]   
+   USE oce , ONLY :   sshu_n  =>    sshu_n  !: sea surface height at u-point [m]   
+   USE oce , ONLY :   sshu_b  =>    sshu_b  !: sea surface height at u-point [m]   
+   USE oce , ONLY :   sshu_a  =>    sshu_a  !: sea surface height at u-point [m]   
+   USE oce , ONLY :   sshv_n  =>    sshv_n  !: sea surface height at v-point [m]   
+   USE oce , ONLY :   sshv_b  =>    sshv_b  !: sea surface height at v-point [m]   
+   USE oce , ONLY :   sshv_a  =>    sshv_a  !: sea surface height at v-point [m]   
+   USE oce , ONLY :   sshf_n  =>    sshf_n  !: sea surface height at v-point [m]   
+   USE oce , ONLY :   l_traldf_rot   =>   l_traldf_rot !: rotated laplacian operator for lateral diffusion    
    USE oce , ONLY :   l_traldf_rot => l_traldf_rot  !: rotated laplacian operator for lateral diffusion
 #if defined key_offline
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/sshwzv_trc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/sshwzv_trc.F90	(revision 2830)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/sshwzv_trc.F90	(revision 2830)
@@ -0,0 +1,193 @@
+MODULE sshwzv_trc   
+   !!==============================================================================
+   !!                       ***  MODULE  sshwzv  ***
+   !! Ocean dynamics : sea surface height and vertical velocity
+   !!==============================================================================
+   !! History :  3.1  !  2009-02  (G. Madec, M. Leclair)  Original code
+   !!            3.3  !  2010-04  (M. Leclair, G. Madec)  modified LF-RA 
+   !!             -   !  2010-05  (K. Mogensen, A. Weaver, M. Martin, D. Lea) Assimilation interface
+   !!             -   !  2010-09  (D.Storkey and E.O'Dea) bug fixes for BDY module
+   !!----------------------------------------------------------------------
+
+   !!----------------------------------------------------------------------
+   !!   ssh_wzv        : after ssh & now vertical velocity
+   !!   ssh_nxt        : filter ans swap the ssh arrays
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers variables
+   USE dom_oce         ! ocean space and time domain variables 
+   USE sbc_oce         ! surface boundary condition: ocean
+   USE domvvl          ! Variable volume
+   USE divcur          ! hor. divergence and curl      (div & cur routines)
+   USE iom             ! I/O library
+   USE restart         ! only for lrst_oce
+   USE in_out_manager  ! I/O manager
+   USE prtctl          ! Print control
+   USE phycst
+   USE lbclnk          ! ocean lateral boundary condition (or mpp link)
+   USE lib_mpp         ! MPP library
+   USE obc_par         ! open boundary cond. parameter
+   USE obc_oce
+   USE bdy_oce
+   USE diaar5, ONLY:   lk_diaar5
+   USE iom
+   USE sbcrnf, ONLY: h_rnf, nk_rnf   ! River runoff 
+   USE trc, ONLY:  nn_dttrc, nittrc000 !TOP_TRC substepping
+#if defined key_agrif
+   USE agrif_opa_update
+   USE agrif_opa_interp
+#endif
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   ssh_wzv_trc    ! called by step.F90
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
+#  include "vectopt_loop_substitute.h90"
+   !!----------------------------------------------------------------------
+   !! NEMO/OPA 3.3 , NEMO Consortium (2010)
+   !! $Id: sshwzv.F90 2715 2011-03-30 15:58:35Z rblod $
+   !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE ssh_wzv_trc( kt ) 
+      !!----------------------------------------------------------------------
+      !!                ***  ROUTINE ssh_wzv  ***
+      !!                   
+      !! ** Purpose :   compute the after ssh (ssha), the now vertical velocity
+      !!              and update the now vertical coordinate (lk_vvl=T).
+      !!
+      !! ** Method  : - Using the incompressibility hypothesis, the vertical 
+      !!      velocity is computed by integrating the horizontal divergence  
+      !!      from the bottom to the surface minus the scale factor evolution.
+      !!        The boundary conditions are w=0 at the bottom (no flux) and.
+      !!
+      !! ** action  :   ssha    : after sea surface height
+      !!                wn      : now vertical velocity
+      !!                sshu_a, sshv_a, sshf_a  : after sea surface height (lk_vvl=T)
+      !!                hu, hv, hur, hvr        : ocean depth and its inverse at u-,v-points
+      !!
+      !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling.
+      !!----------------------------------------------------------------------
+      USE wrk_nemo, ONLY:   wrk_in_use, wrk_not_released
+      USE oce     , ONLY:   z3d   => ta                           ! ta used as 3D workspace
+      USE wrk_nemo, ONLY:   zhdiv => wrk_2d_1 , z2d => wrk_2d_2   ! 2D workspace
+      !
+      INTEGER, INTENT(in) ::   kt   ! time step
+      !
+      INTEGER  ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp) ::   zcoefu, zcoefv, zcoeff, z2dt, z1_2dt, z1_rau0   ! local scalars
+      !!----------------------------------------------------------------------
+
+      IF( wrk_in_use(2, 1,2) ) THEN
+         CALL ctl_stop('ssh_wzv: requested workspace arrays unavailable')   ;   RETURN
+      ENDIF
+
+      IF( kt == nittrc000 ) THEN
+         !
+         IF(lwp) WRITE(numout,*)
+         IF(lwp) WRITE(numout,*) 'ssh_wzv_trc : after sea surface height and now vertical velocity '
+         IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
+         !
+         wn(:,:,jpk) = 0._wp                  ! bottom boundary condition: w=0 (set once for all)
+         !
+         !
+      ENDIF
+
+      !                                           !------------------------------------------!
+      IF( lk_vvl ) THEN                           !  Regridding: Update Now Vertical coord.  !   (only in vvl case)
+         !                                        !------------------------------------------!
+         DO jk = 1, jpkm1
+            fsdept(:,:,jk) = fsdept_n(:,:,jk)         ! now local depths stored in fsdep. arrays
+            fsdepw(:,:,jk) = fsdepw_n(:,:,jk)
+            fsde3w(:,:,jk) = fsde3w_n(:,:,jk)
+            !
+            fse3t (:,:,jk) = fse3t_n (:,:,jk)         ! vertical scale factors stored in fse3. arrays
+            fse3u (:,:,jk) = fse3u_n (:,:,jk)
+            fse3v (:,:,jk) = fse3v_n (:,:,jk)
+            fse3f (:,:,jk) = fse3f_n (:,:,jk)
+            fse3w (:,:,jk) = fse3w_n (:,:,jk)
+            fse3uw(:,:,jk) = fse3uw_n(:,:,jk)
+            fse3vw(:,:,jk) = fse3vw_n(:,:,jk)
+         END DO
+         !
+         hu(:,:) = hu_0(:,:) + sshu_n(:,:)            ! now ocean depth (at u- and v-points)
+         hv(:,:) = hv_0(:,:) + sshv_n(:,:)
+         !                                            ! now masked inverse of the ocean depth (at u- and v-points)
+         hur(:,:) = umask(:,:,1) / ( hu(:,:) + 1._wp - umask(:,:,1) )
+         hvr(:,:) = vmask(:,:,1) / ( hv(:,:) + 1._wp - vmask(:,:,1) )
+         ! 
+      ENDIF
+      !
+      CALL div_cur( kt )                              ! Horizontal divergence & Relative vorticity
+      !
+      z2dt = 2._wp * rdt                              ! set time step size (Euler/Leapfrog)
+      IF( neuler == 0 .AND. kt == nittrc000 )   z2dt = rdt
+
+      !                                           !------------------------------!
+      !                                           !   After Sea Surface Height   !
+      !                                           !------------------------------!
+      zhdiv(:,:) = 0._wp
+      DO jk = 1, jpkm1                                 ! Horizontal divergence of barotropic transports
+        zhdiv(:,:) = zhdiv(:,:) + fse3t(:,:,jk) * hdivn(:,:,jk)
+      END DO
+      !                                                ! Sea surface elevation time stepping
+      ! In forward Euler time stepping case, the same formulation as in the leap-frog case can be used
+      ! because emp_b field is initialized with the vlaues of emp field. Hence, 0.5 * ( emp + emp_b ) = emp
+      z1_rau0 = 0.5 / rau0
+      ssha(:,:) = (  sshb(:,:) - z2dt * ( z1_rau0 * ( emp_b(:,:) + emp(:,:) ) + zhdiv(:,:) )  ) * tmask(:,:,1)
+
+#if defined key_agrif
+      CALL agrif_ssh( kt )
+#endif
+#if defined key_obc
+      IF( Agrif_Root() ) THEN 
+         ssha(:,:) = ssha(:,:) * obctmsk(:,:)
+         CALL lbc_lnk( ssha, 'T', 1. )                 ! absolutly compulsory !! (jmm)
+      ENDIF
+#endif
+#if defined key_bdy
+      ssha(:,:) = ssha(:,:) * bdytmask(:,:)
+      CALL lbc_lnk( ssha, 'T', 1. ) 
+#endif
+
+      !                                                ! Sea Surface Height at u-,v- and f-points (vvl case only)
+      IF( lk_vvl ) THEN                                ! (required only in key_vvl case)
+         DO jj = 1, jpjm1
+            DO ji = 1, jpim1      ! NO Vector Opt.
+               sshu_a(ji,jj) = 0.5  * umask(ji,jj,1) / ( e1u(ji  ,jj) * e2u(ji  ,jj) )                   &
+                  &                                  * ( e1t(ji  ,jj) * e2t(ji  ,jj) * ssha(ji  ,jj)     &
+                  &                                    + e1t(ji+1,jj) * e2t(ji+1,jj) * ssha(ji+1,jj) )
+               sshv_a(ji,jj) = 0.5  * vmask(ji,jj,1) / ( e1v(ji,jj  ) * e2v(ji,jj  ) )                   &
+                  &                                  * ( e1t(ji,jj  ) * e2t(ji,jj  ) * ssha(ji,jj  )     &
+                  &                                    + e1t(ji,jj+1) * e2t(ji,jj+1) * ssha(ji,jj+1) )
+            END DO
+         END DO
+         CALL lbc_lnk( sshu_a, 'U', 1. )   ;   CALL lbc_lnk( sshv_a, 'V', 1. )      ! Boundaries conditions
+      ENDIF
+      
+
+      !                                           !------------------------------!
+      !                                           !     Now Vertical Velocity    !
+      !                                           !------------------------------!
+      z1_2dt = 1.e0 / z2dt
+      DO jk = jpkm1, 1, -1                             ! integrate from the bottom the hor. divergence
+         ! - ML - need 3 lines here because replacement of fse3t by its expression yields too long lines otherwise
+         wn(:,:,jk) = wn(:,:,jk+1) -   fse3t_n(:,:,jk) * hdivn(:,:,jk)        &
+            &                      - ( fse3t_a(:,:,jk) - fse3t_b(:,:,jk) )    &
+            &                         * tmask(:,:,jk) * z1_2dt
+#if defined key_bdy
+         wn(:,:,jk) = wn(:,:,jk) * bdytmask(:,:)
+#endif
+      END DO
+
+      !
+      IF( wrk_not_released(2, 1,2) )   CALL ctl_stop('ssh_wzv: failed to release workspace arrays')
+      !
+   END SUBROUTINE ssh_wzv_trc
+
+
+   !!======================================================================
+END MODULE sshwzv_trc
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 2830)
@@ -58,4 +58,6 @@
    CHARACTER(len=50), PUBLIC ::  cn_trcrst_in    !: suffix of pass. tracer restart name (input)
    CHARACTER(len=50), PUBLIC ::  cn_trcrst_out   !: suffix of pass. tracer restart name (output)
+
+   INTEGER          , PUBLIC ::  nittrc000       !: first time step of passive tracers model
    
    !! information for outputs
@@ -99,4 +101,37 @@
 # endif
 
+   !! variables to average over physics over passive tracer sub-steps.
+   !! ----------------------------------------------------------------
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  un_tm      !: i-horizontal velocity average     [m/s]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  vn_tm      !: j-horizontal velocity average     [m/s]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  wn_tm      !: k-vertical velocity average       [m/s]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::  avt_tm     !: vertical viscosity & diffusivity coeff. at  w-point   [m2/s]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshn_tm !: average ssh for the now step [m]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshb_hold !:hold sshb from the beginning of each sub-stepping[m]  
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshu_n_tm !: average ssh for the now step [m]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshu_b_hold !:hold sshb from the beginning of each sub-stepping[m]  
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshv_n_tm !: average ssh for the now step [m]
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:) ::    sshv_b_hold !:hold sshb from the beginning of each sub-stepping[m]  
+#if defined key_ldfslp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   wslpi_tm !: i-direction slope at u-, w-points
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   wslpj_tm !: j-direction slope at u-, w-points
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   uslp_tm !: j-direction slope at u-, w-points
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION (:,:,:) ::   vslp_tm !: j-direction slope at u-, w-points
+#endif
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)  ::   rnf_tm !: river runoff
+  REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION (:,:)  ::   h_rnf_tm !: depth in metres to the bottom of the relevant grid box
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::    avt_temp,un_temp,vn_temp,wn_temp     !: hold current values of avt, un, vn, wn
+#if defined key_ldfslp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::    wslpi_temp,wslpj_temp, uslp_temp, vslp_temp    !: hold current values 
+#endif
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::    e3t_temp,e3u_temp,e3v_temp,e3w_temp     !: hold current values
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:)::       sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:)::       sshu_n_temp, sshu_b_temp, sshu_a_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:)::       sshf_n_temp, sshf_b_temp, sshf_a_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:)::       sshv_n_temp, sshv_b_temp, sshv_a_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:)::       hu_temp, hv_temp, hur_temp, hvr_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:,:)::     hdivn_temp, rotn_temp
+  REAL(wp), PUBLIC,ALLOCATABLE, SAVE, DIMENSION(:,:,:)::     hdivb_temp, rotb_temp
+
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3.1 , NEMO Consortium (2010)
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdia.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdia.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdia.F90	(revision 2830)
@@ -85,5 +85,5 @@
       !! ** Purpose :   Standard output of passive tracer : concentration fields
       !!
-      !! ** Method  :   At the beginning of the first time step (nit000), define all
+      !! ** Method  :   At the beginning of the first time step (nittrc000), define all
       !!             the NETCDF files and fields for concentration of passive tracer
       !!
@@ -135,5 +135,5 @@
 
       ! define time axis
-      itmod = kt - nit000 + 1
+      itmod = kt - nittrc000 + 1
       it    = kt
       iiter = ( nit000 - 1 ) / nn_dttrc
@@ -144,5 +144,5 @@
       IF(ll_print)WRITE(numout,*)'trcdit_wr kt=',kt,' kindic ',kindic
       
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
 
          ! Compute julian date from starting date of the run
@@ -150,5 +150,5 @@
          zjulian = zjulian - adatrj   !   set calendar origin to the beginning of the experiment
          IF(lwp)WRITE(numout,*)' '  
-         IF(lwp)WRITE(numout,*)' Date 0 used :', nit000                         &
+         IF(lwp)WRITE(numout,*)' Date 0 used :', nittrc000                         &
             &                 ,' YEAR ', nyear, ' MONTH ', nmonth, ' DAY ', nday   &
             &                 ,'Julian day : ', zjulian  
@@ -226,5 +226,5 @@
       !! ** Purpose :   output of passive tracer : additional 2D and 3D arrays
       !!
-      !! ** Method  :   At the beginning of the first time step (nit000), define all
+      !! ** Method  :   At the beginning of the first time step (nittrc000), define all
       !!             the NETCDF files and fields for concentration of passive tracer
       !!
@@ -275,5 +275,5 @@
 
       ! define time axis
-      itmod = kt - nit000 + 1
+      itmod = kt - nittrc000 + 1
       it    = kt
       iiter = ( nit000 - 1 ) / nn_dttrc
@@ -284,5 +284,5 @@
       IF( ll_print ) WRITE(numout,*) 'trcdii_wr kt=', kt, ' kindic ', kindic
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
 
          ! Define the NETCDF files for additional arrays : 2D or 3D
@@ -375,5 +375,5 @@
       !! ** Purpose :   output of passive tracer : biological fields
       !!
-      !! ** Method  :   At the beginning of the first time step (nit000), define all
+      !! ** Method  :   At the beginning of the first time step (nittrc000), define all
       !!             the NETCDF files and fields for concentration of passive tracer
       !!
@@ -424,5 +424,5 @@
 
       ! define time axis
-      itmod = kt - nit000 + 1
+      itmod = kt - nittrc000 + 1
       it    = kt
       iiter = ( nit000 - 1 ) / nn_dttrc
@@ -433,5 +433,5 @@
       IF(ll_print) WRITE(numout,*)'trcdib_wr kt=',kt,' kindic ',kindic
 
-      IF( kt == nit000 ) THEN
+      IF( kt == nittrc000 ) THEN
 
          ! Define the NETCDF files for biological trends
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 2830)
@@ -71,5 +71,5 @@
          IF( lutini(jn) ) THEN 
 
-            IF ( kt == nit000 ) THEN
+            IF ( kt == nittrc000 ) THEN
                !! 3D tracer data
                IF(lwp)WRITE(numout,*)
@@ -86,8 +86,8 @@
 
 
-            ! First call kt=nit000
+            ! First call kt=nittrc000
             ! --------------------
 
-            IF ( kt == nit000 .AND. nlectr(jn) == 0 ) THEN
+            IF ( kt == nittrc000 .AND. nlectr(jn) == 0 ) THEN
                ntrc1(jn) = 0
                IF(lwp) WRITE(numout,*) ' trc_dta : Levitus tracer data monthly fields'
@@ -104,5 +104,5 @@
 # if defined key_pisces
             ! Read montly file
-            IF( ( kt == nit000 .AND. nlectr(jn) == 0)  .OR. imois /= ntrc1(jn) ) THEN
+            IF( ( kt == nittrc000 .AND. nlectr(jn) == 0)  .OR. imois /= ntrc1(jn) ) THEN
                nlectr(jn) = 1
 
@@ -186,5 +186,5 @@
 # else
             ! Read init file only
-            IF( kt == nit000  ) THEN
+            IF( kt == nittrc000  ) THEN
                ntrc1(jn) = 1
                CALL iom_get ( numtr(jn), jpdom_data, ctrcnm(jn), trdta(:,:,:,jn), ntrc1(jn) )
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcini.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcini.F90	(revision 2830)
@@ -29,4 +29,5 @@
    USE zpshde          ! partial step: hor. derivative   (zps_hde routine)
    USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
+   USE trcsubstp       ! variables to substep passive tracers
    
    IMPLICIT NONE
@@ -122,14 +123,14 @@
       IF( ln_rsttr ) THEN
         !
-        IF( lk_offline )  neuler = 1   ! Set time-step indicator at nit000 (leap-frog)
+        IF( lk_offline )  neuler = 1   ! Set time-step indicator at nittrc000 (leap-frog)
         CALL trc_rst_read              ! restart from a file
         !
       ELSE
         IF( lk_offline )  THEN
-           neuler = 0                  ! Set time-step indicator at nit000 (euler)
+           neuler = 0                  ! Set time-step indicator at nittrc000 (euler)
            CALL day_init               ! set calendar
         ENDIF
 #if defined key_dtatrc
-        CALL trc_dta( nit000 )      ! Initialization of tracer from a file that may also be used for damping
+        CALL trc_dta( nittrc000 )      ! Initialization of tracer from a file that may also be used for damping
         DO jn = 1, jptra
            IF( lutini(jn) )   trn(:,:,:,jn) = trdta(:,:,:,jn) * tmask(:,:,:)   ! initialisation from file if required
@@ -143,5 +144,5 @@
       
       IF( ln_zps .AND. .NOT. lk_c1d )   &              ! Partial steps: before horizontal gradient of passive
-        &    CALL zps_hde( nit000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
+        &    CALL zps_hde( nittrc000, jptra, trn, gtru, gtrv )       ! tracers at the bottom ocean level
 
 
@@ -170,4 +171,8 @@
          CALL prt_ctl_trc_info( charout )
          CALL prt_ctl_trc( tab4d=trn, mask=tmask, clinfo=ctrcnm )
+      ENDIF
+
+      IF(nn_dttrc .NE. 1) THEN
+          CALL trc_sub_stp_ini      !initialize variables for substepping passive tracers
       ENDIF
       !
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcnam.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcnam.F90	(revision 2830)
@@ -109,4 +109,7 @@
       END DO
 
+      !!KPE  computes the first time step of tracer model
+      nittrc000 = nit000 + nn_dttrc - 1
+ 
 
       IF(lwp) THEN                   ! control print
@@ -114,4 +117,5 @@
          WRITE(numout,*) ' Namelist : namtrc'
          WRITE(numout,*) '    time step freq. for pass. trac. nn_dttrc             = ', nn_dttrc
+         WRITE(numout,*) '    first time step for pass. trac. nittrc000            = ', nittrc000
          WRITE(numout,*) '    frequency of outputs for passive tracers nn_writetrc = ', nn_writetrc  
          WRITE(numout,*) '    restart LOGICAL for passive tr. ln_rsttr             = ', ln_rsttr
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcrst.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcrst.F90	(revision 2830)
@@ -60,5 +60,5 @@
       !
       IF( lk_offline ) THEN
-         IF( kt == nit000 ) THEN
+         IF( kt == nittrc000 ) THEN
             lrst_trc = .FALSE.
             nitrst = nitend
@@ -71,5 +71,5 @@
          ENDIF
       ELSE
-         IF( kt == nit000 ) lrst_trc = .FALSE.
+         IF( kt == nittrc000 ) lrst_trc = .FALSE.
       ENDIF
 
@@ -119,5 +119,5 @@
       ! Time domain : restart
       ! ---------------------
-      CALL trc_rst_cal( nit000, 'READ' )   ! calendar
+      CALL trc_rst_cal( nittrc000, 'READ' )   ! calendar
 
       ! READ prognostic variables and computes diagnostic variable
@@ -196,6 +196,6 @@
       !!
       !!   According to namelist parameter nrstdt,
-      !!       nn_rsttr = 0  no control on the date (nit000 is  arbitrary).
-      !!       nn_rsttr = 1  we verify that nit000 is equal to the last
+      !!       nn_rsttr = 0  no control on the date (nittrc000 is  arbitrary).
+      !!       nn_rsttr = 1  we verify that nittrc000 is equal to the last
       !!                   time step of previous run + 1.
       !!       In both those options, the  exact duration of the experiment
@@ -223,6 +223,6 @@
             WRITE(numout,*) ' *** restart option'
             SELECT CASE ( nn_rsttr )
-            CASE ( 0 )   ;   WRITE(numout,*) ' nn_rsttr = 0 : no control of nit000'
-            CASE ( 1 )   ;   WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nit000 (use ndate0 read in the namelist)'
+            CASE ( 0 )   ;   WRITE(numout,*) ' nn_rsttr = 0 : no control of nittrc000'
+            CASE ( 1 )   ;   WRITE(numout,*) ' nn_rsttr = 1 : no control the date at nittrc000 (use ndate0 read in the namelist)'
             CASE ( 2 )   ;   WRITE(numout,*) ' nn_rsttr = 2 : calendar parameters read in restart'
             END SELECT
@@ -230,6 +230,6 @@
          ENDIF
          ! Control of date 
-         IF( nit000  - NINT( zkt ) /= 1 .AND.  nn_rsttr /= 0 )                                  &
-            &   CALL ctl_stop( ' ===>>>> : problem with nit000 for the restart',                 &
+         IF( nittrc000  - NINT( zkt ) /= 1 .AND.  nn_rsttr /= 0 )                                  &
+            &   CALL ctl_stop( ' ===>>>> : problem with nittrc000 for the restart',                 &
             &                  ' verify the restart file or rerun with nn_rsttr = 0 (namelist)' )
          IF( lk_offline ) THEN      ! set the date in offline mode
@@ -246,5 +246,5 @@
             ELSE
                ndastp = ndate0 - 1     ! ndate0 read in the namelist in dom_nam
-               adatrj = ( REAL( nit000-1, wp ) * rdttra(1) ) / rday
+               adatrj = ( REAL( nittrc000-1, wp ) * rdttra(1) ) / rday
                ! note this is wrong if time step has changed during run
             ENDIF
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 2830)
@@ -22,4 +22,5 @@
    USE iom
    USE in_out_manager
+   USE trcsubstp
 
    IMPLICIT NONE
@@ -27,4 +28,5 @@
 
    PUBLIC   trc_stp    ! called by step
+#  include "domzgr_substitute.h90"
    
    !!----------------------------------------------------------------------
@@ -49,5 +51,9 @@
       !!-------------------------------------------------------------------
 
-      IF( MOD( kt - 1 , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step
+     IF(nn_dttrc .NE. 1) THEN
+        CALL trc_sub_stp(kt)
+     ENDIF
+     IF( MOD( kt , nn_dttrc ) == 0 ) THEN      ! only every nn_dttrc time step
+
          !
          IF(ln_ctl) THEN
@@ -58,5 +64,5 @@
          tra(:,:,:,:) = 0.e0
          !
-         IF( kt == nit000 .AND. lk_trdmld_trc  )  &
+         IF( kt == nittrc000 .AND. lk_trdmld_trc  )  &
             &                      CALL trd_mld_trc_init        ! trends: Mixed-layer
                                    CALL trc_rst_opn( kt )       ! Open tracer restart file 
@@ -66,8 +72,11 @@
                                    CALL trc_sms( kt )           ! tracers: sink and source
                                    CALL trc_trp( kt )           ! transport of passive tracers
-         IF( kt == nit000 )     CALL iom_close( numrtr )     ! close input  passive tracers restart file
+         IF( kt == nittrc000 )     CALL iom_close( numrtr )     ! close input  passive tracers restart file
          IF( lrst_trc )            CALL trc_rst_wri( kt )       ! write tracer restart file
          IF( lk_trdmld_trc  )      CALL trd_mld_trc( kt )       ! trends: Mixed-layer
          !
+         IF(nn_dttrc .NE. 1) THEN
+            CALL trc_sub_stp_reset(kt)
+         ENDIF
       ENDIF
 
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcsubstp.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcsubstp.F90	(revision 2830)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcsubstp.F90	(revision 2830)
@@ -0,0 +1,399 @@
+MODULE trcsubstp
+   !!======================================================================
+   !!                       ***  MODULE trcsubstp  ***
+   !! Time-stepping    : time loop of opa for passive tracer
+   !!======================================================================
+   !! History :  1.0  !  2004-03  (C. Ethe)  Original
+   !!----------------------------------------------------------------------
+#if defined key_top
+   !!----------------------------------------------------------------------
+   !!   trc_sub_stp     : passive tracer system sub-stepping 
+   !!----------------------------------------------------------------------
+   USE oce_trc          ! ocean dynamics and active tracers variables
+   USE trc
+   USE prtctl_trc       ! Print control for debbuging
+   USE iom
+   USE in_out_manager
+#if defined key_zdftke
+   USE zdftke          ! twice TKE (en)
+#endif
+#if defined key_zdfgls
+   USE zdfgls, ONLY: en
+#endif
+   USE zdf_oce
+   USE domvvl
+   USE sshwzv_trc
+   USE sbcrnf, ONLY:h_rnf
+
+   IMPLICIT NONE
+
+   PUBLIC   trc_sub_stp    ! called by trc_stp
+   PUBLIC   trc_sub_stp_ini ! called by trc_ini to initialize substepping arrays.
+   PUBLIC   trc_sub_stp_reset  !called by trc_stp to reset physics variables
+#  include "domzgr_substitute.h90"
+   
+   !!----------------------------------------------------------------------
+   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! $Id: trcstp.F90 2528 2010-12-27 17:33:53Z rblod $ 
+   !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
+   !!----------------------------------------------------------------------
+CONTAINS
+
+   SUBROUTINE trc_sub_stp( kt )
+      !!-------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_stp  ***
+      !!                      
+      !! ** Purpose : Average variables needed for sub-stepping passive tracers
+      !! 
+      !! ** Method  : 
+      !!              Compute the averages for sub-stepping
+      !!-------------------------------------------------------------------
+      INTEGER, INTENT( in ) ::  kt  ! ocean time-step index
+      INTEGER::				    ji,jj,jk
+      !!-------------------------------------------------------------------
+
+       IF (kt .eq. nit000) THEN
+           sshb_hold=sshn
+           sshu_b_hold=sshu_n
+           sshv_b_hold=sshv_n
+           IF(lwp) WRITE(numout,*)
+           IF(lwp) WRITE(numout,*) 'trc_sub_stp : substepping of the passive tracers'
+           IF(lwp) WRITE(numout,*) '~~~~~~~~~~~'
+       ENDIF  
+       IF( MOD( kt , nn_dttrc ) /= 0 ) THEN
+         if(lwp)write(numout,*)'trc_sub_stp at kt=',kt
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  un_tm(ji,jj,jk)= un_tm(ji,jj,jk)+un(ji,jj,jk)*fse3u(ji,jj,jk)
+                  vn_tm(ji,jj,jk)= vn_tm(ji,jj,jk)+vn(ji,jj,jk)*fse3v(ji,jj,jk)
+		  wn_tm(ji,jj,jk)= wn_tm(ji,jj,jk)+wn(ji,jj,jk)*fse3w(ji,jj,jk)
+                  avt_tm(ji,jj,jk)= avt_tm(ji,jj,jk)+avt(ji,jj,jk)*fse3t(ji,jj,jk)
+#if defined key_ldfslp
+		  wslpi_tm(ji,jj,jk)= wslpi_tm(ji,jj,jk)+wslpi(ji,jj,jk)*fse3w(ji,jj,jk)
+		  wslpj_tm(ji,jj,jk)= wslpj_tm(ji,jj,jk)+wslpj(ji,jj,jk)*fse3w(ji,jj,jk)
+		  uslp_tm(ji,jj,jk)= uslp_tm(ji,jj,jk)+uslp(ji,jj,jk)*fse3u(ji,jj,jk)
+		  vslp_tm(ji,jj,jk)= vslp_tm(ji,jj,jk)+vslp(ji,jj,jk)*fse3v(ji,jj,jk)
+#endif
+             END DO
+            END DO
+         END DO
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+         	sshn_tm(ji,jj)=sshn_tm(ji,jj)+sshn(ji,jj)
+                sshu_n_tm(ji,jj)=sshu_n_tm(ji,jj)+sshu_n(ji,jj)
+                sshv_n_tm(ji,jj)=sshv_n_tm(ji,jj)+sshv_n(ji,jj)
+	        rnf_tm(ji,jj)= rnf_tm(ji,jj)+rnf(ji,jj)
+	        h_rnf_tm(ji,jj)= h_rnf_tm(ji,jj)+h_rnf(ji,jj)
+             END DO
+         END DO
+      ELSE
+         if(lwp)write(numout,*)'trc_sub_stp at kt=',kt
+!it is time to substep
+! 1. set temporary arrays to hold physics variables
+            sshn_temp=sshn
+            sshu_n_temp=sshu_n
+            sshv_n_temp=sshv_n
+            sshf_n_temp=sshf_n
+            sshb_temp=sshb
+            sshu_b_temp=sshu_b
+            sshv_b_temp=sshv_b
+            ssha_temp=ssha
+            sshu_a_temp=sshu_a
+            sshv_a_temp=sshv_a
+            rnf_temp=rnf
+            h_rnf_temp=h_rnf
+            rotn_temp=rotn
+            hdivn_temp=hdivn
+            rotb_temp=rotb
+            hdivb_temp=hdivb
+            un_temp=un
+            vn_temp=vn
+            wn_temp=wn
+            avt_temp=avt
+#if defined key_ldfslp
+            wslpi_temp=wslpi
+            wslpj_temp=wslpj
+            uslp_temp=uslp
+            vslp_temp=vslp
+#endif
+            hu_temp=hu
+            hv_temp=hv
+            hur_temp=hur
+            hvr_temp=hvr
+
+!2. create averages and reassign variables
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  sshn_tm(ji,jj)= sshn_tm(ji,jj)+sshn(ji,jj)
+                  sshn(ji,jj)=sshn_tm(ji,jj)/(nn_dttrc+1)
+		  
+                  sshu_n_tm(ji,jj)= sshu_n_tm(ji,jj)+sshu_n(ji,jj)
+                  sshu_n(ji,jj)=sshu_n_tm(ji,jj)/(nn_dttrc+1)
+		  
+                  sshv_n_tm(ji,jj)= sshv_n_tm(ji,jj)+sshv_n(ji,jj)
+                  sshv_n(ji,jj)=sshv_n_tm(ji,jj)/(nn_dttrc+1)
+
+		  sshb(ji,jj)=sshb_hold(ji,jj)
+
+		  sshu_b(ji,jj)=sshu_b_hold(ji,jj)
+
+		  sshv_b(ji,jj)=sshv_b_hold(ji,jj)
+
+                  rnf_tm(ji,jj)= rnf_tm(ji,jj)+rnf(ji,jj)
+                  rnf(ji,jj)=rnf_tm(ji,jj)/(nn_dttrc+1)
+ 
+                  h_rnf_tm(ji,jj)= h_rnf_tm(ji,jj)+h_rnf(ji,jj)
+                  h_rnf(ji,jj)=h_rnf_tm(ji,jj)/(nn_dttrc+1)
+               END DO
+            END DO
+         DO jk = 1, jpk
+             IF( lk_vvl ) THEN                           !  Update Now Vertical coord.  !   (only in vvl case)
+             !                                           !------------------------------!
+                 fse3t (:,:,jk) = fse3t_n (:,:,jk)          ! vertical scale factors stored in fse3. arrays
+                 fse3u (:,:,jk) = fse3u_n (:,:,jk)
+                 fse3v (:,:,jk) = fse3v_n (:,:,jk)
+                 fse3f (:,:,jk) = fse3f_n (:,:,jk)
+                 fse3w (:,:,jk) = fse3w_n (:,:,jk)
+                 fse3uw(:,:,jk) = fse3uw_n(:,:,jk)
+                 fse3vw(:,:,jk) = fse3vw_n(:,:,jk)
+             ENDIF
+         ENDDO
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+
+                  un_tm(ji,jj,jk)= un_tm(ji,jj,jk)+un(ji,jj,jk)*e3u_temp(ji,jj,jk)
+                  un(ji,jj,jk)=(un_tm(ji,jj,jk)/(nn_dttrc+1))/fse3u(ji,jj,jk)
+		  
+                  vn_tm(ji,jj,jk)= vn_tm(ji,jj,jk)+vn(ji,jj,jk)*e3v_temp(ji,jj,jk)
+                  vn(ji,jj,jk)=(vn_tm(ji,jj,jk)/(nn_dttrc+1))/fse3v(ji,jj,jk)
+		  
+                  wn_tm(ji,jj,jk)= wn_tm(ji,jj,jk)+wn(ji,jj,jk)*e3w_temp(ji,jj,jk)
+                  wn(ji,jj,jk)=(wn_tm(ji,jj,jk)/(nn_dttrc+1))/fse3w(ji,jj,jk)
+		  
+                  avt_tm(ji,jj,jk)= avt_tm(ji,jj,jk)+avt(ji,jj,jk)*e3t_temp(ji,jj,jk)
+                  avt(ji,jj,jk)=(avt_tm(ji,jj,jk)/(nn_dttrc+1))/fse3t(ji,jj,jk)	
+	  
+#if defined key_ldfslp
+                  wslpi_tm(ji,jj,jk)= wslpi_tm(ji,jj,jk)+wslpi(ji,jj,jk)*e3w_temp(ji,jj,jk)
+                  wslpi(ji,jj,jk)=(wslpi_tm(ji,jj,jk)/(nn_dttrc+1))/fse3w(ji,jj,jk)
+
+                  wslpj_tm(ji,jj,jk)= wslpj_tm(ji,jj,jk)+wslpj(ji,jj,jk)*e3w_temp(ji,jj,jk)
+                  wslpj(ji,jj,jk)=(wslpj_tm(ji,jj,jk)/(nn_dttrc+1))/fse3w(ji,jj,jk)
+
+                  uslp_tm(ji,jj,jk)= uslp_tm(ji,jj,jk)+uslp(ji,jj,jk)*e3u_temp(ji,jj,jk)
+                  uslp(ji,jj,jk)=(uslp_tm(ji,jj,jk)/(nn_dttrc+1))/fse3u(ji,jj,jk)
+
+                  vslp_tm(ji,jj,jk)= vslp_tm(ji,jj,jk)+vslp(ji,jj,jk)*e3v_temp(ji,jj,jk)
+                  vslp(ji,jj,jk)=(vslp_tm(ji,jj,jk)/(nn_dttrc+1))/fse3v(ji,jj,jk)
+#endif
+	       END DO
+            END DO
+         END DO
+         CALL ssh_wzv_trc( kt )         ! after ssh & vertical velocity
+      ENDIF
+
+
+   END SUBROUTINE trc_sub_stp
+  !!-------------------------------------------------------------------
+
+  !!-------------------------------------------------------------------
+   SUBROUTINE trc_sub_stp_ini
+      !!-------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_sub_stp_ini  ***
+      !!                      
+      !! ** Purpose : Initialize variables needed for sub-stepping passive tracers
+      !! 
+      !! ** Method  : 
+      !!              Compute the averages for sub-stepping
+      !!-------------------------------------------------------------------
+      INTEGER ::   jk, jn ,ji,jj   ! dummy loop indices
+      INTEGER :: ierr
+      !!-------------------------------------------------------------------
+
+      IF(lwp) WRITE(numout,*)
+      IF(lwp) WRITE(numout,*) 'trc_sub_stp_ini : initial set up of the passive tracers substepping'
+      IF(lwp) WRITE(numout,*) '~~~~~~~'
+
+      ierr =  trc_sub_alloc    ()
+      IF( lk_mpp    )   CALL mpp_sum( ierr )
+      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'top_sub_alloc : unable to allocate standard ocean arrays' )
+
+      DO jk = 1, jpk
+         DO jj = 1, jpj
+            DO ji = 1, jpi
+               un_tm(ji,jj,jk)= un(ji,jj,jk)*fse3u(ji,jj,jk)
+               vn_tm(ji,jj,jk)= vn(ji,jj,jk)*fse3v(ji,jj,jk)
+	       wn_tm(ji,jj,jk)= wn(ji,jj,jk)*fse3w(ji,jj,jk)
+               avt_tm(ji,jj,jk)=avt(ji,jj,jk)*fse3t(ji,jj,jk)
+#if defined key_ldfslp
+               wslpi_tm(ji,jj,jk)= wslpi(ji,jj,jk)*fse3w(ji,jj,jk) !0. 
+               wslpj_tm(ji,jj,jk)= wslpj(ji,jj,jk)*fse3w(ji,jj,jk) !0. 
+               uslp_tm(ji,jj,jk)= uslp(ji,jj,jk)*fse3u(ji,jj,jk) !0. 
+               vslp_tm(ji,jj,jk)= vslp(ji,jj,jk)*fse3v(ji,jj,jk) !0. 
+#endif
+           END DO
+         END DO
+      END DO
+ 
+      sshn_tm = sshn !0.
+      sshu_n_tm = sshu_n !0.
+      sshv_n_tm = sshv_n !0.
+      rnf_tm= rnf !0. 
+      h_rnf_tm= h_rnf !0.
+
+   END SUBROUTINE trc_sub_stp_ini
+
+  !!-------------------------------------------------------------------
+   SUBROUTINE trc_sub_stp_reset(kt)
+      !!-------------------------------------------------------------------
+      !!                     ***  ROUTINE trc_sub_stp_reset  ***
+      !!                      
+      !! ** Purpose : Reset physics variables averaged for substepping
+      !! 
+      !! ** Method  : 
+      !!              Compute the averages for sub-stepping
+      !!-------------------------------------------------------------------
+      INTEGER ::   jk, jn ,ji,jj   ! dummy loop indices
+      INTEGER :: ierr
+      INTEGER, INTENT( in ) ::  kt  ! ocean time-step index
+      !!-------------------------------------------------------------------
+
+      IF(lwp)write(numout,*)'trc_sub_stp_reset at kt=',kt
+!restore physics variables
+        avt=avt_temp
+        un=un_temp
+        vn=vn_temp
+        wn=wn_temp
+        sshn=sshn_temp
+        sshb=sshb_temp
+        ssha=ssha_temp
+        sshu_n=sshu_n_temp
+        sshu_b=sshu_b_temp
+        sshu_a=sshu_a_temp
+        sshv_n=sshv_n_temp
+        sshv_b=sshv_b_temp
+        sshv_a=sshv_a_temp
+        sshf_n=sshf_n_temp
+#if defined key_ldfslp
+        wslpi=wslpi_temp
+        wslpj=wslpj_temp
+        uslp=uslp_temp
+        vslp=vslp_temp
+#endif
+        rnf=rnf_temp
+        h_rnf=h_rnf_temp
+        hdivn=hdivn_temp
+        rotn=rotn_temp
+        hdivb=hdivb_temp
+        rotb=rotb_temp
+        hu=hu_temp
+        hv=hv_temp
+        hur=hur_temp
+        hvr=hvr_temp
+
+       !                                           !------------------------------!
+       IF( lk_vvl ) THEN                           !  Update Now Vertical coord.  !   (only in vvl case)
+       !                                           !------------------------------!
+         DO jk = 1, jpkm1
+            fsdept(:,:,jk) = fsdept_n(:,:,jk)          ! now local depths stored in fsdep. arrays
+            fsdepw(:,:,jk) = fsdepw_n(:,:,jk)
+            fsde3w(:,:,jk) = fsde3w_n(:,:,jk)
+            !
+            fse3t (:,:,jk) = fse3t_n (:,:,jk)          ! vertical scale factors stored in fse3. arrays
+            fse3u (:,:,jk) = fse3u_n (:,:,jk)
+            fse3v (:,:,jk) = fse3v_n (:,:,jk)
+            fse3f (:,:,jk) = fse3f_n (:,:,jk)
+            fse3w (:,:,jk) = fse3w_n (:,:,jk)
+            fse3uw(:,:,jk) = fse3uw_n(:,:,jk)
+            fse3vw(:,:,jk) = fse3vw_n(:,:,jk)
+         END DO
+      ENDIF
+
+!start new averages
+         DO jk = 1, jpk
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  un_tm(ji,jj,jk)=un(ji,jj,jk)*fse3u(ji,jj,jk)  !0.0
+                  vn_tm(ji,jj,jk)=vn(ji,jj,jk)*fse3v(ji,jj,jk)  !0.0
+                  wn_tm(ji,jj,jk)=wn(ji,jj,jk)*fse3w(ji,jj,jk)  !0.0
+                  avt_tm(ji,jj,jk)=avt(ji,jj,jk)*fse3t(ji,jj,jk)  !0.0
+#if defined key_ldfslp
+                  wslpi_tm(ji,jj,jk)= wslpi(ji,jj,jk)*fse3w(ji,jj,jk) !0. 
+                  wslpj_tm(ji,jj,jk)=wslpj(ji,jj,jk)*fse3w(ji,jj,jk) !0. 
+                  uslp_tm(ji,jj,jk)=uslp(ji,jj,jk)*fse3u(ji,jj,jk) !0. 
+                  vslp_tm(ji,jj,jk)=vslp(ji,jj,jk)*fse3v(ji,jj,jk) !0. 
+#endif
+ 	       END DO
+            END DO
+         END DO
+        sshn_tm= sshn !0.0
+        sshu_n_tm= sshu_n !0.0
+        sshv_n_tm= sshv_n !0.0
+        rnf_tm=rnf !0. 
+        h_rnf_tm=h_rnf !0
+        sshb_hold=sshn
+        sshu_b_hold=sshu_n
+        sshv_b_hold=sshv_n
+
+   END SUBROUTINE trc_sub_stp_reset
+
+  !!-------------------------------------------------------------------
+   INTEGER FUNCTION trc_sub_alloc()
+      !!-------------------------------------------------------------------
+      !!                    *** ROUTINE trc_sub_alloc ***
+      !!-------------------------------------------------------------------
+      USE lib_mpp, ONLY: ctl_warn
+      INTEGER :: ierr
+      !!-------------------------------------------------------------------
+      !
+      ALLOCATE( un_temp(jpi,jpj,jpk)        ,  vn_temp(jpi,jpj,jpk)  ,   &
+         &      wn_temp(jpi,jpj,jpk)        ,  avt_temp(jpi,jpj,jpk) ,   &
+         &      sshn_temp(jpi,jpj)          ,  sshb_temp(jpi,jpj) ,    &
+         &      ssha_temp(jpi,jpj)          ,  sshu_a_temp(jpi,jpj),    &
+         &      sshu_n_temp(jpi,jpj)        ,  sshu_b_temp(jpi,jpj),   &
+         &      sshv_n_temp(jpi,jpj)        ,  sshv_b_temp(jpi,jpj),   &
+         &      sshv_a_temp(jpi,jpj)        ,  sshf_a_temp(jpi,jpj),   &
+         &      sshf_n_temp(jpi,jpj)        ,  sshf_b_temp(jpi,jpj),   &
+#if defined key_ldfslp
+         &      wslpi_temp(jpi,jpj,jpk) ,  wslpj_temp(jpi,jpj,jpk),   &
+         &      uslp_temp(jpi,jpj,jpk)  ,  vslp_temp(jpi,jpj,jpk),   &
+#endif
+         &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,   &
+         &      hdivn_temp(jpi,jpj,jpk)     ,  hdivb_temp(jpi,jpj,jpk),    &
+         &      rotn_temp(jpi,jpj,jpk)      ,  rotb_temp(jpi,jpj,jpk),    &
+         &      hu_temp(jpi,jpj)            ,  hv_temp(jpi,jpj),    &
+         &      hur_temp(jpi,jpj)           ,  hvr_temp(jpi,jpj),    &
+         &      un_tm(jpi,jpj,jpk)          ,  vn_tm(jpi,jpj,jpk)  ,   &
+         &      wn_tm(jpi,jpj,jpk)          ,  avt_tm(jpi,jpj,jpk) ,   &
+         &      sshn_tm(jpi,jpj)            ,  sshb_hold(jpi,jpj) ,    &
+         &      sshu_n_tm(jpi,jpj)          ,  sshu_b_hold(jpi,jpj),   &
+         &      sshv_n_tm(jpi,jpj)          ,  sshv_b_hold(jpi,jpj),   &
+#if defined key_ldfslp
+         &      wslpi_tm(jpi,jpj,jpk)   ,  wslpj_tm(jpi,jpj,jpk),   &
+         &      uslp_tm(jpi,jpj,jpk)    ,  vslp_tm(jpi,jpj,jpk),   &
+#endif
+         &      rnf_tm(jpi,jpj)             ,  h_rnf_tm(jpi,jpj) ,   &
+         &                                    STAT=trc_sub_alloc )  
+      IF( trc_sub_alloc /= 0 )   CALL ctl_warn('trc_sub_alloc: failed to allocate arrays')
+
+      !
+   END FUNCTION trc_sub_alloc
+
+#else
+   !!----------------------------------------------------------------------
+   !!   Default key                                     NO passive tracers
+   !!----------------------------------------------------------------------
+CONTAINS
+   SUBROUTINE trc_sub_stp( kt )        ! Empty routine
+      WRITE(*,*) 'trc_sub_stp: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_sub_stp
+   SUBROUTINE trc_sub_stp_ini        ! Empty routine
+      WRITE(*,*) 'trc_sub_stp_ini: You should not have seen this print! error?', kt
+   END SUBROUTINE trc_sub_stp_ini
+
+#endif
+
+   !!======================================================================
+END MODULE trcsubstp
Index: /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcwri.F90
===================================================================
--- /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 2829)
+++ /branches/2011/dev_r2802_TOP_substepping/NEMOGCM/NEMO/TOP_SRC/trcwri.F90	(revision 2830)
@@ -57,5 +57,5 @@
       !!---------------------------------------------------------------------
  
-      IF( lk_offline .AND. kt == nit000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
+      IF( lk_offline .AND. kt == nittrc000 .AND. lwp ) THEN    ! WRITE root name in date.file for use by postpro
          CALL dia_nam( clhstnam, nn_writetrc,' ' )
          CALL ctl_opn( inum, 'date.file', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, numout, lwp, narea )
