Index: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdfphy.F90
===================================================================
--- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdfphy.F90	(revision 10829)
+++ NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdfphy.F90	(revision 10874)
@@ -218,5 +218,5 @@
 
 
-   SUBROUTINE zdf_phy( kt, ktlev1, ktlev2, kt2lev1, kt2lev2 )
+   SUBROUTINE zdf_phy( kt )
       !!----------------------------------------------------------------------
       !!                     ***  ROUTINE zdf_phy  ***
@@ -231,6 +231,4 @@
       !!----------------------------------------------------------------------
       INTEGER, INTENT(in) ::   kt   ! ocean time-step index
-      INTEGER, INTENT(in) ::   ktlev1, ktlev2   ! time level indices for 3-time-level source terms
-      INTEGER, INTENT(in) ::   kt2lev1, kt2lev2 ! time level indices for 2-time-level source terms
       !
       INTEGER ::   ji, jj, jk   ! dummy loop indice
@@ -256,10 +254,10 @@
       !
       IF( l_zdfsh2 )   &         !* shear production at w-points (energy conserving form)
-         CALL zdf_sh2( uu(:,:,:,ktlev1), vv(:,:,:,ktlev1), uu(:,:,:,ktlev2), vv(:,:,:,ktlev2), avm_k,   &     ! <<== in
+         CALL zdf_sh2( ub, vb, un, vn, avm_k,   &     ! <<== in
             &                           zsh2    )     ! ==>> out : shear production
       !
       SELECT CASE ( nzdf_phy )                  !* Vertical eddy viscosity and diffusivity coefficients at w-points
-      CASE( np_RIC )   ;   CALL zdf_ric( kt, gdept(:,:,:,kt2lev2), zsh2, avm_k, avt_k )    ! Richardson number dependent Kz
-      CASE( np_TKE )   ;   CALL zdf_tke( kt, ktlev1, ktlev2, kt2lev1, kt2lev2, zsh2, avm_k, avt_k )    ! TKE closure scheme for Kz
+      CASE( np_RIC )   ;   CALL zdf_ric( kt, gdept_n, zsh2, avm_k, avt_k )    ! Richardson number dependent Kz
+      CASE( np_TKE )   ;   CALL zdf_tke( kt         , zsh2, avm_k, avt_k )    ! TKE closure scheme for Kz
       CASE( np_GLS )   ;   CALL zdf_gls( kt         , zsh2, avm_k, avt_k )    ! GLS closure scheme for Kz
       CASE( np_OSM )   ;   CALL zdf_osm( kt               , avm_k, avt_k )    ! OSMOSIS closure scheme for Kz
@@ -320,5 +318,5 @@
          IF( ln_zdfgls )   CALL gls_rst( kt, 'WRITE' )
          IF( ln_zdfric )   CALL ric_rst( kt, 'WRITE' ) 
-         ! NB. OSMOSIS restart (osm_rst) will be called in step.F90 after ww has been updated
+         ! NB. OSMOSIS restart (osm_rst) will be called in step.F90 after wn has been updated
       ENDIF
       !
Index: NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdftke.F90
===================================================================
--- NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdftke.F90	(revision 10829)
+++ NEMO/branches/2019/dev_r10721_KERNEL-02_Storkey_Coward_IMMERSE_first_steps/src/OCE/ZDF/zdftke.F90	(revision 10874)
@@ -109,5 +109,5 @@
 
 
-   SUBROUTINE zdf_tke( kt, ktlev1, ktlev2, kt2lev1, kt2lev2, p_sh2, p_avm, p_avt )
+   SUBROUTINE zdf_tke( kt, p_sh2, p_avm, p_avt )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE zdf_tke  ***
@@ -155,18 +155,16 @@
       !!----------------------------------------------------------------------
       INTEGER                   , INTENT(in   ) ::   kt             ! ocean time step
-      INTEGER                   , INTENT(in   ) ::   ktlev1, ktlev2   ! time level indices for 3-time-level source terms
-      INTEGER                   , INTENT(in   ) ::   kt2lev1, kt2lev2 ! time level indices for 2-time-level source terms
       REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   p_sh2          ! shear production term
       REAL(wp), DIMENSION(:,:,:), INTENT(inout) ::   p_avm, p_avt   !  momentum and tracer Kz (w-points)
       !!----------------------------------------------------------------------
       !
-      CALL tke_tke( ktlev1, kt2lev1, kt2lev2, gdepw(:,:,:,kt2lev2), e3t(:,:,:,ktlev2), e3w(:,:,:,kt2lev2), p_sh2, p_avm, p_avt )   ! now tke (en)
-      !
-      CALL tke_avn( kt2lev2, gdepw(:,:,:,kt2lev2), e3t(:,:,:,ktlev2), e3w(:,:,:,kt2lev2),        p_avm, p_avt )   ! now avt, avm, dissl
+      CALL tke_tke( gdepw_n, e3t_n, e3w_n, p_sh2, p_avm, p_avt )   ! now tke (en)
+      !
+      CALL tke_avn( gdepw_n, e3t_n, e3w_n,        p_avm, p_avt )   ! now avt, avm, dissl
       !
   END SUBROUTINE zdf_tke
 
 
-   SUBROUTINE tke_tke( ktlev1, kt2lev1, kt2lev2, pdepw, p_e3t, p_e3w, p_sh2, p_avm, p_avt )
+   SUBROUTINE tke_tke( pdepw, p_e3t, p_e3w, p_sh2, p_avm, p_avt )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE tke_tke  ***
@@ -188,6 +186,4 @@
       USE zdf_oce , ONLY : en   ! ocean vertical physics
       !!
-      INTEGER                    , INTENT(in   ) ::   ktlev1           ! time level index for 3-time-level source terms
-      INTEGER                    , INTENT(in   ) ::   kt2lev1, kt2lev2 ! time level indices for 2-time-level source terms
       REAL(wp), DIMENSION(:,:,:) , INTENT(in   ) ::   pdepw          ! depth of w-points
       REAL(wp), DIMENSION(:,:,:) , INTENT(in   ) ::   p_e3t, p_e3w   ! level thickness (t- & w-points)
@@ -247,6 +243,6 @@
                zmskv = ( 2. - vmask(ji,jj-1,mbkt(ji,jj)) * vmask(ji,jj,mbkt(ji,jj)) )
                !                       ! where 0.001875 = (rn_ebb0/rau0) * 0.5 = 3.75*0.5/1000. (CAUTION CdU<0)
-               zebot = - 0.001875_wp * rCdU_bot(ji,jj) * SQRT(  ( zmsku*( uu(ji,jj,mbkt(ji,jj),ktlev1)+uu(ji-1,jj,mbkt(ji,jj),ktlev1) ) )**2  &
-                  &                                           + ( zmskv*( vv(ji,jj,mbkt(ji,jj),ktlev1)+vv(ji,jj-1,mbkt(ji,jj),ktlev1) ) )**2  )
+               zebot = - 0.001875_wp * rCdU_bot(ji,jj) * SQRT(  ( zmsku*( ub(ji,jj,mbkt(ji,jj))+ub(ji-1,jj,mbkt(ji,jj)) ) )**2  &
+                  &                                           + ( zmskv*( vb(ji,jj,mbkt(ji,jj))+vb(ji,jj-1,mbkt(ji,jj)) ) )**2  )
                en(ji,jj,mbkt(ji,jj)+1) = MAX( zebot, rn_emin ) * ssmask(ji,jj)
             END DO
@@ -258,6 +254,6 @@
                   zmskv = ( 2. - vmask(ji,jj-1,mikt(ji,jj)) * vmask(ji,jj,mikt(ji,jj)) )
                   !                             ! where 0.001875 = (rn_ebb0/rau0) * 0.5 = 3.75*0.5/1000.  (CAUTION CdU<0)
-                  zetop = - 0.001875_wp * rCdU_top(ji,jj) * SQRT(  ( zmsku*( uu(ji,jj,mikt(ji,jj),ktlev1)+uu(ji-1,jj,mikt(ji,jj),ktlev1) ) )**2  &
-                     &                                           + ( zmskv*( vv(ji,jj,mikt(ji,jj),ktlev1)+vv(ji,jj-1,mikt(ji,jj),ktlev1) ) )**2  )
+                  zetop = - 0.001875_wp * rCdU_top(ji,jj) * SQRT(  ( zmsku*( ub(ji,jj,mikt(ji,jj))+ub(ji-1,jj,mikt(ji,jj)) ) )**2  &
+                     &                                           + ( zmskv*( vb(ji,jj,mikt(ji,jj))+vb(ji,jj-1,mikt(ji,jj)) ) )**2  )
                   en(ji,jj,mikt(ji,jj)) = MAX( zetop, rn_emin ) * (1._wp - tmask(ji,jj,1))   ! masked at ocean surface
                END DO
@@ -272,7 +268,7 @@
          !
          !                        !* total energy produce by LC : cumulative sum over jk
-         zpelc(:,:,1) =  MAX( r_n2(:,:,1,kt2lev1), 0._wp ) * pdepw(:,:,1) * p_e3w(:,:,1)
+         zpelc(:,:,1) =  MAX( rn2b(:,:,1), 0._wp ) * pdepw(:,:,1) * p_e3w(:,:,1)
          DO jk = 2, jpk
-            zpelc(:,:,jk)  = zpelc(:,:,jk-1) + MAX( r_n2(:,:,jk,kt2lev1), 0._wp ) * pdepw(:,:,jk) * p_e3w(:,:,jk)
+            zpelc(:,:,jk)  = zpelc(:,:,jk-1) + MAX( rn2b(:,:,jk), 0._wp ) * pdepw(:,:,jk) * p_e3w(:,:,jk)
          END DO
          !                        !* finite Langmuir Circulation depth
@@ -331,5 +327,5 @@
                DO ji = 2, jpim1
                   !                             ! local Richardson number
-                  zri = MAX( r_n2(ji,jj,jk,kt2lev1), 0._wp ) * p_avm(ji,jj,jk) / ( p_sh2(ji,jj,jk) + rn_bshear )
+                  zri = MAX( rn2b(ji,jj,jk), 0._wp ) * p_avm(ji,jj,jk) / ( p_sh2(ji,jj,jk) + rn_bshear )
                   !                             ! inverse of Prandtl number
                   apdlr(ji,jj,jk) = MAX(  0.1_wp,  ri_cri / MAX( ri_cri , zri )  )
@@ -356,5 +352,5 @@
                !                                   ! right hand side in en
                en(ji,jj,jk) = en(ji,jj,jk) + rdt * (  p_sh2(ji,jj,jk)                          &   ! shear
-                  &                                 - p_avt(ji,jj,jk) * r_n2(ji,jj,jk,kt2lev2)          &   ! stratification
+                  &                                 - p_avt(ji,jj,jk) * rn2(ji,jj,jk)          &   ! stratification
                   &                                 + zfact3 * dissl(ji,jj,jk) * en(ji,jj,jk)  &   ! dissipation
                   &                                ) * wmask(ji,jj,jk)
@@ -445,5 +441,5 @@
 
 
-   SUBROUTINE tke_avn( kt2lev2, pdepw, p_e3t, p_e3w, p_avm, p_avt )
+   SUBROUTINE tke_avn( pdepw, p_e3t, p_e3w, p_avm, p_avt )
       !!----------------------------------------------------------------------
       !!                   ***  ROUTINE tke_avn  ***
@@ -481,5 +477,4 @@
       USE zdf_oce , ONLY : en, avtb, avmb, avtb_2d   ! ocean vertical physics
       !!
-      INTEGER                   , INTENT(in   ) ::   kt2lev2        ! time level index for 2-time-level source terms
       REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   pdepw          ! depth (w-points)
       REAL(wp), DIMENSION(:,:,:), INTENT(in   ) ::   p_e3t, p_e3w   ! level thickness (t- & w-points)
@@ -517,5 +512,5 @@
          DO jj = 2, jpjm1
             DO ji = fs_2, fs_jpim1   ! vector opt.
-               zrn2 = MAX( r_n2(ji,jj,jk,kt2lev2), rsmall )
+               zrn2 = MAX( rn2(ji,jj,jk), rsmall )
                zmxlm(ji,jj,jk) = MAX(  rmxl_min,  SQRT( 2._wp * en(ji,jj,jk) / zrn2 )  )
             END DO
