Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/NEMO/OPA_SRC/DOM/domzgr.F90	(revision 7189)
@@ -216,23 +216,7 @@
       IF( z_cav == 0._wp ) THEN   ;   ld_isfcav = .false.   ;   ELSE   ;   ld_isfcav = .true.   ;   ENDIF
       !
-      !                                   ! reference 1D-coordinate
+      !                                   ! 1D vertical scale factors (reference coordinate)
       CALL iom_get( inum, jpdom_unknown, 'e3t_1d'  , pe3t_1d  )
       CALL iom_get( inum, jpdom_unknown, 'e3w_1d'  , pe3w_1d  )
-      !
-      IF(  iom_varid( inum, 'gdept_1d', ldstop = .FALSE. ) > 0  .AND.  &
-         & iom_varid( inum, 'gdepw_1d', ldstop = .FALSE. ) > 0    ) THEN
-         CALL ctl_warn( 'zgr_read : old definition of 1d depths and scale factors used ', & 
-            &                      'depths at t- and w-points read in domain_cfg file')
-         CALL iom_get( inum, jpdom_unknown, 'gdept_1d', pdept_1d )   
-         CALL iom_get( inum, jpdom_unknown, 'gdepw_1d', pdepw_1d )
-      ELSE 
-         CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d )
-         IF(lwp) THEN                        ! control print
-            WRITE(numout,*)
-            WRITE(numout,*) '              Reference 1D z-coordinate depth and scale factors:'
-            WRITE(numout, "(9x,' level  gdept_1d  gdepw_1d  e3t_1d   e3w_1d  ')" )
-            WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk )
-         ENDIF
-      ENDIF
       !
       !                                   ! 3D vertical scale factors
@@ -245,13 +229,30 @@
       CALL iom_get( inum, jpdom_data, 'e3vw_0' , pe3vw , lrowattr=ln_use_jattr )
       !
-      !                                   ! 3D depths
-      IF(  iom_varid( inum, 'gdept_0', ldstop = .FALSE. ) > 0  .AND.  &
-         & iom_varid( inum, 'gdepw_0', ldstop = .FALSE. ) > 0    ) THEN
+      !                                   ! 1D & 3D depths
+      !
+      !                                         ! old depth definition (obsolescent feature)
+      IF(  iom_varid( inum, 'gdept_1d', ldstop = .FALSE. ) > 0  .AND.  &
+         & iom_varid( inum, 'gdepw_1d', ldstop = .FALSE. ) > 0  .AND.  &
+         & iom_varid( inum, 'gdept_0' , ldstop = .FALSE. ) > 0  .AND.  &
+         & iom_varid( inum, 'gdepw_0' , ldstop = .FALSE. ) > 0    ) THEN
          CALL ctl_warn( 'zgr_read : old definition of depths and scale factors used ', & 
             &                      'depths at t- and w-points read in domain_cfg file')
-         CALL iom_get( inum, jpdom_data, 'gdept_0' , pdept , lrowattr=ln_use_jattr )
-         CALL iom_get( inum, jpdom_data, 'gdepw_0' , pdepw , lrowattr=ln_use_jattr )
-      ELSE
-         CALL e3_to_depth( pe3t, pe3w, pdept, pdepw )
+         CALL iom_get( inum, jpdom_unknown, 'gdept_1d', pdept_1d )   
+         CALL iom_get( inum, jpdom_unknown, 'gdepw_1d', pdepw_1d )
+         CALL iom_get( inum, jpdom_data   , 'gdept_0' , pdept , lrowattr=ln_use_jattr )
+         CALL iom_get( inum, jpdom_data   , 'gdepw_0' , pdepw , lrowattr=ln_use_jattr )
+         !
+      ELSE                                      ! depths computed from e3. scale factors
+         !
+         CALL e3_to_depth( pe3t_1d, pe3w_1d, pdept_1d, pdepw_1d )    ! 1D reference depth
+         IF(lwp) THEN
+            WRITE(numout,*)
+            WRITE(numout,*) '              Reference 1D z-coordinate depth and scale factors:'
+            WRITE(numout, "(9x,' level  gdept_1d  gdepw_1d  e3t_1d   e3w_1d  ')" )
+            WRITE(numout, "(10x, i4, 4f9.2)" ) ( jk, pdept_1d(jk), pdepw_1d(jk), pe3t_1d(jk), pe3w_1d(jk), jk = 1, jpk )
+         ENDIF
+         !                                      
+         CALL e3_to_depth( pe3t   , pe3w   , pdept   , pdepw    )    ! 3D depths
+         !
       ENDIF
       !
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_cfg
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_cfg	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_cfg	(revision 7189)
@@ -14,14 +14,20 @@
 &namcfg        !   parameters of the configuration
 !-----------------------------------------------------------------------
-   cp_cfg      =  "orca"               !  name of the configuration
-   jp_cfg      =       2               !  resolution of the configuration
-   jpidta      =     182               !  1st lateral dimension ( >= jpi )
-   jpjdta      =     149               !  2nd    "         "    ( >= jpj )
-   jpkdta      =      31               !  number of levels      ( >= jpk )
-   jpiglo      =     182               !  1st dimension of global domain --> i =jpidta
-   jpjglo      =     149               !  2nd    -                  -    --> j  =jpjdta
-   jpizoom     =       1               !  left bottom (i,j) indices of the zoom
-   jpjzoom     =       1               !  in data domain indices
-   jperio      =       4               !  lateral cond. type (between 0 and 6)
+   !
+   ln_e2_dep   = .true.    ! =T : e3=dk[depth] in discret sens. 
+   !                       !      ===>>> will become the only possibility in v4.0
+   !                       ! =F : e3 analytical derivative of depth function
+   !                       !      only there for backward compatibility test with v3.6
+   !                       !      
+   cp_cfg      =  "orca"   !  name of the configuration
+   jp_cfg      =       2   !  resolution of the configuration
+   jpidta      =     182   !  1st lateral dimension ( >= jpi )
+   jpjdta      =     149   !  2nd    "         "    ( >= jpj )
+   jpkdta      =      31   !  number of levels      ( >= jpk )
+   jpiglo      =     182   !  1st dimension of global domain --> i =jpidta
+   jpjglo      =     149   !  2nd    -                  -    --> j  =jpjdta
+   jpizoom     =       1   !  left bottom (i,j) indices of the zoom
+   jpjzoom     =       1   !  in data domain indices
+   jperio      =       4   !  lateral cond. type (between 0 and 6)
 /
 !-----------------------------------------------------------------------
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_ref
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_ref	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/namelist_ref	(revision 7189)
@@ -73,4 +73,10 @@
 &namcfg        !   parameters of the configuration
 !-----------------------------------------------------------------------
+   !
+   ln_e2_dep   = .true.    ! =T : e3=dk[depth] in discret sens. 
+   !                       !      ===>>> will become the only possibility in v4.0
+   !                       ! =F : e3 analytical derivative of depth function
+   !                       !      only there for backward compatibility test with v3.6
+   !
    cp_cfg      = "default" !  name of the configuration
    cp_cfz      = "no zoom" !  name of the zoom of configuration
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domain.f90
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domain.f90	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domain.f90	(revision 7189)
@@ -451,13 +451,15 @@
       CALL iom_rstput( 0, 0, inum, 'ff_t' , ff_t , ktype = jp_r8 )
       !
-      !                             !==  vertical mesh - 3D mask  ==!
+      !                             !==  vertical mesh  ==!
       !                                                     
-      CALL iom_rstput( 0, 0, inum, 'gdept_1d', gdept_1d, ktype = jp_r8 )   !  reference 1D-coordinate
-      CALL iom_rstput( 0, 0, inum, 'gdepw_1d', gdepw_1d, ktype = jp_r8 )
-      CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d  , ktype = jp_r8 )
+      CALL iom_rstput( 0, 0, inum, 'e3t_1d'  , e3t_1d  , ktype = jp_r8 )   !  reference 1D-coordinate
       CALL iom_rstput( 0, 0, inum, 'e3w_1d'  , e3w_1d  , ktype = jp_r8 )
-      !                                                     
-      CALL iom_rstput( 0, 0, inum, 'gdept_0' , gdept_0 , ktype = jp_r8 )   !  depth (t- & w-points)
-      CALL iom_rstput( 0, 0, inum, 'gdepw_0' , gdepw_0 , ktype = jp_r8 )
+      !
+      IF(.NOT.ln_e2_dep ) THEN                                             !  depth (t- & w-points)
+         CALL iom_rstput( 0, 0, inum, 'gdept_1d', gdept_1d, ktype = jp_r8 )   ! required only with  
+         CALL iom_rstput( 0, 0, inum, 'gdepw_1d', gdepw_1d, ktype = jp_r8 )   ! the old e3. definition
+         CALL iom_rstput( 0, 0, inum, 'gdept_0' , gdept_0 , ktype = jp_r8 )
+         CALL iom_rstput( 0, 0, inum, 'gdepw_0' , gdepw_0 , ktype = jp_r8 )
+      ENDIF
       !
       CALL iom_rstput( 0, 0, inum, 'e3t_0'   , e3t_0   , ktype = jp_r8 )   !  vertical scale factors (e
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domzgr.f90
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domzgr.f90	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/domzgr.f90	(revision 7189)
@@ -314,7 +314,10 @@
       ENDIF
 
-      IF ( ln_isfcav ) THEN
-! need to be like this to compute the pressure gradient with ISF. If not, level beneath the ISF are not aligned (sum(e3t) /= depth)
-! define e3t_0 and e3w_0 as the differences between gdept and gdepw respectively
+      IF ( ln_isfcav .OR. ln_e2_dep ) THEN      ! e3. = dk[gdep]   
+         !
+!==>>>   need to be like this to compute the pressure gradient with ISF. 
+!        If not, level beneath the ISF are not aligned (sum(e3t) /= depth)
+!        define e3t_0 and e3w_0 as the differences between gdept and gdepw respectively
+!
          DO jk = 1, jpkm1
             e3t_1d(jk) = gdepw_1d(jk+1)-gdepw_1d(jk) 
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/nemogcm.f90
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/nemogcm.f90	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/nemogcm.f90	(revision 7189)
@@ -89,15 +89,8 @@
       !!----------------------------------------------------------------------
       !
-
-
-
-
       !                            !-----------------------!
       CALL nemo_init               !==  Initialisations  ==!
       !                            !-----------------------!
 
-
-
-
       ! check that all process are still there... If some process have an error,
       ! they will never enter in step and other processes will wait until the end of the cpu time!
@@ -115,20 +108,9 @@
       ENDIF
       !
-
-
-
-
-
-
-
       IF( nn_timing == 1 )   CALL timing_finalize
       !
       CALL nemo_closefile
       !
-
       CALL xios_finalize                  ! end mpp communications with xios
-
-
-
       !
    END SUBROUTINE nemo_gcm
@@ -149,5 +131,6 @@
          &             nn_isplt, nn_jsplt, nn_jctls, nn_jctle,   &
          &             nn_bench, nn_timing, nn_diacfl
-      NAMELIST/namcfg/ cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
+      NAMELIST/namcfg/ ln_e2_dep,                                &
+         &             cp_cfg, cp_cfz, jp_cfg, jpidta, jpjdta, jpkdta, jpiglo, jpjglo, &
          &             jpizoom, jpjzoom, jperio, ln_use_jattr
       !!----------------------------------------------------------------------
@@ -305,4 +288,6 @@
          WRITE(numout,*) '~~~~~~~ '
          WRITE(numout,*) '   Namelist namcfg'
+         WRITE(numout,*) '      vertical scale factors =T: e3.=dk[depth]       ln_e2_dep = ', ln_e2_dep
+         WRITE(numout,*) '                             =F: old definition                 '
          WRITE(numout,*) '      configuration name                               cp_cfg  = ', TRIM(cp_cfg)
          WRITE(numout,*) '      configuration zoom name                          cp_cfz  = ', TRIM(cp_cfz)
@@ -317,4 +302,11 @@
          WRITE(numout,*) '      lateral cond. type (between 0 and 6)             jperio  = ', jperio   
          WRITE(numout,*) '      use file attribute if exists as i/p j-start ln_use_jattr = ', ln_use_jattr
+         !
+         IF(.NOT.ln_e2_dep ) THEN
+            WRITE(numout,cform_war)
+            WRITE(numout,*)
+            WRITE(numout,*) '      ===>>>>    Obsolescent definition of e3 scale factors is used'
+            WRITE(numout,*)
+         ENDIF
       ENDIF
       !                             ! Parameter control
Index: /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/par_oce.f90
===================================================================
--- /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/par_oce.f90	(revision 7188)
+++ /branches/2016/dev_r6409_SIMPLIF_2_usrdef/NEMOGCM/TOOLS/DOMAINcfg/src/par_oce.f90	(revision 7189)
@@ -28,4 +28,7 @@
    !!                   namcfg namelist parameters
    !!----------------------------------------------------------------------
+   !
+   LOGICAL       ::   ln_e2_dep        ! e3. definition flag
+   !
    CHARACTER(lc) ::   cp_cfg           !: name of the configuration
    CHARACTER(lc) ::   cp_cfz           !: name of the zoom of configuration
