Index: NEMO/trunk/src/ICE/icedyn_rhg_eap.F90
===================================================================
--- NEMO/trunk/src/ICE/icedyn_rhg_eap.F90	(revision 15061)
+++ NEMO/trunk/src/ICE/icedyn_rhg_eap.F90	(revision 15062)
@@ -66,4 +66,5 @@
    !! * Substitutions
 #  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/ICE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/ICE/icedyn_rhg_evp.F90
===================================================================
--- NEMO/trunk/src/ICE/icedyn_rhg_evp.F90	(revision 15061)
+++ NEMO/trunk/src/ICE/icedyn_rhg_evp.F90	(revision 15062)
@@ -55,4 +55,5 @@
    !! * Substitutions
 #  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/ICE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/OCE/C1D/dtauvd.F90
===================================================================
--- NEMO/trunk/src/OCE/C1D/dtauvd.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/C1D/dtauvd.F90	(revision 15062)
@@ -33,4 +33,5 @@
    !! * Substitutions
 #  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
@@ -169,5 +170,5 @@
                   zvp(jk) =  pvd(ji,jj,jpkm1)
                ELSE                                      ! inbetween : vertical interpolation between jkk & jkk+1
-                  DO jkk = 1, jpkm1                      ! when  gdept(jkk) < zl < gdept(jkk+1)
+                  DO jkk = 1, jpkm1                      ! when  dept(jkk) < zl < dept(jkk+1)
                      IF( (zl-gdept_1d(jkk)) * (zl-gdept_1d(jkk+1)) <= 0._wp ) THEN
                         zi = ( zl - gdept_1d(jkk) ) / (gdept_1d(jkk+1)-gdept_1d(jkk))
Index: NEMO/trunk/src/OCE/C1D/dyndmp.F90
===================================================================
--- NEMO/trunk/src/OCE/C1D/dyndmp.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/C1D/dyndmp.F90	(revision 15062)
@@ -44,4 +44,5 @@
    !! * Substitutions
 #  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/OCE/DIA/diahsb.F90
===================================================================
--- NEMO/trunk/src/OCE/DIA/diahsb.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/DIA/diahsb.F90	(revision 15062)
@@ -186,5 +186,5 @@
       !
       DO jk = 1, jpkm1           ! volume
-         ztmpk(:,:,jk,1) =   surf    (:,:) * e3t    (:,:,jk,Kmm)*tmask    (:,:,jk)   &
+         ztmpk(:,:,jk,1) =   surf    (:,:) * e3t(:,:,jk,Kmm)*tmask(:,:,jk)   &
             &              - surf_ini(:,:) * e3t_ini(:,:,jk    )*tmask_ini(:,:,jk)
       END DO
Index: NEMO/trunk/src/OCE/DOM/dom_oce.F90
===================================================================
--- NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/DOM/dom_oce.F90	(revision 15062)
@@ -140,7 +140,9 @@
 
    !                                                        !  time-dependent scale factors     (domvvl)
+#if defined key_qco || defined key_linssh
+#else
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::   e3t, e3u, e3v, e3w, e3uw, e3vw  !: vert. scale factor [m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   e3f                             !: F-point vert. scale factor [m]
-
+#endif
    !                                                        !  time-dependent ratio ssh / h_0   (domqco)
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   r3t, r3u, r3v                   !: time-dependent    ratio at t-, u- and v-point [-]
@@ -154,7 +156,9 @@
    
    !                                                        !  time-dependent depths of cells   (domvvl)
+#if defined key_qco || defined key_linssh
+#else
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:,:) ::  gdept, gdepw
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::  gde3w
-
+#endif
    !                                                        !  reference heights of ocean water column and its inverse
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   ht_0, r1_ht_0   !: t-depth        [m] and [1/m]
@@ -164,8 +168,10 @@
    
    !                                                        ! time-dependent heights of ocean water column   (domvvl)
+#if defined key_qco || defined key_linssh 
+#else
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:)     ::   ht          !: t-points           [m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hu, r1_hu   !: u-depth            [m] and [1/m]
    REAL(wp), PUBLIC, ALLOCATABLE, SAVE, DIMENSION(:,:,:)   ::   hv, r1_hv   !: v-depth            [m] and [1/m]
-
+#endif
    INTEGER, PUBLIC ::   nla10              !: deepest    W level Above  ~10m (nlb10 - 1)
    INTEGER, PUBLIC ::   nlb10              !: shallowest W level Bellow ~10m (nla10 + 1)
Index: NEMO/trunk/src/OCE/FLO/flodom.F90
===================================================================
--- NEMO/trunk/src/OCE/FLO/flodom.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/FLO/flodom.F90	(revision 15062)
@@ -33,4 +33,6 @@
    REAL(wp), ALLOCATABLE, DIMENSION(:) ::   zgifl, zgjfl,  zgkfl      ! distances in indexes
 
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/OCE/FLO/flowri.F90
===================================================================
--- NEMO/trunk/src/OCE/FLO/flowri.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/FLO/flowri.F90	(revision 15062)
@@ -33,4 +33,6 @@
    REAL(wp), ALLOCATABLE, DIMENSION(:) ::   ztem , zsal, zrho   ! 2D workspace
 
+   !! * Substitutions
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/OCE/ISF/isfcpl.F90
===================================================================
--- NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/ISF/isfcpl.F90	(revision 15062)
@@ -546,5 +546,5 @@
 
                ! volume diff
-               zdvol =   e3t  (ji,jj,jk,Kmm) *  tmask  (ji,jj,jk)   &
+               zdvol =   e3t(ji,jj,jk,Kmm) *  tmask  (ji,jj,jk)   &
                   &   - ze3t_b(ji,jj,jk    ) * ztmask_b(ji,jj,jk)
 
Index: NEMO/trunk/src/OCE/ISF/isfparmlt.F90
===================================================================
--- NEMO/trunk/src/OCE/ISF/isfparmlt.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/ISF/isfparmlt.F90	(revision 15062)
@@ -28,5 +28,8 @@
 
    PUBLIC  isfpar_mlt 
-   
+
+
+   !! * Substitutions
+#  include "domzgr_substitute.h90"   
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/OCE/LDF/ldfslp.F90
===================================================================
--- NEMO/trunk/src/OCE/LDF/ldfslp.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/LDF/ldfslp.F90	(revision 15062)
@@ -208,8 +208,8 @@
          zfj = MAX( omlmask(ji,jj,jk), omlmask(ji,jj+1,jk) )
          ! thickness of water column between surface and level k at u/v point
-         zdepu = 0.5_wp * ( ( gdept (ji,jj,jk,Kmm) + gdept (ji+1,jj,jk,Kmm) )                            &
+         zdepu = 0.5_wp * ( ( gdept(ji,jj,jk,Kmm) + gdept(ji+1,jj,jk,Kmm) )                            &
             &              - 2 * MAX( risfdep(ji,jj), risfdep(ji+1,jj) )        &
             &              - e3u(ji,jj,miku(ji,jj),Kmm)   )
-         zdepv = 0.5_wp * ( ( gdept (ji,jj,jk,Kmm) + gdept (ji,jj+1,jk,Kmm) )                            &
+         zdepv = 0.5_wp * ( ( gdept(ji,jj,jk,Kmm) + gdept(ji,jj+1,jk,Kmm) )                            &
             &              - 2 * MAX( risfdep(ji,jj), risfdep(ji,jj+1) )        &
             &              - e3v(ji,jj,mikv(ji,jj),Kmm)   )
Index: NEMO/trunk/src/OCE/OBS/diaobs.F90
===================================================================
--- NEMO/trunk/src/OCE/OBS/diaobs.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/OBS/diaobs.F90	(revision 15062)
@@ -604,5 +604,4 @@
       !! ** Action  :
       !!----------------------------------------------------------------------
-      USE dom_oce, ONLY : gdept, gdept_1d     ! Ocean space domain variables (Kmm time-level only)
       USE phycst , ONLY : rday                ! Physical constants
       USE oce    , ONLY : ts, uu, vv, ssh     ! Ocean dynamics and tracers variables (Kmm time-level only)
Index: NEMO/trunk/src/OCE/OBS/obs_prep.F90
===================================================================
--- NEMO/trunk/src/OCE/OBS/obs_prep.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/OBS/obs_prep.F90	(revision 15062)
@@ -1072,11 +1072,5 @@
       !!----------------------------------------------------------------------
       !! * Modules used
-      USE dom_oce, ONLY : &       ! Geographical information 
-         & gdepw_1d,      &
-         & gdepw_0,       &                       
-         & gdepw, r3t,    &
-         & gdept,         &
-         & ln_zco,        &
-         & ln_zps             
+      USE dom_oce   ! Geographical information 
 
       !! * Arguments
Index: NEMO/trunk/src/OCE/SBC/sbcrnf.F90
===================================================================
--- NEMO/trunk/src/OCE/SBC/sbcrnf.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/SBC/sbcrnf.F90	(revision 15062)
@@ -231,5 +231,5 @@
       ELSE                       !==   runoff put only at the surface   ==!
          DO_2D_OVR( nn_hls, nn_hls, nn_hls, nn_hls )
-            h_rnf (ji,jj)   = e3t (ji,jj,1,Kmm)        ! update h_rnf to be depth of top box
+            h_rnf (ji,jj)   = e3t(ji,jj,1,Kmm)        ! update h_rnf to be depth of top box
          END_2D
          DO_2D_OVR( nn_hls-1, nn_hls, nn_hls-1, nn_hls )
Index: NEMO/trunk/src/OCE/SBC/sbcssm.F90
===================================================================
--- NEMO/trunk/src/OCE/SBC/sbcssm.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/SBC/sbcssm.F90	(revision 15062)
@@ -246,5 +246,5 @@
          sss_m(:,:) = ts  (:,:,1,jp_sal,Kmm)
          ssh_m(:,:) = ssh(:,:,Kmm)
-         e3t_m(:,:) = e3t (:,:,1,Kmm)
+         e3t_m(:,:) = e3t(:,:,1,Kmm)
          frq_m(:,:) = 1._wp
          !
Index: NEMO/trunk/src/OCE/TRA/traldf_triad.F90
===================================================================
--- NEMO/trunk/src/OCE/TRA/traldf_triad.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/TRA/traldf_triad.F90	(revision 15062)
@@ -210,5 +210,5 @@
                      &   * (  akz     (ji,jj,jk)   &
                      &      + ah_wslp2(ji,jj,jk)   &
-                     &        / ( e3w (ji,jj,jk,Kmm) * e3w(ji,jj,jk,Kmm) )  )
+                     &        / ( e3w(ji,jj,jk,Kmm) * e3w(ji,jj,jk,Kmm) )  )
                END_3D
             ELSEIF( ln_traldf_lap ) THEN              ! laplacian operator
Index: NEMO/trunk/src/OCE/ZDF/zdfswm.F90
===================================================================
--- NEMO/trunk/src/OCE/ZDF/zdfswm.F90	(revision 15061)
+++ NEMO/trunk/src/OCE/ZDF/zdfswm.F90	(revision 15062)
@@ -29,4 +29,5 @@
    !! * Substitutions
 #  include "do_loop_substitute.h90"
+#  include "domzgr_substitute.h90"
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
Index: NEMO/trunk/src/TOP/PISCES/SED/oce_sed.F90
===================================================================
--- NEMO/trunk/src/TOP/PISCES/SED/oce_sed.F90	(revision 15061)
+++ NEMO/trunk/src/TOP/PISCES/SED/oce_sed.F90	(revision 15062)
@@ -15,5 +15,6 @@
    USE dom_oce , ONLY :   gphit     =>   gphit          !: latitude  of t-point (degre)
  
-#if ! defined key_qco
+#if defined key_qco || defined key_linssh
+#else
    USE dom_oce , ONLY :   e3t       =>   e3t            !: latitude  of t-point (degre)
 #endif
