Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/EXP00/namelist_cfg	(revision 7954)
@@ -189,7 +189,6 @@
 /
 !-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme
-!-----------------------------------------------------------------------
-   nn_bbl_ldf  =  0      !  diffusive bbl (=1)   or not (=0)
+&nambbl        !   bottom boundary layer scheme                         (default: NO)
+!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -305,21 +304,48 @@
 /
 !-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   0.1e-6  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.1e-6  !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.   !  enhanced vertical diffusion (evd) (T) or not (F)
-   nn_evdm     =    1      !  evd apply on tracer (=0) or on tracer and momentum (=1)
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .true.       !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+      nn_evdm     =    0         ! apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd      =  100.        ! mixing coefficient [m2/s]
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+      nn_npc      =    1         ! frequency of application of npc
+      nn_npcp     =  365         ! npc control print frequency
+   !
+   ln_zdfddm   = .false.   ! double diffusive mixing
+      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
+      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
+   !
+   ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing                (T => ln_wave=ln_sdw=T )
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+      nn_zdfexp=    3            !  number of sub-timestep for ln_zdfexp=T
+   !
+   !                       ! coefficients
+   rn_avm0     =   0.1e-6     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.1e-6     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   (ln_zdfgls =T)
 !-----------------------------------------------------------------------
    rn_charn =  100000.     !  Charnock constant for wb induced roughness length
@@ -327,11 +353,6 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .FALSE.   !  ITF specific parameterisation
+&namzdf_tmx    !   internal wave-driven mixing parameterization         (ln_zdftmx =T)
+!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/AMM12/cpp_AMM12.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_zdfgls key_diainstant key_mpp_mpi key_iomput
+ bld::tool::fppkeys   key_diainstant key_mpp_mpi key_iomput
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/EXP00/namelist_cfg	(revision 7954)
@@ -255,28 +255,52 @@
 /
 !-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   ln_zdfevd   = .false.        !  enhanced vertical diffusion (evd) (T) or not (F)
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .false.   !  ITF specific parameterisation
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .true.       !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+      nn_evdm     =    0         ! apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd      =  100.        ! mixing coefficient [m2/s]
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+      nn_npc      =    1         ! frequency of application of npc
+      nn_npcp     =  365         ! npc control print frequency
+   !
+   ln_zdfddm   = .false.   ! double diffusive mixing
+      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
+      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
+   !
+   ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing                (T => ln_wave=ln_sdw=T )
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_gls                !   GLS vertical diffusion                   (ln_zdfgls =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !    internal wave-driven mixing parameterization        (ln_zdftmx =T)
+!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/cpp_C1D_PAPA.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/cpp_C1D_PAPA.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/C1D_PAPA/cpp_C1D_PAPA.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_c1d key_zdfgls
+ bld::tool::fppkeys   key_c1d
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/EXP00/namelist_cfg	(revision 7954)
@@ -43,6 +43,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -245,29 +244,54 @@
 /
 !-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   nn_evdm     =    1      !  evd apply on tracer (=0) or on tracer and momentum (=1)
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .true.       !  enhanced vertical diffusion
+      nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd      =  100.        ! mixing coefficient [m2/s]
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+      nn_npc      =    1         ! frequency of application of npc
+      nn_npcp     =  365         ! npc control print frequency
+   !
+   ln_zdfddm   = .false.   ! double diffusive mixing
+      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
+      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
+   !
+   ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing                (T => ln_wave=ln_sdw=T )
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+      nn_zdfexp=    3            !  number of sub-timestep for ln_zdfexp=T
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke")
 !-----------------------------------------------------------------------
    nn_etau     =   0       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves
 /
 !-----------------------------------------------------------------------
-&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .false.   !  ITF specific parameterisation
+&namzdf_gls                !   GLS vertical diffusion                   (ln_zdfgls =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !    internal wave-driven mixing parameterization        (ln_zdftmx =T)
+!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_BFM/cpp_GYRE_BFM.fcm	(revision 7954)
@@ -1,2 +1,2 @@
-bld::tool::fppkeys key_zdftke key_top key_my_trc key_mpp_mpi key_iomput
+bld::tool::fppkeys   key_top key_my_trc key_mpp_mpi key_iomput
 inc $BFMDIR/src/nemo/bfm.fcm
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 7954)
@@ -83,5 +83,5 @@
 /
 !-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme
+&nambbl        !   bottom boundary layer scheme                         (default: NO)
 !-----------------------------------------------------------------------
 /
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/cpp_GYRE_PISCES.fcm	(revision 7954)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_zdftke key_top key_mpp_mpi key_nosignedzero
+bld::tool::fppkeys   key_top key_mpp_mpi key_nosignedzero
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/1_namelist_cfg	(revision 7954)
@@ -20,9 +20,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------  
@@ -34,6 +29,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-!              !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -103,4 +97,10 @@
 &nambbl        !   bottom boundary layer scheme
 !-----------------------------------------------------------------------
+   ln_trabbl   = .true.    !  Bottom Boundary Layer parameterisation flag
+   nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
+   nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
+   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s]
+   rn_gambbl   =  10.      !  advective bbl coefficient                 [s]
+/
 /
 !-----------------------------------------------------------------------
@@ -205,20 +205,49 @@
    rn_bhm_0      = 8.5e+11     !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .false.   !  ITF specific parameterisation
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .true.       !  Enhanced Vertical Diffusion scheme
+      nn_evdm  =    0            !  evd apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd   =  100.           !  evd mixing coefficient [m2/s]
+   !
+   ln_zdfddm   = .true.    ! double diffusive mixing
+      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
+      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
+   !
+   ln_zdftmx   = .true.    ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! enhanced wave vertical mixing Qiao (2010) (T => ln_wave=T & ln_sdw=T & fill namsbc_wave)
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.   ! split-explicit (T) or implicit (F) time stepping scheme
+      nn_zdfexp=    3         !  number of sub-timestep for ln_zdfexp=T
+   !
+   !                       !  Coefficients
+   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    1         !  horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !    internal wave-driven mixing parameterization        (ln_zdftmx =T)
+!-----------------------------------------------------------------------
+   nn_zpyc     = 1         !  pycnocline-intensified dissipation scales as N (=1) or N^2 (=2)
+   ln_mevar    = .true.    !  variable (T) or constant (F) mixing efficiency
+   ln_tsdiff   = .true.    !  account for differential T/S mixing (T) or not (F)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/file_def_nemo.xml
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/file_def_nemo.xml	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/file_def_nemo.xml	(revision 7954)
@@ -95,5 +95,5 @@
 	  <field field_ref="avt"          name="difvho"   />
 	  <field field_ref="w_masstr"     name="vovematr" />
-          <!-- variables available with key_zdftmx_new -->
+          <!-- variables available when ln_zdftmx =T -->
           <field field_ref="av_wave"      name="av_wave"    />
           <field field_ref="bn2"          name="bn2"        />
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/EXP00/namelist_cfg	(revision 7954)
@@ -17,9 +17,4 @@
       !                    !  (=F) user defined configuration  ==>>>  see usrdef(_...) modules
       cn_domcfg = "ORCA_R2_zps_domcfg"    ! domain configuration filename
-/
-!-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
 /
 !-----------------------------------------------------------------------
@@ -114,6 +109,11 @@
 /
 !-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme
-!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme                         (default: NO)
+!-----------------------------------------------------------------------
+   ln_trabbl   = .true.    !  Bottom Boundary Layer parameterisation flag
+   nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
+   nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
+   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s]
+   rn_gambbl   =  10.      !  advective bbl coefficient                 [s]
 /
 !-----------------------------------------------------------------------
@@ -234,4 +234,7 @@
    ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km)
 /
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
 !-----------------------------------------------------------------------
 &namzdf        !   vertical physics                                     (default: NO selection)
@@ -271,9 +274,5 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx_new !   internal wave-driven mixing parameterization        ("key_zdftmx_new" & "key_zdfddm")
+&namzdf_tmx    !   tidal mixing parameterization                        (ln_zdftmx =T)
 !-----------------------------------------------------------------------
    nn_zpyc     = 2         !  pycnocline-intensified dissipation scales as N (=1) or N^2 (=2)
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/cpp_ORCA2_LIM3_PISCES.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/cpp_ORCA2_LIM3_PISCES.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_LIM3_PISCES/cpp_ORCA2_LIM3_PISCES.fcm	(revision 7954)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_trabbl key_lim3 key_zdftke key_zdftmx_new key_iomput key_mpp_mpi key_top key_nosignedzero
+bld::tool::fppkeys   key_lim3 key_top key_iomput key_mpp_mpi key_nosignedzero
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/EXP00/namelist_cfg	(revision 7954)
@@ -18,9 +18,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
@@ -35,13 +30,4 @@
    rn_shlat    =    2.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
    ln_vorlat   = .false.   !  consistency of vorticity boundary condition with analytical Eqs.
-/
-!-----------------------------------------------------------------------
-&namsplit      !   time splitting parameters                            ("key_dynspg_ts")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -69,4 +55,10 @@
 &nambbl        !   bottom boundary layer scheme
 !-----------------------------------------------------------------------
+   ln_trabbl   = .true.    !  Bottom Boundary Layer parameterisation flag
+   nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
+   nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
+   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s]
+   rn_gambbl   =  10.      !  advective bbl coefficient                 [s]
+/
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_PISCES/cpp_ORCA2_OFF_PISCES.fcm	(revision 7954)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_trabbl key_top key_iomput key_mpp_mpi
+bld::tool::fppkeys   key_top key_iomput key_mpp_mpi
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/EXP00/namelist_cfg	(revision 7954)
@@ -20,9 +20,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
@@ -37,13 +32,4 @@
    rn_shlat    =    2.     !  shlat = 0  !  0 < shlat < 2  !  shlat = 2  !  2 < shlat
    ln_vorlat   = .false.   !  consistency of vorticity boundary condition with analytical Eqs.
-/
-!-----------------------------------------------------------------------
-&namsplit      !   time splitting parameters                            ("key_dynspg_ts")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -71,4 +57,9 @@
 &nambbl        !   bottom boundary layer scheme
 !-----------------------------------------------------------------------
+   ln_trabbl   = .true.    !  Bottom Boundary Layer parameterisation flag
+   nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
+   nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
+   rn_ahtbbl   =  1000.    !  lateral mixing coefficient in the bbl  [m2/s]
+   rn_gambbl   =  10.      !  advective bbl coefficient                 [s]
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/cpp_ORCA2_OFF_TRC.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/cpp_ORCA2_OFF_TRC.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_OFF_TRC/cpp_ORCA2_OFF_TRC.fcm	(revision 7954)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_trabbl key_top key_iomput key_mpp_mpi
+bld::tool::fppkeys   key_top key_iomput key_mpp_mpi
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/EXP00/namelist_cfg	(revision 7954)
@@ -19,9 +19,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .true.    !  z-coordinate - partial steps
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
@@ -32,6 +27,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -75,17 +69,4 @@
 /
 !-----------------------------------------------------------------------
-&nambfr        !   bottom friction
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-   ln_trabbc   = .true.    !  Apply a geothermal heating at the ocean bottom
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
 &nameos        !   ocean physical parameters
 !-----------------------------------------------------------------------
@@ -102,120 +83,4 @@
 /
 !-----------------------------------------------------------------------
-&namtra_adv_mle !  mixed layer eddy parametrisation (Fox-Kemper param)
-!-----------------------------------------------------------------------
-/
-!----------------------------------------------------------------------------------
-&namtra_ldf    !   lateral diffusion scheme for tracers
-!----------------------------------------------------------------------------------
-   !                       !  Operator type:
-   ln_traldf_lap   =  .true.   !    laplacian operator
-   ln_traldf_blp   =  .false.  !  bilaplacian operator
-   !                       !  Direction of action:
-   ln_traldf_lev   =  .false.  !  iso-level
-   ln_traldf_hor   =  .false.  !  horizontal (geopotential)
-   ln_traldf_iso   =  .true.   !  iso-neutral (Standard operator)
-   ln_traldf_triad =  .false.  !  iso-neutral (Triads   operator)
-   !
-   !		       	         !  iso-neutral options:        
-   ln_traldf_msc   =  .true.   !  Method of Stabilizing Correction (both operators)
-   rn_slpmax       =   0.01    !  slope limit                      (both operators)
-   ln_triad_iso    =  .false.  !  pure horizontal mixing in ML              (triad only)
-   rn_sw_triad     =  1        !  =1 switching triad ; =0 all 4 triads used (triad only)
-   ln_botmix_triad =  .false.  !  lateral mixing on bottom                  (triad only)
-   !
-   !                       !  Coefficients:
-   nn_aht_ijk_t    = 20        !  space/time variation of eddy coef
-   !                                !   =-20 (=-30)    read in eddy_diffusivity_2D.nc (..._3D.nc) file
-   !                                !   =  0           constant 
-   !                                !   = 10 F(k)      =ldf_c1d 
-   !                                !   = 20 F(i,j)    =ldf_c2d 
-   !                                !   = 21 F(i,j,t)  =Treguier et al. JPO 1997 formulation
-   !                                !   = 30 F(i,j,k)  =ldf_c2d + ldf_c1d
-   !                                !   = 31 F(i,j,k,t)=F(local velocity)
-   rn_aht_0        = 2000.     !  lateral eddy diffusivity   (lap. operator) [m2/s]
-   rn_bht_0        = 1.e+12    !  lateral eddy diffusivity (bilap. operator) [m4/s]
-/
-!----------------------------------------------------------------------------------
-&namtra_ldfeiv !   eddy induced velocity param.
-!----------------------------------------------------------------------------------
-   ln_ldfeiv     =.true.   ! use eddy induced velocity parameterization
-   ln_ldfeiv_dia =.true.   ! diagnose eiv stream function and velocities
-   rn_aeiv_0     = 2000.   ! eddy induced velocity coefficient   [m2/s]
-   nn_aei_ijk_t  = 21      ! space/time variation of the eiv coeficient
-   !                                !   =-20 (=-30)    read in eddy_induced_velocity_2D.nc (..._3D.nc) file
-   !                                !   =  0           constant 
-   !                                !   = 10 F(k)      =ldf_c1d 
-   !                                !   = 20 F(i,j)    =ldf_c2d 
-   !                                !   = 21 F(i,j,t)  =Treguier et al. JPO 1997 formulation
-   !                                !   = 30 F(i,j,k)  =ldf_c2d + ldf_c1d
-/
-!-----------------------------------------------------------------------
-&namtra_dmp    !   tracer: T & S newtonian damping                      (default: NO)
-!-----------------------------------------------------------------------
-!-----------------------------------------------------------------------
-&namdyn_adv    !   formulation of the momentum advection
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namdyn_vor    !   option of physics/algorithm (not control by CPP keys)
-!-----------------------------------------------------------------------
-   ln_dynvor_ene = .false. !  enstrophy conserving scheme
-   ln_dynvor_ens = .false. !  energy conserving scheme
-   ln_dynvor_mix = .false. !  mixed scheme
-   ln_dynvor_een = .true.  !  energy & enstrophy scheme
-      nn_een_e3f = 0             !  e3f = masked averaging of e3t divided by 4 (=0) or by the sum of mask (=1)
-/
-!-----------------------------------------------------------------------
-&namdyn_hpg    !   Hydrostatic pressure gradient option
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namdyn_spg    !   surface pressure gradient
-!-----------------------------------------------------------------------
-   ln_dynspg_ts  = .true.  !  split-explicit free surface
-/
-!-----------------------------------------------------------------------
-&namdyn_ldf    !   lateral diffusion on momentum
-!-----------------------------------------------------------------------
-   !                       !  Type of the operator :
-   !                           !  no diffusion: set ln_dynldf_lap=..._blp=F 
-   ln_dynldf_lap =  .true.     !    laplacian operator
-   ln_dynldf_blp =  .false.    !  bilaplacian operator
-   !                       !  Direction of action  :
-   ln_dynldf_lev =  .true.     !  iso-level
-   ln_dynldf_hor =  .false.    !  horizontal (geopotential)
-   ln_dynldf_iso =  .false.    !  iso-neutral
-   !                       !  Coefficient
-   nn_ahm_ijk_t  = -30         !  space/time variation of eddy coef
-   !                                !  =-30  read in eddy_viscosity_3D.nc file
-   !                                !  =-20  read in eddy_viscosity_2D.nc file
-   !                                !  =  0  constant 
-   !                                !  = 10  F(k)=c1d
-   !                                !  = 20  F(i,j)=F(grid spacing)=c2d
-   !                                !  = 30  F(i,j,k)=c2d*c1d
-   !                                !  = 31  F(i,j,k)=F(grid spacing and local velocity)
-   rn_ahm_0      =  40000.     !  horizontal laplacian eddy viscosity   [m2/s]
-   rn_ahm_b      =      0.     !  background eddy viscosity for ldf_iso [m2/s]
-   rn_bhm_0      = 1.e+12      !  horizontal bilaplacian eddy viscosity [m4/s]
-   !
-   ! Caution in 20 and 30 cases the coefficient have to be given for a 1 degree grid (~111km)
-/
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
 &nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
 !-----------------------------------------------------------------------
@@ -225,18 +90,2 @@
 !-----------------------------------------------------------------------
 /
-!-----------------------------------------------------------------------
-&namptr       !   Poleward Transport Diagnostic
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namhsb       !  Heat and salt budgets                                  (default F)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namobs       !  observation usage                                      ('key_diaobs')
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nam_asminc   !   assimilation increments                               ('key_asminc')
-!-----------------------------------------------------------------------
-/
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/cpp_ORCA2_SAS_LIM3.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/cpp_ORCA2_SAS_LIM3.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/ORCA2_SAS_LIM3/cpp_ORCA2_SAS_LIM3.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_trabbl key_lim3  key_zdftke key_zdfddm key_zdftmx key_iomput key_mpp_mpi
+ bld::tool::fppkeys   key_lim3 key_iomput key_mpp_mpi
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/field_def_nemo-opa.xml	(revision 7954)
@@ -307,5 +307,5 @@
          <field id="uoce_eiv"     long_name="EIV ocean current along i-axis"   standard_name="bolus_sea_water_x_velocity"   unit="m/s"   grid_ref="grid_U_3D" />
 
-         <!-- uoce_eiv: available with key_trabbl -->
+         <!-- variables available when ln_trabbl = T -->
          <field id="uoce_bbl"     long_name="BBL ocean current along i-axis"    unit="m/s"  />
          <field id="ahu_bbl"      long_name="BBL diffusive flux along i-axis"   unit="m3/s" />
@@ -355,5 +355,5 @@
          <field id="voce_eiv"     long_name="EIV ocean current along j-axis"   standard_name="bolus_sea_water_y_velocity"   unit="m/s"   grid_ref="grid_V_3D" />
 
-         <!-- voce_eiv: available with key_trabbl -->
+         <!-- variables available when ln_trabbl = T  -->
          <field id="voce_bbl"     long_name="BBL ocean current along j-axis"    unit="m/s"  />
          <field id="ahv_bbl"      long_name="BBL diffusive flux along j-axis"   unit="m3/s" />
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7954)
@@ -3,5 +3,5 @@
 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 !! NEMO/OPA  :  1 - run manager      (namrun)
-!! namelists    2 - Domain           (namcfg, namzgr, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
+!! namelists    2 - Domain           (namcfg, namdom, namtsd, namcrs, namc1d, namc1d_uvd)
 !!              3 - Surface boundary (namsbc, namsbc_flx, namsbc_blk, namsbc_sas)
 !!                                    namsbc_cpl, namtra_qsr, namsbc_rnf,
@@ -59,9 +59,8 @@
 !!======================================================================
 !!   namcfg       parameters of the configuration
-!!   namzgr       vertical coordinate                                   (default: NO selection)
 !!   namdom       space and time domain (bathymetry, mesh, timestep)
 !!   namwad       Wetting and drying                                    (default F)
 !!   namtsd       data: temperature & salinity
-!!   namcrs       coarsened grid (for outputs and/or TOP)               ("key_crs")
+!!   namcrs       coarsened grid (for outputs and/or TOP)               (ln_crs =T)
 !!   namc1d       1D configuration options                              ("key_c1d")
 !!   namc1d_dyndmp 1D newtonian damping applied on currents             ("key_c1d")
@@ -94,5 +93,5 @@
    rn_atfp     =    0.1    !  asselin time filter parameter
    !
-   ln_crs      = .false.   !  Logical switch for coarsening module
+   ln_crs      = .false.   !  Logical switch for coarsening module      (T => fill namcrs)
 /
 !-----------------------------------------------------------------------
@@ -118,5 +117,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   coarsened grid (for outputs and/or TOP)              ("key_crs")
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
    nn_factx    = 3         !  Reduction factor of x-direction
@@ -606,5 +605,5 @@
 !!   nambfr        bottom friction
 !!   nambbc        bottom temperature boundary condition
-!!   nambbl        bottom boundary layer scheme                         ("key_trabbl")
+!!   nambbl        bottom boundary layer scheme                         (default: NO)
 !!======================================================================
 !
@@ -647,6 +646,7 @@
 /
 !-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
+&nambbl        !   bottom boundary layer scheme                         (default: NO)
+!-----------------------------------------------------------------------
+   ln_trabbl   = .false.   !  Bottom Boundary Layer parameterisation flag
    nn_bbl_ldf  =  1        !  diffusive bbl (=1)   or not (=0)
    nn_bbl_adv  =  0        !  advective bbl (=1/2) or not (=0)
@@ -901,9 +901,9 @@
    ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
    !
-   ln_zdfqiao  = .false.   ! surface wave-induced mixing (Qiao et al. 2010) (T =>   ln_wave=ln_sdw=T. & fill namsbc_wave)
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing                (T => ln_wave=ln_sdw=T )
    !
    !                       ! time-stepping
-   ln_zdfexp   = .false.   ! split-explicit (T) or implicit (F) scheme
-      nn_zdfexp=    3         !  number of sub-timestep for ln_zdfexp=T
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+      nn_zdfexp=    3            !  number of sub-timestep for ln_zdfexp=T
    !
    !                       ! coefficients
@@ -912,8 +912,7 @@
    nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
    nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
-   !
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric=T)
+/
+!-----------------------------------------------------------------------
+&namzdf_ric    !   richardson number dependent vertical diffusion       (ln_zdfric =T)
 !-----------------------------------------------------------------------
    rn_avmri    =  100.e-4  !  maximum value of the vertical viscosity
@@ -928,5 +927,5 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke=T)
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
 !-----------------------------------------------------------------------
    rn_ediff    =   0.1     !  coef. for vertical eddy coef. (avt=rn_ediff*mxl*sqrt(e) )
@@ -956,5 +955,5 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_gls    !   GLS vertical diffusion                               (ln_zdfgls)
+&namzdf_gls    !   GLS vertical diffusion                               (ln_zdfgls =T)
 !-----------------------------------------------------------------------
    rn_emin       = 1.e-7   !  minimum value of e   [m2/s2]
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/EXP00/namelist_cfg	(revision 7954)
@@ -326,39 +326,34 @@
 /
 !-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.0e-3  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   5.0e-5  !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   nn_avb      =    0      !  profile for background avt & avm (=1) or not (=0)
-   nn_havtb    =    0      !  horizontal shape for avtb (=1) or not (=0)
-   ln_zdfevd   = .true.    !  enhanced vertical diffusion (evd) (T) or not (F)
-   nn_evdm     =    1      !  evd apply on tracer (=0) or on tracer and momentum (=1)
-   rn_avevd    =   0.1     !  evd mixing coefficient [m2/s]
-   ln_zdfnpc   = .false.   !  Non-Penetrative Convective algorithm (T) or not (F)
-   nn_npc      =    1            !  frequency of application of npc
-   nn_npcp     =  365            !  npc control print frequency
-   ln_zdfexp   = .false.   !  time-stepping: split-explicit (T) or implicit (F) time stepping
-   nn_zdfexp   =    3            !  number of sub-timestep for ln_zdfexp=T
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .false.   !  ITF specific parameterisation
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .true.       !  enhanced vertical diffusion
+      nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd      =   0.1        ! mixing coefficient [m2/s]
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+      nn_npc      =    1         ! frequency of application of npc
+      nn_npcp     =  365         ! npc control print frequency
+   !
+   ln_zdfddm   = .false.   ! double diffusive mixing
+   !
+   ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing                (T => ln_wave=ln_sdw=T )
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-3     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   5.e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
@@ -380,21 +375,9 @@
 /
 !-----------------------------------------------------------------------
-&namflo       !   float parameters                                      ("key_float")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namptr       !   Poleward Transport Diagnostic
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
 &namhsb       !  Heat and salt budgets
 !-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
-&namdct        ! transports through sections
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namobs       !  observation usage switch                               ('key_diaobs')
+&namobs       !  observation usage switch                               (ln_diaobs =T)
 !-----------------------------------------------------------------------
 /
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/cpp_ISOMIP.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/cpp_ISOMIP.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/ISOMIP/cpp_ISOMIP.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_zdfcst key_iomput key_mpp_mpi key_nosignedzero 
+ bld::tool::fppkeys   key_iomput key_mpp_mpi key_nosignedzero 
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_cen2_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_cen2_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_cen2_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_ubs_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_ubs_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_flux_ubs_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_eenH_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_eenH_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_eenH_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_een_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_een_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_een_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ene_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ene_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ene_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ens_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ens_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT2_vect_ens_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_cen2_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_cen2_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_cen2_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_ubs_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_ubs_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_flux_ubs_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_eenH_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_eenH_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_eenH_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_een_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_een_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_een_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ene_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ene_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ene_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ens_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ens_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_FCT4_vect_ens_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/EXP00/namelist_cfg	(revision 7954)
@@ -72,12 +72,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -197,11 +189,25 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/cpp_LOCK_EXCHANGE.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/cpp_LOCK_EXCHANGE.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/LOCK_EXCHANGE/cpp_LOCK_EXCHANGE.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_zdfcst key_iomput key_mpp_mpi key_nosignedzero
+ bld::tool::fppkeys   key_iomput key_mpp_mpi key_nosignedzero
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_cfg	(revision 7954)
@@ -66,12 +66,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -191,11 +183,28 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.         !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_sco_FCT2_flux_ubs_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_sco_FCT2_flux_ubs_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_sco_FCT2_flux_ubs_cfg	(revision 7954)
@@ -66,12 +66,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -191,11 +183,28 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.   ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT2_flux_ubs_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT2_flux_ubs_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT2_flux_ubs_cfg	(revision 7954)
@@ -66,12 +66,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -191,11 +183,28 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_flux_ubs_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_flux_ubs_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_flux_ubs_cfg	(revision 7954)
@@ -66,12 +66,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -191,11 +183,28 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_vect_een_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_vect_een_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/EXP00/namelist_zps_FCT4_vect_een_cfg	(revision 7954)
@@ -66,12 +66,4 @@
    nn_bfr      =    0      !  type of bottom friction :   = 0 : free slip,  = 1 : linear friction
                            !                              = 2 : nonlinear friction
-/
-!-----------------------------------------------------------------------
-&nambbc        !   bottom temperature boundary condition                (default: NO)
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nambbl        !   bottom boundary layer scheme                         ("key_trabbl")
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -191,11 +183,28 @@
    rn_bhm_0      =     1.e+12  !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   0.     !  vertical eddy diffusivity [m2/s]          (background Kz if not "key_zdfcst")
-   ln_zdfevd   = .false.  !  enhanced vertical diffusion (evd)
-   ln_zdfnpc   = .false.  !  Non-Penetrative Convective algorithm
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .false.      !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .false.      !  enhanced vertical diffusion
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.      ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.e-4      !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   0.e0       !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/cpp_OVERFLOW.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/cpp_OVERFLOW.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/OVERFLOW/cpp_OVERFLOW.fcm	(revision 7954)
@@ -1,1 +1,1 @@
-bld::tool::fppkeys key_zdfcst key_mpp_mpi key_iomput key_nosignedzero
+bld::tool::fppkeys   key_mpp_mpi key_iomput key_nosignedzero
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/1_namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/1_namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/1_namelist_cfg	(revision 7954)
@@ -33,6 +33,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -141,14 +140,4 @@
 &namtra_ldfeiv !   eddy induced velocity param.
 !----------------------------------------------------------------------------------
-   ln_ldfeiv     =.true.   ! use eddy induced velocity parameterization
-   ln_ldfeiv_dia =.true.   ! diagnose eiv stream function and velocities
-   rn_aeiv_0     = 2000.   ! eddy induced velocity coefficient   [m2/s]
-   nn_aei_ijk_t  = 21      ! space/time variation of the eiv coeficient
-   !                                !   =-20 (=-30)    read in eddy_induced_velocity_2D.nc (..._3D.nc) file
-   !                                !   =  0           constant 
-   !                                !   = 10 F(k)      =ldf_c1d 
-   !                                !   = 20 F(i,j)    =ldf_c2d 
-   !                                !   = 21 F(i,j,t)  =Treguier et al. JPO 1997 formulation
-   !                                !   = 30 F(i,j,k)  =ldf_c2d + ldf_c1d
 /
 !-----------------------------------------------------------------------
@@ -209,16 +198,4 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
 &nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/SAS_BIPER/EXP00/namelist_cfg	(revision 7954)
@@ -33,6 +33,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -210,21 +209,23 @@
 /
 !-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .true.       !  constant mixing
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_ddm    !   double diffusive mixing parameterization             (ln_zdfddm =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&namzdf_tmx    !   tidal mixing parameterization                        (ln_zdftmx =T)
+!-----------------------------------------------------------------------
+/
+!-----------------------------------------------------------------------
+&nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi")
 !-----------------------------------------------------------------------
 /
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/EXP00/namelist_cfg
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/EXP00/namelist_cfg	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/EXP00/namelist_cfg	(revision 7954)
@@ -32,10 +32,4 @@
 /
 !-----------------------------------------------------------------------
-&namzgr        !   vertical coordinate
-!-----------------------------------------------------------------------
-   ln_zps      = .false.   !  z-coordinate - partial steps
-   ln_sco      = .true.    !  s-coordinate
-/
-!-----------------------------------------------------------------------
 &namdom        !   space and time domain (bathymetry, mesh, timestep)
 !-----------------------------------------------------------------------
@@ -46,6 +40,5 @@
 /
 !-----------------------------------------------------------------------
-&namcrs        !   Grid coarsening for dynamics output and/or
-               !   passive tracer coarsened online simulations
+&namcrs        !   coarsened grid (for outputs and/or TOP)              (ln_crs =T)
 !-----------------------------------------------------------------------
 /
@@ -62,32 +55,10 @@
    nn_fsbc     = 1         !  frequency of surface boundary condition computation
    !                       !     (also = the frequency of sea-ice model call)
-   ln_usr      = .true.    !  analytical formulation                    (T => fill namsbc_ana )
-   ln_blk      = .false.   !  CORE bulk formulation                     (T => fill namsbc_core)
+   ln_usr      = .true.    !  analytical formulation                    (T => check usrdef_sbc)
+   ln_blk      = .false.   !  CORE bulk formulation                     (T => fill namsbc_blk )
    nn_ice      = 0         !  =0 no ice boundary condition   ,
-   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf)
-   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr)
+   ln_rnf      = .false.   !  runoffs                                   (T => fill namsbc_rnf )
+   ln_ssr      = .false.   !  Sea Surface Restoring on T and/or S       (T => fill namsbc_ssr )
    nn_fwb      = 0         !  FreshWater Budget: =0 unchecked
-/
-!-----------------------------------------------------------------------
-&namsbc_ana    !   analytical surface boundary condition
-!-----------------------------------------------------------------------
-   nn_tau000   =   100     !  gently increase the stress over the first ntau_rst time-steps
-   rn_utau0    =   0.0e0   !  uniform value for the i-stress
-/
-!-----------------------------------------------------------------------
-&namsbc_flx    !   surface boundary condition : flux formulation
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_clio   !   namsbc_clio  CLIO bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_core   !   namsbc_core  CORE bulk formulae
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namsbc_mfs   !   namsbc_mfs  MFS bulk formulae
-!-----------------------------------------------------------------------
 /
 !-----------------------------------------------------------------------
@@ -350,31 +321,56 @@
    rn_bhm_0      =      0.     !  horizontal bilaplacian eddy viscosity [m4/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   nn_evdm     =    1      !  evd apply on tracer (=0) or on tracer and momentum (=1)
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+!!======================================================================
+!!                     vertical physics namelists                     !!
+!!======================================================================
+!!    namzdf        vertical physics
+!!    namzdf_ric    richardson number vertical mixing                   (ln_zdfric=T)
+!!    namzdf_tke    TKE vertical mixing                                 (ln_zdftke=T)
+!!    namzdf_gls    GLS vertical mixing                                 (ln_zdfgls=T)
+!!    namzdf_tmx    tidal mixing parameterization                       (ln_zdftmx=T)
+!!======================================================================
+!-----------------------------------------------------------------------
+&namzdf        !   vertical physics                                     (default: NO selection)
+!-----------------------------------------------------------------------
+   !                       ! type of vertical closure
+   ln_zdfcst   = .false.      !  constant mixing
+   ln_zdfric   = .false.      !  local Richardson dependent formulation (T =>   fill namzdf_ric)
+   ln_zdftke   = .true.       !  Turbulent Kinetic Energy closure       (T =>   fill namzdf_tke)
+   ln_zdfgls   = .false.      !  Generic Length Scale closure           (T =>   fill namzdf_gls)
+   !
+   !                       ! convection
+   ln_zdfevd   = .true.       !  enhanced vertical diffusion
+      nn_evdm     =    1         ! apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd      =  100.        ! mixing coefficient [m2/s]
+   ln_zdfnpc   = .false.      !  Non-Penetrative Convective algorithm
+      nn_npc      =    1         ! frequency of application of npc
+      nn_npcp     =  365         ! npc control print frequency
+   !
+   ln_zdfddm   = .false.   ! double diffusive mixing
+      rn_avts  =    1.e-4     !  maximum avs (vertical mixing on salinity)
+      rn_hsbfr =    1.6       !  heat/salt buoyancy flux ratio
+   !
+   ln_zdftmx   = .false.   ! tidal mixing parameterization              (T =>   fill namzdf_tmx)
+   !
+   ln_zdfqiao  = .false.   ! surface wave-induced mixing (Qiao et al. 2010) (T =>   ln_wave=ln_sdw=T. & fill namsbc_wave)
+   !
+   !                       ! time-stepping
+   ln_zdfexp   = .false.   ! split-explicit (T) or implicit (F) scheme
+   !
+   !                       ! coefficients
+   rn_avm0     =   1.2e-4     !  vertical eddy viscosity   [m2/s]       (background Kz if ln_zdfcst=F)
+   rn_avt0     =   1.2e-5     !  vertical eddy diffusivity [m2/s]       (background Kz if ln_zdfcst=F)
+   nn_avb      =    0         !  profile for background avt & avm (=1) or not (=0)
+   nn_havtb    =    0         !  horizontal shape for avtb (=1) or not (=0)
+/
+!-----------------------------------------------------------------------
+&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  (ln_zdftke =T)
 !-----------------------------------------------------------------------
    nn_etau     =   0       !  penetration of tke below the mixed layer (ML) due to internal & intertial waves
 /
-!-----------------------------------------------------------------------
-&namzdf_gls                !   GLS vertical diffusion                   ("key_zdfgls")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
-!-----------------------------------------------------------------------
-   ln_tmx_itf  = .false.   !  ITF specific parameterisation
-/
+
+!!======================================================================
+!!                  ***  Miscellaneous namelists  ***
+!!======================================================================
 !-----------------------------------------------------------------------
 &nammpp        !   Massively Parallel Processing                        ("key_mpp_mpi)
@@ -411,12 +407,4 @@
 !!gm
 !-----------------------------------------------------------------------
-&namflo       !   float parameters                                      ("key_float")
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
-&namptr       !   Poleward Transport Diagnostic
-!-----------------------------------------------------------------------
-/
-!-----------------------------------------------------------------------
 &namhsb       !  Heat and salt budgets
 !-----------------------------------------------------------------------
@@ -430,5 +418,5 @@
 /
 !-----------------------------------------------------------------------
-&namobs       !  observation usage switch                               ('key_diaobs')
+&namobs       !  observation usage switch
 !-----------------------------------------------------------------------
 /
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/cpp_WAD.fcm
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/cpp_WAD.fcm	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/TEST_CASES/WAD/cpp_WAD.fcm	(revision 7954)
@@ -1,1 +1,1 @@
- bld::tool::fppkeys key_zdftke key_iomput key_mpp_mpi key_nosignedzero
+ bld::tool::fppkeys   key_iomput key_mpp_mpi key_nosignedzero
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/cfg.txt
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/cfg.txt	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/cfg.txt	(revision 7954)
@@ -5,5 +5,5 @@
 ORCA2_OFF_PISCES OPA_SRC OFF_SRC TOP_SRC
 ORCA2_OFF_TRC OPA_SRC OFF_SRC TOP_SRC
-GYRE_PISCES OPA_SRC TOP_SRC
 ORCA2_LIM3_PISCES OPA_SRC LIM_SRC_3 TOP_SRC NST_SRC
 GYRE_PISCES_XIOS OPA_SRC TOP_SRC
+GYRE_PISCES OPA_SRC TOP_SRC
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/dtadyn.F90	(revision 7954)
@@ -167,11 +167,11 @@
       CALL zdf_mxl( kt )                                                   ! In any case, we need mxl
       !
-      hmld(:,:)         = sf_dyn(jf_mld)%fnow(:,:,1) * tmask(:,:,1)    ! mixed layer depht
-      avt(:,:,:)        = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:)    ! vertical diffusive coefficient 
-      !
-#if defined key_trabbl && ! defined key_c1d
-      ahu_bbl(:,:)      = sf_dyn(jf_ubl)%fnow(:,:,1) * umask(:,:,1)    ! bbl diffusive coef
-      ahv_bbl(:,:)      = sf_dyn(jf_vbl)%fnow(:,:,1) * vmask(:,:,1)
-#endif
+      hmld(:,:)       = sf_dyn(jf_mld)%fnow(:,:,1) * tmask(:,:,1)    ! mixed layer depht
+      avt(:,:,:)      = sf_dyn(jf_avt)%fnow(:,:,:) * tmask(:,:,:)    ! vertical diffusive coefficient 
+      !
+      IF( ln_trabbl .AND. .NOT.lk_c1d ) THEN       ! diffusive Bottom boundary layer param 
+         ahu_bbl(:,:) = sf_dyn(jf_ubl)%fnow(:,:,1) * umask(:,:,1)    ! bbl diffusive coef
+         ahv_bbl(:,:) = sf_dyn(jf_vbl)%fnow(:,:,1) * vmask(:,:,1)
+      ENDIF
       !
       !
@@ -275,5 +275,5 @@
       ENDIF
       !
-      IF( lk_trabbl ) THEN
+      IF( ln_trabbl ) THEN
                  jf_ubl  = jfld + 1    ;         jf_vbl  = jfld + 2     ;      jfld = jf_vbl
            slf_d(jf_ubl) = sn_ubl      ;   slf_d(jf_vbl) = sn_vbl
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OFF_SRC/nemogcm.F90	(revision 7954)
@@ -315,5 +315,5 @@
 
                             CALL tra_qsr_init   ! penetrative solar radiation qsr
-      IF( lk_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme
+      IF( ln_trabbl     )   CALL tra_bbl_init   ! advective (and/or diffusive) bottom boundary layer scheme
 
                             CALL trc_nam_run    ! Needed to get restart parameters for passive tracers
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trabbl.F90	(revision 7954)
@@ -13,8 +13,7 @@
    !!             -   ! 2010-11  (G. Madec) add mbk. arrays associated to the deepest ocean level
    !!             -   ! 2013-04  (F. Roquet, G. Madec)  use of eosbn2 instead of local hard coded alpha and beta
+   !!            4.0  ! 2017-04  (G. Madec)  ln_trabbl namelist variable instead of a CPP key
    !!----------------------------------------------------------------------
-#if   defined key_trabbl
-   !!----------------------------------------------------------------------
-   !!   'key_trabbl'   or                             bottom boundary layer
+
    !!----------------------------------------------------------------------
    !!   tra_bbl_alloc : allocate trabbl arrays
@@ -49,7 +48,6 @@
    PUBLIC   bbl           !  routine called by trcbbl.F90 and dtadyn.F90
 
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trabbl = .TRUE.    !: bottom boundary layer flag
-
    !                                !!* Namelist nambbl *
+   LOGICAL , PUBLIC ::   ln_trabbl   !: bottom boundary layer flag
    INTEGER , PUBLIC ::   nn_bbl_ldf  !: =1   : diffusive bbl or not (=0)
    INTEGER , PUBLIC ::   nn_bbl_adv  !: =1/2 : advective bbl or not (=0)
@@ -82,8 +80,8 @@
       !!                ***  FUNCTION tra_bbl_alloc  ***
       !!----------------------------------------------------------------------
-      ALLOCATE( utr_bbl  (jpi,jpj) , ahu_bbl  (jpi,jpj) , mbku_d  (jpi,jpj) , mgrhu(jpi,jpj) ,     &
-         &      vtr_bbl  (jpi,jpj) , ahv_bbl  (jpi,jpj) , mbkv_d  (jpi,jpj) , mgrhv(jpi,jpj) ,     &
-         &      ahu_bbl_0(jpi,jpj) , ahv_bbl_0(jpi,jpj) ,                                          &
-         &      e3u_bbl_0(jpi,jpj) , e3v_bbl_0(jpi,jpj) ,                                      STAT=tra_bbl_alloc )
+      ALLOCATE( utr_bbl  (jpi,jpj) , ahu_bbl  (jpi,jpj) , mbku_d(jpi,jpj) , mgrhu(jpi,jpj) ,     &
+         &      vtr_bbl  (jpi,jpj) , ahv_bbl  (jpi,jpj) , mbkv_d(jpi,jpj) , mgrhv(jpi,jpj) ,     &
+         &      ahu_bbl_0(jpi,jpj) , ahv_bbl_0(jpi,jpj) ,                                        &
+         &      e3u_bbl_0(jpi,jpj) , e3v_bbl_0(jpi,jpj) ,                                    STAT=tra_bbl_alloc )
          !
       IF( lk_mpp            )   CALL mpp_sum ( tra_bbl_alloc )
@@ -111,5 +109,5 @@
       IF( nn_timing == 1 )  CALL timing_start( 'tra_bbl')
       !
-      IF( l_trdtra )   THEN                         !* Save the input trends
+      IF( l_trdtra )   THEN                         !* Save the T-S input trends
          CALL wrk_alloc( jpi, jpj, jpk, ztrdt, ztrds )
          ztrdt(:,:,:) = tsa(:,:,:,jp_tem)
@@ -301,7 +299,8 @@
             !
          END DO
-         !                                                       ! ===========
-      END DO                                                     ! end tracer
-      !                                                          ! ===========
+         !                                                  ! ===========
+      END DO                                                ! end tracer
+      !                                                     ! ===========
+      !
       IF( nn_timing == 1 )  CALL timing_stop( 'tra_bbl_adv')
       !
@@ -498,6 +497,6 @@
       INTEGER ::   ios                  !   -      -
       REAL(wp), POINTER, DIMENSION(:,:) :: zmbk
-      !
-      NAMELIST/nambbl/ nn_bbl_ldf, nn_bbl_adv, rn_ahtbbl, rn_gambbl
+      !!
+      NAMELIST/nambbl/ ln_trabbl, nn_bbl_ldf, nn_bbl_adv, rn_ahtbbl, rn_gambbl
       !!----------------------------------------------------------------------
       !
@@ -519,17 +518,22 @@
          WRITE(numout,*) 'tra_bbl_init : bottom boundary layer initialisation'
          WRITE(numout,*) '~~~~~~~~~~~~'
-         WRITE(numout,*) '   Namelist nambbl : set bbl parameters'
-         WRITE(numout,*) '      diffusive bbl (=1)   or not (=0)    nn_bbl_ldf = ', nn_bbl_ldf
-         WRITE(numout,*) '      advective bbl (=1/2) or not (=0)    nn_bbl_adv = ', nn_bbl_adv
-         WRITE(numout,*) '      diffusive bbl coefficient           rn_ahtbbl  = ', rn_ahtbbl, ' m2/s'
-         WRITE(numout,*) '      advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
-      ENDIF
-
+         WRITE(numout,*) '       Namelist nambbl : set bbl parameters'
+         WRITE(numout,*) '          bottom boundary layer flag          ln_trabbl  = ', ln_trabbl
+      ENDIF
+      IF( .NOT.ln_trabbl )   RETURN
+      !
+      IF(lwp) THEN
+         WRITE(numout,*) '          diffusive bbl (=1)   or not (=0)    nn_bbl_ldf = ', nn_bbl_ldf
+         WRITE(numout,*) '          advective bbl (=1/2) or not (=0)    nn_bbl_adv = ', nn_bbl_adv
+         WRITE(numout,*) '          diffusive bbl coefficient           rn_ahtbbl  = ', rn_ahtbbl, ' m2/s'
+         WRITE(numout,*) '          advective bbl coefficient           rn_gambbl  = ', rn_gambbl, ' s'
+      ENDIF
+      !
       !                              ! allocate trabbl arrays
       IF( tra_bbl_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'tra_bbl_init : unable to allocate arrays' )
-
+      !
       IF( nn_bbl_adv == 1 )    WRITE(numout,*) '       * Advective BBL using upper velocity'
       IF( nn_bbl_adv == 2 )    WRITE(numout,*) '       * Advective BBL using velocity = F( delta rho)'
-
+      !
       !                             !* vertical index of  "deep" bottom u- and v-points
       DO jj = 1, jpjm1                    ! (the "shelf" bottom k-indices are mbku and mbkv)
@@ -544,5 +548,5 @@
       zmbk(:,:) = REAL( mbkv_d(:,:), wp )   ;   CALL lbc_lnk(zmbk,'V',1.)   ;   mbkv_d(:,:) = MAX( INT( zmbk(:,:) ), 1 )
       CALL wrk_dealloc( jpi, jpj, zmbk )
-
+      !
       !                                 !* sign of grad(H) at u- and v-points
       mgrhu(jpi,:) = 0   ;   mgrhu(:,jpj) = 0   ;   mgrhv(jpi,:) = 0   ;   mgrhv(:,jpj) = 0
@@ -565,22 +569,8 @@
       ahu_bbl_0(:,:) = rn_ahtbbl * e2_e1u(:,:) * e3u_bbl_0(:,:) * umask(:,:,1)
       ahv_bbl_0(:,:) = rn_ahtbbl * e1_e2v(:,:) * e3v_bbl_0(:,:) * vmask(:,:,1)
-
       !
       IF( nn_timing == 1 )  CALL timing_stop( 'tra_bbl_init')
       !
    END SUBROUTINE tra_bbl_init
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Dummy module :                      No bottom boundary layer scheme
-   !!----------------------------------------------------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_trabbl = .FALSE.   !: bbl flag
-CONTAINS
-   SUBROUTINE tra_bbl_init               ! Dummy routine
-   END SUBROUTINE tra_bbl_init
-   SUBROUTINE tra_bbl( kt )              ! Dummy routine
-      WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt
-   END SUBROUTINE tra_bbl
-#endif
 
    !!======================================================================
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 7954)
@@ -43,5 +43,5 @@
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
-   !! NEMO/OPA 3.7 , NEMO Consortium (2015)
+   !! NEMO/OPA 4.0 , NEMO Consortium (2017)
    !! $Id$
    !! Software governed by the CeCILL licence     (NEMOGCM/NEMO_CeCILL.txt)
@@ -64,7 +64,7 @@
       !
       IF( neuler == 0 .AND. kt == nit000 ) THEN     ! at nit000
-         r2dt =  rdt                          ! = rdt (restarting with Euler time stepping)
+         r2dt =  rdt                                     ! = rdt (restarting with Euler time stepping)
       ELSEIF( kt <= nit000 + 1) THEN                ! at nit000 or nit000+1
-         r2dt = 2. * rdt                      ! = 2 rdt (leapfrog)
+         r2dt = 2. * rdt                                 ! = 2 rdt (leapfrog)
       ENDIF
       !
@@ -120,7 +120,4 @@
       !!          an implicit scheme is required.
       !!----------------------------------------------------------------------
-      USE zdftke
-      USE zdfgls
-      !!----------------------------------------------------------------------
       !
       ! Choice from ln_zdfexp (namzdf namelist variable read in zdfphy module)
@@ -129,11 +126,9 @@
       ENDIF
       !
-      ! Force implicit schemes
-      IF( ln_zdftke .OR. ln_zdfgls   )   nzdf = 1   ! TKE, or GLS physics
+      ! Force implicit schemes when absolutely needed
+      IF( .NOT.ln_zdfcst             )   nzdf = 1   ! turbulent closure schemes
       IF( ln_traldf_iso              )   nzdf = 1   ! iso-neutral lateral physics
       IF( ln_traldf_hor .AND. ln_sco )   nzdf = 1   ! horizontal lateral physics in s-coordinate
-      IF( ln_zdfexp .AND. nzdf == 1 )   CALL ctl_stop( 'tra_zdf : If using the rotation of lateral mixing operator',   &
-            &                         ' GLS or TKE scheme, the implicit scheme is required, set ln_zdfexp = .false.' )
-            !
+      !
       IF(lwp) THEN
          WRITE(numout,*)
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7954)
@@ -467,5 +467,5 @@
                             CALL tra_qsr_init      ! penetrative solar radiation qsr
                             CALL tra_bbc_init      ! bottom heat flux
-      IF( lk_trabbl     )   CALL tra_bbl_init      ! advective (and/or diffusive) bottom boundary layer scheme
+      IF( ln_trabbl     )   CALL tra_bbl_init      ! advective (and/or diffusive) bottom boundary layer scheme
                             CALL tra_dmp_init      ! internal tracer damping
                             CALL tra_adv_init      ! horizontal & vertical advection
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7954)
@@ -232,5 +232,5 @@
       IF( ln_traqsr  )   CALL tra_qsr       ( kstp )  ! penetrative solar radiation qsr
       IF( ln_trabbc  )   CALL tra_bbc       ( kstp )  ! bottom heat flux
-      IF( lk_trabbl  )   CALL tra_bbl       ( kstp )  ! advective (and/or diffusive) bottom boundary layer scheme
+      IF( ln_trabbl  )   CALL tra_bbl       ( kstp )  ! advective (and/or diffusive) bottom boundary layer scheme
       IF( ln_tradmp  )   CALL tra_dmp       ( kstp )  ! internal damping trends
       IF( ln_bdy     )   CALL bdy_tra_dmp   ( kstp )  ! bdy damping trends
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trcbbl.F90	(revision 7954)
@@ -5,5 +5,4 @@
    !!                                  layer scheme
    !!======================================================================
-   !!==============================================================================
    !! History :  OPA  !  1996-06  (L. Mortier)  Original code
    !!            8.0  !  1997-11  (G. Madec)    Optimization
@@ -13,28 +12,27 @@
    !!             -   !  2010-04  (G. Madec)  Campin & Goosse advective bbl 
    !!             -   !  2010-06  (C. Ethe, G. Madec)  merge TRA-TRC
+   !!            4.0  !  2017-04  (G. Madec)  ln_trabbl namelist variable instead of a CPP key
    !!----------------------------------------------------------------------
-#if  defined key_top &&  defined key_trabbl 
+#if  defined key_top
    !!----------------------------------------------------------------------
-   !!   'key_trabbl                      diffusive or/and adevective bottom boundary layer
+   !!   'key_top'                                                TOP models
    !!----------------------------------------------------------------------
-   !!    trc_bbl       : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
+   !!    trc_bbl      : update the tracer trends due to the bottom boundary layer (advective and/or diffusive)
    !!----------------------------------------------------------------------
-   USE oce_trc             ! ocean dynamics and active tracers variables
-   USE trc                 ! ocean passive tracers variables
-   USE trabbl              ! 
-   USE prtctl_trc          ! Print control for debbuging
-   USE trd_oce
-   USE trdtra
+   USE oce_trc        ! ocean dynamics and active tracers variables
+   USE trc            ! ocean passive tracers variables
+   USE trd_oce        ! trends: ocean variables
+   USE trdtra         ! tracer trends
+   USE trabbl         ! bottom boundary layer 
+   USE prtctl_trc     ! Print control for debbuging
 
-   PUBLIC   trc_bbl       !  routine called by step.F90
+   PUBLIC   trc_bbl   !  routine called by trctrp.F90
 
    !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! NEMO/TOP 4.0 , NEMO Consortium (2017)
    !! $Id$ 
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
    !!----------------------------------------------------------------------
-
 CONTAINS
-
 
    SUBROUTINE trc_bbl( kt )
@@ -98,12 +96,4 @@
    END SUBROUTINE trc_bbl
 
-#else
-   !!----------------------------------------------------------------------
-   !!   Dummy module :                      No bottom boundary layer scheme
-   !!----------------------------------------------------------------------
-CONTAINS
-   SUBROUTINE trc_bbl( kt )              ! Empty routine
-      WRITE(*,*) 'tra_bbl: You should not have seen this print! error?', kt
-   END SUBROUTINE trc_bbl
 #endif
 
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trctrp.F90	(revision 7954)
@@ -15,5 +15,4 @@
    USE oce_trc         ! ocean dynamics and active tracers variables
    USE trc             ! ocean passive tracers variables 
-   USE trabbl          ! bottom boundary layer               (trc_bbl routine)
    USE trcbbl          ! bottom boundary layer               (trc_bbl routine)
    USE trcdmp          ! internal damping                    (trc_dmp routine)
@@ -63,5 +62,5 @@
          !
                                 CALL trc_sbc    ( kt )      ! surface boundary condition
-         IF( lk_trabbl )        CALL trc_bbl    ( kt )      ! advective (and/or diffusive) bottom boundary layer scheme
+         IF( ln_trabbl )        CALL trc_bbl    ( kt )      ! advective (and/or diffusive) bottom boundary layer scheme
          IF( ln_trcdmp )        CALL trc_dmp    ( kt )      ! internal damping trends
          IF( ln_bdy )           CALL trc_bdy_dmp( kt )      ! BDY damping trends
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trc.F90	(revision 7954)
@@ -17,59 +17,58 @@
    PUBLIC   trc_alloc   ! called by nemogcm.F90
 
-   !! parameters for the control of passive tracers
-   !! ---------------------------------------------   
-   INTEGER, PUBLIC                                                 ::   numnat_ref = -1   !: logical unit for the reference passive tracer namelist_top_ref
-   INTEGER, PUBLIC                                                 ::   numnat_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg
-   INTEGER, PUBLIC                                                 ::   numont     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top
-   INTEGER, PUBLIC                                                 ::   numtrc_ref = -1   !: logical unit for the reference passive tracer namelist_top_ref
-   INTEGER, PUBLIC                                                 ::   numtrc_cfg = -1   !: logical unit for the reference passive tracer namelist_top_cfg
-   INTEGER, PUBLIC                                                 ::   numonr     = -1   !: logical unit for the reference passive tracer namelist output output.namelist.top
-   INTEGER, PUBLIC                                                 ::   numstr        !: logical unit for tracer statistics
-   INTEGER, PUBLIC                                                 ::   numrtr        !: logical unit for trc restart (read )
-   INTEGER, PUBLIC                                                 ::   numrtw        !: logical unit for trc restart ( write )
+   !                                     !!- logical units of passive tracers
+   INTEGER, PUBLIC ::   numnat_ref = -1   !: reference passive tracer namelist_top_ref
+   INTEGER, PUBLIC ::   numnat_cfg = -1   !: reference passive tracer namelist_top_cfg
+   INTEGER, PUBLIC ::   numont     = -1   !: reference passive tracer namelist output output.namelist.top
+   INTEGER, PUBLIC ::   numtrc_ref = -1   !: reference passive tracer namelist_top_ref
+   INTEGER, PUBLIC ::   numtrc_cfg = -1   !: reference passive tracer namelist_top_cfg
+   INTEGER, PUBLIC ::   numonr     = -1   !: reference passive tracer namelist output output.namelist.top
+   INTEGER, PUBLIC ::   numstr            !: tracer statistics
+   INTEGER, PUBLIC ::   numrtr            !: trc restart (read )
+   INTEGER, PUBLIC ::   numrtw            !: trc restart ( write )
 
    !! passive tracers fields (before,now,after)
    !! --------------------------------------------------
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)               ::  trai           !: initial total tracer
-   REAL(wp), PUBLIC                                                ::  areatot        !: total volume 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  cvol           !: volume correction -degrad option- 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trn            !: tracer concentration for now time step
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  tra            !: tracer concentration for next time step
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trb            !: tracer concentration for before time step
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  sbc_trc_b      !: Before sbc fluxes for tracers
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  sbc_trc        !: Now sbc fluxes for tracers
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)       ::  trai           !: initial total tracer
+   REAL(wp), PUBLIC                                        ::  areatot        !: total volume 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  cvol           !: volume correction -degrad option- 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trn            !: tracer concentration for now time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tra            !: tracer concentration for next time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  trb            !: tracer concentration for before time step
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  sbc_trc_b      !: Before sbc fluxes for tracers
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  sbc_trc        !: Now sbc fluxes for tracers
 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_i          !: prescribed tracer concentration in sea ice for SBC
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  )         ::  trc_o          !: prescribed tracer concentration in ocean for SBC
-   INTEGER             , PUBLIC                                    ::  nn_ice_tr      !: handling of sea ice tracers
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  trc_i          !: prescribed tracer concentration in sea ice for SBC
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:  ) ::  trc_o          !: prescribed tracer concentration in ocean for SBC
+   INTEGER             , PUBLIC                            ::  nn_ice_tr      !: handling of sea ice tracers
 
    !! interpolated gradient
    !!--------------------------------------------------  
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtru           !: hor. gradient at u-points at bottom ocean level
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrv           !: hor. gradient at v-points at bottom ocean level
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrui          !: hor. gradient at u-points at top    ocean level
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)           ::  gtrvi          !: hor. gradient at v-points at top    ocean level
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)             ::  qsr_mean        !: daily mean qsr
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtru           !: hor. gradient at u-points at bottom ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrv           !: hor. gradient at v-points at bottom ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrui          !: hor. gradient at u-points at top    ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gtrvi          !: hor. gradient at v-points at top    ocean level
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_mean        !: daily mean qsr
    
    !! passive tracers  (input and output)
    !! ------------------------------------------  
-   LOGICAL             , PUBLIC                                    ::  ln_rsttr       !: boolean term for restart i/o for passive tracers (namelist)
-   LOGICAL             , PUBLIC                                    ::  lrst_trc       !: logical to control the trc restart write
-   INTEGER             , PUBLIC                                    ::  nn_writetrc    !: time step frequency for concentration outputs (namelist)
-   INTEGER             , PUBLIC                                    ::  nutwrs         !: output FILE for passive tracers restart
-   INTEGER             , PUBLIC                                    ::  nutrst         !: logical unit for restart FILE for passive tracers
-   INTEGER             , PUBLIC                                    ::  nn_rsttr       !: control of the time step ( 0 or 1 ) for pass. tr.
-   CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_in   !: suffix of pass. tracer restart name (input)
-   CHARACTER(len = 256), PUBLIC                                    ::  cn_trcrst_indir  !: restart input directory
-   CHARACTER(len = 80) , PUBLIC                                    ::  cn_trcrst_out  !: suffix of pass. tracer restart name (output)
-   CHARACTER(len = 256), PUBLIC                                    ::  cn_trcrst_outdir  !: restart output directory
-   REAL(wp)            , PUBLIC                                    ::  rdttrc         !: passive tracer time step
-   REAL(wp)            , PUBLIC                                    ::  r2dttrc        !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0
-   LOGICAL             , PUBLIC                                    ::  ln_top_euler   !: boolean term for euler integration 
-   LOGICAL             , PUBLIC                                    ::  ln_trcdta      !: Read inputs data from files
-   LOGICAL             , PUBLIC                                    ::  ln_trcdmp      !: internal damping flag
-   LOGICAL             , PUBLIC                                    ::  ln_trcdmp_clo  !: internal damping flag on closed seas
-   INTEGER             , PUBLIC                                    ::  nittrc000      !: first time step of passive tracers model
-   LOGICAL             , PUBLIC                                    ::  l_trcdm2dc     !: Diurnal cycle for TOP
+   LOGICAL             , PUBLIC ::   ln_rsttr           !: boolean term for restart i/o for passive tracers (namelist)
+   LOGICAL             , PUBLIC ::   lrst_trc           !: logical to control the trc restart write
+   INTEGER             , PUBLIC ::   nn_writetrc        !: time step frequency for concentration outputs (namelist)
+   INTEGER             , PUBLIC ::   nutwrs             !: output FILE for passive tracers restart
+   INTEGER             , PUBLIC ::   nutrst             !: logical unit for restart FILE for passive tracers
+   INTEGER             , PUBLIC ::   nn_rsttr           !: control of the time step ( 0 or 1 ) for pass. tr.
+   CHARACTER(len = 80) , PUBLIC ::   cn_trcrst_in       !: suffix of pass. tracer restart name (input)
+   CHARACTER(len = 256), PUBLIC ::   cn_trcrst_indir    !: restart input directory
+   CHARACTER(len = 80) , PUBLIC ::   cn_trcrst_out      !: suffix of pass. tracer restart name (output)
+   CHARACTER(len = 256), PUBLIC ::   cn_trcrst_outdir   !: restart output directory
+   REAL(wp)            , PUBLIC ::   rdttrc             !: passive tracer time step
+   REAL(wp)            , PUBLIC ::   r2dttrc            !: = 2*rdttrc except at nit000 (=rdttrc) if neuler=0
+   LOGICAL             , PUBLIC ::   ln_top_euler       !: boolean term for euler integration 
+   LOGICAL             , PUBLIC ::   ln_trcdta          !: Read inputs data from files
+   LOGICAL             , PUBLIC ::   ln_trcdmp          !: internal damping flag
+   LOGICAL             , PUBLIC ::   ln_trcdmp_clo      !: internal damping flag on closed seas
+   INTEGER             , PUBLIC ::   nittrc000          !: first time step of passive tracers model
+   LOGICAL             , PUBLIC ::   l_trcdm2dc         !: Diurnal cycle for TOP
 
    !! Information for the ice module for tracers
@@ -80,13 +79,13 @@
          CHARACTER(len=2) :: ctrc_o     ! choice of ocean trc cc
    END TYPE
-
-   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_ratio      ! ice-ocean tracer ratio
-   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: trc_ice_prescr     ! prescribed ice trc cc
-   CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)  :: cn_trc_o ! choice of ocean tracer cc
+   !
+   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   trc_ice_ratio    !: ice-ocean tracer ratio
+   REAL(wp)        , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   trc_ice_prescr   !: prescribed ice trc cc
+   CHARACTER(len=2), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:) ::   cn_trc_o         !: choice of ocean tracer cc
 
 
    !! information for outputs
    !! --------------------------------------------------
-   TYPE, PUBLIC :: PTRACER                                                            !: Passive tracer type
+   TYPE, PUBLIC :: PTRACER                                                         !: Passive tracer type
        CHARACTER(len = 20)  :: clsname  !: short name
        CHARACTER(len = 80)  :: cllname  !: long name
@@ -97,15 +96,15 @@
        LOGICAL              :: llobc   !: read in a file or not
    END TYPE PTRACER
-
-   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm         !: tracer name 
-   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln         !: trccer field long name
-   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun         !: tracer unit
-
-   TYPE, PUBLIC :: DIAG                                                               !: passive trcacer ddditional diagnostic type
+   !
+   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcnm     !: tracer name 
+   CHARACTER(len = 80), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcln     !: trccer field long name
+   CHARACTER(len = 20), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ctrcun     !: tracer unit
+   !
+   TYPE, PUBLIC :: DIAG                                                           !: passive trcacer ddditional diagnostic type
       CHARACTER(len = 20)  :: sname    !: short name
       CHARACTER(len = 80)  :: lname    !: long name
       CHARACTER(len = 20)  :: units    !: unit
    END TYPE DIAG
-
+   !
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc3d          !: 3D diagnostics for tracers
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:)         ::  trc2d          !: 2D diagnostics for tracers
@@ -113,52 +112,11 @@
    !! information for inputs
    !! --------------------------------------------------
-   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_ini     !: Initialisation from data input file
-   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_obc     !: Use open boundary condition data
-   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_sbc     !: Use surface boundary condition data
-   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::  ln_trc_cbc     !: Use coastal boundary condition data
-   LOGICAL , PUBLIC                                     ::  ln_rnf_ctl     !: remove runoff dilution on tracers
-   REAL(wp), PUBLIC                                     ::  rn_bc_time     !: Time scaling factor for SBC and CBC data (seconds in a day)
+   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_ini     !: Initialisation from data input file
+   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_obc     !: Use open boundary condition data
+   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_sbc     !: Use surface boundary condition data
+   LOGICAL , PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:)    ::   ln_trc_cbc     !: Use coastal boundary condition data
+   LOGICAL , PUBLIC                                     ::   ln_rnf_ctl     !: remove runoff dilution on tracers
+   REAL(wp), PUBLIC                                     ::   rn_bc_time     !: Time scaling factor for SBC and CBC data (seconds in a day)
 
-
-   !! variables to average over physics over passive tracer sub-steps.
-   !! ----------------------------------------------------------------
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_tm       !: i-horizontal velocity average     [m/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  vn_tm       !: j-horizontal velocity average     [m/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_tm      !: t/s average     [m/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_tm      !: vertical diffusivity coeff. at  w-point   [m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  rhop_tm     !: 
-#if defined key_trabbl
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm  !: u-, w-points
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahv_bbl_tm  !: j-direction slope at u-, w-points
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  utr_bbl_tm  !: j-direction slope at u-, w-points
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  vtr_bbl_tm  !: j-direction slope at u-, w-points
-#endif
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_tm     !: average ssh for the now step [m]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]  
-
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  rnf_tm     !: river runoff
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  h_rnf_tm   !: depth in metres to the bottom of the relevant grid box
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_tm    !: mixed layer depth average [m]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fr_i_tm    !: average ice fraction     [m/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_tm     !: freshwater budget: volume flux [Kg/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  fmmflx_tm  !: freshwater budget: freezing/melting [Kg/m2/s]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_b_hold !: hold emp from the beginning of each sub-stepping[m]  
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  qsr_tm     !: solar radiation average [m]
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  wndm_tm    !: 10m wind average [m]
-   !
-
-   ! Temporary physical arrays for sub_stepping
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  tsn_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  un_temp,vn_temp,wn_temp     !: hold current values of avt, un, vn, wn
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  avs_temp, rhop_temp     !: hold current values of avt, un, vn, wn
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_temp, sshb_temp, ssha_temp, rnf_temp,h_rnf_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  hmld_temp, qsr_temp, fr_i_temp,wndm_temp
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  emp_temp, fmmflx_temp, emp_b_temp
-   !
-#if defined key_trabbl
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_temp, ahv_bbl_temp, utr_bbl_temp, vtr_bbl_temp !: hold current values 
-#endif
    !
    !
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcstp.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcstp.F90	(revision 7954)
@@ -8,19 +8,20 @@
 #if defined key_top
    !!----------------------------------------------------------------------
-   !!   trc_stp      : passive tracer system time-stepping
-   !!----------------------------------------------------------------------
-   USE oce_trc          ! ocean dynamics and active tracers variables
+   !!   trc_stp       : passive tracer system time-stepping
+   !!----------------------------------------------------------------------
+   USE oce_trc        ! ocean dynamics and active tracers variables
    USE sbc_oce
    USE trc
-   USE trctrp           ! passive tracers transport
-   USE trcsms           ! passive tracers sources and sinks
+   USE trctrp         ! passive tracers transport
+   USE trcsms         ! passive tracers sources and sinks
    USE trcwri
    USE trcrst
+   USE trcsub         !
    USE trdtrc_oce
    USE trdmxl_trc
-   USE prtctl_trc       ! Print control for debbuging
-   USE iom
-   USE in_out_manager
-   USE trcsub
+   !
+   USE prtctl_trc     ! Print control for debbuging
+   USE iom            !
+   USE in_out_manager !
 
    IMPLICIT NONE
@@ -29,9 +30,9 @@
    PUBLIC   trc_stp    ! called by step
 
-   REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   qsr_arr ! save qsr during TOP time-step
-   REAL(wp) :: rdt_sampl
-   INTEGER  :: nb_rec_per_day, ktdcy
-   REAL(wp) :: rsecfst, rseclast
-   LOGICAL  :: llnew
+   LOGICAL  ::   llnew                   ! ???
+   REAL(wp) ::   rdt_sampl               ! ???
+   INTEGER  ::   nb_rec_per_day, ktdcy   ! ???
+   REAL(wp) ::   rsecfst, rseclast       ! ???
+   REAL(wp), DIMENSION(:,:,:), SAVE, ALLOCATABLE ::   qsr_arr   ! save qsr during TOP time-step
 
    !!----------------------------------------------------------------------
@@ -46,15 +47,14 @@
       !!                     ***  ROUTINE trc_stp  ***
       !!                      
-      !! ** Purpose : Time loop of opa for passive tracer
+      !! ** Purpose :   Time loop of opa for passive tracer
       !! 
-      !! ** Method  : 
-      !!              Compute the passive tracers trends 
-      !!              Update the passive tracers
+      !! ** Method  :   Compute the passive tracers trends 
+      !!                Update the passive tracers
       !!-------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::  kt      ! ocean time-step index
-      INTEGER               ::  jk, jn  ! dummy loop indices
-      REAL(wp)              ::  ztrai
-      CHARACTER (len=25)    ::  charout 
-
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
+      INTEGER ::   jk, jn   ! dummy loop indices
+      REAL(wp)::   ztrai    ! local scalar
+      CHARACTER (len=25) ::   charout   !
       !!-------------------------------------------------------------------
       !
@@ -115,4 +115,5 @@
       !
    END SUBROUTINE trc_stp
+
 
    SUBROUTINE trc_mean_qsr( kt )
@@ -128,10 +129,12 @@
       !!              In coupled mode, the sampling is done at every coupling frequency 
       !!----------------------------------------------------------------------
-      INTEGER, INTENT(in) ::   kt
-      INTEGER  :: jn
-      REAL(wp) :: zkt, zrec
-      CHARACTER(len=1)               ::   cl1                      ! 1 character
-      CHARACTER(len=2)               ::   cl2                      ! 2 characters
-
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
+      INTEGER  ::   jn   ! dummy loop indices
+      REAL(wp) ::   zkt, zrec     ! local scalars
+      CHARACTER(len=1) ::   cl1   ! 1 character
+      CHARACTER(len=2) ::   cl2   ! 2 characters
+      !!----------------------------------------------------------------------
+      !
       IF( kt == nittrc000 ) THEN
          IF( ln_cpl )  THEN  
@@ -143,5 +146,5 @@
          ENDIF
          !
-         IF( lwp ) THEN
+         IF(lwp) THEN
             WRITE(numout,*) 
             WRITE(numout,*) ' Sampling frequency dt = ', rdt_sampl, 's','   Number of sampling per day  nrec = ', nb_rec_per_day
@@ -171,5 +174,5 @@
                     CALL iom_get( numrtr, jpdom_autoglo, 'qsr_arr_'//cl2, qsr_arr(:,:,jn) )   !  A mean of qsr
                   ENDIF
-              ENDDO
+              END DO
             ELSE
                DO jn = 1, nb_rec_per_day
@@ -184,5 +187,5 @@
             DO jn = 1, nb_rec_per_day
                qsr_arr(:,:,jn) = qsr_mean(:,:)
-            ENDDO
+            END DO
          ENDIF
          !
@@ -220,5 +223,5 @@
                CALL iom_rstput( kt, nitrst, numrtw, 'qsr_arr_'//cl2, qsr_arr(:,:,jn) )
              ENDIF
-         ENDDO
+         END DO
          CALL iom_rstput( kt, nitrst, numrtw, 'qsr_mean', qsr_mean(:,:) )
       ENDIF
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 7953)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/trcsub.F90	(revision 7954)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE trcsubstp  ***
-   !!TOP :   Averages physics variables for TOP substepping. 
+   !!   TOP :   Averages physics variables for TOP substepping. 
    !!======================================================================
    !! History :  1.0  !  2011-10  (K. Edwards)  Original
@@ -8,18 +8,19 @@
 #if defined key_top
    !!----------------------------------------------------------------------
-   !!   trc_sub    : passive tracer system sub-stepping 
+   !!   trc_sub       : passive tracer system sub-stepping 
    !!----------------------------------------------------------------------
-   USE oce_trc          ! ocean dynamics and active tracers variables
+   USE oce_trc        ! ocean dynamics and active tracers variables
    USE trc
-   USE prtctl_trc       ! Print control for debbuging
-   USE iom
-   USE in_out_manager
-   USE lbclnk
-   USE trabbl
+   USE trabbl         ! bottom boundary layer
    USE zdf_oce
    USE domvvl
-   USE divhor          ! horizontal divergence            (div_hor routine)
-   USE sbcrnf    , ONLY: h_rnf, nk_rnf    ! River runoff
-   USE bdy_oce   , ONLY: ln_bdy, bdytmask ! BDY
+   USE divhor         ! horizontal divergence
+   USE sbcrnf   , ONLY: h_rnf, nk_rnf    ! River runoff
+   USE bdy_oce  , ONLY: ln_bdy, bdytmask ! BDY
+   !
+   USE prtctl_trc     ! Print control for debbuging
+   USE in_out_manager ! 
+   USE iom
+   USE lbclnk
 #if defined key_agrif
    USE agrif_opa_update
@@ -29,18 +30,51 @@
    IMPLICIT NONE
 
-   PUBLIC   trc_sub_stp      ! called by trc_stp
-   PUBLIC   trc_sub_ini      ! called by trc_ini to initialize substepping arrays.
-   PUBLIC   trc_sub_reset    ! called by trc_stp to reset physics variables
-   PUBLIC   trc_sub_ssh      ! called by trc_stp to reset physics variables
-
-   REAL(wp)  :: r1_ndttrc     !    1 /  nn_dttrc 
-   REAL(wp)  :: r1_ndttrcp1   !    1 / (nn_dttrc+1) 
-
-   !                                                       !* iso-neutral slopes (if l_ldfslp=T)
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_temp, vslp_temp, wslpi_temp, wslpj_temp   !: hold current values 
-   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  uslp_tm  , vslp_tm  , wslpi_tm  , wslpj_tm     !: time mean 
+   PUBLIC   trc_sub_stp     ! called by trc_stp
+   PUBLIC   trc_sub_ini     ! called by trc_ini to initialize substepping arrays.
+   PUBLIC   trc_sub_reset   ! called by trc_stp to reset physics variables
+   PUBLIC   trc_sub_ssh     ! called by trc_stp to reset physics variables
+
+   REAL(wp) :: r1_ndttrc     ! = 1 /  nn_dttrc 
+   REAL(wp) :: r1_ndttrcp1   ! = 1 / (nn_dttrc+1) 
+
+
+   !! averaged and temporary saved variables  (needed when a larger passive tracer time-step is used)
+   !! ----------------------------------------------------------------
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    un_tm ,   un_temp   !: i-horizontal velocity average     [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::    vn_tm ,   vn_temp   !: j-horizontal velocity average     [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::              wn_temp   !: hold current values of avt, un, vn, wn
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   tsn_tm ,  tsn_temp   !: t/s average     [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   avs_tm ,  avs_temp   !: vertical diffusivity coeff. at  w-point   [m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  rhop_tm , rhop_temp   !: 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshn_tm , sshn_temp   !: average ssh for the now step [m]
+
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    rnf_tm ,    rnf_temp   !: river runoff
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  h_rnf_tm ,  h_rnf_temp   !: depth in metres to the bottom of the relevant grid box
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   hmld_tm ,   hmld_temp   !: mixed layer depth average [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   fr_i_tm ,   fr_i_temp   !: average ice fraction     [m/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    emp_tm ,    emp_temp   !: freshwater budget: volume flux [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     :: fmmflx_tm , fmmflx_temp   !: freshwater budget: freezing/melting [Kg/m2/s]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     :: emp_b_hold,  emp_b_temp   !: hold emp from the beginning of each sub-stepping[m]  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::    qsr_tm ,    qsr_temp   !: solar radiation average [m]
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   wndm_tm ,   wndm_temp   !: 10m wind average [m]
+   !
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  sshb_hold   !:hold sshb from the beginning of each sub-stepping[m]  
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   sshb_temp, ssha_temp
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivn_temp, rotn_temp
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  hdivb_temp, rotb_temp
+   !
+   !                                                    !!- bottom boundary layer param (ln_trabbl=T)
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahu_bbl_tm, ahu_bbl_temp  ! BBL diffusive i-coef.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  ahv_bbl_tm, ahv_bbl_temp  ! BBL diffusive j-coef.
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  utr_bbl_tm, utr_bbl_temp  ! BBL u-advection
+   REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:)     ::  vtr_bbl_tm, vtr_bbl_temp  ! BBL v-advection
+
+   !                                                      !!- iso-neutral slopes (if l_ldfslp=T)
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   uslp_temp, vslp_temp, wslpi_temp, wslpj_temp   !: hold current values 
+   REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   uslp_tm  , vslp_tm  , wslpi_tm  , wslpj_tm     !: time mean 
+
 
    !!----------------------------------------------------------------------
-   !! NEMO/TOP 3.3 , NEMO Consortium (2010)
+   !! NEMO/TOP 4.0 , NEMO Consortium (2017)
    !! $Id$ 
    !! Software governed by the CeCILL licence (NEMOGCM/NEMO_CeCILL.txt)
@@ -57,7 +91,8 @@
       !!              on TOP steps, calculate averages.
       !!-------------------------------------------------------------------
-      INTEGER, INTENT( in ) ::  kt        ! ocean time-step index
-      INTEGER               ::  ji,jj,jk  ! dummy loop indices
-      REAL(wp)              ::  z1_ne3t, z1_ne3u, z1_ne3v, z1_ne3w
+      INTEGER, INTENT( in ) ::   kt   ! ocean time-step index
+      !
+      INTEGER ::   ji, jj, jk   ! dummy loop indices
+      REAL(wp)::   z1_ne3t, z1_ne3u, z1_ne3v, z1_ne3w   ! local scalars
       !!-------------------------------------------------------------------
       !
@@ -74,15 +109,14 @@
            r1_ndttrc        = 1._wp / REAL( nn_dttrc    , wp ) 
            r1_ndttrcp1      = 1._wp / REAL( nn_dttrc + 1, wp )
-           !
       ENDIF  
 
-       IF( MOD( kt , nn_dttrc ) /= 0 ) THEN
-          !
-          un_tm   (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:) 
-          vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:) 
-          tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,:)  
-          tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,:)  
-          rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,:)  
-          avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,:)  
+      IF( MOD( kt , nn_dttrc ) /= 0 ) THEN
+         !
+         un_tm   (:,:,:)        = un_tm   (:,:,:)        + un   (:,:,:)        * e3u_n(:,:,:) 
+         vn_tm   (:,:,:)        = vn_tm   (:,:,:)        + vn   (:,:,:)        * e3v_n(:,:,:) 
+         tsn_tm  (:,:,:,jp_tem) = tsn_tm  (:,:,:,jp_tem) + tsn  (:,:,:,jp_tem) * e3t_n(:,:,:)  
+         tsn_tm  (:,:,:,jp_sal) = tsn_tm  (:,:,:,jp_sal) + tsn  (:,:,:,jp_sal) * e3t_n(:,:,:)  
+         rhop_tm (:,:,:)        = rhop_tm (:,:,:)        + rhop (:,:,:)        * e3t_n(:,:,:)  
+         avs_tm  (:,:,:)        = avs_tm  (:,:,:)        + avs  (:,:,:)        * e3w_n(:,:,:)  
          IF( l_ldfslp ) THEN
             uslp_tm (:,:,:)      = uslp_tm (:,:,:)        + uslp (:,:,:)
@@ -91,27 +125,27 @@
             wslpj_tm(:,:,:)      = wslpj_tm(:,:,:)        + wslpj(:,:,:)
          ENDIF
-# if defined key_trabbl
-          IF( nn_bbl_ldf == 1 ) THEN
-             ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:) 
-             ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:) 
-          ENDIF
-          IF( nn_bbl_adv == 1 ) THEN
-             utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:) 
-             vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:) 
-          ENDIF
-# endif
-          !
-          sshn_tm  (:,:)         = sshn_tm  (:,:)         + sshn  (:,:) 
-          rnf_tm   (:,:)         = rnf_tm   (:,:)         + rnf   (:,:) 
-          h_rnf_tm (:,:)         = h_rnf_tm (:,:)         + h_rnf (:,:) 
-          hmld_tm  (:,:)         = hmld_tm  (:,:)         + hmld  (:,:)
-          fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:)
-          emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:) 
-          fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:)
-          qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:)
-          wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:)
-
+         IF( ln_trabbl ) THEN
+            IF( nn_bbl_ldf == 1 ) THEN
+               ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:) 
+               ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:) 
+            ENDIF
+            IF( nn_bbl_adv == 1 ) THEN
+               utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:) 
+               vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:) 
+            ENDIF
+         ENDIF 
+         !
+         sshn_tm  (:,:)         = sshn_tm  (:,:)         + sshn  (:,:) 
+         rnf_tm   (:,:)         = rnf_tm   (:,:)         + rnf   (:,:) 
+         h_rnf_tm (:,:)         = h_rnf_tm (:,:)         + h_rnf (:,:) 
+         hmld_tm  (:,:)         = hmld_tm  (:,:)         + hmld  (:,:)
+         fr_i_tm  (:,:)         = fr_i_tm  (:,:)         + fr_i  (:,:)
+         emp_tm   (:,:)         = emp_tm   (:,:)         + emp   (:,:) 
+         fmmflx_tm(:,:)         = fmmflx_tm(:,:)         + fmmflx(:,:)
+         qsr_tm   (:,:)         = qsr_tm   (:,:)         + qsr   (:,:)
+         wndm_tm  (:,:)         = wndm_tm  (:,:)         + wndm  (:,:)
+         !
       ELSE                           !  It is time to substep 
-         !   1. set temporary arrays to hold physics variables
+         !   1. set temporary arrays to hold physics/dynamical variables
          un_temp    (:,:,:)      = un    (:,:,:)
          vn_temp    (:,:,:)      = vn    (:,:,:)
@@ -124,14 +158,14 @@
             vslp_temp  (:,:,:)   = vslp  (:,:,:)   ;   wslpj_temp (:,:,:)   = wslpj (:,:,:)
          ENDIF
-# if defined key_trabbl
-          IF( nn_bbl_ldf == 1 ) THEN
-             ahu_bbl_temp(:,:)   = ahu_bbl(:,:)  
-             ahv_bbl_temp(:,:)   = ahv_bbl(:,:) 
-          ENDIF
-          IF( nn_bbl_adv == 1 ) THEN
-             utr_bbl_temp(:,:)   = utr_bbl(:,:) 
-             vtr_bbl_temp(:,:)   = vtr_bbl(:,:) 
-          ENDIF
-# endif
+         IF( ln_trabbl ) THEN
+            IF( nn_bbl_ldf == 1 ) THEN
+               ahu_bbl_temp(:,:)   = ahu_bbl(:,:)  
+               ahv_bbl_temp(:,:)   = ahv_bbl(:,:) 
+            ENDIF
+            IF( nn_bbl_adv == 1 ) THEN
+               utr_bbl_temp(:,:)   = utr_bbl(:,:) 
+               vtr_bbl_temp(:,:)   = vtr_bbl(:,:) 
+            ENDIF
+         ENDIF 
          sshn_temp  (:,:)        = sshn  (:,:)
          sshb_temp  (:,:)        = sshb  (:,:)
@@ -162,14 +196,14 @@
             wslpj_tm (:,:,:)     = wslpj_tm(:,:,:)        + wslpj(:,:,:) 
          ENDIF
-# if defined key_trabbl
-          IF( nn_bbl_ldf == 1 ) THEN
-             ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:) 
-             ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:) 
-          ENDIF
-          IF( nn_bbl_adv == 1 ) THEN
-             utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:) 
-             vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:) 
-          ENDIF
-# endif
+         IF( ln_trabbl ) THEN
+            IF( nn_bbl_ldf == 1 ) THEN
+               ahu_bbl_tm(:,:)     = ahu_bbl_tm(:,:)        + ahu_bbl(:,:) 
+               ahv_bbl_tm(:,:)     = ahv_bbl_tm(:,:)        + ahv_bbl(:,:) 
+            ENDIF
+            IF( nn_bbl_adv == 1 ) THEN
+               utr_bbl_tm(:,:)     = utr_bbl_tm(:,:)        + utr_bbl(:,:) 
+               vtr_bbl_tm(:,:)     = vtr_bbl_tm(:,:)        + vtr_bbl(:,:) 
+            ENDIF
+         ENDIF 
          sshn_tm  (:,:)          = sshn_tm    (:,:)       + sshn  (:,:) 
          rnf_tm   (:,:)          = rnf_tm     (:,:)       + rnf   (:,:) 
@@ -195,14 +229,14 @@
             fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrc 
             fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrc
-# if defined key_trabbl
-            IF( nn_bbl_ldf == 1 ) THEN
-               ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrc  
-               ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrc 
-            ENDIF
-            IF( nn_bbl_adv == 1 ) THEN
-               utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrc  
-               vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrc 
-            ENDIF
-# endif
+            IF( ln_trabbl ) THEN
+               IF( nn_bbl_ldf == 1 ) THEN
+                  ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrc  
+                  ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrc 
+               ENDIF
+               IF( nn_bbl_adv == 1 ) THEN
+                  utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrc  
+                  vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrc 
+               ENDIF
+            ENDIF
          ELSE
             wndm  (:,:)          = wndm_tm    (:,:) * r1_ndttrcp1 
@@ -211,14 +245,14 @@
             fmmflx(:,:)          = fmmflx_tm  (:,:) * r1_ndttrcp1 
             fr_i  (:,:)          = fr_i_tm    (:,:) * r1_ndttrcp1 
-# if defined key_trabbl
-            IF( nn_bbl_ldf == 1 ) THEN
-               ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrcp1  
-               ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrcp1 
-            ENDIF
-            IF( nn_bbl_adv == 1 ) THEN
-               utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrcp1  
-               vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrcp1 
-            ENDIF
-# endif
+            IF( ln_trabbl ) THEN
+               IF( nn_bbl_ldf == 1 ) THEN
+                  ahu_bbl(:,:)      = ahu_bbl_tm (:,:) * r1_ndttrcp1  
+                  ahv_bbl(:,:)      = ahv_bbl_tm (:,:) * r1_ndttrcp1 
+               ENDIF
+               IF( nn_bbl_adv == 1 ) THEN
+                  utr_bbl(:,:)      = utr_bbl_tm (:,:) * r1_ndttrcp1  
+                  vtr_bbl(:,:)      = vtr_bbl_tm (:,:) * r1_ndttrcp1 
+               ENDIF
+            ENDIF
          ENDIF
          !
@@ -298,19 +332,19 @@
 
       ! Physics variables that are set after initialization:
-      fr_i_tm(:,:) = 0._wp
-      emp_tm (:,:) = 0._wp
+      fr_i_tm  (:,:) = 0._wp
+      emp_tm   (:,:) = 0._wp
       fmmflx_tm(:,:)  = 0._wp
-      qsr_tm (:,:) = 0._wp
-      wndm_tm(:,:) = 0._wp
-# if defined key_trabbl
-      IF( nn_bbl_ldf == 1 ) THEN
-         ahu_bbl_tm(:,:) = 0._wp
-         ahv_bbl_tm(:,:) = 0._wp
-      ENDIF
-      IF( nn_bbl_adv == 1 ) THEN
-         utr_bbl_tm(:,:) = 0._wp
-         vtr_bbl_tm(:,:) = 0._wp
-      ENDIF
-# endif
+      qsr_tm   (:,:) = 0._wp
+      wndm_tm  (:,:) = 0._wp
+      IF( ln_trabbl ) THEN
+         IF( nn_bbl_ldf == 1 ) THEN
+            ahu_bbl_tm(:,:) = 0._wp
+            ahv_bbl_tm(:,:) = 0._wp
+         ENDIF
+         IF( nn_bbl_adv == 1 ) THEN
+            utr_bbl_tm(:,:) = 0._wp
+            vtr_bbl_tm(:,:) = 0._wp
+         ENDIF
+      ENDIF
       !
       IF( nn_timing == 1 )  CALL timing_stop('trc_sub_ini')
@@ -359,14 +393,14 @@
       qsr   (:,:)     =  qsr_temp   (:,:)
       wndm  (:,:)     =  wndm_temp  (:,:)
-# if defined key_trabbl
-      IF( nn_bbl_ldf == 1 ) THEN
-         ahu_bbl(:,:) = ahu_bbl_temp(:,:) 
-         ahv_bbl(:,:) = ahv_bbl_temp(:,:) 
-      ENDIF
-      IF( nn_bbl_adv == 1 ) THEN
-         utr_bbl(:,:) = utr_bbl_temp(:,:) 
-         vtr_bbl(:,:) = vtr_bbl_temp(:,:) 
-      ENDIF
-# endif
+      IF( ln_trabbl ) THEN
+         IF( nn_bbl_ldf == 1 ) THEN
+            ahu_bbl(:,:) = ahu_bbl_temp(:,:) 
+            ahv_bbl(:,:) = ahv_bbl_temp(:,:) 
+         ENDIF
+         IF( nn_bbl_adv == 1 ) THEN
+            utr_bbl(:,:) = utr_bbl_temp(:,:) 
+            vtr_bbl(:,:) = vtr_bbl_temp(:,:) 
+         ENDIF
+      ENDIF
       !
       hdivn (:,:,:)   =  hdivn_temp (:,:,:)
@@ -397,14 +431,14 @@
       qsr_tm     (:,:) = qsr   (:,:)
       wndm_tm    (:,:) = wndm  (:,:)
-# if defined key_trabbl
-      IF( nn_bbl_ldf == 1 ) THEN
-         ahu_bbl_tm(:,:) = ahu_bbl(:,:) 
-         ahv_bbl_tm(:,:) = ahv_bbl(:,:) 
-      ENDIF
-      IF( nn_bbl_adv == 1 ) THEN
-         utr_bbl_tm(:,:) = utr_bbl(:,:) 
-         vtr_bbl_tm(:,:) = vtr_bbl(:,:) 
-      ENDIF
-# endif
+      IF( ln_trabbl ) THEN
+         IF( nn_bbl_ldf == 1 ) THEN
+            ahu_bbl_tm(:,:) = ahu_bbl(:,:) 
+            ahv_bbl_tm(:,:) = ahv_bbl(:,:) 
+         ENDIF
+         IF( nn_bbl_adv == 1 ) THEN
+            utr_bbl_tm(:,:) = utr_bbl(:,:) 
+            vtr_bbl_tm(:,:) = vtr_bbl(:,:) 
+         ENDIF
+      ENDIF
       !
       !
@@ -509,46 +543,46 @@
       !!-------------------------------------------------------------------
       USE lib_mpp, ONLY: ctl_warn
-      INTEGER ::  ierr
-      !!-------------------------------------------------------------------
-      !
-      ALLOCATE( un_temp(jpi,jpj,jpk)        ,  vn_temp(jpi,jpj,jpk)  ,   &
-         &      wn_temp(jpi,jpj,jpk)        ,                            &
-         &      rhop_temp(jpi,jpj,jpk)      ,  rhop_tm(jpi,jpj,jpk) ,   &
-         &      sshn_temp(jpi,jpj)          ,  sshb_temp(jpi,jpj) ,      &
-         &      ssha_temp(jpi,jpj)          ,                           &
-#if defined key_trabbl
-         &      ahu_bbl_temp(jpi,jpj)       ,  ahv_bbl_temp(jpi,jpj),    &
-         &      utr_bbl_temp(jpi,jpj)       ,  vtr_bbl_temp(jpi,jpj),    &
-#endif
-         &      rnf_temp(jpi,jpj)           ,  h_rnf_temp(jpi,jpj) ,     &
-         &      tsn_temp(jpi,jpj,jpk,2)     ,  emp_b_temp(jpi,jpj),      &
-         &      emp_temp(jpi,jpj)           ,  fmmflx_temp(jpi,jpj),     &
-         &      hmld_temp(jpi,jpj)          ,  qsr_temp(jpi,jpj) ,       &
-         &      fr_i_temp(jpi,jpj)          ,  fr_i_tm(jpi,jpj) ,        &
-         &      wndm_temp(jpi,jpj)          ,  wndm_tm(jpi,jpj) ,        &
-         &      avs_tm(jpi,jpj,jpk)         ,  avs_temp(jpi,jpj,jpk) ,   &
-         &      hdivn_temp(jpi,jpj,jpk)     ,  hdivb_temp(jpi,jpj,jpk),  &
-         &      un_tm(jpi,jpj,jpk)          ,  vn_tm(jpi,jpj,jpk)  ,     &
-         &      sshn_tm(jpi,jpj)            ,  sshb_hold(jpi,jpj) ,      &
-         &      tsn_tm(jpi,jpj,jpk,2)       ,                            &
-         &      emp_tm(jpi,jpj)             ,  fmmflx_tm(jpi,jpj)  ,     &
-         &      emp_b_hold(jpi,jpj)         ,                            &
-         &      hmld_tm(jpi,jpj)            ,  qsr_tm(jpi,jpj) ,         &
-#if defined key_trabbl
-         &      ahu_bbl_tm(jpi,jpj)         ,  ahv_bbl_tm(jpi,jpj),      &
-         &      utr_bbl_tm(jpi,jpj)         ,  vtr_bbl_tm(jpi,jpj),      &
-#endif
-         &      rnf_tm(jpi,jpj)             ,  h_rnf_tm(jpi,jpj) , STAT=trc_sub_alloc )  
+      INTEGER ::  ierr(3)
+      !!-------------------------------------------------------------------
+      !
+      ierr(:) = 0
+      !
+      ALLOCATE( un_temp(jpi,jpj,jpk)      ,  vn_temp(jpi,jpj,jpk)   ,     &
+         &      wn_temp(jpi,jpj,jpk)      ,                               &
+         &      rhop_temp(jpi,jpj,jpk)    ,  rhop_tm(jpi,jpj,jpk)   ,     &
+         &      sshn_temp(jpi,jpj)        ,  sshb_temp(jpi,jpj)     ,     &
+         &      ssha_temp(jpi,jpj)        ,                               &
+         &      rnf_temp(jpi,jpj)         ,  h_rnf_temp(jpi,jpj)    ,     &
+         &      tsn_temp(jpi,jpj,jpk,2)   ,  emp_b_temp(jpi,jpj)    ,     &
+         &      emp_temp(jpi,jpj)         ,  fmmflx_temp(jpi,jpj)   ,     &
+         &      hmld_temp(jpi,jpj)        ,  qsr_temp(jpi,jpj)      ,     &
+         &      fr_i_temp(jpi,jpj)        ,  fr_i_tm(jpi,jpj)       ,     &
+         &      wndm_temp(jpi,jpj)        ,  wndm_tm(jpi,jpj)       ,     &
+         &      avs_tm(jpi,jpj,jpk)       ,  avs_temp(jpi,jpj,jpk)  ,     &
+         &      hdivn_temp(jpi,jpj,jpk)   ,  hdivb_temp(jpi,jpj,jpk),     &
+         &      un_tm(jpi,jpj,jpk)        ,  vn_tm(jpi,jpj,jpk)     ,     &
+         &      sshn_tm(jpi,jpj)          ,  sshb_hold(jpi,jpj)     ,     &
+         &      tsn_tm(jpi,jpj,jpk,2)     ,                               &
+         &      emp_tm(jpi,jpj)           ,  fmmflx_tm(jpi,jpj)     ,     &
+         &      emp_b_hold(jpi,jpj)       ,                               &
+         &      hmld_tm(jpi,jpj)          ,  qsr_tm(jpi,jpj)        ,     &
+         &      rnf_tm(jpi,jpj)           ,  h_rnf_tm(jpi,jpj)      , STAT=ierr(1) )  
+      !
+      IF( l_ldfslp ) THEN
+         ALLOCATE( uslp_temp(jpi,jpj,jpk) ,  wslpi_temp(jpi,jpj,jpk),     &
+            &      vslp_temp(jpi,jpj,jpk) ,  wslpj_temp(jpi,jpj,jpk),     &
+            &      uslp_tm  (jpi,jpj,jpk) ,  wslpi_tm  (jpi,jpj,jpk),     &
+            &      vslp_tm  (jpi,jpj,jpk) ,  wslpj_tm  (jpi,jpj,jpk), STAT=ierr(2) )
+      ENDIF
+      IF( ln_trabbl ) THEN
+         ALLOCATE( ahu_bbl_temp(jpi,jpj)  , utr_bbl_temp(jpi,jpj)   ,     &
+            &      ahv_bbl_temp(jpi,jpj)  , vtr_bbl_temp(jpi,jpj)   ,     &
+            &      ahu_bbl_tm  (jpi,jpj)  , utr_bbl_tm  (jpi,jpj)   ,     &
+            &      ahv_bbl_tm  (jpi,jpj)  , vtr_bbl_tm  (jpi,jpj)   , STAT=ierr(3) ) 
+      ENDIF
+      !
+      trc_sub_alloc = MAXVAL( ierr )
       !
       IF( trc_sub_alloc /= 0 )   CALL ctl_warn('trc_sub_alloc: failed to allocate arrays')
-      !
-      IF( l_ldfslp ) THEN
-         ALLOCATE( uslp_temp(jpi,jpj,jpk)   ,  wslpi_temp(jpi,jpj,jpk),      &
-            &      vslp_temp(jpi,jpj,jpk)   ,  wslpj_temp(jpi,jpj,jpk),      &
-            &      uslp_tm  (jpi,jpj,jpk)   ,  wslpi_tm  (jpi,jpj,jpk),      &
-            &      vslp_tm  (jpi,jpj,jpk)   ,  wslpj_tm  (jpi,jpj,jpk),  STAT=trc_sub_alloc )
-      ENDIF
-      !
-      IF( trc_sub_alloc /= 0 )   CALL ctl_warn('trc_sub_alloc: failed to allocate ldf_slp arrays')
       !
    END FUNCTION trc_sub_alloc
