Index: NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DYN/dynspg_ts.F90
===================================================================
--- NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DYN/dynspg_ts.F90	(revision 13427)
+++ NEMO/branches/2020/dev_r13327_KERNEL-06_2_techene_e3/src/OCE/DYN/dynspg_ts.F90	(revision 13696)
@@ -1119,5 +1119,5 @@
       !! although they should be updated in the variable volume case. Not a big approximation.
       !! To remove this approximation, copy lines below inside barotropic loop
-      !! and update depths at T-F points (ht and zhf resp.) at each barotropic time step
+      !! and update depths at T- points (ht) at each barotropic time step
       !!
       !! Compute zwz = f / ( height of the water colomn )
@@ -1126,12 +1126,11 @@
       INTEGER  ::   ji ,jj, jk              ! dummy loop indices
       REAL(wp) ::   z1_ht
-      REAL(wp), DIMENSION(jpi,jpj) :: zhf
       !!----------------------------------------------------------------------
       !
       SELECT CASE( nvor_scheme )
-      CASE( np_EEN )                != EEN scheme using e3f energy & enstrophy scheme
-         SELECT CASE( nn_een_e3f )              !* ff_f/e3 at F-point
+      CASE( np_EEN, np_ENE, np_ENS , np_MIX )   !=  schemes using the same e3f definition
+         SELECT CASE( nn_e3f_typ )                  !* ff_f/e3 at F-point
          CASE ( 0 )                                   ! original formulation  (masked averaging of e3t divided by 4)
-            DO_2D( 1, 0, 1, 0 )
+            DO_2D( 0, 0, 0, 0 )
                zwz(ji,jj) = ( ht(ji,jj+1) + ht(ji+1,jj+1)   &
                     &       + ht(ji,jj  ) + ht(ji+1,jj  ) ) * 0.25_wp  
@@ -1139,5 +1138,5 @@
             END_2D
          CASE ( 1 )                                   ! new formulation  (masked averaging of e3t divided by the sum of mask)
-            DO_2D( 1, 0, 1, 0 )
+            DO_2D( 0, 0, 0, 0 )
                zwz(ji,jj) =     (    ht(ji,jj+1) +     ht(ji+1,jj+1)      &
                     &            +   ht(ji,jj  ) +     ht(ji+1,jj  )  )   &
@@ -1148,4 +1147,8 @@
          END SELECT
          CALL lbc_lnk( 'dynspg_ts', zwz, 'F', 1._wp )
+      END SELECT
+      !
+      SELECT CASE( nvor_scheme )
+      CASE( np_EEN )
          !
          ftne(1,:) = 0._wp   ;   ftnw(1,:) = 0._wp   ;   ftse(1,:) = 0._wp   ;   ftsw(1,:) = 0._wp
@@ -1157,5 +1160,5 @@
          END_2D
          !
-      CASE( np_EET )                  != EEN scheme using e3t energy conserving scheme
+      CASE( np_EET )                            != EEN scheme using e3t energy conserving scheme
          ftne(1,:) = 0._wp   ;   ftnw(1,:) = 0._wp   ;   ftse(1,:) = 0._wp   ;   ftsw(1,:) = 0._wp
          DO_2D( 0, 1, 0, 1 )
@@ -1167,56 +1170,7 @@
          END_2D
          !
-      CASE( np_ENE, np_ENS , np_MIX )  != all other schemes (ENE, ENS, MIX) except ENT !
-         !
-         zwz(:,:) = 0._wp
-         zhf(:,:) = 0._wp
-         
-         !!gm  assume 0 in both cases (which is almost surely WRONG ! ) as hvatf has been removed 
-!!gm    A priori a better value should be something like :
-!!gm          zhf(i,j) = masked sum of  ht(i,j) , ht(i+1,j) , ht(i,j+1) , (i+1,j+1) 
-!!gm                     divided by the sum of the corresponding mask 
-!!gm 
-!!            
-         IF( .NOT.ln_sco ) THEN
-  
-   !!gm  agree the JC comment  : this should be done in a much clear way
-  
-   ! JC: It not clear yet what should be the depth at f-points over land in z-coordinate case
-   !     Set it to zero for the time being 
-   !              IF( rn_hmin < 0._wp ) THEN    ;   jk = - INT( rn_hmin )                                      ! from a nb of level
-   !              ELSE                          ;   jk = MINLOC( gdepw_0, mask = gdepw_0 > rn_hmin, dim = 1 )  ! from a depth
-   !              ENDIF
-   !              zhf(:,:) = gdepw_0(:,:,jk+1)
-            !
-         ELSE
-            !
-            !zhf(:,:) = hbatf(:,:)
-            DO_2D( 1, 0, 1, 0 )
-               zhf(ji,jj) =    (   ht_0  (ji,jj  ) + ht_0  (ji+1,jj  )          &
-                    &            + ht_0  (ji,jj+1) + ht_0  (ji+1,jj+1)   )      &
-                    &     / MAX(   ssmask(ji,jj  ) + ssmask(ji+1,jj  )          &
-                    &            + ssmask(ji,jj+1) + ssmask(ji+1,jj+1) , 1._wp  )
-            END_2D
-         ENDIF
-         !
-         DO jj = 1, jpjm1   ! keep only the value at the coast if sco
-            zhf(:,jj) = zhf(:,jj) * (1._wp- umask(:,jj,1) * umask(:,jj+1,1))
-         END DO
-         !
-         DO jk = 1, jpkm1   ! ocean point : sum of masked e3f
-            DO jj = 1, jpjm1
-               zhf(:,jj) = zhf(:,jj) + e3f(:,jj,jk) * umask(:,jj,jk) * umask(:,jj+1,jk)
-            END DO
-         END DO
-         CALL lbc_lnk( 'dynspg_ts', zhf, 'F', 1._wp )
-         ! JC: TBC. hf should be greater than 0 
-         DO_2D( 1, 1, 1, 1 )
-            IF( zhf(ji,jj) /= 0._wp )   zwz(ji,jj) = 1._wp / zhf(ji,jj)
-         END_2D
-         zwz(:,:) = ff_f(:,:) * zwz(:,:)
       END SELECT
       
    END SUBROUTINE dyn_cor_2d_init
-
 
 
@@ -1412,5 +1366,4 @@
    END SUBROUTINE wad_spg
      
-
 
    SUBROUTINE dyn_drg_init( Kbb, Kmm, puu, pvv, puu_b ,pvv_b, pu_RHSi, pv_RHSi, pCdU_u, pCdU_v )
