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 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/GYRE_PISCES/EXP00/namelist_cfg	(revision 7931)
@@ -245,8 +245,39 @@
    rn_ahm_0_lap     = 100000.   !  horizontal laplacian eddy viscosity   [m2/s]
 /
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   nn_evdm     =    1      !  evd apply on tracer (=0) or on tracer and momentum (=1)
+!!======================================================================
+!!                     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  =    1            !  evd apply on tracer (=0) or on tracer and momentum (=1)
+      rn_evd   =  100.           !  evd mixing coefficient [m2/s]
+   !
+   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.   ! 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    =    0         !  horizontal shape for avtb (=1) or not (=0)
+   !
 /
 !-----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/CONFIG/SHARED/namelist_ref	(revision 7931)
@@ -1,4 +1,4 @@
 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
-!!                            namelist_ref
+!!                            namelist_ref                            !!
 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 !! NEMO/OPA  :  1 - run manager      (namrun)
@@ -11,12 +11,12 @@
 !!              6 - Tracer           (nameos, namtra_adv, namtra_ldf, namtra_ldfeiv, namtra_dmp)
 !!              7 - dynamics         (namdyn_adv, namdyn_vor, namdyn_hpg, namdyn_spg, namdyn_ldf)
-!!              8 - Verical physics  (namzdf, namzdf_ric, namzdf_tke, namzdf_ddm, namzdf_tmx, namzdf_tmx_new)
-!!              9 - diagnostics      (namnc4, namtrd, namspr, namflo, namhsb, namsto)
-!!             10 - miscellaneous    (nammpp, namctl)
+!!              8 - Verical physics  (namzdf, namzdf_ric, namzdf_tke, namzdf_gls, namzdf_tmx, namzdf_tmx_new)
+!!              9 - miscellaneous    (nammpp, namctl)
+!!             10 - diagnostics      (namnc4, namtrd, namspr, namflo, namhsb, namsto)
 !!             11 - Obs & Assim      (namobs, nam_asminc)
 !!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
 
 !!======================================================================
-!!                   ***  Run management namelists  ***
+!!                   ***  Run management namelists  ***               !!
 !!======================================================================
 !!   namrun       parameters of the run
@@ -70,5 +70,5 @@
 !
 !-----------------------------------------------------------------------
-&namcfg        !   parameters of the configuration
+&namcfg        !   parameters of the configuration                     !   (default: user defined GYRE)
 !-----------------------------------------------------------------------
    ln_read_cfg = .false.   !  (=T) read the domain configuration file
@@ -83,5 +83,5 @@
 /
 !-----------------------------------------------------------------------
-&namdom        !   space and time domain (bathymetry, mesh, timestep)
+&namdom        !   time and space domain
 !-----------------------------------------------------------------------
    ln_linssh   = .false.   !  =T  linear free surface  ==>>  model level are fixed in time
@@ -91,5 +91,5 @@
    rn_isfhmin  =    1.00   !  treshold (m) to discriminate grounding ice to floating ice
    !
-   rn_rdt      = 5760.     !  time step for the dynamics (and tracer if nn_acc=0)
+   rn_rdt      = 5760.     !  time step for the dynamics and tracer
    rn_atfp     =    0.1    !  asselin time filter parameter
    !
@@ -232,5 +232,5 @@
    sn_qsr      = 'qsr'       ,        24         , 'qsr'     , .false.      , .false., 'yearly'  , ''       , ''       , ''
    sn_emp      = 'emp'       ,        24         , 'emp'     , .false.      , .false., 'yearly'  , ''       , ''       , ''
-
+   !
    cn_dir      = './'      !  root directory for the location of the flux files
 /
@@ -263,7 +263,7 @@
    rn_efac     = 1.        !  multiplicative factor for evaporation (0. or 1.)
    rn_vfac     = 0.        !  multiplicative factor for ocean/ice velocity
-                           !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds)
-   ln_Cd_L12   = .false.   !  Modify the drag ice-atm and oce-atm depending on ice concentration
-                           !  This parameterization is from Lupkes et al. (JGR 2012)
+   !                       !  in the calculation of the wind stress (0.=absolute winds or 1.=relative winds)
+   ln_Cd_L12   = .false.   !  air-ice and ocean-ice function of ice concentration (Lupkes et al. JGR 2012)
+
 /
 !-----------------------------------------------------------------------
@@ -429,5 +429,5 @@
    nn_sstr     =     0     !  add a retroaction term in the surface heat       flux (=1) or not (=0)
    nn_sssr     =     2     !  add a damping     term in the surface freshwater flux (=2)
-                           !  or to SSS only (=1) or no damping term (=0)
+   !                       !  or to SSS only (=1) or no damping term (=0)
    rn_dqdt     =   -40.    !  magnitude of the retroaction on temperature   [W/m2/K]
    rn_deds     =  -166.67  !  magnitude of the damping on salinity   [mm/day]
@@ -439,7 +439,7 @@
 !-----------------------------------------------------------------------
    nn_ice_alb   =    1   !  parameterization of ice/snow albedo
-                         !     0: Shine & Henderson-Sellers (JGR 1985), giving clear-sky albedo
-                         !     1: "home made" based on Brandt et al. (JClim 2005) and Grenfell & Perovich (JGR 2004),
-                         !        giving cloud-sky albedo
+   !                     !     0: Shine & Henderson-Sellers (JGR 1985), giving clear-sky albedo
+   !                     !     1: "home made" based on Brandt et al. (JClim 2005) and Grenfell & Perovich (JGR 2004),
+   !                     !        giving cloud-sky albedo
    rn_alb_sdry  =  0.85  !  dry snow albedo         : 0.80 (nn_ice_alb = 0); 0.85 (nn_ice_alb = 1); obs 0.85-0.87 (cloud-sky)
    rn_alb_smlt  =  0.75  !  melting snow albedo     : 0.65 ( '' )          ; 0.75 ( '' )          ; obs 0.72-0.82 ( '' )
@@ -498,5 +498,5 @@
 
 !!======================================================================
-!!               ***  Lateral boundary condition  ***
+!!               ***  Lateral boundary condition  ***                 !!
 !!======================================================================
 !!   namlbc        lateral momentum boundary condition
@@ -667,5 +667,5 @@
 !
 !-----------------------------------------------------------------------
-&nameos        !   ocean physical parameters
+&nameos        !   ocean Equation Of State                              (default: NO)
 !-----------------------------------------------------------------------
    ln_teos10   = .false.         !  = Use TEOS-10 equation of state
@@ -750,26 +750,26 @@
 !-----------------------------------------------------------------------
    ln_ldfeiv     =.false.  ! use eddy induced velocity parameterization
-   ln_ldfeiv_dia =.false.  ! 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
+      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
+      ln_ldfeiv_dia =.false.  ! diagnose eiv stream function and velocities
 /
 !-----------------------------------------------------------------------
 &namtra_dmp    !   tracer: T & S newtonian damping                      (default: NO)
 !-----------------------------------------------------------------------
-   ln_tradmp   =  .true.   !  add a damping termn (T) or not (F)
-   nn_zdmp     =    0      !  vertical   shape =0    damping throughout the water column
-                           !                   =1 no damping in the mixing layer (kz  criteria)
-                           !                   =2 no damping in the mixed  layer (rho crieria)
-   cn_resto    ='resto.nc' !  Name of file containing restoration coeff. field (use dmp_tools to create this)
-/
-
-!!======================================================================
-!!                      ***  Dynamics namelists  ***
+   ln_tradmp   =  .true.   !  add a damping term
+      nn_zdmp     =    0      !  vertical shape =0    damping throughout the water column
+      !                    !                    =1 no damping in the mixing layer (kz  criteria)
+      !                    !                    =2 no damping in the mixed  layer (rho crieria)
+      cn_resto    ='resto.nc' !  Name of file containing restoration coeff. field (use dmp_tools to create this)
+/
+
+!!======================================================================
+!!                      ***  Dynamics namelists  ***                  !!
 !!======================================================================
 !!   namdyn_adv    formulation of the momentum advection
@@ -787,5 +787,5 @@
    ln_dynadv_cen2= .false. !  flux form - 2nd order centered scheme
    ln_dynadv_ubs = .false. !  flux form - 3rd order UBS      scheme
-   ln_dynzad_zts = .false. !  Use (T) sub timestepping for vertical momentum advection
+   ln_dynzad_zts = .false. !  sub-time-stepping for vertical momentum advection
 /
 !-----------------------------------------------------------------------
@@ -814,5 +814,5 @@
 /
 !-----------------------------------------------------------------------
-&namdyn_hpg    !   Hydrostatic pressure gradient option                 (default: zps)
+&namdyn_hpg    !   Hydrostatic pressure gradient option                 (default: NO selection)
 !-----------------------------------------------------------------------
    ln_hpg_zco  = .false.   !  z-coordinate - full steps
@@ -869,33 +869,53 @@
 
 !!======================================================================
-!!             Tracers & Dynamics vertical physics namelists
+!!                     vertical physics namelists                     !!
 !!======================================================================
 !!    namzdf        vertical physics
-!!    namzdf_ric    richardson number dependent vertical mixing         ("key_zdfric")
-!!    namzdf_tke    TKE dependent vertical mixing                       ("key_zdftke")
-!!    namzdf_gls    GLS vertical mixing                                 ("key_zdfgls")
-!!    namzdf_ddm    double diffusive mixing parameterization            ("key_zdfddm")
-!!    namzdf_tmx    tidal mixing parameterization                       ("key_zdftmx")
-!!======================================================================
-!
-!-----------------------------------------------------------------------
-&namzdf        !   vertical physics
-!-----------------------------------------------------------------------
-   rn_avm0     =   1.2e-4  !  vertical eddy viscosity   [m2/s]          (background Kz if not "key_zdfcst")
-   rn_avt0     =   1.2e-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     =    0        ! evd apply on tracer (=0) or on tracer and momentum (=1)
-      rn_avevd    =  100.       !  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
-   ln_zdfqiao  = .false.   !  Enhanced wave vertical mixing Qiao (2010) (T => ln_wave=.true. & ln_sdw=.true. & fill namsbc_wave)
-/
-!-----------------------------------------------------------------------
-&namzdf_ric    !   richardson number dependent vertical diffusion       ("key_zdfric" )
+!!    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   = .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
+      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
+!!gm new
+   !
+   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)
+   !
+!!gm
+   !
+   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
+      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)
 !-----------------------------------------------------------------------
    rn_avmri    =  100.e-4  !  maximum value of the vertical viscosity
@@ -910,5 +930,5 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_tke    !   turbulent eddy kinetic dependent vertical diffusion  ("key_zdftke")
+&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) )
@@ -927,5 +947,5 @@
    ln_lc       = .true.    !  Langmuir cell parameterisation (Axell 2002)
    rn_lc       =   0.15    !  coef. associated to Langmuir cells
-   nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to near intertial waves
+   nn_etau     =   1       !  penetration of tke below the mixed layer (ML) due to NIWs
                            !        = 0 no penetration
                            !        = 1 add a tke source below the ML
@@ -938,5 +958,5 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_gls    !   GLS vertical diffusion                               ("key_zdfgls")
+&namzdf_gls    !   GLS vertical diffusion                               (ln_zdfgls)
 !-----------------------------------------------------------------------
    rn_emin       = 1.e-7   !  minimum value of e   [m2/s2]
@@ -957,10 +977,4 @@
 /
 !-----------------------------------------------------------------------
-&namzdf_ddm    !   double diffusive mixing parameterization             ("key_zdfddm")
-!-----------------------------------------------------------------------
-   rn_avts     = 1.e-4     !  maximum avs (vertical mixing on salinity)
-   rn_hsbfr    = 1.6       !  heat/salt buoyancy flux ratio
-/
-!-----------------------------------------------------------------------
 &namzdf_tmx    !   tidal mixing parameterization                        ("key_zdftmx")
 !-----------------------------------------------------------------------
@@ -1116,14 +1130,4 @@
 !-----------------------------------------------------------------------
 &nam_diatmb    !  Top Middle Bottom Output                               (default F)
-!-----------------------------------------------------------------------
-   ln_diatmb   = .false.   !  Choose Top Middle and Bottom output or not
-/
-!-----------------------------------------------------------------------
-&nam_dia25h    !  25h Mean Output                                        (default F)
-!-----------------------------------------------------------------------
-   ln_dia25h   = .false.   ! Choose 25h mean output or not
-/
-!-----------------------------------------------------------------------
-&namnc4        !   netcdf4 chunking and compression settings            ("key_netcdf4")
 !-----------------------------------------------------------------------
    ln_diatmb   = .false.   !  Choose Top Middle and Bottom output or not
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/C1D/step_c1d.F90	(revision 7931)
@@ -27,6 +27,4 @@
    PUBLIC stp_c1d      ! called by opa.F90
 
-   !! * Substitutions
-#  include "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/C1D 3.7 , NEMO Consortium (2015)
@@ -93,5 +91,5 @@
       IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity
       IF( lk_zdftmx  )   CALL zdf_tmx( kstp )         ! tidal vertical mixing
-      IF( lk_zdfddm  )   CALL zdf_ddm( kstp )         ! double diffusive mixing
+      IF( ln_zdfddm  )   CALL zdf_ddm( kstp )         ! double diffusive mixing
                          CALL zdf_mxl( kstp )         ! mixed layer depth
 
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diaar5.F90	(revision 7931)
@@ -39,5 +39,4 @@
       
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -212,33 +211,38 @@
       ! Exclude points where rn2 is negative as convection kicks in here and
       ! work is not being done against stratification
-          CALL wrk_alloc( jpi, jpj, zpe )
-          zpe(:,:) = 0._wp
-          IF( lk_zdfddm ) THEN
-             DO ji=1,jpi
-                DO jj=1,jpj
-                   DO jk=1,jpk
-                      zrw =   ( gdepw_n(ji,jj,jk  ) - gdept_n(ji,jj,jk) )   &
-                         &  / ( gdept_n(ji,jj,jk-1) - gdept_n(ji,jj,jk) )
-                      !
-                      zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw
-                      zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw
-                      !
-                      zpe(ji, jj) = zpe(ji, jj) - MIN(0._wp, rn2(ji,jj,jk)) * &
-                           &       grav * (avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  &
-                           &       - fsavs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) )
-
-                   ENDDO
-                ENDDO
-             ENDDO
+         CALL wrk_alloc( jpi, jpj, zpe )
+         zpe(:,:) = 0._wp
+         IF( ln_zdfddm ) THEN
+            DO jk = 2, jpk
+               DO jj = 1, jpj
+                  DO ji = 1, jpi
+                     IF( rn2(ji,jj,jk) > 0._wp ) THEN
+                        zrw =   ( gdepw_n(ji,jj,jk  ) - gdept_n(ji,jj,jk) )   &
+                           &  / ( gdept_n(ji,jj,jk-1) - gdept_n(ji,jj,jk) )
+!!gm  this can be reduced to :  (depw-dept) / e3w   (NB idem dans bn2 !)
+!                        zrw =   ( gdept_n(ji,jj,jk) - gdepw_n(ji,jj,jk) ) / e3w_n(ji,jj,jk)
+!!gm end
+                        !
+                        zaw = rab_n(ji,jj,jk,jp_tem) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_tem)* zrw
+                        zbw = rab_n(ji,jj,jk,jp_sal) * (1. - zrw) + rab_n(ji,jj,jk-1,jp_sal)* zrw
+                        !
+                        zpe(ji, jj) = zpe(ji, jj)            &
+                           &        -  grav * (  avt(ji,jj,jk) * zaw * (tsn(ji,jj,jk-1,jp_tem) - tsn(ji,jj,jk,jp_tem) )  &
+                           &                   - avs(ji,jj,jk) * zbw * (tsn(ji,jj,jk-1,jp_sal) - tsn(ji,jj,jk,jp_sal) ) )
+                     ENDIF
+                  END DO
+               END DO
+             END DO
           ELSE
-             DO ji = 1, jpi
-                DO jj = 1, jpj
-                   DO jk = 1, jpk
-                       zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w_n(ji, jj, jk)
-                   ENDDO
-                ENDDO
-             ENDDO
-          ENDIF
-          CALL lbc_lnk( zpe, 'T', 1._wp)         
+            DO jk = 1, jpk
+               DO ji = 1, jpi
+                  DO jj = 1, jpj
+                     zpe(ji,jj) = zpe(ji,jj) + avt(ji, jj, jk) * MIN(0._wp,rn2(ji, jj, jk)) * rau0 * e3w_n(ji, jj, jk)
+                  END DO
+               END DO
+            END DO
+         ENDIF
+!!gm useless lbc_lnk since the computation above is performed over 1:jpi & 1:jpj
+!!gm           CALL lbc_lnk( zpe, 'T', 1._wp)         
           CALL iom_put( 'tnpeo', zpe )
           CALL wrk_dealloc( jpi, jpj, zpe )
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/DIA/diawri.F90	(revision 7931)
@@ -80,5 +80,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -234,9 +233,9 @@
 
       CALL iom_put( "avt" , avt                        )    ! T vert. eddy diff. coef.
+      CALL iom_put( "avs" , avs                        )    ! S vert. eddy diff. coef. (useful only with key_zdfddm)
       CALL iom_put( "avm" , avmu                       )    ! T vert. eddy visc. coef.
-      CALL iom_put( "avs" , fsavs(:,:,:)               )    ! S vert. eddy diff. coef. (useful only with key_zdfddm)
-
-      IF( iom_use('logavt') )   CALL iom_put( "logavt", LOG( MAX( 1.e-20_wp, avt  (:,:,:) ) ) )
-      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, fsavs(:,:,:) ) ) )
+
+      IF( iom_use('logavt') )   CALL iom_put( "logavt", LOG( MAX( 1.e-20_wp, avt(:,:,:) ) ) )
+      IF( iom_use('logavs') )   CALL iom_put( "logavs", LOG( MAX( 1.e-20_wp, avs(:,:,:) ) ) )
 
       IF ( iom_use("sstgrad") .OR. iom_use("sstgrad2") ) THEN
@@ -750,5 +749,5 @@
             &          jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout )
 
-         IF( lk_zdfddm ) THEN
+         IF( ln_zdfddm ) THEN
             CALL histdef( nid_W,"voddmavs","Salt Vertical Eddy Diffusivity"    , "m2/s"   ,   &  ! avs
                &          jpi, jpj, nh_W, ipk, 1, ipk, nz_W, 32, clop, zsto, zout )
@@ -875,12 +874,12 @@
       CALL histwrite( nid_W, "votkeavt", it, avt            , ndim_T, ndex_T )    ! T vert. eddy diff. coef.
       CALL histwrite( nid_W, "votkeavm", it, avmu           , ndim_T, ndex_T )    ! T vert. eddy visc. coef.
-      IF( lk_zdfddm ) THEN
-         CALL histwrite( nid_W, "voddmavs", it, fsavs(:,:,:), ndim_T, ndex_T )    ! S vert. eddy diff. coef.
+      IF( ln_zdfddm ) THEN
+         CALL histwrite( nid_W, "voddmavs", it, avs         , ndim_T, ndex_T )    ! S vert. eddy diff. coef.
       ENDIF
 
       IF( ln_wave .AND. ln_sdw ) THEN
-         CALL histwrite( nid_U, "sdzocrtx", it, usd           , ndim_U , ndex_U )    ! i-StokesDrift-current
-         CALL histwrite( nid_V, "sdmecrty", it, vsd           , ndim_V , ndex_V )    ! j-StokesDrift-current
-         CALL histwrite( nid_W, "sdvecrtz", it, wsd           , ndim_T , ndex_T )    ! StokesDrift vert. current
+         CALL histwrite( nid_U, "sdzocrtx", it, usd         , ndim_U , ndex_U )    ! i-StokesDrift-current
+         CALL histwrite( nid_V, "sdmecrty", it, vsd         , ndim_V , ndex_V )    ! j-StokesDrift-current
+         CALL histwrite( nid_W, "sdvecrtz", it, wsd         , ndim_T , ndex_T )    ! StokesDrift vert. current
       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 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf.F90	(revision 7931)
@@ -41,5 +41,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_exp.F90	(revision 7931)
@@ -41,5 +41,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -62,5 +61,5 @@
       !!                ztb = ptb + p2dt difft
       !!      where difft = dz( avt dz(ptb) ) = 1/e3t dk+1( avt/e3w dk(ptb) )
-      !!           (if lk_zdfddm=T use avs on salinity and passive tracers instead of avt)
+      !!           (if ln_zdfddm=T use avs on salinity and passive tracers instead of avt)
       !!      difft is evaluated with an Euler split-explit scheme using a
       !!      no flux boundary condition at both surface and bottomi boundaries.
@@ -116,5 +115,5 @@
                         zwf(ji,jj,jk) =   avt(ji,jj,jk) * ( ztb(ji,jj,jk-1) - ztb(ji,jj,jk) ) / e3w_b(ji,jj,jk)
                      ELSE                                           ! salinity or pass. tracer : use of avs
-                        zwf(ji,jj,jk) = fsavs(ji,jj,jk) * ( ztb(ji,jj,jk-1) - ztb(ji,jj,jk) ) / e3w_b(ji,jj,jk)
+                        zwf(ji,jj,jk) = avs(ji,jj,jk) * ( ztb(ji,jj,jk-1) - ztb(ji,jj,jk) ) / e3w_b(ji,jj,jk)
                      END IF
                   END DO
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRA/trazdf_imp.F90	(revision 7931)
@@ -44,5 +44,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -66,5 +65,5 @@
       !!      It is computed using a backward time scheme (t=after field)
       !!      which provide directly the after tracer field.
-      !!      If lk_zdfddm=T, use avs for salinity or for passive tracers
+      !!      If ln_zdfddm=T, use avs for salinity or for passive tracers
       !!      Surface and bottom boundary conditions: no diffusive flux on
       !!      both tracers (bottom, applied through the masked field avt).
@@ -102,10 +101,10 @@
          ! Build matrix if temperature or salinity (only in double diffusion case) or first passive tracer
          !
-         IF(  ( cdtype == 'TRA' .AND. ( jn == jp_tem .OR. ( jn == jp_sal .AND. lk_zdfddm ) ) ) .OR.   &
+         IF(  ( cdtype == 'TRA' .AND. ( jn == jp_tem .OR. ( jn == jp_sal .AND. ln_zdfddm ) ) ) .OR.   &
             & ( cdtype == 'TRC' .AND. jn == 1 )  )  THEN
             !
             ! vertical mixing coef.: avt for temperature, avs for salinity and passive tracers
-            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt  (:,:,2:jpk)
-            ELSE                                            ;   zwt(:,:,2:jpk) = fsavs(:,:,2:jpk)
+            IF( cdtype == 'TRA' .AND. jn == jp_tem ) THEN   ;   zwt(:,:,2:jpk) = avt(:,:,2:jpk)
+            ELSE                                            ;   zwt(:,:,2:jpk) = avs(:,:,2:jpk)
             ENDIF
             zwt(:,:,1) = 0._wp
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdglo.F90	(revision 7931)
@@ -53,5 +53,4 @@
    !! * Substitutions
 #  include "vectopt_loop_substitute.h90"
-#  include "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdmxl.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdmxl.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdmxl.F90	(revision 7931)
@@ -69,6 +69,4 @@
    INTEGER ::   ionce, icount                   
 
-   !! * Substitutions
-#  include "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OPA 3.3 , NEMO Consortium (2010)
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdpen.F90	(revision 7931)
@@ -37,5 +37,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/TRD/trdtra.F90	(revision 7931)
@@ -42,5 +42,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -129,5 +128,5 @@
             DO jk = 2, jpk
                zwt(:,:,jk) = avt(:,:,jk) * ( tsa(:,:,jk-1,jp_tem) - tsa(:,:,jk,jp_tem) ) / e3w_n(:,:,jk) * tmask(:,:,jk)
-               zws(:,:,jk) = fsavs(:,:,jk) * ( tsa(:,:,jk-1,jp_sal) - tsa(:,:,jk,jp_sal) ) / e3w_n(:,:,jk) * tmask(:,:,jk)
+               zws(:,:,jk) = avs(:,:,jk) * ( tsa(:,:,jk-1,jp_sal) - tsa(:,:,jk,jp_sal) ) / e3w_n(:,:,jk) * tmask(:,:,jk)
             END DO
             !
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdf_oce.F90	(revision 7931)
@@ -23,18 +23,35 @@
 
    !                                 !!* namelist namzdf: vertical diffusion *
+!!gm
+   !                             ! vertical closure scheme flags
+   LOGICAL , PUBLIC ::   ln_zdfcst   !: constant coefficients
+   LOGICAL , PUBLIC ::   ln_zdfric   !: Richardson depend coefficients
+   LOGICAL , PUBLIC ::   ln_zdftke   !: Turbulent Kinetic Energy closure
+   LOGICAL , PUBLIC ::   ln_zdfgls   !: Generic Length Sclare closure
+   !                             ! tidal induced mixing   
+   LOGICAL , PUBLIC ::   ln_zdftmx   !: tidal mixing parameterization flag
+   !                             ! double diffusion
+   LOGICAL , PUBLIC ::   ln_zdfddm   !: double diffusive mixing flag
+   REAL(wp), PUBLIC ::      rn_avts     !: maximum value of avs for salt fingering
+   REAL(wp), PUBLIC ::      rn_hsbfr    !: heat/salt buoyancy flux ratio
+!!gm
+   LOGICAL , PUBLIC ::   ln_zdfexp   !: explicit vertical diffusion scheme flag
+   INTEGER , PUBLIC ::   nn_zdfexp   !: number of sub-time step (explicit time stepping)
+   LOGICAL , PUBLIC ::   ln_zdfevd   !: convection: enhanced vertical diffusion flag
+   INTEGER , PUBLIC ::      nn_evdm     !: =0/1 flag to apply enhanced avm or not
+   REAL(wp), PUBLIC ::      rn_evd      !: vertical eddy coeff. for enhanced vert. diff. (m2/s)
+   LOGICAL , PUBLIC ::   ln_zdfnpc   !: convection: non-penetrative convection flag
+   INTEGER , PUBLIC ::      nn_npc      !: non penetrative convective scheme call  frequency
+   INTEGER , PUBLIC ::      nn_npcp     !: non penetrative convective scheme print frequency
+   !                             ! Surface wave-induced mixing
+   LOGICAL , PUBLIC ::   ln_zdfqiao  !: Enhanced wave vertical mixing Qiao(2010) formulation flag
+   !                             ! coefficients 
    REAL(wp), PUBLIC ::   rn_avm0     !: vertical eddy viscosity (m2/s)
    REAL(wp), PUBLIC ::   rn_avt0     !: vertical eddy diffusivity (m2/s)
    INTEGER , PUBLIC ::   nn_avb      !: constant or profile background on avt (=0/1)
-   INTEGER , PUBLIC ::   nn_havtb    !: horizontal shape or not for avtb (=0/1)
-   LOGICAL , PUBLIC ::   ln_zdfexp   !: explicit vertical diffusion scheme flag
-   INTEGER , PUBLIC ::   nn_zdfexp   !: number of sub-time step (explicit time stepping)
-   LOGICAL , PUBLIC ::   ln_zdfevd   !: convection: enhanced vertical diffusion flag
-   INTEGER , PUBLIC ::   nn_evdm     !: =0/1 flag to apply enhanced avm or not
-   REAL(wp), PUBLIC ::   rn_avevd    !: vertical eddy coeff. for enhanced vert. diff. (m2/s)
-   LOGICAL , PUBLIC ::   ln_zdfnpc   !: convection: non-penetrative convection flag
-   INTEGER , PUBLIC ::   nn_npc      !: non penetrative convective scheme call  frequency
-   INTEGER , PUBLIC ::   nn_npcp     !: non penetrative convective scheme print frequency
-   LOGICAL , PUBLIC ::   ln_zdfqiao  !: Enhanced wave vertical mixing Qiao(2010) formulation flag
+   INTEGER , PUBLIC ::   nn_havtb    !: horizontal shape or not for avtb (=0/1)   !                             ! convection
 
+
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avt  , avs     !: vertical eddy diffusivity coef at w-pt [m2/s]
 
    REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:)     ::   avmb , avtb    !: background profile of avm and avt
@@ -43,5 +60,5 @@
    REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:)   ::   tfrua, tfrva   !: top friction coefficients set in zdfbfr
    REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avmu , avmv    !: vertical viscosity coef at uw- & vw-pts       [m2/s]
-   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avm  , avt     !: vertical viscosity & diffusivity coef at w-pt [m2/s]
+   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avm            !: vertical viscosity & diffusivity coef at w-pt [m2/s]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   avt_k , avm_k  ! not enhanced Kz
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:) ::   avmu_k, avmv_k ! not enhanced Kz
@@ -64,5 +81,5 @@
          &     tfrua(jpi, jpj), tfrva(jpi, jpj)              ,      &
          &     avmu  (jpi,jpj,jpk), avm   (jpi,jpj,jpk)      ,      &
-         &     avmv  (jpi,jpj,jpk), avt   (jpi,jpj,jpk)      ,      &
+         &     avmv  (jpi,jpj,jpk), avt   (jpi,jpj,jpk)      , avs   (jpi,jpj,jpk),          &
          &     avt_k (jpi,jpj,jpk), avm_k (jpi,jpj,jpk)      ,      & 
          &     avmu_k(jpi,jpj,jpk), avmv_k(jpi,jpj,jpk)      ,      &
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfddm.F90	(revision 7931)
@@ -9,22 +9,19 @@
    !!            3.6  ! 2013-04  (G. Madec, F. Roquet) zrau compute locally using interpolation of alpha & beta
    !!----------------------------------------------------------------------
-#if defined key_zdfddm
+
    !!----------------------------------------------------------------------
-   !!   'key_zdfddm' :                                     double diffusion
+   !!   zdf_ddm       : compute the Kz for salinity
    !!----------------------------------------------------------------------
-   !!   zdf_ddm       : compute the Ks for salinity
-   !!   zdf_ddm_init  : read namelist and control the parameters
-   !!----------------------------------------------------------------------
-   USE oce             ! ocean dynamics and tracers variables
-   USE dom_oce         ! ocean space and time domain variables 
-   USE zdf_oce         ! ocean vertical physics variables
+   USE oce            ! ocean dynamics and tracers variables
+   USE dom_oce        ! ocean space and time domain variables
+   USE zdf_oce        ! ocean vertical physics variables
    USE eosbn2         ! equation of state
    !
-   USE in_out_manager  ! I/O manager
-   USE lbclnk          ! ocean lateral boundary conditions (or mpp link)
-   USE prtctl          ! Print control
-   USE lib_mpp         ! MPP library
-   USE wrk_nemo        ! work arrays
-   USE timing          ! Timing
+   USE in_out_manager ! I/O manager
+   USE lbclnk         ! ocean lateral boundary conditions (or mpp link)
+   USE prtctl         ! Print control
+   USE lib_mpp        ! MPP library
+   USE wrk_nemo       ! work arrays
+   USE timing         ! Timing
 
    IMPLICIT NONE
@@ -32,14 +29,4 @@
 
    PUBLIC   zdf_ddm       ! called by step.F90
-   PUBLIC   zdf_ddm_init  ! called by opa.F90
-   PUBLIC   zdf_ddm_alloc ! called by nemogcm.F90
-
-   LOGICAL , PUBLIC, PARAMETER ::   lk_zdfddm = .TRUE.  !: double diffusive mixing flag
-
-   REAL(wp), PUBLIC, SAVE, ALLOCATABLE, DIMENSION(:,:,:) ::   avs   !: salinity vertical diffusivity coeff. at w-point
-
-   !                       !!* Namelist namzdf_ddm : double diffusive mixing *
-   REAL(wp) ::   rn_avts    ! maximum value of avs for salt fingering
-   REAL(wp) ::   rn_hsbfr   ! heat/salt buoyancy flux ratio
 
    !! * Substitutions
@@ -51,14 +38,4 @@
    !!----------------------------------------------------------------------
 CONTAINS
-
-   INTEGER FUNCTION zdf_ddm_alloc()
-      !!----------------------------------------------------------------------
-      !!                ***  ROUTINE zdf_ddm_alloc  ***
-      !!----------------------------------------------------------------------
-      ALLOCATE( avs(jpi,jpj,jpk) , STAT= zdf_ddm_alloc )
-      IF( lk_mpp             )   CALL mpp_sum ( zdf_ddm_alloc )
-      IF( zdf_ddm_alloc /= 0 )   CALL ctl_warn('zdf_ddm_alloc: failed to allocate arrays')
-   END FUNCTION zdf_ddm_alloc
-
 
    SUBROUTINE zdf_ddm( kt )
@@ -174,12 +151,7 @@
                   &                             +  0.15 * zrau(ji,jj)          * zmskd2(ji,jj)  )
                ! add to the eddy viscosity coef. previously computed
-# if defined key_zdftmx_new
-               ! key_zdftmx_new: New internal wave-driven param: use avs value computed by zdftmx
-               avs (ji,jj,jk) = avs(ji,jj,jk) + zavfs + zavds
-# else
-               avs (ji,jj,jk) = avt(ji,jj,jk) + zavfs + zavds
-# endif
-               avt (ji,jj,jk) = avt(ji,jj,jk) + zavft + zavdt
-               avm (ji,jj,jk) = avm(ji,jj,jk) + MAX( zavft + zavdt, zavfs + zavds )
+               avs(ji,jj,jk) = avt(ji,jj,jk) + zavfs + zavds
+               avt(ji,jj,jk) = avt(ji,jj,jk) + zavft + zavdt
+               avm(ji,jj,jk) = avm(ji,jj,jk) + MAX( zavft + zavdt, zavfs + zavds )
             END DO
          END DO
@@ -221,57 +193,4 @@
    END SUBROUTINE zdf_ddm
    
-   
-   SUBROUTINE zdf_ddm_init
-      !!----------------------------------------------------------------------
-      !!                  ***  ROUTINE zdf_ddm_init  ***
-      !!
-      !! ** Purpose :   Initialization of double diffusion mixing scheme
-      !!
-      !! ** Method  :   Read the namzdf_ddm namelist and check the parameter values
-      !!              called by zdf_ddm at the first timestep (nit000)
-      !!----------------------------------------------------------------------
-      INTEGER ::   ios   ! local integer
-      !!
-      NAMELIST/namzdf_ddm/ rn_avts, rn_hsbfr
-      !!----------------------------------------------------------------------
-      !
-      REWIND( numnam_ref )              ! Namelist namzdf_ddm in reference namelist : Double diffusion mixing scheme
-      READ  ( numnam_ref, namzdf_ddm, IOSTAT = ios, ERR = 901)
-901   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ddm in reference namelist', lwp )
-
-      REWIND( numnam_cfg )              ! Namelist namzdf_ddm in configuration namelist : Double diffusion mixing scheme
-      READ  ( numnam_cfg, namzdf_ddm, IOSTAT = ios, ERR = 902 )
-902   IF( ios /= 0 ) CALL ctl_nam ( ios , 'namzdf_ddm in configuration namelist', lwp )
-      IF(lwm) WRITE ( numond, namzdf_ddm )
-      !
-      IF(lwp) THEN                    ! Parameter print
-         WRITE(numout,*)
-         WRITE(numout,*) 'zdf_ddm : double diffusive mixing'
-         WRITE(numout,*) '~~~~~~~'
-         WRITE(numout,*) '   Namelist namzdf_ddm : set dd mixing parameter'
-         WRITE(numout,*) '      maximum avs for dd mixing      rn_avts   = ', rn_avts
-         WRITE(numout,*) '      heat/salt buoyancy flux ratio  rn_hsbfr  = ', rn_hsbfr
-      ENDIF
-      !
-      !                               ! allocate zdfddm arrays
-      IF( zdf_ddm_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_ddm_init : unable to allocate arrays' )
-      !                               ! initialization to masked Kz
-      avs(:,:,:) = rn_avt0 * wmask(:,:,:) 
-      !
-   END SUBROUTINE zdf_ddm_init
-
-#else
-   !!----------------------------------------------------------------------
-   !!   Default option :          Dummy module          No double diffusion
-   !!----------------------------------------------------------------------
-   LOGICAL, PUBLIC, PARAMETER ::   lk_zdfddm = .FALSE.   !: double diffusion flag
-CONTAINS
-   SUBROUTINE zdf_ddm( kt )           ! Dummy routine
-      WRITE(*,*) 'zdf_ddm: You should not have seen this print! error?', kt
-   END SUBROUTINE zdf_ddm
-   SUBROUTINE zdf_ddm_init            ! Dummy routine
-   END SUBROUTINE zdf_ddm_init
-#endif
-
    !!======================================================================
 END MODULE zdfddm
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfevd.F90	(revision 7931)
@@ -82,10 +82,10 @@
                DO ji = 2, jpi
                   IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 ) THEN
-                     avt (ji  ,jj  ,jk) = rn_avevd * tmask(ji  ,jj  ,jk)
-                     avm (ji  ,jj  ,jk) = rn_avevd * tmask(ji  ,jj  ,jk)
-                     avmu(ji  ,jj  ,jk) = rn_avevd * umask(ji  ,jj  ,jk)
-                     avmu(ji-1,jj  ,jk) = rn_avevd * umask(ji-1,jj  ,jk)
-                     avmv(ji  ,jj  ,jk) = rn_avevd * vmask(ji  ,jj  ,jk)
-                     avmv(ji  ,jj-1,jk) = rn_avevd * vmask(ji  ,jj-1,jk)
+                     avt (ji  ,jj  ,jk) = rn_evd * tmask(ji  ,jj  ,jk)
+                     avm (ji  ,jj  ,jk) = rn_evd * tmask(ji  ,jj  ,jk)
+                     avmu(ji  ,jj  ,jk) = rn_evd * umask(ji  ,jj  ,jk)
+                     avmu(ji-1,jj  ,jk) = rn_evd * umask(ji-1,jj  ,jk)
+                     avmv(ji  ,jj  ,jk) = rn_evd * vmask(ji  ,jj  ,jk)
+                     avmv(ji  ,jj-1,jk) = rn_evd * vmask(ji  ,jj-1,jk)
                   ENDIF
                END DO
@@ -104,5 +104,5 @@
                DO ji = 1, jpi
                   IF(  MIN( rn2(ji,jj,jk), rn2b(ji,jj,jk) ) <= -1.e-12 )   &
-                     avt(ji,jj,jk) = rn_avevd * tmask(ji,jj,jk)
+                     avt(ji,jj,jk) = rn_evd * tmask(ji,jj,jk)
                END DO
             END DO
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdfini.F90	(revision 7931)
@@ -51,7 +51,17 @@
       INTEGER ::   ioptio, ios       ! local integers
       !!
-      NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp,  &
-         &        ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp,       &
-         &        ln_zdfqiao
+      NAMELIST/namzdf/ ln_zdfcst, ln_zdfric, ln_zdftke, ln_zdfgls,   &     ! type of closure scheme
+         &             ln_zdfevd, nn_evdm, rn_evd ,                  &     ! convection : evd
+         &             ln_zdfnpc, nn_npc , nn_npcp,                  &     ! convection : npc
+         &             ln_zdfddm, rn_avts, rn_hsbfr,                 &     ! double diffusion
+         &             ln_zdftmx,                                    &     ! tidal mixing
+         &             ln_zdfqiao,                                   &     ! surface wave-induced mixing
+         &             ln_zdfexp, nn_zdfexp,                         &     ! time-stepping
+         &             rn_avm0, rn_avt0, nn_avb, nn_havtb                  ! coefficients
+
+
+!!org      NAMELIST/namzdf/ rn_avm0, rn_avt0, nn_avb, nn_havtb, ln_zdfexp, nn_zdfexp,  &
+!!org         &        ln_zdfevd, nn_evdm, rn_avevd, ln_zdfnpc, nn_npc, nn_npcp,       &
+!!org         &        ln_zdfqiao
       !!----------------------------------------------------------------------
 
@@ -70,18 +80,35 @@
          WRITE(numout,*) '~~~~~~~~'
          WRITE(numout,*) '   Namelist namzdf : set vertical mixing mixing parameters'
+         WRITE(numout,*) '      vertical closure scheme'
+         WRITE(numout,*) '         constant vertical mixing coefficient    ln_zdfcst = ', ln_zdfcst
+         WRITE(numout,*) '         constant vertical mixing coefficient    ln_zdfric = ', ln_zdfric
+         WRITE(numout,*) '         constant vertical mixing coefficient    ln_zdftke = ', ln_zdftke
+         WRITE(numout,*) '         constant vertical mixing coefficient    ln_zdfgls = ', ln_zdfgls
+         WRITE(numout,*) '      convection: '
+         WRITE(numout,*) '         enhanced vertical diffusion             ln_zdfevd = ', ln_zdfevd
+         WRITE(numout,*) '            applied on momentum (=1/0)             nn_evdm = ', nn_evdm
+         WRITE(numout,*) '            vertical coefficient for evd           rn_evd  = ', rn_evd
+         WRITE(numout,*) '         non-penetrative convection (npc)        ln_zdfnpc = ', ln_zdfnpc
+         WRITE(numout,*) '            npc call  frequency                    nn_npc  = ', nn_npc
+         WRITE(numout,*) '            npc print frequency                    nn_npcp = ', nn_npcp
+         WRITE(numout,*) '      double diffusive mixing                    ln_zdfddm = ', ln_zdfddm
+         WRITE(numout,*) '         maximum avs for dd mixing                 rn_avts = ', rn_avts
+         WRITE(numout,*) '         heat/salt buoyancy flux ratio             rn_hsbfr= ', rn_hsbfr
+         WRITE(numout,*) '      surface wave-induced mixing                ln_zdfqiao= ', ln_zdfqiao                                          ! surface wave induced mixing
+         WRITE(numout,*) '      tidal mixing                               ln_zdftmx = ', ln_zdftmx
+         WRITE(numout,*) '      time splitting / backward scheme           ln_zdfexp = ', ln_zdfexp
+         WRITE(numout,*) '         number of sub-time step (ln_zdfexp=T)   nn_zdfexp = ', nn_zdfexp
+         WRITE(numout,*) '      coefficients : '
          WRITE(numout,*) '      vertical eddy viscosity             rn_avm0   = ', rn_avm0
          WRITE(numout,*) '      vertical eddy diffusivity           rn_avt0   = ', rn_avt0
          WRITE(numout,*) '      constant background or profile      nn_avb    = ', nn_avb
          WRITE(numout,*) '      horizontal variation for avtb       nn_havtb  = ', nn_havtb
-         WRITE(numout,*) '      time splitting / backward scheme    ln_zdfexp = ', ln_zdfexp
-         WRITE(numout,*) '      number of time step                 nn_zdfexp = ', nn_zdfexp
-         WRITE(numout,*) '      enhanced vertical diffusion         ln_zdfevd = ', ln_zdfevd
-         WRITE(numout,*) '         applied on momentum (=1/0)       nn_evdm   = ', nn_evdm
-         WRITE(numout,*) '      vertical coefficient for evd        rn_avevd  = ', rn_avevd
-         WRITE(numout,*) '      non-penetrative convection (npc)    ln_zdfnpc = ', ln_zdfnpc
-         WRITE(numout,*) '      npc call  frequency                 nn_npc    = ', nn_npc
-         WRITE(numout,*) '      npc print frequency                 nn_npcp   = ', nn_npcp
-         WRITE(numout,*) '      Qiao formulation flag               ln_zdfqiao=', ln_zdfqiao
-      ENDIF
+      ENDIF
+
+      IF(ln_zdfddm) THEN                    ! double diffusive mixing'
+         ALLOCATE( avs(jpi,jpj,jpk) )
+         avs(:,:,:) = rn_avt0 * wmask(:,:,:) 
+      ENDIF
+
 
       !                          !* Parameter & logical controls
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/ZDF/zdftmx.F90	(revision 7931)
@@ -163,5 +163,5 @@
       !                          ! ----------------------- !
       DO jk = 2, jpkm1              !* update momentum & tracer diffusivity with tidal mixing
-         avt(:,:,jk) = avt(:,:,jk) + zav_tide(:,:,jk) * wmask(:,:,jk)
+         avt(:,:,jk) = avs(:,:,jk) + zav_tide(:,:,jk) * wmask(:,:,jk)
          avm(:,:,jk) = avm(:,:,jk) + zav_tide(:,:,jk) * wmask(:,:,jk)
          DO jj = 2, jpjm1
@@ -591,5 +591,4 @@
 
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
@@ -700,4 +699,5 @@
          emix_tmx(:,:,jk) = zfact(:,:) * (  EXP( ( gde3w_n(:,:,jk  ) - zhdep(:,:) ) / hcri_tmx(:,:) )                      &
             &                             - EXP( ( gde3w_n(:,:,jk-1) - zhdep(:,:) ) / hcri_tmx(:,:) )  ) * wmask(:,:,jk)   &
+!!gm delta(gde3w_n) = e3t_n  !!  Please verify the grid-point position w versus t-point
             &                          / ( gde3w_n(:,:,jk) - gde3w_n(:,:,jk-1) )
       END DO
@@ -824,4 +824,5 @@
       IF( kt == nit000 ) THEN        !* Control print at first time-step: diagnose the energy consumed by zav_wave
          ztpc = 0._wp
+!!gm used of glosum 3D....
          DO jk = 2, jpkm1
             DO jj = 1, jpj
@@ -860,14 +861,14 @@
          CALL iom_put( "av_ratio", zav_ratio )
          DO jk = 2, jpkm1           !* update momentum & tracer diffusivity with wave-driven mixing
-            fsavs(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk)
-            avt  (:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk)
-            avm  (:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk)
+            avs(:,:,jk) = avs(:,:,jk) + zav_wave(:,:,jk) * zav_ratio(:,:,jk)
+            avt(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk)
+            avm(:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk)
          END DO
          !
       ELSE                          !* update momentum & tracer diffusivity with wave-driven mixing
          DO jk = 2, jpkm1
-            fsavs(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk)
-            avt  (:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk)
-            avm  (:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk)
+            avs(:,:,jk) = avs(:,:,jk) + zav_wave(:,:,jk)
+            avt(:,:,jk) = avt(:,:,jk) + zav_wave(:,:,jk)
+            avm(:,:,jk) = avm(:,:,jk) + zav_wave(:,:,jk)
          END DO
       ENDIF
@@ -976,7 +977,5 @@
             &               'the viscous molecular value & a very small diffusive value, resp.'
       ENDIF
-      
-      IF( .NOT.lk_zdfddm )   CALL ctl_stop( 'STOP', 'zdf_tmx_init_new : key_zdftmx_new requires key_zdfddm' )
-      
+            
       !                             ! allocate tmx arrays
       IF( zdf_tmx_alloc() /= 0 )   CALL ctl_stop( 'STOP', 'zdf_tmx_init : unable to allocate tmx arrays' )
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 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/nemogcm.F90	(revision 7931)
@@ -463,5 +463,5 @@
       IF( lk_zdfgls     )   CALL zdf_gls_init      ! GLS closure scheme
       IF( lk_zdftmx     )   CALL zdf_tmx_init      ! tidal vertical mixing
-      IF( lk_zdfddm     )   CALL zdf_ddm_init      ! double diffusive mixing
+!!gm      IF( ln_zdfddm     )   CALL zdf_ddm_init      ! double diffusive mixing
          
       !                                         ! Lateral physics
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 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/step.F90	(revision 7931)
@@ -136,16 +136,22 @@
       IF( lk_zdfcst  ) THEN                                ! Constant Kz (reset avt, avm[uv] to the background value)
          avt (:,:,:) = rn_avt0 * wmask (:,:,:)
+         avm (:,:,:) = rn_avm0 * wmask (:,:,:)
          avmu(:,:,:) = rn_avm0 * wumask(:,:,:)
          avmv(:,:,:) = rn_avm0 * wvmask(:,:,:)
       ENDIF
-
+      !
       IF( ln_rnf_mouth ) THEN                         ! increase diffusivity at rivers mouths
          DO jk = 2, nkrnf   ;   avt(:,:,jk) = avt(:,:,jk) + 2._wp * rn_avt_rnf * rnfmsk(:,:) * tmask(:,:,jk)   ;   END DO
       ENDIF
+      !
       IF( ln_zdfevd  )   CALL zdf_evd( kstp )         ! enhanced vertical eddy diffusivity
-
+      !
+      IF( ln_zdfddm  ) THEN                           ! double diffusive mixing
+                         CALL zdf_ddm( kstp )
+      ELSE                                            ! avs=avt
+         DO jk = 2, jpkm1   ;   avs(:,:,jk) = avt(:,:,jk)   ;   END DO
+      ENDIF
+      !
       IF( lk_zdftmx  )   CALL zdf_tmx( kstp )         ! tidal vertical mixing
-
-      IF( lk_zdfddm  )   CALL zdf_ddm( kstp )         ! double diffusive mixing
 
                          CALL zdf_mxl( kstp )         ! mixed layer depth
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/stpctl.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/stpctl.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/OPA_SRC/stpctl.F90	(revision 7931)
@@ -87,5 +87,6 @@
       !
       IF( MOD( kt, nwrite ) == 1 .AND. lwp ) THEN
-         WRITE(numout,*) ' ==>> time-step= ',kt,' |U| max: ', zmax(1), ' SSS min:', - zmax(2)
+         WRITE(numout,*) ' ==>> time-step= ', kt, ' |ssh| max: ',   zmax(1), ' |U| max: ', zmax(2),   &
+            &                                     ' SSS min: '  , - zmax(3)
       ENDIF
       !
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trczdf.F90	(revision 7931)
@@ -36,5 +36,4 @@
       !                                ! defined from ln_zdf...  namlist logicals)
    !! * Substitutions
-#  include "zdfddm_substitute.h90"
 #  include "vectopt_loop_substitute.h90"
    !!----------------------------------------------------------------------
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/NEMO/TOP_SRC/TRP/trdmxl_trc.F90	(revision 7931)
@@ -20,8 +20,5 @@
    USE dom_oce           ! domain definition
    USE zdfmxl  , ONLY : nmln ! number of level in the mixed layer
-   USE zdf_oce , ONLY : avt  ! vert. diffusivity coef. at w-point for temp  
-# if defined key_zdfddm   
-   USE zdfddm  , ONLY : avs  ! salinity vertical diffusivity coeff. at w-point
-# endif
+   USE zdf_oce , ONLY : avs  ! vert. diffusivity coef. at w-point for temp  
    USE trdtrc_oce    ! definition of main arrays used for trends computations
    USE in_out_manager    ! I/O manager
@@ -54,6 +51,4 @@
    REAL(wp), ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  ztmltrd2   !
 
-   !! * Substitutions
-#  include "zdfddm_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/TOP 3.3 , NEMO Consortium (2010)
@@ -275,11 +270,10 @@
       IF( ln_trcldf_iso ) THEN
          !
-         DO jj = 1,jpj
-            DO ji = 1,jpi
-               ik = nmld_trc(ji,jj)
-               zavt = fsavs(ji,jj,ik)
-               DO jn = 1, jptra
+         DO jn = 1, jptra
+            DO jj = 1, jpj
+               DO ji = 1, jpi
+                  ik = nmld_trc(ji,jj)
                   IF( ln_trdtrc(jn) )    &
-                  tmltrd_trc(ji,jj,jpmxl_trc_zdf,jn) = - zavt / e3w_n(ji,jj,ik) * tmask(ji,jj,ik)  &
+                  tmltrd_trc(ji,jj,jpmxl_trc_zdf,jn) = - avs(ji,jj,ik) / e3w_n(ji,jj,ik) * tmask(ji,jj,ik)  &
                        &                    * ( trn(ji,jj,ik-1,jn) - trn(ji,jj,ik,jn) )            &
                        &                    / MAX( 1., rmld_trc(ji,jj) ) * tmask(ji,jj,1)
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/README
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/README	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/README	(revision 7931)
@@ -45,5 +45,5 @@
                INPUT_DIR   	   : directory in which store input files (tar file)
                TMPDIR      	   : temporary directory NEEDED ONLY FOR IBM machines (put EXP00 directory)
-	       NEMO_VALIDATION_DIR : directory in which create NEMO_VALIDATION tree, and store restart, solver.stat, tracer.stat and ocean.output files in
+	       NEMO_VALIDATION_DIR : directory in which create NEMO_VALIDATION tree, and store restart, run.stat, tracer.stat and ocean.output files in
       			             tree NEMO_VALIDATION_DIR/WCONFIG_NAME/WCOMPILER_NAME/TEST_NAME/REVISION_NUMBER(or DATE)
  in fcm_job.sh :
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/all_functions.sh
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/all_functions.sh	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/all_functions.sh	(revision 7931)
@@ -219,17 +219,17 @@
     fi
     # Save output & debug files in NEMO_VALIDATION tree
-    echo "saving ocean & ice output, solver.stat, tracer.stat files ...." >> ${SETTE_DIR}/output.sette
+    echo "saving ocean & ice output, run.stat, tracer.stat files ...." >> ${SETTE_DIR}/output.sette
     echo "            " >> ${SETTE_DIR}/output.sette
     [ -f ${EXE_DIR}/ocean.output ] && cp ${EXE_DIR}/*ocean.output ${NEMO_VALID}/.
-    [ -f ${EXE_DIR}/solver.stat ] && cp ${EXE_DIR}/*solver.stat ${NEMO_VALID}/.
+    [ -f ${EXE_DIR}/run.stat ] && cp ${EXE_DIR}/*run.stat ${NEMO_VALID}/.
     [ -f ${EXE_DIR}/output.namelist.dyn ] && cp ${EXE_DIR}/*output.nam* ${NEMO_VALID}/.
     [ -f ${EXE_DIR}/tracer.stat ] && cp ${EXE_DIR}/*tracer.stat ${NEMO_VALID}/.
 
-    if [ -n "$(ls ${NEMO_VALID}/*solver*)" ] ; then
-	echo "moved solver.stat in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "moved solver.stat in ${NEMO_VALID} directory"  
+    if [ -n "$(ls ${NEMO_VALID}/*run*)" ] ; then
+	echo "moved run.stat in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
+	echo "moved run.stat in ${NEMO_VALID} directory"  
     else
-	echo "problem in looking for solver.stat file in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
-	echo "solver.stat IS NOT in ${NEMO_VALID} directory" 
+	echo "problem in looking for run.stat file in ${NEMO_VALID} directory"  >> ${SETTE_DIR}/output.sette
+	echo "run.stat IS NOT in ${NEMO_VALID} directory" 
     fi
     if [ -n "$(ls ${NEMO_VALID}/*ocean.output*)" ] ; then
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette.sh
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette.sh	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette.sh	(revision 7931)
@@ -56,5 +56,5 @@
 #   set_namelist     : function declared in all_functions that sets namelist parameters 
 #   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (solver.stat and ocean.output) in it after execution of test.
+#                      (run.stat and ocean.output) in it after execution of test.
 #
 #  VALIDATION tree is:
@@ -137,5 +137,5 @@
 # ORCA2_OFF_PISCES  :  5 &  6
 # AMM12             :  7 &  8 
-# SAS               :  9     fos SAS there is no solver so is useless to test REPRO
+# SAS               :  9     fos SAS there is no run.stat so is useless to test REPRO
 # ISOMIP            : 10 & 11
 # ORCA2_LIM3_OBS    : 12
@@ -661,5 +661,5 @@
     export TEST_NAME="LONG"
     cd ${CONFIG_DIR0}
-    . ./makenemo -m ${CMP_NAM} -n AMM12_LONG -r AMM12 -j 8 add_key "key_tide" del_key ${DEL_KEYS}
+    . ./makenemo -m ${CMP_NAM} -n AMM12_LONG -r AMM12 -j 8 del_key ${DEL_KEYS}
     cd ${SETTE_DIR}
     . ./param.cfg
@@ -1121,4 +1121,5 @@
     set_namelist 1_namelist_cfg nn_it000 1
     set_namelist 1_namelist_cfg nn_itend 150
+    set_namelist 1_namelist_cfg nn_fsbc 1
     set_namelist 1_namelist_cfg ln_ctl .false.
     set_namelist 1_namelist_cfg ln_clobber .true.
@@ -1245,4 +1246,5 @@
     set_namelist 1_namelist_cfg nn_itend 300
     set_namelist 1_namelist_cfg nn_stock 150
+    set_namelist 1_namelist_cfg nn_fsbc 1
     set_namelist 1_namelist_cfg ln_ctl .false.
     set_namelist 1_namelist_cfg ln_clobber .true.
@@ -1283,4 +1285,5 @@
     set_namelist 1_namelist_cfg nn_itend 300
     set_namelist 1_namelist_cfg nn_stock 150
+    set_namelist 1_namelist_cfg nn_fsbc 1
     set_namelist 1_namelist_cfg ln_rstart .true.
     set_namelist 1_namelist_cfg nn_rstctl 2
@@ -1339,4 +1342,5 @@
     set_namelist 1_namelist_cfg nn_it000 1
     set_namelist 1_namelist_cfg nn_itend 150
+    set_namelist 1_namelist_cfg nn_fsbc 1
     set_namelist 1_namelist_cfg ln_ctl .false.
     set_namelist 1_namelist_cfg ln_clobber .true.
@@ -1378,4 +1382,5 @@
     set_namelist 1_namelist_cfg nn_itend 150
     set_namelist 1_namelist_cfg ln_ctl .false.
+    set_namelist 1_namelist_cfg nn_fsbc 1
     set_namelist 1_namelist_cfg ln_clobber .true.
     set_namelist 1_namelist_cfg ln_read_cfg .true.
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_beginner.sh
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_beginner.sh	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_beginner.sh	(revision 7931)
@@ -55,5 +55,5 @@
 #   set_namelist     : function declared in all_functions that sets namelist parameters 
 #   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (solver.stat and ocean.output) in it after execution of test.
+#                      (run.stat and ocean.output) in it after execution of test.
 #
 #  VALIDATION tree is:
Index: /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_xios.sh
===================================================================
--- /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_xios.sh	(revision 7930)
+++ /branches/2017/dev_r7881_HPC09_ZDF/NEMOGCM/SETTE/sette_xios.sh	(revision 7931)
@@ -52,5 +52,5 @@
 #   set_namelist     : function declared in all_functions that sets namelist parameters 
 #   post_test_tidyup : creates validation storage directory and copies required output files 
-#                      (solver.stat and ocean.output) in it after execution of test.
+#                      (run.stat and ocean.output) in it after execution of test.
 #
 #  VALIDATION tree is:
