Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 5866)
@@ -34,6 +34,5 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F)
-   ln_sco      = .true.    !  s- or hybrid z-s-coordinate    (T/F)
+   ln_sco      = .true.    !  s- or hybrid z-s-coordinate
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm	(revision 5866)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys  key_bdy key_tide key_dynspg_ts  key_zdfgls  key_vvl key_diainstant key_mpp_mpi key_iomput
+ bld::tool::fppkeys  key_bdy key_tide key_dynspg_ts  key_zdfgls key_diainstant key_mpp_mpi key_iomput
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 5866)
@@ -30,4 +30,5 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE/EXP00/namelist_cfg	(revision 5866)
@@ -32,6 +32,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .true.    !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
-   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F)
+   ln_zco      = .true.    !  z-coordinate - full    steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 5866)
@@ -35,6 +35,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .true.    !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
-   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F)
+   ln_zco      = .true.    !  z-coordinate - full    steps
+   ln_linssh   = .true.   !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 5866)
@@ -29,6 +29,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .true.    !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
-   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F)
+   ln_zco      = .true.    !  z-coordinate - full    steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/GYRE_XIOS/EXP00/namelist_cfg	(revision 5866)
@@ -29,6 +29,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .true.    !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
-   ln_zps      = .false.   !  z-coordinate - partial steps   (T/F)
+   ln_zco      = .true.    !  z-coordinate - full    steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/1_namelist_cfg	(revision 5866)
@@ -29,4 +29,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/EXP00/namelist_cfg	(revision 5866)
@@ -6,4 +6,8 @@
 &namrun        !   parameters of the run
 !-----------------------------------------------------------------------
+   nn_no       =       0   !  job number (no more used...)
+   cn_exp      =  "ORCA2"  !  experience name
+   nn_it000    =       1   !  first time step
+   nn_itend    =     300   !  last  time step (std 5475)
 /
 !-----------------------------------------------------------------------
@@ -24,4 +28,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
@@ -181,5 +187,5 @@
    ln_dynvor_mix = .false. !  mixed scheme
    ln_dynvor_een = .true.  !  energy & enstrophy scheme
-      nn_een_e3f = 1             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)
+      nn_een_e3f = 0             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM/cpp_ORCA2_LIM.fcm	(revision 5866)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_trabbl key_lim2 key_dynspg_flt key_zdftke key_zdfddm key_zdftmx  key_mpp_mpi key_iomput
+bld::tool::fppkeys key_trabbl key_lim2 key_dynspg_flt key_zdftke key_zdfddm key_zdftmx  key_mpp_mpi key_iomput key_nosignedzero
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/1_namelist_cfg	(revision 5866)
@@ -28,4 +28,5 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/EXP00/namelist_cfg	(revision 5866)
@@ -6,4 +6,8 @@
 &namrun        !   parameters of the run
 !-----------------------------------------------------------------------
+   nn_no       =       0   !  job number (no more used...)
+   cn_exp      =  "ORCA2"  !  experience name
+   nn_it000    =       1   !  first time step
+   nn_itend    =     300   !  last  time step (std 5475)
 /
 !-----------------------------------------------------------------------
@@ -24,4 +28,5 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/cpp_ORCA2_LIM3.fcm
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/cpp_ORCA2_LIM3.fcm	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM3/cpp_ORCA2_LIM3.fcm	(revision 5866)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_trabbl key_lim3 key_vvl key_dynspg_ts key_zdftke key_zdfddm key_zdftmx  key_mpp_mpi key_diaobs key_asminc key_iomput key_nosignedzero
+ bld::tool::fppkeys key_trabbl key_lim3 key_dynspg_ts key_zdftke key_zdfddm key_zdftmx  key_mpp_mpi key_diaobs key_asminc key_iomput key_nosignedzero
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/1_namelist_cfg	(revision 5866)
@@ -59,7 +59,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .false.   !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
    ln_zps      = .true.    !  z-coordinate - partial steps   (T/F)
-   ln_sco      = .false.   !  s- or hybrid z-s-coordinate    (T/F)
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_CFC_C14b/EXP00/namelist_cfg	(revision 5866)
@@ -31,4 +31,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_LIM_PISCES/EXP00/namelist_cfg	(revision 5866)
@@ -24,4 +24,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 5866)
@@ -27,4 +27,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zps      = .true.    !  z-coordinate - partial steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/ORCA2_SAS_LIM/EXP00/namelist_cfg	(revision 5866)
@@ -26,4 +26,6 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
+   ln_zco      = .true.    !  z-coordinate - full    steps
+   ln_linssh   = .true.    !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 5866)
@@ -89,8 +89,9 @@
 &namzgr        !   vertical coordinate
 !-----------------------------------------------------------------------
-   ln_zco      = .false.   !  z-coordinate - full    steps   (T/F)      ("key_zco" may also be defined)
-   ln_zps      = .true.    !  z-coordinate - partial steps   (T/F)
-   ln_sco      = .false.   !  s- or hybrid z-s-coordinate    (T/F)
-   ln_isfcav   = .false.   !  ice shelf cavity               (T/F)
+   ln_zco      = .false.   !  z-coordinate - full    steps
+   ln_zps      = .false.   !  z-coordinate - partial steps
+   ln_sco      = .false.   !  s- or hybrid z-s-coordinate
+   ln_isfcav   = .false.   !  ice shelf cavity
+   ln_linssh   = .false.   !  linear free surface
 /
 !-----------------------------------------------------------------------
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_2/limsbc_2.F90	(revision 5866)
@@ -469,41 +469,37 @@
          sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0
          sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
-!!gm  like for lim3 :
-#if defined key_vvl            
+!!gm I really don't like this staff here...  Find a way to put that elsewhere or differently
 !!gm
-         do jk = 1,jpkm1                     ! adjust initial vertical scale factors
-          e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-          e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-         end do
-         e3t_a(:,:,:) = e3t_b(:,:,:)
-         ! Reconstruction of all vertical scale factors at now and before time steps
-         ! =============================================================================
-         ! Horizontal scale factor interpolations
-         ! --------------------------------------
-         CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
-         CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
-         CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
-         CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
-         CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
-         ! Vertical scale factor interpolations
-         ! ------------------------------------
-         CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
-         CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
-         CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
-         CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
-         CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
-         ! t- and w- points depth
-         ! ----------------------
-         gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
-         gdepw_n(:,:,1) = 0.0_wp
-         gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
-         DO jk = 2, jpk
-            gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
-            gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
-            gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
-         END DO
-!!gm
-#endif
-!!gm
+         IF( .NOT. ln_linssh ) THEN
+
+            do jk = 1,jpkm1                     ! adjust initial vertical scale factors
+               e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+               e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+            end do
+            e3t_a(:,:,:) = e3t_b(:,:,:)
+            ! Reconstruction of all vertical scale factors at now and before time steps
+            !        ! Horizontal scale factor interpolations
+            CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
+            CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
+            CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
+            CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
+            CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
+            !        ! Vertical scale factor interpolations
+            CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
+            CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
+            CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
+            CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
+            CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
+            !        ! t- and w- points depth
+            gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
+            gdepw_n(:,:,1) = 0.0_wp
+            gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
+            DO jk = 2, jpk
+               gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
+               gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
+               gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
+            END DO
+         ENDIF
+!!gm end
       ENDIF
       !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/LIM_SRC_3/limsbc.F90	(revision 5866)
@@ -335,45 +335,43 @@
             sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
 
-#if defined key_vvl            
-!!gm key_vvl necessary? clem: yes for compilation purpose
 !!gm I really don't like this staff here...  Find a way to put that elsewhere or differently
-            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
-               e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-               e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-            END DO
-            e3t_a(:,:,:) = e3t_b(:,:,:)
-            ! Reconstruction of all vertical scale factors at now and before time
-            ! steps
-            ! =============================================================================
-            ! Horizontal scale factor interpolations
-            ! --------------------------------------
-            CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
-            CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
-            CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
-            ! Vertical scale factor interpolations
-            ! ------------------------------------
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
-            CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
-            CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
-            CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
-            CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
-            ! t- and w- points depth
-            ! ----------------------
+!!gm
+            IF( .NOT.ln_linssh ) THEN
+               DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
+                  e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+                  e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+               END DO
+               e3t_a(:,:,:) = e3t_b(:,:,:)
+               ! Reconstruction of all vertical scale factors at now and before time-steps
+               ! =========================================================================
+               ! Horizontal scale factor interpolations
+               ! --------------------------------------
+               CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
+               CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
+               CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
+               ! Vertical scale factor interpolations
+                 ! ------------------------------------
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
+               CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
+               CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
+               CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
+               CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
+               ! t- and w- points depth
+               ! ----------------------
 !!gm not sure of that....
-            gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
-            gdepw_n(:,:,1) = 0.0_wp
-            gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
-            DO jk = 2, jpk
-               gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
-               gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
-               gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
-            END DO
-#endif
+               gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
+               gdepw_n(:,:,1) = 0.0_wp
+               gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
+               DO jk = 2, jpk
+                  gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
+                  gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
+                  gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
+               END DO
+            ENDIF
          ENDIF
       ENDIF ! .NOT. ln_rstart
       !
-
    END SUBROUTINE lim_sbc_init
 
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ASM/asminc.F90	(revision 5866)
@@ -870,5 +870,5 @@
             sshb(:,:) = sshn(:,:)                        ! Update before fields
             !
-            IF( lk_vvl ) THEN
+            IF( .NOT.ln_linssh ) THEN
                DO jk = 1, jpk
                   e3t_b(:,:,jk) = e3t_n(:,:,jk)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/BDY/bdyini.F90	(revision 5866)
@@ -1310,6 +1310,6 @@
       ! Compute total lateral surface for volume correction:
       ! ----------------------------------------------------
-      ! JC: this must be done at each time step with key_vvl
-      bdysurftot = 0.e0 
+      ! JC: this must be done at each time step with non-linear free surface
+      bdysurftot = 0._wp 
       IF( ln_vol ) THEN  
          igrd = 2      ! Lateral surface at U-points
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/CRS/crsini.F90	(revision 5866)
@@ -12,5 +12,5 @@
    USE par_kind, ONLY: wp
    USE par_oce                  ! For parameter jpi,jpj,jphgr_msh
-   USE dom_oce                  ! For parameters in par_oce (jperio, lk_vvl)
+   USE dom_oce                  ! For parameters in par_oce
    USE crs                      ! Coarse grid domain
    USE phycst, ONLY: omega, rad ! physical constants
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 5866)
@@ -103,5 +103,5 @@
          zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
       END DO
-      IF( .NOT.lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          IF ( ln_isfcav ) THEN
             DO ji=1,jpi
@@ -129,5 +129,5 @@
          zbotpres(:,:) = zbotpres(:,:) + e3t_n(:,:,jk) * zrhd(:,:,jk)
       END DO
-      IF( .NOT.lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          IF ( ln_isfcav ) THEN
             DO ji=1,jpi
@@ -163,5 +163,5 @@
          END DO
       END DO
-      IF( .NOT.lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          IF ( ln_isfcav ) THEN
             DO ji=1,jpi
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diadct.F90	(revision 5866)
@@ -1,108 +1,103 @@
 MODULE diadct
-  !!=====================================================================
-  !!                       ***  MODULE  diadct  ***
-  !! Ocean diagnostics: Compute the transport trough a sec.
-  !!===============================================================
-  !! History : 
-  !!
-  !!         original  : 02/99 (Y Drillet)
-  !!         addition  : 10/01 (Y Drillet, R Bourdalle Badie)
-  !!                   : 10/05 (M Laborie) F90
-  !!         addition  : 04/07 (G Garric) Ice sections
-  !!         bugfix    : 04/07 (C Bricaud) test on sec%nb_point
-  !!                                      initialisation of ztransp1,ztransp2,...
-  !!         nemo_v_3_4: 09/2011 (C Bricaud)
-  !!
-  !!
-  !!----------------------------------------------------------------------
+   !!======================================================================
+   !!                       ***  MODULE  diadct  ***
+   !! Ocean diagnostics: Compute the transport trough a sec.
+   !!======================================================================
+   !! History :  OPA  ! 02/1999 (Y Drillet)  original code
+   !!                 ! 10/2001 (Y Drillet, R Bourdalle Badie)
+   !!   NEMO     1.0  ! 10/2005 (M Laborie) F90
+   !!            3.0  ! 04/2007 (G Garric) Ice sections
+   !!             -   ! 04/2007 (C Bricaud) test on sec%nb_point, initialisation of ztransp1,ztransp2,...
+   !!            3.4  ! 09/2011 (C Bricaud)
+   !!----------------------------------------------------------------------
 #if defined key_diadct
-  !!----------------------------------------------------------------------
-  !!   'key_diadct' :
-  !!----------------------------------------------------------------------
-  !!----------------------------------------------------------------------
-  !!   dia_dct      :  Compute the transport through a sec.
-  !!   dia_dct_init :  Read namelist.
-  !!   readsec      :  Read sections description and pathway
-  !!   removepoints :  Remove points which are common to 2 procs
-  !!   transport    :  Compute transport for each sections
-  !!   dia_dct_wri  :  Write tranports results in ascii files
-  !!   interp       :  Compute temperature/salinity/density at U-point or V-point
-  !!   
-  !!----------------------------------------------------------------------
-  USE oce             ! ocean dynamics and tracers
-  USE dom_oce         ! ocean space and time domain
-  USE phycst          ! physical constants
-  USE in_out_manager  ! I/O manager
-  USE daymod          ! calendar
-  USE dianam          ! build name of file
-  USE lib_mpp         ! distributed memory computing library
+   !!----------------------------------------------------------------------
+   !!   'key_diadct' :
+   !!----------------------------------------------------------------------
+   !!----------------------------------------------------------------------
+   !!   dia_dct      :  Compute the transport through a sec.
+   !!   dia_dct_init :  Read namelist.
+   !!   readsec      :  Read sections description and pathway
+   !!   removepoints :  Remove points which are common to 2 procs
+   !!   transport    :  Compute transport for each sections
+   !!   dia_dct_wri  :  Write tranports results in ascii files
+   !!   interp       :  Compute temperature/salinity/density at U-point or V-point
+   !!   
+   !!----------------------------------------------------------------------
+   USE oce             ! ocean dynamics and tracers
+   USE dom_oce         ! ocean space and time domain
+   USE phycst          ! physical constants
+   USE in_out_manager  ! I/O manager
+   USE daymod          ! calendar
+   USE dianam          ! build name of file
+   USE lib_mpp         ! distributed memory computing library
 #if defined key_lim2
-  USE ice_2
+   USE ice_2
 #endif
 #if defined key_lim3
-  USE ice
+   USE ice
 #endif
-  USE domvvl
-  USE timing          ! preformance summary
-  USE wrk_nemo        ! working arrays
-
-  IMPLICIT NONE
-  PRIVATE
-
-  PUBLIC   dia_dct      ! routine called by step.F90
-  PUBLIC   dia_dct_init ! routine called by opa.F90
-  PUBLIC   diadct_alloc ! routine called by nemo_init in nemogcm.F90 
-  PRIVATE  readsec
-  PRIVATE  removepoints
-  PRIVATE  transport
-  PRIVATE  dia_dct_wri
-
-  LOGICAL, PUBLIC, PARAMETER ::   lk_diadct = .TRUE.   !: model-data diagnostics flag
-
-  INTEGER :: nn_dct        ! Frequency of computation
-  INTEGER :: nn_dctwri     ! Frequency of output
-  INTEGER :: nn_secdebug   ! Number of the section to debug
+   USE domvvl
+   USE timing          ! preformance summary
+   USE wrk_nemo        ! working arrays
+
+   IMPLICIT NONE
+   PRIVATE
+
+   PUBLIC   dia_dct      ! routine called by step.F90
+   PUBLIC   dia_dct_init ! routine called by opa.F90
+   PUBLIC   diadct_alloc ! routine called by nemo_init in nemogcm.F90 
+   PRIVATE  readsec
+   PRIVATE  removepoints
+   PRIVATE  transport
+   PRIVATE  dia_dct_wri
+
+   LOGICAL, PUBLIC, PARAMETER ::   lk_diadct = .TRUE.   !: model-data diagnostics flag
+
+   INTEGER :: nn_dct        ! Frequency of computation
+   INTEGER :: nn_dctwri     ! Frequency of output
+   INTEGER :: nn_secdebug   ! Number of the section to debug
    
-  INTEGER, PARAMETER :: nb_class_max  = 10
-  INTEGER, PARAMETER :: nb_sec_max    = 150
-  INTEGER, PARAMETER :: nb_point_max  = 2000
-  INTEGER, PARAMETER :: nb_type_class = 10
-  INTEGER, PARAMETER :: nb_3d_vars    = 3 
-  INTEGER, PARAMETER :: nb_2d_vars    = 2 
-  INTEGER            :: nb_sec 
-
-  TYPE POINT_SECTION
-     INTEGER :: I,J
-  END TYPE POINT_SECTION
-
-  TYPE COORD_SECTION
-     REAL(wp) :: lon,lat
-  END TYPE COORD_SECTION
-
-  TYPE SECTION
-     CHARACTER(len=60)                            :: name              ! name of the sec
-     LOGICAL                                      :: llstrpond         ! true if you want the computation of salt and
+   INTEGER, PARAMETER :: nb_class_max  = 10
+   INTEGER, PARAMETER :: nb_sec_max    = 150
+   INTEGER, PARAMETER :: nb_point_max  = 2000
+   INTEGER, PARAMETER :: nb_type_class = 10
+   INTEGER, PARAMETER :: nb_3d_vars    = 3 
+   INTEGER, PARAMETER :: nb_2d_vars    = 2 
+   INTEGER            :: nb_sec 
+
+   TYPE POINT_SECTION
+      INTEGER :: I,J
+   END TYPE POINT_SECTION
+
+   TYPE COORD_SECTION
+      REAL(wp) :: lon,lat
+   END TYPE COORD_SECTION
+
+   TYPE SECTION
+      CHARACTER(len=60)                            :: name              ! name of the sec
+      LOGICAL                                      :: llstrpond         ! true if you want the computation of salt and
                                                                        ! heat transports
-     LOGICAL                                      :: ll_ice_section    ! ice surface and ice volume computation
-     LOGICAL                                      :: ll_date_line      ! = T if the section crosses the date-line
-     TYPE(COORD_SECTION), DIMENSION(2)            :: coordSec          ! longitude and latitude of the extremities of the sec
-     INTEGER                                      :: nb_class          ! number of boundaries for density classes
-     INTEGER, DIMENSION(nb_point_max)             :: direction         ! vector direction of the point in the section
-     CHARACTER(len=40),DIMENSION(nb_class_max)    :: classname         ! characteristics of the class
-     REAL(wp), DIMENSION(nb_class_max)            :: zsigi           ,&! in-situ   density classes    (99 if you don't want)
-                                                     zsigp           ,&! potential density classes    (99 if you don't want)
-                                                     zsal            ,&! salinity classes   (99 if you don't want)
-                                                     ztem            ,&! temperature classes(99 if you don't want)
-                                                     zlay              ! level classes      (99 if you don't want)
-     REAL(wp), DIMENSION(nb_type_class,nb_class_max)  :: transport     ! transport output
-     REAL(wp)                                         :: slopeSection  ! slope of the section
-     INTEGER                                          :: nb_point      ! number of points in the section
-     TYPE(POINT_SECTION),DIMENSION(nb_point_max)      :: listPoint     ! list of points in the sections
-  END TYPE SECTION
-
-  TYPE(SECTION),DIMENSION(nb_sec_max) :: secs ! Array of sections
- 
-  REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::  transports_3d 
-  REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::  transports_2d  
+      LOGICAL                                      :: ll_ice_section    ! ice surface and ice volume computation
+      LOGICAL                                      :: ll_date_line      ! = T if the section crosses the date-line
+      TYPE(COORD_SECTION), DIMENSION(2)            :: coordSec          ! longitude and latitude of the extremities of the sec
+      INTEGER                                      :: nb_class          ! number of boundaries for density classes
+      INTEGER, DIMENSION(nb_point_max)             :: direction         ! vector direction of the point in the section
+      CHARACTER(len=40),DIMENSION(nb_class_max)    :: classname         ! characteristics of the class
+      REAL(wp), DIMENSION(nb_class_max)            :: zsigi           ,&! in-situ   density classes    (99 if you don't want)
+                                                      zsigp           ,&! potential density classes    (99 if you don't want)
+                                                      zsal            ,&! salinity classes   (99 if you don't want)
+                                                      ztem            ,&! temperature classes(99 if you don't want)
+                                                      zlay              ! level classes      (99 if you don't want)
+      REAL(wp), DIMENSION(nb_type_class,nb_class_max)  :: transport     ! transport output
+      REAL(wp)                                         :: slopeSection  ! slope of the section
+      INTEGER                                          :: nb_point      ! number of points in the section
+      TYPE(POINT_SECTION),DIMENSION(nb_point_max)      :: listPoint     ! list of points in the sections
+   END TYPE SECTION
+
+   TYPE(SECTION),DIMENSION(nb_sec_max) :: secs ! Array of sections
+ 
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:,:) ::  transports_3d 
+   REAL(wp), ALLOCATABLE, DIMENSION(:,:,:)   ::  transports_2d  
 
    !!----------------------------------------------------------------------
@@ -618,139 +613,137 @@
 
      TYPE(POINT_SECTION) :: k
-     !!--------------------------------------------------------
-
-     IF( ld_debug )WRITE(numout,*)'      Compute transport'
-
-     !---------------------------!
-     !  COMPUTE TRANSPORT        !
-     !---------------------------!
-     IF(sec%nb_point .NE. 0)THEN   
-
-        !----------------------------------------------------------------------------------------------------
-        !Compute sign for velocities:
-        !
-        !convention:
-        !   non horizontal section: direction + is toward left hand of section
-        !       horizontal section: direction + is toward north of section
-        !
-        !
-        !       slopeSection < 0     slopeSection > 0       slopeSection=inf            slopeSection=0
-        !       ----------------      -----------------     ---------------             --------------
-        !
-        !   isgnv=1         direction +      
-        !  ______         _____             ______                                                   
-        !        |           //|            |                  |                         direction +   
-        !        | isgnu=1  // |            |isgnu=1           |isgnu=1                     /|\
-        !        |_______  //         ______|    \\            | ---\                        |
-        !               |             | isgnv=-1  \\ |         | ---/ direction +       ____________
-        !               |             |          __\\|         |                    
-        !               |             |     direction +        |                      isgnv=1                                 
-        !                                                      
-        !----------------------------------------------------------------------------------------------------
-        isgnu = 1
-        IF( sec%slopeSection .GT. 0 ) THEN  ; isgnv = -1 
-        ELSE                                ; isgnv =  1
-        ENDIF
-        IF( sec%slopeSection .GE. 9999. )     isgnv =  1
-
-        IF( ld_debug )write(numout,*)"sec%slopeSection isgnu isgnv ",sec%slopeSection,isgnu,isgnv
-
-        !--------------------------------------!
-        ! LOOP ON THE SEGMENT BETWEEN 2 NODES  !
-        !--------------------------------------!
-        DO jseg=1,MAX(sec%nb_point-1,0)
+      !!--------------------------------------------------------
+      !
+      IF( ld_debug )WRITE(numout,*)'      Compute transport'
+
+      !---------------------------!
+      !  COMPUTE TRANSPORT        !
+      !---------------------------!
+      IF(sec%nb_point .NE. 0)THEN   
+
+         !----------------------------------------------------------------------------------------------------
+         !Compute sign for velocities:
+         !
+         !convention:
+         !   non horizontal section: direction + is toward left hand of section
+         !       horizontal section: direction + is toward north of section
+         !
+         !
+         !       slopeSection < 0     slopeSection > 0       slopeSection=inf            slopeSection=0
+         !       ----------------      -----------------     ---------------             --------------
+         !
+         !   isgnv=1         direction +      
+         !  ______         _____             ______                                                   
+         !        |           //|            |                  |                         direction +   
+         !        | isgnu=1  // |            |isgnu=1           |isgnu=1                     /|\
+         !        |_______  //         ______|    \\            | ---\                        |
+         !               |             | isgnv=-1  \\ |         | ---/ direction +       ____________
+         !               |             |          __\\|         |                    
+         !               |             |     direction +        |                      isgnv=1                                 
+         !                                                      
+         !----------------------------------------------------------------------------------------------------
+         isgnu = 1
+         IF( sec%slopeSection .GT. 0 ) THEN  ; isgnv = -1 
+         ELSE                                ; isgnv =  1
+         ENDIF
+         IF( sec%slopeSection .GE. 9999. )     isgnv =  1
+
+         IF( ld_debug )write(numout,*)"sec%slopeSection isgnu isgnv ",sec%slopeSection,isgnu,isgnv
+
+         !--------------------------------------!
+         ! LOOP ON THE SEGMENT BETWEEN 2 NODES  !
+         !--------------------------------------!
+         DO jseg=1,MAX(sec%nb_point-1,0)
               
-           !-------------------------------------------------------------------------------------------
-           ! Select the appropriate coordinate for computing the velocity of the segment
-           !
-           !                      CASE(0)                                    Case (2)
-           !                      -------                                    --------
-           !  listPoint(jseg)                 listPoint(jseg+1)       listPoint(jseg)  F(i,j)      
-           !      F(i,j)----------V(i+1,j)-------F(i+1,j)                               |
-           !                                                                            |
-           !                                                                            |
-           !                                                                            |
-           !                      Case (3)                                            U(i,j)
-           !                      --------                                              |
-           !                                                                            |
-           !  listPoint(jseg+1) F(i,j+1)                                                |
-           !                        |                                                   |
-           !                        |                                                   |
-           !                        |                                 listPoint(jseg+1) F(i,j-1)
-           !                        |                                            
-           !                        |                                            
-           !                     U(i,j+1)                                            
-           !                        |                                       Case(1)     
-           !                        |                                       ------      
-           !                        |                                            
-           !                        |                 listPoint(jseg+1)             listPoint(jseg)                           
-           !                        |                 F(i-1,j)-----------V(i,j) -------f(jseg)                           
-           ! listPoint(jseg)     F(i,j)
-           ! 
-           !-------------------------------------------------------------------------------------------
-
-           SELECT CASE( sec%direction(jseg) )
-           CASE(0)  ;   k = sec%listPoint(jseg)
-           CASE(1)  ;   k = POINT_SECTION(sec%listPoint(jseg)%I+1,sec%listPoint(jseg)%J)
-           CASE(2)  ;   k = sec%listPoint(jseg)
-           CASE(3)  ;   k = POINT_SECTION(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J+1)
-           END SELECT
-
-           !---------------------------| 
-           !     LOOP ON THE LEVEL     | 
-           !---------------------------| 
-           !Sum of the transport on the vertical  
-           DO jk=1,mbathy(k%I,k%J) 
- 
-              ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point 
-              SELECT CASE( sec%direction(jseg) ) 
-              CASE(0,1) 
-                 ztn   = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) ) 
-                 zsn   = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) ) 
-                 zrhop = interp(k%I,k%J,jk,'V',rhop) 
-                 zrhoi = interp(k%I,k%J,jk,'V',rhd*rau0+rau0) 
-                 zsshn =  0.5*( sshn(k%I,k%J)    + sshn(k%I,k%J+1)    ) * vmask(k%I,k%J,1) 
-              CASE(2,3) 
-                 ztn   = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) ) 
-                 zsn   = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) ) 
-                 zrhop = interp(k%I,k%J,jk,'U',rhop) 
-                 zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 
-                 zsshn =  0.5*( sshn(k%I,k%J)    + sshn(k%I+1,k%J)    ) * umask(k%I,k%J,1)  
-              END SELECT 
- 
-              zdep= gdept_n(k%I,k%J,jk) 
+            !-------------------------------------------------------------------------------------------
+            ! Select the appropriate coordinate for computing the velocity of the segment
+            !
+            !                      CASE(0)                                    Case (2)
+            !                      -------                                    --------
+            !  listPoint(jseg)                 listPoint(jseg+1)       listPoint(jseg)  F(i,j)      
+            !      F(i,j)----------V(i+1,j)-------F(i+1,j)                               |
+            !                                                                            |
+            !                                                                            |
+            !                                                                            |
+            !                      Case (3)                                            U(i,j)
+            !                      --------                                              |
+            !                                                                            |
+            !  listPoint(jseg+1) F(i,j+1)                                                |
+            !                        |                                                   |
+            !                        |                                                   |
+            !                        |                                 listPoint(jseg+1) F(i,j-1)
+            !                        |                                            
+            !                        |                                            
+            !                     U(i,j+1)                                            
+            !                        |                                       Case(1)     
+            !                        |                                       ------      
+            !                        |                                            
+            !                        |                 listPoint(jseg+1)             listPoint(jseg)                           
+            !                        |                 F(i-1,j)-----------V(i,j) -------f(jseg)                           
+            ! listPoint(jseg)     F(i,j)
+            ! 
+            !-------------------------------------------------------------------------------------------
+
+            SELECT CASE( sec%direction(jseg) )
+            CASE(0)   ;    k = sec%listPoint(jseg)
+            CASE(1)   ;    k = POINT_SECTION(sec%listPoint(jseg)%I+1,sec%listPoint(jseg)%J)
+            CASE(2)   ;    k = sec%listPoint(jseg)
+            CASE(3)   ;    k = POINT_SECTION(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J+1)
+            END SELECT
+
+            !---------------------------| 
+            !     LOOP ON THE LEVEL     | 
+            !---------------------------| 
+            DO jk = 1, mbathy(k%I,k%J)            !Sum of the transport on the vertical
+            !           ! compute temperature, salinity, insitu & potential density, ssh and depth at U/V point 
+            SELECT CASE( sec%direction(jseg) )
+               CASE(0,1) 
+                  ztn   = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_tem) ) 
+                  zsn   = interp(k%I,k%J,jk,'V',tsn(:,:,:,jp_sal) ) 
+                  zrhop = interp(k%I,k%J,jk,'V',rhop) 
+                  zrhoi = interp(k%I,k%J,jk,'V',rhd*rau0+rau0) 
+                  zsshn =  0.5*( sshn(k%I,k%J) + sshn(k%I,k%J+1)    ) * vmask(k%I,k%J,1) 
+               CASE(2,3) 
+                  ztn   = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_tem) ) 
+                  zsn   = interp(k%I,k%J,jk,'U',tsn(:,:,:,jp_sal) ) 
+                  zrhop = interp(k%I,k%J,jk,'U',rhop) 
+                  zrhoi = interp(k%I,k%J,jk,'U',rhd*rau0+rau0) 
+                  zsshn =  0.5*( sshn(k%I,k%J) + sshn(k%I+1,k%J)    ) * umask(k%I,k%J,1)  
+               END SELECT 
+               !
+               zdep= gdept_n(k%I,k%J,jk) 
   
-              !compute velocity with the correct direction 
-              SELECT CASE( sec%direction(jseg) ) 
-              CASE(0,1)   
-                 zumid=0. 
-                 zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) 
-              CASE(2,3) 
-                 zumid=isgnu*un(k%I,k%J,jk)*umask(k%I,k%J,jk) 
-                 zvmid=0. 
-              END SELECT 
- 
-              !zTnorm=transport through one cell; 
-              !velocity* cell's length * cell's thickness 
-              zTnorm=zumid*e2u(k%I,k%J)*  e3u_n(k%I,k%J,jk)+     & 
-                     zvmid*e1v(k%I,k%J)*  e3v_n(k%I,k%J,jk) 
-
-#if ! defined key_vvl
-              !add transport due to free surface 
-              IF( jk==1 )THEN 
-                 zTnorm = zTnorm + zumid* e2u(k%I,k%J) * zsshn * umask(k%I,k%J,jk) + & 
-                                   zvmid* e1v(k%I,k%J) * zsshn * vmask(k%I,k%J,jk) 
-              ENDIF 
-#endif
+               SELECT CASE( sec%direction(jseg) )                !compute velocity with the correct direction 
+               CASE(0,1)   
+                  zumid=0._wp
+                  zvmid=isgnv*vn(k%I,k%J,jk)*vmask(k%I,k%J,jk) 
+               CASE(2,3) 
+                  zumid=isgnu*un(k%I,k%J,jk)*umask(k%I,k%J,jk) 
+                  zvmid=0._wp
+               END SELECT 
+ 
+               !zTnorm=transport through one cell; 
+               !velocity* cell's length * cell's thickness 
+               zTnorm = zumid*e2u(k%I,k%J) * e3u_n(k%I,k%J,jk)     & 
+                  &   + zvmid*e1v(k%I,k%J) * e3v_n(k%I,k%J,jk) 
+
+!!gm  THIS is WRONG  no transport due to ssh in linear free surface case !!!!!
+               IF( ln_linssh ) THEN              !add transport due to free surface 
+                  IF( jk==1 ) THEN 
+                     zTnorm = zTnorm + zumid* e2u(k%I,k%J) * zsshn * umask(k%I,k%J,jk)   & 
+                        &            + zvmid* e1v(k%I,k%J) * zsshn * vmask(k%I,k%J,jk) 
+                  ENDIF 
+               ENDIF
+!!gm end
               !COMPUTE TRANSPORT  
  
               transports_3d(1,jsec,jseg,jk) = transports_3d(1,jsec,jseg,jk) + zTnorm 
   
-              IF ( sec%llstrpond ) THEN 
+              IF( sec%llstrpond ) THEN 
                  transports_3d(2,jsec,jseg,jk) = transports_3d(2,jsec,jseg,jk)  + zTnorm * ztn * zrhop * rcp
                  transports_3d(3,jsec,jseg,jk) = transports_3d(3,jsec,jseg,jk)  + zTnorm * zsn * zrhop * 0.001
               ENDIF
    
-           ENDDO !end of loop on the level
+           END DO !end of loop on the level
 
 #if defined key_lim2 || defined key_lim3
@@ -793,5 +786,5 @@
                  transports_2d(2,jsec,jseg) = transports_2d(2,jsec,jseg) + (zTnorm)*   &
                                    a_i(sec%listPoint(jseg)%I,sec%listPoint(jseg)%J,jl)
-              ENDDO
+              END DO
 #endif
    
@@ -799,10 +792,11 @@
 #endif
  
-        ENDDO !end of loop on the segment
+        END DO !end of loop on the segment
 
      ENDIF !end of sec%nb_point =0 case
      !
   END SUBROUTINE transport
-  
+
+
   SUBROUTINE dia_dct_sum(sec,jsec) 
      !!------------------------------------------------------------- 
@@ -986,5 +980,5 @@
 #endif 
   
-        ENDDO !end of loop on the segment 
+        END DO !end of loop on the segment 
  
      ELSE  !if sec%nb_point =0 
@@ -995,5 +989,6 @@
  
   END SUBROUTINE dia_dct_sum 
-  
+
+
   SUBROUTINE dia_dct_wri(kt,ksec,sec)
      !!-------------------------------------------------------------
@@ -1133,15 +1128,15 @@
                               sec%transport(9,1),sec%transport(10,1), &
                               sec%transport(9,1)+sec%transport(10,1) 
-     ENDIF
+      ENDIF
                                               
-118 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3F12.4)
-119 FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6)
-
-     CALL wrk_dealloc(nb_type_class , zsumclasses )  
-     !
-  END SUBROUTINE dia_dct_wri
-
-
-  FUNCTION interp(ki, kj, kk, cd_point, ptab)
+118   FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3F12.4)
+119   FORMAT(I8,1X,I8,1X,I4,1X,A30,1X,f9.2,1X,I4,3X,A8,1X,2F12.4,5X,3E15.6)
+
+      CALL wrk_dealloc(nb_type_class , zsumclasses )  
+      !
+   END SUBROUTINE dia_dct_wri
+
+
+   FUNCTION interp(ki, kj, kk, cd_point, ptab)
   !!----------------------------------------------------------------------
   !!
@@ -1297,3 +1292,4 @@
 #endif
 
+   !!======================================================================
 END MODULE diadct
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahsb.F90	(revision 5866)
@@ -109,5 +109,5 @@
       IF( ln_trabbc )   z_frc_trd_t = z_frc_trd_t +               glob_sum( qgh_trd0(:,:) * surf(:,:) )
       !
-      IF( .NOT. lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          IF ( ln_isfcav ) THEN
             DO ji=1,jpi
@@ -129,5 +129,5 @@
       frc_s = frc_s + z_frc_trd_s * rdt
       !                                          ! Advection flux through fixed surface (z=0)
-      IF( .NOT. lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          frc_wn_t = frc_wn_t + z_wn_trd_t * rdt
          frc_wn_s = frc_wn_s + z_wn_trd_s * rdt
@@ -145,5 +145,5 @@
 
       ! heat & salt content variation (associated with ssh)
-      IF( .NOT. lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          IF ( ln_isfcav ) THEN
             DO ji = 1, jpi
@@ -175,8 +175,8 @@
       ! Substract forcing from heat content, salt content and volume variations
       zdiff_v1 = zdiff_v1 - frc_v
-      IF( lk_vvl )   zdiff_v2 = zdiff_v2 - frc_v
+      IF( .NOT.ln_linssh )   zdiff_v2 = zdiff_v2 - frc_v
       zdiff_hc = zdiff_hc - frc_t
       zdiff_sc = zdiff_sc - frc_s
-      IF( .NOT. lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          zdiff_hc1 = zdiff_hc + z_ssh_hc 
          zdiff_sc1 = zdiff_sc + z_ssh_sc
@@ -194,10 +194,10 @@
 
 !!gm to be added ?
-!      IF( .NOT. lk_vvl ) THEN            ! fixed volume, add the ssh contribution
+!      IF( ln_linssh ) THEN            ! fixed volume, add the ssh contribution
 !        zvol_tot = zvol_tot + glob_sum( surf(:,:) * sshn(:,:) )
 !      ENDIF
 !!gm end
 
-      IF( lk_vvl ) THEN
+      IF( .NOT.ln_linssh ) THEN
         CALL iom_put( 'bgtemper' , zdiff_hc / zvol_tot )              ! Temperature variation (C) 
         CALL iom_put( 'bgsaline' , zdiff_sc / zvol_tot )              ! Salinity    variation (psu)
@@ -256,5 +256,5 @@
            CALL iom_get( numror, 'frc_t', frc_t )
            CALL iom_get( numror, 'frc_s', frc_s )
-           IF( .NOT. lk_vvl ) THEN
+           IF( ln_linssh ) THEN
               CALL iom_get( numror, 'frc_wn_t', frc_wn_t )
               CALL iom_get( numror, 'frc_wn_s', frc_wn_s )
@@ -264,5 +264,5 @@
            CALL iom_get( numror, jpdom_autoglo, 'hc_loc_ini', hc_loc_ini )
            CALL iom_get( numror, jpdom_autoglo, 'sc_loc_ini', sc_loc_ini )
-           IF( .NOT. lk_vvl ) THEN
+           IF( ln_linssh ) THEN
               CALL iom_get( numror, jpdom_autoglo, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
               CALL iom_get( numror, jpdom_autoglo, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
@@ -281,5 +281,5 @@
           frc_t = 0._wp                                           ! heat content   -    -   -    -   
           frc_s = 0._wp                                           ! salt content   -    -   -    -        
-          IF( .NOT. lk_vvl ) THEN
+          IF( ln_linssh ) THEN
              IF ( ln_isfcav ) THEN
                 DO ji=1,jpi
@@ -307,5 +307,5 @@
         CALL iom_rstput( kt, nitrst, numrow, 'frc_t'   , frc_t     )
         CALL iom_rstput( kt, nitrst, numrow, 'frc_s'   , frc_s     )
-        IF( .NOT. lk_vvl ) THEN
+        IF( ln_linssh ) THEN
            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_t', frc_wn_t )
            CALL iom_rstput( kt, nitrst, numrow, 'frc_wn_s', frc_wn_s )
@@ -315,5 +315,5 @@
         CALL iom_rstput( kt, nitrst, numrow, 'hc_loc_ini', hc_loc_ini )
         CALL iom_rstput( kt, nitrst, numrow, 'sc_loc_ini', sc_loc_ini )
-        IF( .NOT. lk_vvl ) THEN
+        IF( ln_linssh ) THEN
            CALL iom_rstput( kt, nitrst, numrow, 'ssh_hc_loc_ini', ssh_hc_loc_ini )
            CALL iom_rstput( kt, nitrst, numrow, 'ssh_sc_loc_ini', ssh_sc_loc_ini )
@@ -384,5 +384,5 @@
       ENDIF
 
-      IF(.NOT. lk_vvl ) ALLOCATE( ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj),STAT=ierror )
+      IF( ln_linssh )   ALLOCATE( ssh_hc_loc_ini(jpi,jpj), ssh_sc_loc_ini(jpi,jpj),STAT=ierror )
       IF( ierror > 0 ) THEN
          CALL ctl_stop( 'dia_hsb: unable to allocate hc_loc_ini' )   ;   RETURN
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diahth.F90	(revision 5866)
@@ -311,6 +311,6 @@
       END DO
       ! surface boundary condition
-      IF( lk_vvl ) THEN   ;   zthick(:,:) = 0._wp       ;   htc3(:,:) = 0._wp                                   
-      ELSE                ;   zthick(:,:) = sshn(:,:)   ;   htc3(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1)   
+      IF( .NOT.ln_linssh ) THEN   ;   zthick(:,:) = 0._wp       ;   htc3(:,:) = 0._wp                                   
+      ELSE                        ;   zthick(:,:) = sshn(:,:)   ;   htc3(:,:) = tsn(:,:,1,jp_tem) * sshn(:,:) * tmask(:,:,1)  
       ENDIF
       ! integration down to ilevel
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 5866)
@@ -146,5 +146,5 @@
       ENDIF
 
-      IF( .NOT.lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          CALL iom_put( "e3t" , e3t_n(:,:,:) )
          CALL iom_put( "e3u" , e3u_n(:,:,:) )
@@ -419,6 +419,6 @@
       IF( nn_timing == 1 )   CALL timing_start('dia_wri')
       !
-                     CALL wrk_alloc( jpi,jpj      , zw2d )
-      IF( lk_vvl )   CALL wrk_alloc( jpi,jpj,jpk  , zw3d )
+                             CALL wrk_alloc( jpi,jpj      , zw2d )
+      IF( .NOT.ln_linssh )   CALL wrk_alloc( jpi,jpj,jpk  , zw3d )
       !
       ! Output the initial state and forcings
@@ -563,5 +563,5 @@
          CALL histdef( nid_T, "vosaline", "Salinity"                           , "PSU"    ,   &  ! sn
             &          jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
-         IF(  lk_vvl  ) THEN
+         IF(  .NOT.ln_linssh  ) THEN
             CALL histdef( nid_T, "vovvle3t", "Level thickness"                    , "m"      ,&  ! e3t_n
             &             jpi, jpj, nh_T, ipk, 1, ipk, nz_T, 32, clop, zsto, zout )
@@ -584,5 +584,5 @@
          CALL histdef( nid_T, "sosfldow", "downward salt flux"                 , "PSU/m2/s",  &  ! sfx
             &          jpi, jpj, nh_T, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-         IF(  .NOT. lk_vvl  ) THEN
+         IF(  ln_linssh  ) THEN
             CALL histdef( nid_T, "sosst_cd", "Concentration/Dilution term on temperature"     &  ! emp * tsn(:,:,1,jp_tem)
             &                                                                  , "KgC/m2/s",  &  ! sosst_cd
@@ -730,5 +730,5 @@
       ENDIF
 
-      IF( lk_vvl ) THEN
+      IF( .NOT.ln_linssh ) THEN
          CALL histwrite( nid_T, "votemper", it, tsn(:,:,:,jp_tem) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! heat content
          CALL histwrite( nid_T, "vosaline", it, tsn(:,:,:,jp_sal) * e3t_n(:,:,:) , ndim_T , ndex_T  )   ! salt content
@@ -741,5 +741,5 @@
          CALL histwrite( nid_T, "sosaline", it, tsn(:,:,1,jp_sal) , ndim_hT, ndex_hT )   ! sea surface salinity
       ENDIF
-      IF( lk_vvl ) THEN
+      IF( .NOT.ln_linssh ) THEN
          zw3d(:,:,:) = ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2
          CALL histwrite( nid_T, "vovvle3t", it, e3t_n (:,:,:) , ndim_T , ndex_T  )   ! level thickness
@@ -753,5 +753,5 @@
                                                                                   ! (includes virtual salt flux beneath ice 
                                                                                   ! in linear free surface case)
-      IF( .NOT. lk_vvl ) THEN
+      IF( ln_linssh ) THEN
          zw2d(:,:) = emp (:,:) * tsn(:,:,1,jp_tem)
          CALL histwrite( nid_T, "sosst_cd", it, zw2d, ndim_hT, ndex_hT )          ! c/d term on sst
@@ -838,6 +838,6 @@
       ENDIF
       !
-                     CALL wrk_dealloc( jpi , jpj        , zw2d )
-      IF( lk_vvl )   CALL wrk_dealloc( jpi , jpj , jpk  , zw3d )
+                             CALL wrk_dealloc( jpi , jpj        , zw2d )
+      IF( .NOT.ln_linssh )   CALL wrk_dealloc( jpi , jpj , jpk  , zw3d )
       !
       IF( nn_timing == 1 )   CALL timing_stop('dia_wri')
@@ -936,5 +936,5 @@
       CALL histdef( id_i, "sometauy", "Meridional Wind Stress", "N/m2"   ,   &   ! j-wind stress
          &          jpi, jpj, nh_i, 1  , 1, 1  , -99 , 32, clop, zsto, zout )
-      IF( lk_vvl ) THEN
+      IF( .NOT.ln_linssh ) THEN
          CALL histdef( id_i, "vovvldep", "T point depth"         , "m"      ,   &   ! t-point depth
             &          jpi, jpj, nh_i, jpk, 1, jpk, nz_i, 32, clop, zsto, zout )
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/dom_oce.F90	(revision 5866)
@@ -173,19 +173,10 @@
    !! vertical coordinate and scale factors
    !! ---------------------------------------------------------------------
-   !                                 !!* Namelist namzgr : vertical coordinate *
-   LOGICAL, PUBLIC ::   ln_zco        !: z-coordinate - full step
-   LOGICAL, PUBLIC ::   ln_zps        !: z-coordinate - partial step
-   LOGICAL, PUBLIC ::   ln_sco        !: s-coordinate or hybrid z-s coordinate
-   LOGICAL, PUBLIC ::   ln_isfcav     !: presence of ISF 
-
-!!gm
-#if defined key_vvl
-   LOGICAL, PUBLIC, PARAMETER ::   lk_vvl = .TRUE.    !: variable grid flag
-   LOGICAL, PUBLIC ::   lk_linssh = .FALSE.    !: variable grid flag
-#else
-   LOGICAL, PUBLIC, PARAMETER ::   lk_vvl = .FALSE.   !: variable grid flag
-   LOGICAL, PUBLIC ::   lk_linssh = .TRUE.    !: variable grid flag
-#endif
-!!gm
+   !                                !!* Namelist namzgr : vertical coordinate *
+   LOGICAL, PUBLIC ::   ln_zco       !: z-coordinate - full step
+   LOGICAL, PUBLIC ::   ln_zps       !: z-coordinate - partial step
+   LOGICAL, PUBLIC ::   ln_sco       !: s-coordinate or hybrid z-s coordinate
+   LOGICAL, PUBLIC ::   ln_isfcav    !: presence of ISF 
+   LOGICAL, PUBLIC ::   ln_linssh    !: variable grid flag
 
    !                                                        !  ref.   ! before  !   now   ! after  !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domain.F90	(revision 5866)
@@ -101,10 +101,11 @@
       END DO
       !
-      IF( lk_vvl ) THEN       !==  time varying coordinate system  ==!
-         !
-         CALL dom_vvl_init                      ! set before/now/after variables
-         !
-      ELSE                    !==  Fix in time  ==!   set everything to the reference one for all
-         !
+      !              !==  time varying part of coordinate system  ==!
+      !
+      IF( .NOT.ln_linssh ) THEN                 ! time varying : initialize before/now/after variables
+         !
+         CALL dom_vvl_init 
+         !
+      ELSE                                      ! Fix in time : set to the reference one for all
          !       before        !          now          !       after         !
          ;  gdept_b = gdept_0  ;   gdept_n = gdept_0   !        ---          ! depth of grid-points
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domstp.F90	(revision 5866)
@@ -82,5 +82,5 @@
             IF(lwp) WRITE(numout,*)'               accelerating the convergence'
             IF(lwp) WRITE(numout,*)'               dynamics time step = ', rdt/3600., ' hours'
-            IF( ln_sco .AND. rdtmin /= rdtmax .AND. lk_vvl )   &
+            IF( ln_sco .AND. rdtmin /= rdtmax .AND. .NOT.ln_linssh )   &
                  & CALL ctl_stop ( ' depth dependent acceleration of convergence not implemented in s-coordinates &
                  &                   nor in variable volume' )
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domvvl.F90	(revision 5866)
@@ -178,6 +178,6 @@
       ht_n(:,:) = e3t_n(:,:,1) * tmask(:,:,1)   !!gm  BUG  :  this should be 1/2 * e3w(k=1) ....
       hu_b(:,:) = e3u_b(:,:,1) * umask(:,:,1)
-      hv_b(:,:) = e3u_b(:,:,1) * vmask(:,:,1)
       hu_n(:,:) = e3u_n(:,:,1) * umask(:,:,1)
+      hv_b(:,:) = e3v_b(:,:,1) * vmask(:,:,1)
       hv_n(:,:) = e3v_n(:,:,1) * vmask(:,:,1)
       DO jk = 2, jpkm1
@@ -617,14 +617,12 @@
       
       ! Vertical scale factor interpolations
-      ! ------------------------------------
-      CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
+      CALL dom_vvl_interpol( e3t_n(:,:,:),  e3w_n(:,:,:), 'W'  )
       CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
       CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
-      CALL dom_vvl_interpol( e3t_b(:,:,:), e3w_b (:,:,:), 'W'  )
+      CALL dom_vvl_interpol( e3t_b(:,:,:),  e3w_b(:,:,:), 'W'  )
       CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
       CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
-      ! t- and w- points depth
-      ! ----------------------
-      ! set the isf depth as it is in the initial step
+
+      ! t- and w- points depth (set the isf depth as it is in the initial step)
       gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
       gdepw_n(:,:,1) = 0.0_wp
@@ -656,17 +654,17 @@
       ! Write outputs
       ! =============
-      CALL iom_put(     "e3t" , e3t_n  (:,:,:) )
-      CALL iom_put(     "e3u" , e3u_n  (:,:,:) )
-      CALL iom_put(     "e3v" , e3v_n  (:,:,:) )
-      CALL iom_put(     "e3w" , e3w_n  (:,:,:) )
-      CALL iom_put( "tpt_dep" , gde3w_n(:,:,:) )
+      CALL iom_put(     "e3t",   e3t_n(:,:,:) )
+      CALL iom_put(     "e3u",   e3u_n(:,:,:) )
+      CALL iom_put(     "e3v",   e3v_n(:,:,:) )
+      CALL iom_put(     "e3w",   e3w_n(:,:,:) )
+      CALL iom_put( "tpt_dep", gde3w_n(:,:,:) )
       IF( iom_use("e3tdef") )   &
-         CALL iom_put( "e3tdef"  , ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100 * tmask(:,:,:) ) ** 2 )
+         CALL iom_put( "e3tdef", ( ( e3t_n(:,:,:) - e3t_0(:,:,:) ) / e3t_0(:,:,:) * 100. * tmask(:,:,:) ) ** 2 )
 
       ! write restart file
       ! ==================
-      IF( lrst_oce ) CALL dom_vvl_rst( kt, 'WRITE' )
-      !
-      IF( nn_timing == 1 )  CALL timing_stop('dom_vvl_sf_swp')
+      IF( lrst_oce )   CALL dom_vvl_rst( kt, 'WRITE' )
+      !
+      IF( nn_timing == 1 )   CALL timing_stop('dom_vvl_sf_swp')
       !
    END SUBROUTINE dom_vvl_sf_swp
@@ -691,5 +689,5 @@
       !!----------------------------------------------------------------------
       !
-      IF( nn_timing == 1 )  CALL timing_start('dom_vvl_interpol')
+      IF( nn_timing == 1 )   CALL timing_start('dom_vvl_interpol')
       !
       SELECT CASE ( pout )    !==  type of interpolation  ==!
@@ -765,5 +763,5 @@
       END SELECT
       !
-      IF( nn_timing == 1 )  CALL timing_stop('dom_vvl_interpol')
+      IF( nn_timing == 1 )   CALL timing_stop('dom_vvl_interpol')
       !
    END SUBROUTINE dom_vvl_interpol
@@ -970,5 +968,5 @@
       !
       IF( ioptio /= 1 )   CALL ctl_stop( 'Choose ONE vertical coordinate in namelist nam_vvl' )
-      IF( .NOT. ln_vvl_zstar .AND. nn_isf .NE. 0) CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
+      IF( .NOT. ln_vvl_zstar .AND. nn_isf /= 0)   CALL ctl_stop( 'Only vvl_zstar has been tested with ice shelf cavity' )
       !
       IF(lwp) THEN                   ! Print the choice
@@ -984,5 +982,5 @@
       !
 #if defined key_agrif
-      IF (.NOT.Agrif_Root()) CALL ctl_stop( 'AGRIF not implemented with non-linear free surface (key_vvl)' )
+      IF(.NOT.Agrif_Root() )   CALL ctl_stop( 'AGRIF not implemented with non-linear free surface' )
 #endif
       !
@@ -991,5 +989,2 @@
    !!======================================================================
 END MODULE domvvl
-
-
-
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 5866)
@@ -102,5 +102,5 @@
       INTEGER ::   ios
       !
-      NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco, ln_isfcav
+      NAMELIST/namzgr/ ln_zco, ln_zps, ln_sco, ln_isfcav, ln_linssh
       !!----------------------------------------------------------------------
       !
@@ -120,10 +120,13 @@
          WRITE(numout,*) 'dom_zgr : vertical coordinate'
          WRITE(numout,*) '~~~~~~~'
-         WRITE(numout,*) '          Namelist namzgr : set vertical coordinate'
-         WRITE(numout,*) '             z-coordinate - full steps      ln_zco    = ', ln_zco
-         WRITE(numout,*) '             z-coordinate - partial steps   ln_zps    = ', ln_zps
-         WRITE(numout,*) '             s- or hybrid z-s-coordinate    ln_sco    = ', ln_sco
-         WRITE(numout,*) '             ice shelf cavities             ln_isfcav = ', ln_isfcav
+         WRITE(numout,*) '   Namelist namzgr : set vertical coordinate'
+         WRITE(numout,*) '      z-coordinate - full steps      ln_zco    = ', ln_zco
+         WRITE(numout,*) '      z-coordinate - partial steps   ln_zps    = ', ln_zps
+         WRITE(numout,*) '      s- or hybrid z-s-coordinate    ln_sco    = ', ln_sco
+         WRITE(numout,*) '      ice shelf cavities             ln_isfcav = ', ln_isfcav
+         WRITE(numout,*) '      linear free surface            ln_linssh = ', ln_linssh
       ENDIF
+
+      IF( ln_linssh .AND. lwp) WRITE(numout,*) '   linear free surface: the vertical mesh does not change in time'
 
       ioptio = 0                       ! Check Vertical coordinate options
@@ -2059,4 +2062,5 @@
       e3uw_n (:,:,:) = e3uw_0 (:,:,:)
       e3vw_n (:,:,:) = e3vw_0 (:,:,:)
+!!gm and obviously in the following, use the _0 arrays until the end of this subroutine
 !! gm end
 !!
@@ -2190,6 +2194,6 @@
       !!----------------------------------------------------------------------
 
-      CALL wrk_alloc( jpi,jpj,jpk,  z_gsigw3, z_gsigt3, z_gsi3w3                                      )
-      CALL wrk_alloc( jpi,jpj,jpk,  z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 )
+      CALL wrk_alloc( jpi,jpj,jpk,   z_gsigw3, z_gsigt3, z_gsi3w3                                      )
+      CALL wrk_alloc( jpi,jpj,jpk,   z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 )
 
       z_gsigw3  = 0._wp   ;   z_gsigt3  = 0._wp   ;   z_gsi3w3  = 0._wp
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DOM/istate.F90	(revision 5866)
@@ -124,5 +124,5 @@
          !   
          ! - ML - sshn could be modified by istate_eel, so that initialization of e3t_b is done here
-         IF( lk_vvl ) THEN
+         IF( .NOT.ln_linssh ) THEN
             DO jk = 1, jpk
                e3t_b(:,:,jk) = e3t_n(:,:,jk)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_cen2.F90	(revision 5866)
@@ -119,7 +119,7 @@
             zfv_vw(:,:,jpk) = 0.e0
             !                                           ! Surface value :
-            IF( lk_vvl ) THEN                                ! variable volume : flux set to zero
-               zfu_uw(:,:, 1 ) = 0.e0    
-               zfv_vw(:,:, 1 ) = 0.e0
+            IF( .NOT.ln_linssh ) THEN                        ! variable volume : flux set to zero
+               zfu_uw(:,:, 1 ) = 0._wp    
+               zfv_vw(:,:, 1 ) = 0._wp
             ELSE                                             ! constant volume : advection through the surface
                DO jj = 2, jpjm1
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynadv_ubs.F90	(revision 5866)
@@ -208,12 +208,12 @@
             zfv_vw(:,:,jpk) = 0.e0
             !                                           ! Surface value :
-            IF( lk_vvl ) THEN                                ! variable volume : flux set to zero
-               zfu_uw(:,:, 1 ) = 0.e0    
-               zfv_vw(:,:, 1 ) = 0.e0
+            IF( .NOT.ln_linssh ) THEN                        ! variable volume : flux set to zero
+               zfu_uw(:,:, 1 ) = 0._wp
+               zfv_vw(:,:, 1 ) = 0._wp
             ELSE                                             ! constant volume : advection through the surface
                DO jj = 2, jpjm1
                   DO ji = fs_2, fs_jpim1
-                     zfu_uw(ji,jj, 1 ) = 2.e0 * ( zfw(ji,jj,1) + zfw(ji+1,jj  ,1) ) * un(ji,jj,1)
-                     zfv_vw(ji,jj, 1 ) = 2.e0 * ( zfw(ji,jj,1) + zfw(ji  ,jj+1,1) ) * vn(ji,jj,1)
+                     zfu_uw(ji,jj, 1 ) = 2._wp * ( zfw(ji,jj,1) + zfw(ji+1,jj  ,1) ) * un(ji,jj,1)
+                     zfv_vw(ji,jj, 1 ) = 2._wp * ( zfw(ji,jj,1) + zfw(ji  ,jj+1,1) ) * vn(ji,jj,1)
                   END DO
                END DO
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynhpg.F90	(revision 5866)
@@ -162,8 +162,8 @@
                            & either  ln_hpg_sco or  ln_hpg_prj instead')
       !
-      IF( lk_vvl .AND. .NOT. (ln_hpg_sco.OR.ln_hpg_prj.OR.ln_hpg_isf) )   &
-         &   CALL ctl_stop('dyn_hpg_init : variable volume key_vvl requires:&
-                           & the standard jacobian formulation hpg_sco or &
-                           & the pressure jacobian formulation hpg_prj')
+      IF( .NOT.ln_linssh .AND. .NOT. (ln_hpg_sco.OR.ln_hpg_prj.OR.ln_hpg_isf) )       &
+         &   CALL ctl_stop('dyn_hpg_init : non-linear free surface requires either ', &
+         &                 '   the standard jacobian formulation hpg_sco    or '    , &
+         &                 '   the pressure jacobian formulation hpg_prj'            )
 
       IF(       ln_hpg_isf .AND. .NOT. ln_isfcav )   &
@@ -393,6 +393,6 @@
       zcoef0 = - grav * 0.5_wp
       ! To use density and not density anomaly
-      IF ( lk_vvl ) THEN   ;     znad = 1._wp          ! Variable volume
-      ELSE                 ;     znad = 0._wp         ! Fixed volume
+      IF ( .NOT.ln_linssh ) THEN   ;     znad = 1._wp          ! Variable volume
+      ELSE                         ;     znad = 0._wp         ! Fixed volume
       ENDIF
 
@@ -484,6 +484,6 @@
       zcoef0 = - grav * 0.5_wp
       ! To use density and not density anomaly
-!      IF ( lk_vvl ) THEN   ;     znad = 1._wp          ! Variable volume
-!      ELSE                 ;     znad = 0._wp         ! Fixed volume
+!      IF ( .NOT.ln_linssh ) THEN   ;     znad = 1._wp          ! Variable volume
+!      ELSE                         ;     znad = 0._wp         ! Fixed volume
 !      ENDIF
       znad=1._wp
@@ -970,5 +970,5 @@
       zcoef0 = - grav
       znad = 0.0_wp
-      IF( lk_vvl ) znad = 1._wp
+      IF( .NOT.ln_linssh )   znad = 1._wp
 
       ! Clean 3-D work arrays
@@ -1145,5 +1145,5 @@
 
                zdpdx1 = zcoef0 * r1_e1u(ji,jj) * ( zhpi(ji+1,jj,jk) - zhpi(ji,jj,jk) )
-               IF( lk_vvl ) THEN
+               IF( .NOT.ln_linssh ) THEN
                  zdpdx2 = zcoef0 * r1_e1u(ji,jj) * &
                     &    ( REAL(jis-jid, wp) * (zpwes + zpwed) + (sshn(ji+1,jj)-sshn(ji,jj)) )
@@ -1202,5 +1202,5 @@
 
                zdpdy1 = zcoef0 * r1_e2v(ji,jj) * ( zhpi(ji,jj+1,jk) - zhpi(ji,jj,jk) )
-               IF( lk_vvl ) THEN
+               IF( .NOT.ln_linssh ) THEN
                    zdpdy2 = zcoef0 * r1_e2v(ji,jj) * &
                            ( REAL(jjs-jjd, wp) * (zpnss + zpnsd) + (sshn(ji,jj+1)-sshn(ji,jj)) )
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynldf_lap_blp.F90	(revision 5866)
@@ -86,11 +86,14 @@
             DO ji = fs_2, jpi   ! vector opt.
                !                                      ! ahm * e3 * curl  (computed from 1 to jpim1/jpjm1)
-               zcur(ji-1,jj-1) = ahmf(ji-1,jj-1,jk) * e3f_n(ji-1,jj-1,jk) * r1_e1e2f(ji-1,jj-1)      &
-                  &     * (  e2v(ji  ,jj-1) * pvb(ji  ,jj-1,jk) - e2v(ji-1,jj-1) * pvb(ji-1,jj-1,jk)                &
-                  &        - e1u(ji-1,jj  ) * pub(ji-1,jj  ,jk) + e1u(ji-1,jj-1) * pub(ji-1,jj-1,jk)  ) * fmask(ji-1,jj-1,jk)
+!!gm open question here : fse3f  at before or now ?    probably now...
+!!gm note that ahmf has already been multiplied by fmask
+               zcur(ji-1,jj-1) = ahmf(ji-1,jj-1,jk) * e3f_n(ji-1,jj-1,jk) * r1_e1e2f(ji-1,jj-1)       &
+                  &     * (  e2v(ji  ,jj-1) * pvb(ji  ,jj-1,jk) - e2v(ji-1,jj-1) * pvb(ji-1,jj-1,jk)  &
+                  &        - e1u(ji-1,jj  ) * pub(ji-1,jj  ,jk) + e1u(ji-1,jj-1) * pub(ji-1,jj-1,jk)  )
                !                                      ! ahm * div        (computed from 2 to jpi/jpj)
-               zdiv(ji,jj)     = ahmt(ji,jj,jk) / ( e1e2t(ji,jj) * e3t_n(ji,jj,jk) )                     * tmask(ji,jj,jk)    &
-                  &     * (  e2u(ji,jj)*e3u_n(ji,jj,jk) * pub(ji,jj,jk) - e2u(ji-1,jj)*e3u_n(ji-1,jj,jk) * pub(ji-1,jj,jk)    &
-                  &        + e1v(ji,jj)*e3v_n(ji,jj,jk) * pvb(ji,jj,jk) - e1v(ji,jj-1)*e3v_n(ji,jj-1,jk) * pvb(ji,jj-1,jk)  )
+!!gm note that ahmt has already been multiplied by tmask
+               zdiv(ji,jj)     = ahmt(ji,jj,jk) * r1_e1e2t(ji,jj) / e3t_b(ji,jj,jk)                                         &
+                  &     * (  e2u(ji,jj)*e3u_b(ji,jj,jk) * pub(ji,jj,jk) - e2u(ji-1,jj)*e3u_b(ji-1,jj,jk) * pub(ji-1,jj,jk)  &
+                  &        + e1v(ji,jj)*e3v_b(ji,jj,jk) * pvb(ji,jj,jk) - e1v(ji,jj-1)*e3v_b(ji,jj-1,jk) * pvb(ji,jj-1,jk)  )
             END DO  
          END DO  
@@ -98,10 +101,10 @@
          DO jj = 2, jpjm1                             ! - curl( curl) + grad( div )
             DO ji = fs_2, fs_jpim1   ! vector opt.
-               pua(ji,jj,jk) = pua(ji,jj,jk) + zsign * (                                                   &
-                  &              - ( zcur(ji  ,jj) - zcur(ji,jj-1) ) /  ( e2u(ji,jj) * e3u_n(ji,jj,jk) )   &
+               pua(ji,jj,jk) = pua(ji,jj,jk) + zsign * (                                                 &
+                  &              - ( zcur(ji  ,jj) - zcur(ji,jj-1) ) * r1_e2u(ji,jj) / e3u_n(ji,jj,jk)   &
                   &              + ( zdiv(ji+1,jj) - zdiv(ji,jj  ) ) * r1_e1u(ji,jj)                     )
                   !
-               pva(ji,jj,jk) = pva(ji,jj,jk) + zsign * (                                                   &
-                  &                ( zcur(ji,jj  ) - zcur(ji-1,jj) ) /  ( e1v(ji,jj) * e3v_n(ji,jj,jk) )   &
+               pva(ji,jj,jk) = pva(ji,jj,jk) + zsign * (                                                 &
+                  &                ( zcur(ji,jj  ) - zcur(ji-1,jj) ) * r1_e1v(ji,jj) / e3v_n(ji,jj,jk)   &
                   &              + ( zdiv(ji,jj+1) - zdiv(ji  ,jj) ) * r1_e2v(ji,jj)                     )
             END DO
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynnxt.F90	(revision 5866)
@@ -73,7 +73,6 @@
       !! ** Method  : * After velocity is compute using a leap-frog scheme:
       !!                       (ua,va) = (ub,vb) + 2 rdt (ua,va)
-      !!             Note that with flux form advection and variable volume layer
-      !!             (lk_vvl=T), the leap-frog is applied on thickness weighted
-      !!             velocity.
+      !!             Note that with flux form advection and non linear free surface,
+      !!             the leap-frog is applied on thickness weighted velocity.
       !!             Note also that in filtered free surface (lk_dynspg_flt=T),
       !!             the time stepping has already been done in dynspg module
@@ -88,7 +87,6 @@
       !!                (ub,vb) = (un,vn) + atfp [ (ub,vb) + (ua,va) - 2 (un,vn) ]
       !!                (un,vn) = (ua,va).
-      !!             Note that with flux form advection and variable volume layer
-      !!             (lk_vvl=T), the time filter is applied on thickness weighted
-      !!             velocity.
+      !!             Note that with flux form advection and non linear free surface,
+      !!             the time filter is applied on thickness weighted velocity.
       !!
       !! ** Action :   ub,vb   filtered before horizontal velocity of next time-step
@@ -137,10 +135,10 @@
       IF( neuler == 0 .AND. kt == nit000 )  z2dt = rdt
       !
-      IF( ln_dynadv_vec .OR. .NOT. lk_vvl ) THEN      ! applied on velocity
+      IF( ln_dynadv_vec .OR. ln_linssh ) THEN         !==  applied on velocity  ==!
          DO jk = 1, jpkm1
             ua(:,:,jk) = ( ub(:,:,jk) + z2dt * ua(:,:,jk) ) * umask(:,:,jk)
             va(:,:,jk) = ( vb(:,:,jk) + z2dt * va(:,:,jk) ) * vmask(:,:,jk)
          END DO
-      ELSE                                            ! applied on thickness weighted velocity
+      ELSE                                            !==  applied on thickness weighted velocity  ==!
          DO jk = 1, jpkm1
             ua(:,:,jk) = (          ub(:,:,jk) * e3u_b(:,:,jk)    &
@@ -225,14 +223,14 @@
             vn(:,:,jk) = va(:,:,jk)
          END DO
-         IF (lk_vvl) THEN
+         IF(.NOT.ln_linssh ) THEN
             DO jk = 1, jpkm1
                e3t_b(:,:,jk) = e3t_n(:,:,jk)
                e3u_b(:,:,jk) = e3u_n(:,:,jk)
                e3v_b(:,:,jk) = e3v_n(:,:,jk)
-            ENDDO
+            END DO
          ENDIF
       ELSE                                             !* Leap-Frog : Asselin filter and swap
          !                                ! =============!
-         IF( .NOT. lk_vvl ) THEN          ! Fixed volume !
+         IF( ln_linssh ) THEN             ! Fixed volume !
             !                             ! =============!
             DO jk = 1, jpkm1                              
@@ -354,5 +352,5 @@
       !
       !
-      IF (lk_vvl) THEN
+      IF(.NOT.ln_linssh ) THEN
          hu_b(:,:) = e3u_b(:,:,1) * umask(:,:,1)
          hv_b(:,:) = e3v_b(:,:,1) * vmask(:,:,1)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_exp.F90	(revision 5866)
@@ -73,8 +73,8 @@
          spgu(:,:) = 0._wp   ;   spgv(:,:) = 0._wp
          !
-         IF( lk_vvl .AND. lwp ) WRITE(numout,*) '              lk_vvl=T : spg is included in dynhpg'
+         IF( .NOT.ln_linssh .AND. lwp ) WRITE(numout,*) '      non linear free surface: spg is included in dynhpg'
       ENDIF
 
-      IF( .NOT. lk_vvl ) THEN          !* fixed volume : add the surface pressure gradient trend
+      IF( ln_linssh ) THEN          !* linear free surface : add the surface pressure gradient trend
          !
          DO jj = 2, jpjm1                    ! now surface pressure gradient
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_flt.F90	(revision 5866)
@@ -138,5 +138,5 @@
       ! Evaluate the masked next velocity (effect of the additional force not included)
       ! ---------------------------------  
-      IF( lk_vvl ) THEN          ! variable volume  (surface pressure gradient already included in dyn_hpg)
+      IF( .NOT.ln_linssh ) THEN     ! variable volume  (surface pressure gradient already included in dyn_hpg)
          !
          IF( ln_dynadv_vec ) THEN      ! vector form : applied on velocity
@@ -230,5 +230,5 @@
       CALL lbc_lnk( spgv, 'V', -1. )
 
-      IF( lk_vvl ) CALL sol_mat( kt )      ! build the matrix at kt (vvl case only)
+      IF( .NOT.ln_linssh )   CALL sol_mat( kt )      ! build the matrix at kt (non-linear free surface only)
 
       ! Right hand side of the elliptic equation and first guess
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynspg_ts.F90	(revision 5866)
@@ -212,5 +212,5 @@
       ! and update depths at T-F points (ht and zhf resp.) at each barotropic time step
       !
-      IF ( kt == nit000 .OR. lk_vvl ) THEN
+      IF ( kt == nit000 .OR. .NOT.ln_linssh ) THEN
          IF ( ln_dynvor_een ) THEN              !==  EEN scheme  ==!
             SELECT CASE( nn_een_e3f )              !* ff/e3 at F-point
@@ -366,5 +366,5 @@
       !                                   !* Right-Hand-Side of the barotropic momentum equation
       !                                   ! ----------------------------------------------------
-      IF( lk_vvl ) THEN                         ! Variable volume : remove surface pressure gradient
+      IF( .NOT.ln_linssh ) THEN                 ! Variable volume : remove surface pressure gradient
          DO jj = 2, jpjm1 
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -530,5 +530,5 @@
          va_e(:,:) = za1 * zvn_e(:,:) + za2 * vb_e(:,:) + za3 * vbb_e(:,:)
 
-         IF( lk_vvl ) THEN                                !* Update ocean depth (variable volume case only)
+         IF( .NOT.ln_linssh ) THEN                        !* Update ocean depth (variable volume case only)
             !                                             !  ------------------
             ! Extrapolate Sea Level at step jit+0.5:
@@ -562,7 +562,6 @@
          !
 #if defined key_agrif
-         ! Set fluxes during predictor step to ensure 
-         ! volume conservation
-         IF( (.NOT.Agrif_Root()).AND.ln_bt_fw ) THEN
+         ! Set fluxes during predictor step to ensure volume conservation
+         IF( .NOT.Agrif_Root() .AND. ln_bt_fw ) THEN
             IF((nbondi == -1).OR.(nbondi == 2)) THEN
                DO jj=1,jpj
@@ -604,13 +603,13 @@
 
 #if defined key_bdy
-         ! Duplicate sea level across open boundaries (this is only cosmetic if lk_vvl=.false.)
-         IF (lk_bdy) CALL bdy_ssh( ssha_e )
+         ! Duplicate sea level across open boundaries (this is only cosmetic if linssh=T)
+         IF( lk_bdy )   CALL bdy_ssh( ssha_e )
 #endif
 #if defined key_agrif
-         IF( .NOT.Agrif_Root() ) CALL agrif_ssh_ts( jn )
+         IF( .NOT.Agrif_Root() )   CALL agrif_ssh_ts( jn )
 #endif
          !  
          ! Sea Surface Height at u-,v-points (vvl case only)
-         IF ( lk_vvl ) THEN                                
+         IF( .NOT.ln_linssh ) THEN                                
             DO jj = 2, jpjm1
                DO ji = 2, jpim1      ! NO Vector Opt.
@@ -644,11 +643,10 @@
            za3=0.013_wp                     ! za3 = eps
          ENDIF
-
+         !
          zsshp2_e(:,:) = za0 *  ssha_e(:,:) + za1 *  sshn_e (:,:) &
           &            + za2 *  sshb_e(:,:) + za3 *  sshbb_e(:,:)
-
          !
          ! Compute associated depths at U and V points:
-         IF ( lk_vvl.AND.(.NOT.ln_dynadv_vec) ) THEN      
+         IF( ln_dynadv_vec .OR. ln_linssh ) THEN 	!* Vector form
             !                                        
             DO jj = 2, jpjm1                            
@@ -667,5 +665,5 @@
          !
          ! Add Coriolis trend:
-         ! zwz array below or triads normally depend on sea level with key_vvl and should be updated
+         ! zwz array below or triads normally depend on sea level with ln_linssh=F and should be updated
          ! at each time step. We however keep them constant here for optimization.
          ! Recall that zwx and zwy arrays hold fluxes at this stage:
@@ -741,5 +739,5 @@
          !
          ! Set next velocities:
-         IF( ln_dynadv_vec .OR. (.NOT. lk_vvl) ) THEN 	! Vector form
+         IF( ln_dynadv_vec .OR. ln_linssh ) THEN 	!* Vector form
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -758,5 +756,5 @@
             END DO
 
-         ELSE					 	! Flux form
+         ELSE					 	                     !* Flux form
             DO jj = 2, jpjm1
                DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -780,5 +778,5 @@
          ENDIF
          !
-         IF( lk_vvl ) THEN                             !* Update ocean depth (variable volume case only)
+         IF( .NOT.ln_linssh ) THEN                     !* Update ocean depth (variable volume case only)
             !                                          !  ----------------------------------------------        
             hu_e (:,:) = hu_0(:,:) + zsshu_a(:,:)
@@ -788,11 +786,11 @@
             !
          ENDIF
-         !                                                 !* domain lateral boundary
-         !                                                 !  -----------------------
+         !                                             !* domain lateral boundary
+         !                                             !  -----------------------
          !
          CALL lbc_lnk_multi( ua_e, 'U', -1._wp, va_e , 'V', -1._wp )
-
+         !
 #if defined key_bdy  
-                                                           ! open boundaries
+         !                                                 ! open boundaries
          IF( lk_bdy ) CALL bdy_dyn2d( jn, ua_e, va_e, zun_e, zvn_e, hur_e, hvr_e, ssha_e )
 #endif
@@ -817,5 +815,5 @@
          !                                             !  ----------------------
          za1 = wgtbtp1(jn)                                    
-         IF (( ln_dynadv_vec ).OR. (.NOT. lk_vvl)) THEN    ! Sum velocities
+         IF( ln_dynadv_vec .OR. ln_linssh ) THEN    ! Sum velocities
             ua_b  (:,:) = ua_b  (:,:) + za1 * ua_e  (:,:) 
             va_b  (:,:) = va_b  (:,:) + za1 * va_e  (:,:) 
@@ -835,5 +833,5 @@
       ! At this stage ssha holds a time averaged value
       !                                                ! Sea Surface Height at u-,v- and f-points
-      IF( lk_vvl ) THEN                                ! (required only in key_vvl case)
+      IF( .NOT.ln_linssh ) THEN                        ! (required only in non-linear free surface case)
          DO jj = 1, jpjm1
             DO ji = 1, jpim1      ! NO Vector Opt.
@@ -864,5 +862,5 @@
       !
       ! Update barotropic trend:
-      IF( ln_dynadv_vec .OR. .NOT.lk_vvl ) THEN
+      IF( ln_dynadv_vec .OR. ln_linssh ) THEN
          DO jk=1,jpkm1
             ua(:,:,jk) = ua(:,:,jk) + ( ua_b(:,:) - ub_b(:,:) ) * z1_2dt_b
@@ -1079,5 +1077,5 @@
       CALL wrk_alloc( jpi, jpj, zcu )
       !
-      IF (lk_vvl) THEN 
+      IF( .NOT.ln_linssh ) THEN 
          DO jj = 1, jpj
             DO ji =1, jpi
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/dynzdf_imp.F90	(revision 5866)
@@ -33,5 +33,5 @@
    PUBLIC   dyn_zdf_imp   ! called by step.F90
 
-   REAL(wp) ::  r_vvl     ! variable volume indicator, =1 if lk_vvl=T, =0 otherwise 
+   REAL(wp) ::  r_vvl     ! variable volume indicator, =1 if ln_linssh=F, =0 otherwise 
 
    !! * Substitutions
@@ -81,6 +81,6 @@
          IF(lwp) WRITE(numout,*) '~~~~~~~~~~~ '
          !
-         IF( lk_vvl ) THEN   ;    r_vvl = 1._wp       ! Variable volume indicator
-         ELSE                ;    r_vvl = 0._wp       
+         IF( .NOT.ln_linssh ) THEN   ;    r_vvl = 1._wp       ! Variable volume indicator
+         ELSE                        ;    r_vvl = 0._wp       
          ENDIF
       ENDIF
@@ -119,17 +119,15 @@
 
 #if defined key_dynspg_ts
-      IF( ln_dynadv_vec .OR. .NOT. lk_vvl ) THEN      ! applied on velocity
+      IF( ln_dynadv_vec .OR. ln_linssh ) THEN      ! applied on velocity
          DO jk = 1, jpkm1
             ua(:,:,jk) = ( ub(:,:,jk) + p2dt * ua(:,:,jk) ) * umask(:,:,jk)
             va(:,:,jk) = ( vb(:,:,jk) + p2dt * va(:,:,jk) ) * vmask(:,:,jk)
          END DO
-      ELSE                                            ! applied on thickness weighted velocity
+      ELSE                                         ! applied on thickness weighted velocity
          DO jk = 1, jpkm1
-            ua(:,:,jk) = (          ub(:,:,jk) * e3u_b(:,:,jk)      &
-               &           + p2dt * ua(:,:,jk) * e3u_n(:,:,jk)  )   &
-               &                               / e3u_a(:,:,jk) * umask(:,:,jk)
-            va(:,:,jk) = (          vb(:,:,jk) * e3v_b(:,:,jk)      &
-               &           + p2dt * va(:,:,jk) * e3v_n(:,:,jk)  )   &
-               &                               / e3v_a(:,:,jk) * vmask(:,:,jk)
+            ua(:,:,jk) = (          ub(:,:,jk) * e3u_b(:,:,jk)    &
+               &           + p2dt * ua(:,:,jk) * e3u_n(:,:,jk)  ) / e3u_a(:,:,jk) * umask(:,:,jk)
+            va(:,:,jk) = (          vb(:,:,jk) * e3v_b(:,:,jk)    &
+               &           + p2dt * va(:,:,jk) * e3v_n(:,:,jk)  ) / e3v_a(:,:,jk) * vmask(:,:,jk)
          END DO
       ENDIF
@@ -178,7 +176,7 @@
                ze3ua =  ( 1._wp - r_vvl ) * e3u_n(ji,jj,jk) + r_vvl   * e3u_a(ji,jj,jk)   ! after scale factor at T-point
                zcoef = - p2dt / ze3ua      
-               zzwi          = zcoef * avmu  (ji,jj,jk  ) / e3uw_n(ji,jj,jk  )
+               zzwi  = zcoef * avmu(ji,jj,jk  ) / e3uw_n(ji,jj,jk  )
+               zzws  = zcoef * avmu(ji,jj,jk+1) / e3uw_n(ji,jj,jk+1) 
                zwi(ji,jj,jk) = zzwi  * wumask(ji,jj,jk  )
-               zzws          = zcoef * avmu  (ji,jj,jk+1) / e3uw_n(ji,jj,jk+1) 
                zws(ji,jj,jk) = zzws  * wumask(ji,jj,jk+1)
                zwd(ji,jj,jk) = 1._wp - zzwi - zzws
@@ -223,7 +221,7 @@
                &                                      / ( ze3ua * rau0 ) * umask(ji,jj,1) 
 #else
-            ua(ji,jj,1) = ub(ji,jj,1) &
-               &                   + p2dt *(ua(ji,jj,1) +  0.5_wp * ( utau_b(ji,jj) + utau(ji,jj) )   &
-               &                                      / ( e3u_n(ji,jj,1) * rau0     ) * umask(ji,jj,1) ) 
+            ua(ji,jj,1) = ub(ji,jj,1)  &
+               &        + p2dt *( ua(ji,jj,1) +  0.5_wp * ( utau_b(ji,jj) + utau(ji,jj) )   &
+               &                                        / ( e3u_n(ji,jj,1) * rau0 ) * umask(ji,jj,1) ) 
 #endif
          END DO
@@ -322,7 +320,7 @@
                &                                      / ( ze3va * rau0 ) 
 #else
-            va(ji,jj,1) = vb(ji,jj,1) &
-               &                   + p2dt *(va(ji,jj,1) +  0.5_wp * ( vtau_b(ji,jj) + vtau(ji,jj) )   &
-               &                                                       / ( e3v_n(ji,jj,1) * rau0     )  )
+            va(ji,jj,1) = vb(ji,jj,1)   &
+               &        + p2dt *( va(ji,jj,1) + 0.5_wp * ( vtau_b(ji,jj) + vtau(ji,jj) )   &
+               &                                       / ( e3v_n(ji,jj,1) * rau0 )         )
 #endif
          END DO
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/DYN/sshwzv.F90	(revision 5866)
@@ -259,5 +259,5 @@
       ELSE                                         !** Leap-Frog time-stepping: Asselin filter + swap
          sshb(:,:) = sshn(:,:) + atfp * ( sshb(:,:) - 2 * sshn(:,:) + ssha(:,:) )     ! before <-- now filtered
-         IF( lk_vvl ) sshb(:,:) = sshb(:,:) - atfp * rdt / rau0 * ( emp_b(:,:)    - emp(:,:)    &
+         IF( .NOT.ln_linssh )   sshb(:,:) = sshb(:,:) - atfp * rdt / rau0 * ( emp_b(:,:)    - emp(:,:)    &
                                 &                                 - rnf_b(:,:)    + rnf(:,:)    &
                                 &                                 + fwfisf_b(:,:) - fwfisf(:,:) ) * ssmask(:,:)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/IOM/restart.F90	(revision 5866)
@@ -245,5 +245,5 @@
          sshb (:,:)     = sshn (:,:)
          !
-         IF( lk_vvl ) THEN
+         IF( .NOT.ln_linssh ) THEN
             DO jk = 1, jpk
                e3t_b(:,:,jk) = e3t_n(:,:,jk)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/LDF/ldfslp.F90	(revision 5866)
@@ -766,5 +766,5 @@
 
          !!gm I no longer understand this.....
-!!gm         IF( (ln_traldf_hor .OR. ln_dynldf_hor) .AND. .NOT. (lk_vvl .AND. ln_rstart) ) THEN
+!!gm         IF( (ln_traldf_hor .OR. ln_dynldf_hor) .AND. .NOT. (.NOT.ln_linssh .AND. ln_rstart) ) THEN
 !            IF(lwp)   WRITE(numout,*) '          Horizontal mixing in s-coordinate: slope = slope of s-surfaces'
 !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbccpl.F90	(revision 5866)
@@ -534,5 +534,5 @@
          IF( .NOT. ln_cpl ) srcv(:)%nsgn    = 1.        ! force default definition in case of opa <-> sas coupling
          srcv( (/jpr_toce, jpr_soce, jpr_ssh, jpr_fraqsr, jpr_ocx1, jpr_ocy1/) )%laction = .TRUE.
-         srcv( jpr_e3t1st )%laction = lk_vvl
+         srcv( jpr_e3t1st )%laction = .NOT.ln_linssh
          srcv(jpr_ocx1)%clgrid = 'U'        ! oce components given at U-point
          srcv(jpr_ocy1)%clgrid = 'V'        !           and           V-point
@@ -700,5 +700,5 @@
          ssnd(:)%laction = .FALSE.   ! force default definition in case of opa <-> sas coupling
          ssnd( (/jps_toce, jps_soce, jps_ssh, jps_fraqsr, jps_ocx1, jps_ocy1/) )%laction = .TRUE.
-         ssnd( jps_e3t1st )%laction = lk_vvl
+         ssnd( jps_e3t1st )%laction = .NOT.ln_linssh
          ! vector definition: not used but cleaner...
          ssnd(jps_ocx1)%clgrid  = 'U'        ! oce components given at U-point
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcice_cice.F90	(revision 5866)
@@ -240,47 +240,48 @@
          snwice_mass_b(:,:) = 0.0_wp         ! no mass exchanges
       ENDIF
-      IF( .NOT. ln_rstart ) THEN
+      IF( .NOT.ln_rstart ) THEN
          IF( nn_ice_embd == 2 ) THEN            ! full embedment (case 2) deplete the initial ssh below sea-ice area
             sshn(:,:) = sshn(:,:) - snwice_mass(:,:) * r1_rau0
             sshb(:,:) = sshb(:,:) - snwice_mass(:,:) * r1_rau0
-#if defined key_vvl            
-!!gm key_vvl necessary? clem: yes for compilation purpose
-!!gm same remark as in limsbc
-            DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
-               e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-               e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
-            ENDDO
-            e3t_a(:,:,:) = e3t_b(:,:,:)
-            ! Reconstruction of all vertical scale factors at now and before time
-            ! steps
-            ! =============================================================================
-            ! Horizontal scale factor interpolations
-            ! --------------------------------------
-            CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
-            CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
-            CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
-            ! Vertical scale factor interpolations
-            ! ------------------------------------
-            CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
-            CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
-            CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
-            CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
-            CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
-            ! t- and w- points depth
-            ! ----------------------
-            gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
-            gdepw_n(:,:,1) = 0.0_wp
-            gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
-            DO jk = 2, jpk
-               gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
-               gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
-               gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
-            END DO
-#endif
+
+!!gm This should be put elsewhere....   (same remark for limsbc)
+!!gm especially here it is assumed zstar coordinate, but it can be ztilde....
+            IF( .NOT.ln_linssh ) THEN
+               !
+               DO jk = 1,jpkm1                     ! adjust initial vertical scale factors
+                  e3t_n(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshn(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+                  e3t_b(:,:,jk) = e3t_0(:,:,jk)*( 1._wp + sshb(:,:)*tmask(:,:,1)/(ht_0(:,:) + 1.0 - tmask(:,:,1)) )
+               ENDDO
+               e3t_a(:,:,:) = e3t_b(:,:,:)
+               ! Reconstruction of all vertical scale factors at now and before time-steps
+               ! =============================================================================
+               ! Horizontal scale factor interpolations
+               ! --------------------------------------
+               CALL dom_vvl_interpol( e3t_b(:,:,:), e3u_b(:,:,:), 'U' )
+               CALL dom_vvl_interpol( e3t_b(:,:,:), e3v_b(:,:,:), 'V' )
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3u_n(:,:,:), 'U' )
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3v_n(:,:,:), 'V' )
+               CALL dom_vvl_interpol( e3u_n(:,:,:), e3f_n(:,:,:), 'F' )
+               ! Vertical scale factor interpolations
+               ! ------------------------------------
+               CALL dom_vvl_interpol( e3t_n(:,:,:), e3w_n (:,:,:), 'W'  )
+               CALL dom_vvl_interpol( e3u_n(:,:,:), e3uw_n(:,:,:), 'UW' )
+               CALL dom_vvl_interpol( e3v_n(:,:,:), e3vw_n(:,:,:), 'VW' )
+               CALL dom_vvl_interpol( e3u_b(:,:,:), e3uw_b(:,:,:), 'UW' )
+               CALL dom_vvl_interpol( e3v_b(:,:,:), e3vw_b(:,:,:), 'VW' )
+               ! t- and w- points depth
+               ! ----------------------
+               gdept_n(:,:,1) = 0.5_wp * e3w_n(:,:,1)
+               gdepw_n(:,:,1) = 0.0_wp
+               gde3w_n(:,:,1) = gdept_n(:,:,1) - sshn(:,:)
+               DO jk = 2, jpk
+                  gdept_n(:,:,jk) = gdept_n(:,:,jk-1) + e3w_n(:,:,jk)
+                  gdepw_n(:,:,jk) = gdepw_n(:,:,jk-1) + e3t_n(:,:,jk-1)
+                  gde3w_n(:,:,jk) = gdept_n(:,:,jk  ) - sshn   (:,:)
+               END DO
+            ENDIF
          ENDIF
       ENDIF
- 
+      !
       CALL wrk_dealloc( jpi,jpj, ztmp1, ztmp2 )
       !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcisf.F90	(revision 5866)
@@ -780,5 +780,5 @@
       zfact   = 0.5_wp
       !
-      IF (lk_vvl) THEN     ! need to re compute level distribution of isf fresh water
+      IF(.NOT.ln_linssh ) THEN     ! need to re compute level distribution of isf fresh water
          DO jj = 1,jpj
             DO ji = 1,jpi
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcrnf.F90	(revision 5866)
@@ -209,5 +209,5 @@
       !
       IF( ln_rnf_depth .OR. ln_rnf_depth_ini ) THEN      !==   runoff distributed over several levels   ==!
-         IF( lk_vvl ) THEN             ! variable volume case
+         IF( .NOT.ln_linssh ) THEN     ! variable volume case
             DO jj = 1, jpj                   ! update the depth over which runoffs are distributed
                DO ji = 1, jpi
@@ -232,5 +232,5 @@
          ENDIF
       ELSE                       !==   runoff put only at the surface   ==!
-         IF( lk_vvl ) THEN              ! variable volume case
+         IF( .NOT.ln_linssh ) THEN              ! variable volume case
             h_rnf(:,:) = e3t_n(:,:,1)   ! recalculate h_rnf to be depth of top box
          ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/SBC/sbcssm.F90	(revision 5866)
@@ -78,5 +78,5 @@
          ENDIF
          !
-         IF( lk_vvl )   e3t_m(:,:) = e3t_n(:,:,1)
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = e3t_n(:,:,1)
          !
          frq_m(:,:) = fraqsr_1lev(:,:)
@@ -100,5 +100,5 @@
             ENDIF
             !
-            IF( lk_vvl )   e3t_m(:,:) = zcoef * e3t_n(:,:,1)
+            IF( .NOT.ln_linssh )   e3t_m(:,:) = zcoef * e3t_n(:,:,1)
             !
             frq_m(:,:) = zcoef * fraqsr_1lev(:,:)
@@ -106,11 +106,11 @@
          ELSEIF( MOD( kt - 2 , nn_fsbc ) == 0 ) THEN      !   Initialisation: New mean computation   !
             !                                             ! ---------------------------------------- !
-            ssu_m(:,:) = 0.e0      ! reset to zero ocean mean sbc fields
-            ssv_m(:,:) = 0.e0
-            sst_m(:,:) = 0.e0
-            sss_m(:,:) = 0.e0
-            ssh_m(:,:) = 0.e0
-            IF( lk_vvl )   e3t_m(:,:) = 0.e0
-            frq_m(:,:) = 0.e0
+            ssu_m(:,:) = 0._wp     ! reset to zero ocean mean sbc fields
+            ssv_m(:,:) = 0._wp
+            sst_m(:,:) = 0._wp
+            sss_m(:,:) = 0._wp
+            ssh_m(:,:) = 0._wp
+            IF( .NOT.ln_linssh )   e3t_m(:,:) = 0._wp
+            frq_m(:,:) = 0._wp
          ENDIF
          !                                                ! ---------------------------------------- !
@@ -128,5 +128,5 @@
          ENDIF
          !
-         IF( lk_vvl )   e3t_m(:,:) = e3t_m(:,:) + e3t_n(:,:,1)
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = e3t_m(:,:) + e3t_n(:,:,1)
          !
          frq_m(:,:) =   frq_m(:,:) + fraqsr_1lev(:,:)
@@ -141,5 +141,5 @@
             ssv_m(:,:) = ssv_m(:,:) * zcoef           !
             ssh_m(:,:) = ssh_m(:,:) * zcoef           ! mean SSH             [m]
-            IF( lk_vvl )   e3t_m(:,:) = e3t_m(:,:) * zcoef   ! mean vertical scale factor [m]
+            IF( .NOT.ln_linssh )   e3t_m(:,:) = e3t_m(:,:) * zcoef   ! mean vertical scale factor [m]
             frq_m(:,:) = frq_m(:,:) * zcoef   ! mean fraction of solar net radiation absorbed in the 1st T level [-]
             !
@@ -159,5 +159,5 @@
             CALL iom_rstput( kt, nitrst, numrow, 'sss_m'  , sss_m  )
             CALL iom_rstput( kt, nitrst, numrow, 'ssh_m'  , ssh_m  )
-            IF( lk_vvl )   CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m  )
+            IF( .NOT.ln_linssh )   CALL iom_rstput( kt, nitrst, numrow, 'e3t_m'  , e3t_m  )
             CALL iom_rstput( kt, nitrst, numrow, 'frq_m'  , frq_m  )
             !
@@ -172,5 +172,5 @@
          CALL iom_put( 'sss_m', sss_m )
          CALL iom_put( 'ssh_m', ssh_m )
-         IF( lk_vvl )   CALL iom_put( 'e3t_m', e3t_m )
+         IF( .NOT.ln_linssh )   CALL iom_put( 'e3t_m', e3t_m )
          CALL iom_put( 'frq_m', frq_m )
       ENDIF
@@ -209,5 +209,5 @@
             CALL iom_get( numror, jpdom_autoglo, 'sss_m'  , sss_m  )   !   "         "    salinity    (T-point)
             CALL iom_get( numror, jpdom_autoglo, 'ssh_m'  , ssh_m  )   !   "         "    height      (T-point)
-            IF( lk_vvl ) CALL iom_get( numror, jpdom_autoglo, 'e3t_m', e3t_m )
+            IF( .NOT.ln_linssh )   CALL iom_get( numror, jpdom_autoglo, 'e3t_m', e3t_m )
             ! fraction of solar net radiation absorbed in 1st T level
             IF( iom_varid( numror, 'frq_m', ldstop = .FALSE. ) > 0 ) THEN
@@ -226,5 +226,5 @@
                sss_m(:,:) = zcoef * sss_m(:,:)
                ssh_m(:,:) = zcoef * ssh_m(:,:)
-               IF( lk_vvl )   e3t_m(:,:) = zcoef * e3t_m(:,:)
+               IF( .NOT.ln_linssh )   e3t_m(:,:) = zcoef * e3t_m(:,:)
                frq_m(:,:) = zcoef * frq_m(:,:)
             ELSE
@@ -244,5 +244,5 @@
          sss_m(:,:) = tsn(:,:,1,jp_sal)
          ssh_m(:,:) = sshn(:,:)
-         IF( lk_vvl )   e3t_m(:,:) = e3t_n(:,:,1)
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = e3t_n(:,:,1)
          frq_m(:,:) = 1._wp
          !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv.F90	(revision 5866)
@@ -228,5 +228,5 @@
             CALL ctl_stop( 'tra_adv_init: force 2nd order FCT scheme, 4th order does not exist with sub-timestepping' )
          ENDIF
-         IF( lk_vvl ) THEN
+         IF( .NOT.ln_linssh ) THEN
             CALL ctl_stop( 'tra_adv_init: vertical sub-timestepping not allow in non-linear free surface' )
          ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_cen.F90	(revision 5866)
@@ -90,6 +90,6 @@
       !
       !                          ! surface & bottom values 
-      IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all
-                     zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface
+      IF( .NOT.ln_linssh )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all
+                             zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface
       !
       DO jn = 1, kjpt            !==  loop over the tracers  ==!
@@ -164,5 +164,5 @@
          END SELECT
          !
-         IF(.NOT.lk_vvl ) THEN               !* top value   (only in linear free surf. as zwz is multiplied by wmask)
+         IF( ln_linssh ) THEN                !* top value   (only in linear free surf. as zwz is multiplied by wmask)
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
                DO jj = 1, jpj
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_fct.F90	(revision 5866)
@@ -102,5 +102,5 @@
       !
       !                                         ! surface & bottom value : flux set to zero one for all
-      IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp                ! except at the surface in linear free surface case
+      IF( .NOT.ln_linssh )   zwz(:,:, 1 ) = 0._wp                ! except at the surface in linear free surface case
       zwx(:,:,jpk) = 0._wp   ;   zwy(:,:,jpk) = 0._wp    ;    zwz(:,:,jpk) = 0._wp
       !
@@ -136,5 +136,5 @@
          END DO
          !                    
-         IF(.NOT.lk_vvl ) THEN   ! top ocean value (only in linear free surface as zwz has been w-masked)
+         IF( ln_linssh ) THEN    ! top ocean value (only in linear free surface as zwz has been w-masked)
             IF( ln_isfcav ) THEN             ! top of the ice-shelf cavities and at the ocean surface
                DO jj = 1, jpj
@@ -428,5 +428,5 @@
          END DO
          !                       ! top value
-         IF( lk_vvl ) THEN             ! variable volume: only k=1 as zwz is multiplied by wmask
+         IF( .NOT.ln_linssh ) THEN             ! variable volume: only k=1 as zwz is multiplied by wmask
             zwz(:,:, 1 ) = 0._wp
          ELSE                          ! linear free surface
@@ -502,5 +502,5 @@
          ztrs   (:,:,:,1) = ptb(:,:,:,jn)
          zwzts  (:,:,:)   = 0._wp
-         IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp    ! surface value set to zero in vvl case
+         IF( .NOT.ln_linssh )   zwz(:,:, 1 ) = 0._wp    ! surface value set to zero in vvl case
          !
          DO jl = 1, kn_fct_zts                  ! Start of sub timestepping loop
@@ -528,5 +528,5 @@
                END DO
             END DO
-            IF(.NOT.lk_vvl ) THEN                    ! top value (only in linear free surface case)
+            IF( ln_linssh ) THEN                    ! top value (only in linear free surface case)
                IF( ln_isfcav ) THEN                      ! ice-shelf cavities
                   DO jj = 1, jpj
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_mus.F90	(revision 5866)
@@ -250,7 +250,5 @@
          END DO
          !                                      ! top values  (bottom already set to zero)
-         IF( lk_vvl ) THEN                            !  variable volume
-            zwx(:,:, 1 ) = 0._wp                            ! k=1 only as zwx has been multiplied by wmask
-         ELSE                                         ! linear free surface 
+         IF( ln_linssh ) THEN                         !* linear free surface 
             IF( ln_isfcav ) THEN                            ! ice-shelf cavities (top of the ocean)
                DO jj = 1, jpj
@@ -262,4 +260,6 @@
                zwx(:,:,1) = pwn(:,:,1) * ptb(:,:,1,jn)
             ENDIF
+         ELSE                                       !* non-linear free surface
+            zwx(:,:, 1 ) = 0._wp                            ! k=1 only as zwx has been multiplied by wmask
          ENDIF
          !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_qck.F90	(revision 5866)
@@ -382,6 +382,6 @@
       !
       !                          ! surface & bottom values 
-      IF( lk_vvl )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all
-                     zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface
+      IF( .NOT.ln_linssh )   zwz(:,:, 1 ) = 0._wp             ! set to zero one for all
+                             zwz(:,:,jpk) = 0._wp             ! except at the surface in linear free surface
       !
       !                                                          ! ===========
@@ -396,5 +396,5 @@
             END DO
          END DO
-         IF(.NOT.lk_vvl ) THEN               !* top value   (only in linear free surf. as zwz is multiplied by wmask)
+         IF( ln_linssh ) THEN                !* top value   (only in linear free surf. as zwz is multiplied by wmask)
             IF( ln_isfcav ) THEN                  ! ice-shelf cavities (top of the ocean)
                DO jj = 1, jpj
@@ -421,5 +421,5 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwz )
+      CALL wrk_dealloc( jpi,jpj,jpk,   zwz )
       !
    END SUBROUTINE tra_adv_cen2_k
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traadv_ubs.F90	(revision 5866)
@@ -112,5 +112,5 @@
       zltu(:,:,jpk) = 0._wp   ;   zltv(:,:,jpk) = 0._wp     ! Bottom value : set to zero one for all
       ztw (:,:,jpk) = 0._wp   ;   zti (:,:,jpk) = 0._wp
-      IF( lk_vvl )   ztw(:,:, 1 ) = 0._wp                   ! surface value: set to zero only in vvl case
+      IF( .NOT.ln_linssh )   ztw(:,:, 1 ) = 0._wp                   ! surface value: set to zero only in vvl case
       !
       !                                                          ! ===========
@@ -199,5 +199,5 @@
                END DO
             END DO 
-            IF(.NOT.lk_vvl ) THEN            ! top ocean value (only in linear free surface as ztw has been w-masked)
+            IF( ln_linssh ) THEN             ! top ocean value (only in linear free surface as ztw has been w-masked)
                IF( ln_isfcav ) THEN                ! top of the ice-shelf cavities and at the ocean surface
                   DO jj = 1, jpj
@@ -233,5 +233,5 @@
             END DO
             !                                            ! top ocean value: high order == upstream  ==>>  zwz=0
-            IF(.NOT.lk_vvl )   ztw(:,:, 1 ) = 0._wp      ! only ocean surface as interior zwz values have been w-masked
+            IF( ln_linssh )   ztw(:,:, 1 ) = 0._wp       ! only ocean surface as interior zwz values have been w-masked
             !
             CALL nonosc_z( ptb(:,:,:,jn), ztw, zti, p2dt )      !  monotonicity algorithm
@@ -246,5 +246,5 @@
                END DO
             END DO
-            IF(.NOT.lk_vvl )   ztw(:,:, 1 ) = pwn(:,:,1) * ptn(:,:,1,jn)     !!gm ISF & 4th COMPACT doesn't work
+            IF( ln_linssh )   ztw(:,:, 1 ) = pwn(:,:,1) * ptn(:,:,1,jn)     !!gm ISF & 4th COMPACT doesn't work
             !
          END SELECT
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/tranxt.F90	(revision 5866)
@@ -144,7 +144,7 @@
       ELSE                                            ! Leap-Frog + Asselin filter time stepping
          !
-         IF( lk_vvl )  THEN   ;   CALL tra_nxt_vvl( kt, nit000, rdttra, 'TRA', tsb, tsn, tsa,   &
-           &                                                              sbc_tsc, sbc_tsc_b, jpts )  ! variable volume level (vvl) 
-         ELSE                 ;   CALL tra_nxt_fix( kt, nit000,         'TRA', tsb, tsn, tsa, jpts )  ! fixed    volume level 
+         IF( ln_linssh ) THEN   ;   CALL tra_nxt_fix( kt, nit000,         'TRA', tsb, tsn, tsa, jpts )  ! linear free surface 
+         ELSE                   ;   CALL tra_nxt_vvl( kt, nit000, rdttra, 'TRA', tsb, tsn, tsa,   &
+           &                                                                sbc_tsc, sbc_tsc_b, jpts )  ! non-linear free surface
          ENDIF
       ENDIF     
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/traqsr.F90	(revision 5866)
@@ -182,5 +182,5 @@
             !                                             ! ------------------------- !
             ! Set chlorophyl concentration
-            IF( nn_chldta == 1 .OR. lk_vvl ) THEN            !*  Variable Chlorophyll or ocean volume
+            IF( nn_chldta == 1 .OR. .NOT.ln_linssh ) THEN            !*  Variable Chlorophyll or ocean volume
                !
                IF( nn_chldta == 1 ) THEN                             !*  Variable Chlorophyll
@@ -261,5 +261,5 @@
             !                                             ! ------------------------- !
             !
-            IF( lk_vvl ) THEN                                  !* variable volume
+            IF( .NOT.ln_linssh ) THEN                                  !* variable volume
                zz0   =        rn_abs   * r1_rau0_rcp
                zz1   = ( 1. - rn_abs ) * r1_rau0_rcp
@@ -376,6 +376,6 @@
       IF( nn_timing == 1 )  CALL timing_start('tra_qsr_init')
       !
-      CALL wrk_alloc( jpi, jpj,      zekb, zekg, zekr        ) 
-      CALL wrk_alloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) 
+      CALL wrk_alloc( jpi,jpj,       zekb, zekg, zekr        ) 
+      CALL wrk_alloc( jpi,jpj,jpk,   ze0, ze1, ze2, ze3, zea ) 
       !
 
@@ -470,8 +470,8 @@
                IF(lwp) WRITE(numout,*)
                IF(lwp) WRITE(numout,*) '        Constant Chlorophyll concentration = 0.05'
-               IF( lk_vvl ) THEN                   ! variable volume
-                  IF(lwp) WRITE(numout,*) '        key_vvl: light distribution will be computed at each time step'
+               IF( .NOT.ln_linssh ) THEN                   ! variable volume
+                  IF(lwp) WRITE(numout,*) '        non-linear free surface: light distribution will be computed at each time step'
                ELSE                                ! constant volume: computes one for all
-                  IF(lwp) WRITE(numout,*) '        fixed volume: light distribution computed one for all'
+                  IF(lwp) WRITE(numout,*) '        linear free surface: light distribution computed one for all'
                   !
                   zchl = 0.05                                 ! constant chlorophyll
@@ -524,6 +524,6 @@
             ENDIF
             !
-            IF( lk_vvl ) THEN                   ! variable volume
-               IF(lwp) WRITE(numout,*) '        key_vvl: light distribution will be computed at each time step'
+            IF( .NOT.ln_linssh ) THEN                   ! variable volume
+               IF(lwp) WRITE(numout,*) '        non-linear free surface: light distribution will be computed at each time step'
             ELSE                                ! constant volume: computes one for all
                zz0 =        rn_abs   * r1_rau0_rcp
@@ -538,5 +538,5 @@
                   END DO
                END DO
-               etot3(:,:,nksr+1:jpk) = 0.e0                   ! below 400m set to zero
+               etot3(:,:,nksr+1:jpk) = 0._wp                  ! below 400m set to zero
                !
             ENDIF
@@ -559,6 +559,6 @@
       ENDIF
       !
-      CALL wrk_dealloc( jpi, jpj,      zekb, zekg, zekr        ) 
-      CALL wrk_dealloc( jpi, jpj, jpk, ze0, ze1, ze2, ze3, zea ) 
+      CALL wrk_dealloc( jpi,jpj,       zekb, zekg, zekr        ) 
+      CALL wrk_dealloc( jpi,jpj,jpk,   ze0, ze1, ze2, ze3, zea ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_qsr_init')
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trasbc.F90	(revision 5866)
@@ -74,5 +74,5 @@
       !!      The formulation for Fwb and Fwi vary according to the free 
       !!      surface formulation (linear or variable volume). 
-      !!      * Linear free surface
+      !!      * Linear free surface (ln_linssh=T)
       !!            The surface freshwater flux modifies the ocean volume
       !!         and thus the concentration of a tracer and the temperature.
@@ -100,5 +100,5 @@
       !!         forcing and must be taken into account in the global heat
       !!         balance).
-      !!      * nonlinear free surface (variable volume, lk_vvl)
+      !!      * nonlinear free surface (ln_linssh=F)
       !!         contrary to the linear free surface case, Fwi is properly 
       !!         taken into account by using the true layer thicknesses to       
@@ -145,8 +145,8 @@
       !        EMP, SFX and QNS effects
       !----------------------------------------
-      !                                          Set before sbc tracer content fields
-      !                                          ************************************
+      !                                   !==  Set before sbc tracer content fields  ==!
+      !
       IF( kt == nit000 ) THEN                      ! Set the forcing field at nit000 - 1
-         !                                         ! -----------------------------------
+         !
          IF( ln_rstart .AND.    &                     ! Restart: read in restart file
               & iom_varid( numror, 'sbc_hc_b', ldstop = .FALSE. ) > 0 ) THEN
@@ -160,5 +160,4 @@
          ENDIF
       ELSE                                         ! Swap of forcing fields
-         !                                         ! ----------------------
          zfact = 0.5_wp
          sbc_tsc_b(:,:,:) = sbc_tsc(:,:,:)
@@ -170,5 +169,5 @@
                                                    ! evaporation, precipitation and qns, but not river runoff 
                                                
-      IF( lk_vvl ) THEN                            ! Variable Volume case  ==>> heat content of mass flux is in qns
+      IF( .NOT.ln_linssh ) THEN                    !* Variable Volume case  ==>> heat content of mass flux is in qns
          DO jj = 1, jpj
             DO ji = 1, jpi 
@@ -177,5 +176,5 @@
             END DO
          END DO
-      ELSE                                         ! Constant Volume case ==>> Concentration dilution effect
+      ELSE                                         !* Constant Volume case ==>> Concentration dilution effect
          DO jj = 2, jpj
             DO ji = fs_2, fs_jpim1   ! vector opt.
@@ -191,5 +190,5 @@
          IF( iom_use('emp_x_sss') )   CALL iom_put( "emp_x_sss", emp (:,:) * tsn(:,:,1,jp_sal) )   ! c/d term on sss
       ENDIF
-      ! Concentration dilution effect on (t,s) due to evapouration, precipitation and qns, but not river runoff  
+      !
       DO jn = 1, jpts
          DO jj = 2, jpj
@@ -218,5 +217,5 @@
       !
       IF( nn_isf > 0 ) THEN
-         zfact = 0.5e0
+         zfact = 0.5_wp
          DO jj = 2, jpj
             DO ji = fs_2, fs_jpim1
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 5866)
@@ -66,13 +66,9 @@
       !!      (N.B. bottom condition is applied through the masked field avt).
       !!              - the after tracer fields due to the whole trend is 
-      !!      obtained in leap-frog environment by :
-      !!          pta = zwx + p2dt pta
-      !!              - in case of variable level thickness (lk_vvl=T) the 
-      !!     the leap-frog is applied on thickness weighted tracer. That is:
+      !!      obtained in leap-frog environment applied on thickness weighted tracer by :
       !!          pta = [ ptb*e3tb + e3tn*( zwx - ptb + p2dt pta ) ] / e3tn
       !!
       !! ** Action : - after tracer fields pta
       !!---------------------------------------------------------------------
-      !
       INTEGER                              , INTENT(in   ) ::   kt          ! ocean time-step index
       INTEGER                              , INTENT(in   ) ::   kit000      ! first time step index
@@ -92,5 +88,5 @@
       IF( nn_timing == 1 )  CALL timing_start('tra_zdf_exp')
       !
-      CALL wrk_alloc( jpi, jpj, jpk, zwx, zwy ) 
+      CALL wrk_alloc( jpi,jpj,jpk,   zwx, zwy ) 
       !
 
@@ -121,5 +117,5 @@
                DO jj = 2, jpjm1 
                   DO ji = fs_2, fs_jpim1   ! vector opt.
-                     zave3r = 1.e0 / e3w_n(ji,jj,jk) 
+                     zave3r = 1.e0 / e3w_n(ji,jj,jk)            !!gm here it should be e3w_b  ????
                      IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN  ! temperature : use of avt
                         zwy(ji,jj,jk) =   avt(ji,jj,jk) * ( zwx(ji,jj,jk-1) - zwx(ji,jj,jk) ) * zave3r
@@ -144,5 +140,5 @@
          ! After tracer due to all trends
          ! ------------------------------
-         IF( lk_vvl ) THEN          ! variable level thickness : leap-frog on tracer*e3t
+         IF( .NOT.ln_linssh ) THEN     ! variable level thickness : leap-frog on tracer*e3t
             DO jk = 1, jpkm1
                DO jj = 2, jpjm1 
@@ -154,5 +150,5 @@
                END DO
             END DO
-         ELSE                       ! fixed level thickness : leap-frog on tracers
+         ELSE                          ! fixed level thickness : leap-frog on tracers
             DO jk = 1, jpkm1
                DO jj = 2, jpjm1 
@@ -166,5 +162,5 @@
       END DO
       !
-      CALL wrk_dealloc( jpi, jpj, jpk, zwx, zwy ) 
+      CALL wrk_dealloc( jpi,jpj,jpk,   zwx, zwy ) 
       !
       IF( nn_timing == 1 )  CALL timing_stop('tra_zdf_exp')
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 5866)
@@ -42,5 +42,5 @@
    PUBLIC   tra_zdf_imp   !  routine called by step.F90
 
-   REAL(wp) ::  r_vvl     ! variable volume indicator, =1 if lk_vvl=T, =0 otherwise 
+   REAL(wp) ::  r_vvl     ! variable volume indicator, =1 if ln_linssh=F, =0 otherwise 
 
    !! * Substitutions
@@ -95,6 +95,6 @@
          IF(lwp)WRITE(numout,*) '~~~~~~~~~~~ '
          !
-         IF( lk_vvl ) THEN   ;    r_vvl = 1._wp       ! Variable volume indicator
-         ELSE                ;    r_vvl = 0._wp       
+         IF( .NOT.ln_linssh ) THEN   ;    r_vvl = 1._wp       ! Variable volume indicator
+         ELSE                        ;    r_vvl = 0._wp       
          ENDIF
       ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90	(revision 5866)
@@ -102,9 +102,9 @@
             END DO
             !                       ! linear free surface: diagnose advective flux trough the fixed k=1 w-surface
-            IF( .NOT.lk_vvl .AND. ktrd == jptra_zad ) THEN  
-               tmo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) )
-               smo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  )
-               t2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:)  )
-               s2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:)  )
+            IF( ln_linssh .AND. ktrd == jptra_zad ) THEN  
+               tmo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * e1e2t(:,:) * tmask_i(:,:) )
+               smo(jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * e1e2t(:,:) * tmask_i(:,:)  )
+               t2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_tem) * tsn(:,:,1,jp_tem) * e1e2t(:,:) * tmask_i(:,:)  )
+               s2 (jptra_sad) = SUM( wn(:,:,1) * tsn(:,:,1,jp_sal) * tsn(:,:,1,jp_sal) * e1e2t(:,:) * tmask_i(:,:)  )
             ENDIF
             !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdini.F90	(revision 5866)
@@ -90,5 +90,5 @@
 !!gm end
       !
-      IF( lk_vvl .AND. ( l_trdtra .OR. l_trddyn ) )  CALL ctl_stop( 'trend diagnostics with variable volume not validated' )
+      IF( .NOT.ln_linssh .AND. ( l_trdtra .OR. l_trddyn ) )  CALL ctl_stop( 'trend diagnostics with variable volume not validated' )
       
 !!gm  : Potential BUG : 3D output only for vector invariant form!  add a ctl_stop or code the flux form case
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdken.F90	(revision 5866)
@@ -93,5 +93,5 @@
       CALL lbc_lnk( putrd, 'U', -1. )   ;   CALL lbc_lnk( pvtrd, 'V', -1. )      ! lateral boundary conditions
       !
-      IF ( lk_vvl .AND. kt /= nkstp ) THEN   ! Variable volume: set box volume at the 1st call of kt time step
+      IF( .NOT.ln_linssh .AND. kt /= nkstp ) THEN   ! Variable volume: set box volume at the 1st call of kt time step
          nkstp = kt
          DO jk = 1, jpkm1
@@ -268,5 +268,5 @@
 !!gm         &   CALL ctl_stop('trd_ken_init : only full and partial cells are coded for conversion rate')
       !
-      IF( .NOT.lk_vvl ) THEN      ! constant volume: bu, bv, 1/bt computed one for all
+      IF( ln_linssh ) THEN      ! constant volume: bu, bv, 1/bt computed one for all
          DO jk = 1, jpkm1
             bu   (:,:,jk) =           e1e2u(:,:) * e3u_n(:,:,jk)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90	(revision 5866)
@@ -96,5 +96,5 @@
       CASE ( jptra_yad  )   ;   CALL iom_put( "petrd_yad", zpe )   ! merid.   advection
       CASE ( jptra_zad  )   ;   CALL iom_put( "petrd_zad", zpe )   ! vertical advection
-                                IF( .NOT.lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface
+                                IF( ln_linssh ) THEN                   ! cst volume : adv flux through z=0 surface
                                    CALL wrk_alloc( jpi, jpj, z2d )
                                    z2d(:,:) = wn(:,:,1) * ( &
@@ -115,5 +115,5 @@
       CASE ( jptra_bbc  )   ;   CALL iom_put( "petrd_bbc" , zpe )   ! bottom bound cond (geoth flux)
       CASE ( jptra_atf  )   ;   CALL iom_put( "petrd_atf" , zpe )   ! asselin time filter (last trend)
-                                !IF( .NOT.lk_vvl ) THEN                   ! cst volume : ssh term (otherwise include in e3t variation)
+                                !IF( ln_linssh ) THEN                   ! cst volume : ssh term (otherwise include in e3t variation)
                                 !   CALL wrk_alloc( jpi, jpj, z2d )
                                 !   z2d(:,:) = ( ssha(:,:) - sshb(:,:) )                 &
@@ -150,5 +150,5 @@
       rab_pe(:,:,:,:) = 0._wp
       !
-      IF ( lk_vvl               )   CALL ctl_stop('trd_pen_init : PE trends not coded for variable volume')
+      IF( .NOT.ln_linssh )   CALL ctl_stop('trd_pen_init : PE trends not coded for variable volume')
       !
       nkstp     = nit000 - 1
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 5866)
@@ -305,5 +305,5 @@
       CASE( jptra_zad  )   ;   CALL iom_put( "ttrd_zad" , ptrdx )        ! z- vertical   advection
                                CALL iom_put( "strd_zad" , ptrdy )
-                               IF( .NOT. lk_vvl ) THEN                   ! cst volume : adv flux through z=0 surface
+                               IF( ln_linssh ) THEN                   ! cst volume : adv flux through z=0 surface
                                	 CALL wrk_alloc( jpi, jpj, z2dx, z2dy )
                                   z2dx(:,:) = wn(:,:,1) * tsn(:,:,1,jp_tem) / e3t_n(:,:,1)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfbfr.F90	(revision 5866)
@@ -110,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
@@ -370,5 +370,5 @@
          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
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 5866)
@@ -178,7 +178,7 @@
       !  Ocean dynamics : hdiv, ssh, e3, wn
       !<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-                         CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_hor)
-      IF( lk_vvl     )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors 
-                         CALL wzv           ( kstp )  ! now cross-level velocity 
+                             CALL ssh_nxt       ( kstp )  ! after ssh (includes call to div_hor)
+      IF( .NOT.ln_linssh )   CALL dom_vvl_sf_nxt( kstp )  ! after vertical scale factors 
+                             CALL wzv           ( kstp )  ! now cross-level velocity 
 
       IF( lk_dynspg_ts ) THEN 
@@ -217,5 +217,5 @@
 
                                   CALL div_hor( kstp )         ! Horizontal divergence  (2nd call in time-split case)
-          IF( lk_vvl     )        CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component)
+          IF( .NOT.ln_linssh )    CALL dom_vvl_sf_nxt( kstp, kcall=2 )  ! after vertical scale factors (update depth average component)
                                   CALL wzv           ( kstp )  ! now cross-level velocity 
       ENDIF
@@ -331,5 +331,5 @@
 
                                CALL ssh_swp( kstp )         ! swap of sea surface height
-      IF( lk_vvl           )   CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors
+      IF( .NOT.ln_linssh )     CALL dom_vvl_sf_swp( kstp )  ! swap of vertical scale factors
       !
 
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90	(revision 5866)
@@ -88,9 +88,9 @@
          ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
          ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
-         IF( lk_vvl )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
       ELSE
          ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1)    ! u-velocity
          ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1)    ! v-velocity 
-         IF( lk_vvl )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
+         IF( .NOT.ln_linssh )   e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1)    ! v-velocity 
       ENDIF
       !
@@ -115,6 +115,6 @@
          CALL prt_ctl(tab2d_1=ssv_m, clinfo1=' ssv_m   - : ', mask1=vmask, ovlap=1   )
          CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' ssh_m   - : ', mask1=tmask, ovlap=1   )
-         IF( lk_vvl      )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   )
-         IF( ln_read_frq )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   )
+         IF( .NOT.ln_linssh )   CALL prt_ctl(tab2d_1=ssh_m, clinfo1=' e3t_m   - : ', mask1=tmask, ovlap=1   )
+         IF( ln_read_frq    )   CALL prt_ctl(tab2d_1=frq_m, clinfo1=' frq_m   - : ', mask1=tmask, ovlap=1   )
       ENDIF
       !
@@ -125,6 +125,6 @@
          CALL iom_put( 'sss_m', sss_m )
          CALL iom_put( 'ssh_m', ssh_m )
-         IF( lk_vvl      )   CALL iom_put( 'e3t_m', e3t_m )
-         IF( ln_read_frq )   CALL iom_put( 'frq_m', frq_m )
+         IF( .NOT.ln_linssh )   CALL iom_put( 'e3t_m', e3t_m )
+         IF( ln_read_frq    )   CALL iom_put( 'frq_m', frq_m )
       ENDIF
       !
@@ -216,10 +216,10 @@
       IF( ln_3d_uve ) THEN
          jf_usp = 1 ; jf_vsp = 2 ; jf_e3t = 3      ! define 3D fields index
-         nfld_3d  = 2 + COUNT( (/lk_vvl/) )        ! number of 3D fields to read
+         nfld_3d  = 2 + COUNT( (/.NOT.ln_linssh/) )        ! number of 3D fields to read
          nfld_2d  = 3 + COUNT( (/ln_read_frq/) )   ! number of 2D fields to read
       ELSE
-         jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/lk_vvl/) )   ! update 2D fields index
+         jf_usp = 4 ; jf_vsp = 5 ; jf_e3t = 6 ; jf_frq = 6 + COUNT( (/.NOT.ln_linssh/) )   ! update 2D fields index
          nfld_3d  = 0                                                              ! no 3D fields to read
-         nfld_2d  = 5 + COUNT( (/lk_vvl/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read
+         nfld_2d  = 5 + COUNT( (/.NOT.ln_linssh/) ) + COUNT( (/ln_read_frq/) )             ! number of 2D fields to read
       ENDIF
 
@@ -231,5 +231,5 @@
          slf_3d(jf_usp) = sn_usp
          slf_3d(jf_vsp) = sn_vsp
-         IF( lk_vvl )   slf_3d(jf_e3t) = sn_e3t
+         IF( .NOT.ln_linssh )   slf_3d(jf_e3t) = sn_e3t
       ENDIF
 
@@ -243,5 +243,5 @@
          IF( .NOT. ln_3d_uve ) THEN
             slf_2d(jf_usp) = sn_usp ; slf_2d(jf_vsp) = sn_vsp
-            IF( lk_vvl )   slf_2d(jf_e3t) = sn_e3t
+            IF( .NOT.ln_linssh )   slf_2d(jf_e3t) = sn_e3t
          ENDIF
       ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcadv.F90	(revision 5866)
@@ -230,5 +230,5 @@
             CALL ctl_stop( 'trc_adv_init: force 2nd order FCT scheme, 4th order does not exist with sub-timestepping' )
          ENDIF
-         IF( lk_vvl ) THEN
+         IF( .NOT.ln_linssh ) THEN
             CALL ctl_stop( 'trc_adv_init: vertical sub-timestepping not allow in non-linear free surface' )
          ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcnxt.F90	(revision 5866)
@@ -137,7 +137,7 @@
       ELSE
          ! Leap-Frog + Asselin filter time stepping
-         IF( lk_vvl ) THEN   ;   CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
-           &                                                                sbc_trc, sbc_trc_b, jptra )      ! variable volume level (vvl) 
-         ELSE                ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )      ! fixed    volume level 
+         IF( ln_linssh ) THEN   ;   CALL tra_nxt_fix( kt, nittrc000,         'TRC', trb, trn, tra, jptra )  !     linear ssh
+         ELSE                   ;   CALL tra_nxt_vvl( kt, nittrc000, rdttrc, 'TRC', trb, trn, tra,      &
+           &                                                                   sbc_trc, sbc_trc_b, jptra )  ! non-linear ssh
          ENDIF
       ENDIF
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/TRP/trcsbc.F90	(revision 5866)
@@ -75,6 +75,6 @@
       !
       ! Allocate temporary workspace
-                      CALL wrk_alloc( jpi, jpj,      zsfx   )
-      IF( l_trdtrc )  CALL wrk_alloc( jpi, jpj, jpk, ztrtrd )
+                      CALL wrk_alloc( jpi,jpj,       zsfx   )
+      IF( l_trdtrc )  CALL wrk_alloc( jpi,jpj,jpk,   ztrtrd )
       !
       zrtrn = 1.e-15_wp
@@ -128,5 +128,5 @@
       ! Coupling offline : runoff are in emp which contains E-P-R
       !
-      IF( .NOT. lk_offline .AND. lk_vvl ) THEN  ! online coupling with vvl
+      IF( .NOT. lk_offline .AND. .NOT.ln_linssh ) THEN  ! online coupling with vvl
          zsfx(:,:) = 0._wp
       ELSE                                      ! online coupling free surface or offline with free surface
@@ -137,6 +137,5 @@
       DO jn = 1, jptra
          !
-         IF( l_trdtrc ) ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
-         !                                             ! add the trend to the general tracer trend
+         IF( l_trdtrc )   ztrtrd(:,:,:) = tra(:,:,:,jn)  ! save trends
 
          IF ( nn_ice_tr == -1 ) THEN  ! No tracers in sea ice (null concentration in sea ice)
@@ -202,6 +201,6 @@
                                            CALL prt_ctl_trc( tab4d=tra, mask=tmask, clinfo=ctrcnm, clinfo2='trd' )
       ENDIF
-                      CALL wrk_dealloc( jpi, jpj,      zsfx   )
-      IF( l_trdtrc )  CALL wrk_dealloc( jpi, jpj, jpk, ztrtrd )
+                      CALL wrk_dealloc( jpi,jpj,       zsfx   )
+      IF( l_trdtrc )  CALL wrk_dealloc( jpi,jpj,jpk,   ztrtrd )
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_sbc')
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcdta.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcdta.F90	(revision 5866)
@@ -235,16 +235,4 @@
          sf_dta(1)%fnow(:,:,:) = sf_dta(1)%fnow(:,:,:) * zrf_trfac   !  multiplicative factor
          !
-         IF( lwp .AND. kt == nit000 ) THEN
-               clndta = TRIM( sf_dta(1)%clvar ) 
-               WRITE(numout,*) ''//clndta//' data '
-               WRITE(numout,*)
-               WRITE(numout,*)'  level = 1'
-               CALL prihre( sf_dta(1)%fnow(:,:,1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)'  level = ', jpk/2
-               CALL prihre( sf_dta(1)%fnow(:,:,jpk/2), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)'  level = ', jpkm1
-               CALL prihre( sf_dta(1)%fnow(:,:,jpkm1), jpi, jpj, 1, jpi, 20, 1, jpj, 20, 1., numout )
-               WRITE(numout,*)
-         ENDIF
       ENDIF
       !
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 5866)
@@ -64,5 +64,5 @@
       IF( kt == nittrc000 .AND. lk_trdmxl_trc )  CALL trd_mxl_trc_init    ! trends: Mixed-layer
       !
-      IF( lk_vvl ) THEN                                                   ! update ocean volume due to ssh temporal evolution
+      IF( .NOT.ln_linssh ) THEN                                           ! update ocean volume due to ssh temporal evolution
          DO jk = 1, jpk
             cvol(:,:,jk) = e1e2t(:,:) * e3t_n(:,:,jk) * tmask(:,:,jk)
Index: /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
===================================================================
--- /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 5865)
+++ /branches/2015/dev_r5836_NOC3_vvl_by_default/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 5866)
@@ -446,5 +446,5 @@
       !!                   
       !! ** Purpose :   compute the after ssh (ssha), the now vertical velocity
-      !!              and update the now vertical coordinate (lk_vvl=T).
+      !!              and update the now vertical coordinate (ln_linssh=F).
       !!
       !! ** Method  : - Using the incompressibility hypothesis, the vertical 
@@ -455,9 +455,8 @@
       !! ** action  :   ssha    : after sea surface height
       !!                wn      : now vertical velocity
-      !!                sshu_a, sshv_a, sshf_a  : after sea surface height (lk_vvl=T)
+      !!                sshu_a, sshv_a, sshf_a  : after sea surface height (ln_linssh=F)
       !!
       !! Reference  : Leclair, M., and G. Madec, 2009, Ocean Modelling.
       !!----------------------------------------------------------------------
-      !
       INTEGER, INTENT(in) ::   kt   ! time step
       !
@@ -470,5 +469,5 @@
       !
       ! Allocate temporary workspace
-      CALL wrk_alloc( jpi, jpj, zhdiv )
+      CALL wrk_alloc( jpi,jpj,   zhdiv )
 
       IF( kt == nittrc000 ) THEN
@@ -482,4 +481,5 @@
       ENDIF
       !
+!!gm BUG here !   hdivn will include the runoff divergence at the wrong timestep !!!!
       CALL div_hor( kt )                              ! Horizontal divergence & Relative vorticity
       !
@@ -510,6 +510,5 @@
 #endif
 #endif
-
-
+      !
       !                                           !------------------------------!
       !                                           !     Now Vertical Velocity    !
@@ -525,11 +524,11 @@
 #endif
       END DO
-
-      !
-      CALL wrk_dealloc( jpi, jpj, zhdiv )
+      !
+      CALL wrk_dealloc( jpi,jpj,   zhdiv )
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ssh')
       !
    END SUBROUTINE trc_sub_ssh
+
 
    INTEGER FUNCTION trc_sub_alloc()
