Index: branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 6059)
+++ branches/2015/dev_merge_2015/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 6060)
@@ -56,5 +56,4 @@
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
-#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OPA 4.0 , NEMO Consortium (2011)
@@ -111,5 +110,5 @@
          CALL wrk_alloc( jpi, jpj, zbfrt, ztfrt )
 
-         IF ( ln_loglayer.AND.lk_vvl ) THEN ! "log layer" bottom friction coefficient
+         IF ( ln_loglayer.AND. .NOT.ln_linssh ) THEN ! "log layer" bottom friction coefficient
 
             DO jj = 1, jpj
@@ -117,5 +116,5 @@
                   ikbt = mbkt(ji,jj)
 !! JC: possible WAD implementation should modify line below if layers vanish
-                  ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * fse3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
+                  ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * e3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
                   zbfrt(ji,jj) = MAX(bfrcoef2d(ji,jj), ztmp)
                   zbfrt(ji,jj) = MIN(zbfrt(ji,jj), rn_bfri2_max)
@@ -128,5 +127,5 @@
                      ikbt = mikt(ji,jj)
 ! JC: possible WAD implementation should modify line below if layers vanish
-                     ztmp = (1-tmask(ji,jj,1)) * ( vkarmn / LOG( 0.5_wp * fse3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
+                     ztmp = (1.-tmask(ji,jj,1)) * ( vkarmn / LOG( 0.5_wp * e3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
                      ztfrt(ji,jj) = MAX(tfrcoef2d(ji,jj), ztmp)
                      ztfrt(ji,jj) = MIN(ztfrt(ji,jj), rn_tfri2_max)
@@ -134,5 +133,5 @@
                END DO
             END IF
-         !   
+            !   
          ELSE
             zbfrt(:,:) = bfrcoef2d(:,:)
@@ -158,20 +157,20 @@
                ! in case of 2 cell water column, we assume each cell feels the top and bottom friction
                IF ( ln_isfcav ) THEN
-                  IF ( miku(ji,jj) + 1 .GE. mbku(ji,jj) ) THEN
+                  IF ( miku(ji,jj) + 1  >=  mbku(ji,jj) ) THEN
                      bfrua(ji,jj) = - 0.5_wp * ( ( zbfrt(ji,jj) + zbfrt(ji+1,jj  ) )   &
                                   &            + ( ztfrt(ji,jj) + ztfrt(ji+1,jj  ) ) ) &
                                   &          * zecu * (1._wp - umask(ji,jj,1))
-                  END IF
-                  IF ( mikv(ji,jj) + 1 .GE. mbkv(ji,jj) ) THEN
+                  ENDIF
+                  IF( mikv(ji,jj) + 1  >=  mbkv(ji,jj) ) THEN
                      bfrva(ji,jj) = - 0.5_wp * ( ( zbfrt(ji,jj) + zbfrt(ji  ,jj+1) )   &
                                   &            + ( ztfrt(ji,jj) + ztfrt(ji  ,jj+1) ) ) &
                                   &          * zecv * (1._wp - vmask(ji,jj,1))
-                  END IF
-               END IF
+                  ENDIF
+               ENDIF
             END DO
          END DO
          CALL lbc_lnk( bfrua, 'U', 1. )   ;   CALL lbc_lnk( bfrva, 'V', 1. )      ! Lateral boundary condition
 
-         IF ( ln_isfcav ) THEN
+         IF( ln_isfcav ) THEN
             DO jj = 2, jpjm1
                DO ji = 2, jpim1
@@ -371,9 +370,9 @@
          END IF
          !
-         IF ( ln_loglayer.AND.(.NOT.lk_vvl) ) THEN ! set "log layer" bottom friction once for all
+         IF( ln_loglayer.AND. ln_linssh ) THEN ! set "log layer" bottom friction once for all
             DO jj = 1, jpj
                DO ji = 1, jpi
                   ikbt = mbkt(ji,jj)
-                  ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * fse3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
+                  ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * e3t_n(ji,jj,ikbt) / rn_bfrz0 ))**2._wp
                   bfrcoef2d(ji,jj) = MAX(bfrcoef2d(ji,jj), ztmp)
                   bfrcoef2d(ji,jj) = MIN(bfrcoef2d(ji,jj), rn_bfri2_max)
@@ -384,5 +383,5 @@
                   DO ji = 1, jpi
                      ikbt = mikt(ji,jj)
-                     ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * fse3t_n(ji,jj,ikbt) / rn_tfrz0 ))**2._wp
+                     ztmp = tmask(ji,jj,ikbt) * ( vkarmn / LOG( 0.5_wp * e3t_n(ji,jj,ikbt) / rn_tfrz0 ))**2._wp
                      tfrcoef2d(ji,jj) = MAX(tfrcoef2d(ji,jj), ztmp)
                      tfrcoef2d(ji,jj) = MIN(tfrcoef2d(ji,jj), rn_tfri2_max)
@@ -424,6 +423,6 @@
              ikbu = mbku(ji,jj)       ! deepest ocean level at u- and v-points
              ikbv = mbkv(ji,jj)
-             zfru = 0.5 * fse3u(ji,jj,ikbu) / rdt
-             zfrv = 0.5 * fse3v(ji,jj,ikbv) / rdt
+             zfru = 0.5 * e3u_n(ji,jj,ikbu) / rdt
+             zfrv = 0.5 * e3v_n(ji,jj,ikbv) / rdt
              IF( ABS( bfrcoef2d(ji,jj) ) > zfru ) THEN
                 IF( ln_ctl ) THEN
@@ -446,6 +445,6 @@
                 ikbu = miku(ji,jj)       ! 1st wet ocean level at u- and v-points
                 ikbv = mikv(ji,jj)
-                zfru = 0.5 * fse3u(ji,jj,ikbu) / rdt
-                zfrv = 0.5 * fse3v(ji,jj,ikbv) / rdt
+                zfru = 0.5 * e3u_n(ji,jj,ikbu) / rdt
+                zfrv = 0.5 * e3v_n(ji,jj,ikbv) / rdt
                 IF( ABS( tfrcoef2d(ji,jj) ) > zfru ) THEN
                    IF( ln_ctl ) THEN
