Index: NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90
===================================================================
--- NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90	(revision 11201)
+++ NEMO/branches/2019/ENHANCE-03_domcfg/src/domzgr.F90	(revision 11602)
@@ -170,5 +170,5 @@
          WRITE(numout,*) ' MIN val mbathy  ', MINVAL(  mbathy(:,:) ), ' MAX ', MAXVAL( mbathy(:,:) )
          WRITE(numout,*) ' MIN val depth t ', MINVAL( gdept_0(:,:,:) ),   &
-            &                          ' w ', MINVAL( gdepw_0(:,:,:) ), '3w ', MINVAL( gde3w_0(:,:,:) )
+            &                          ' w ', MINVAL( gdepw_0(:,:,:) )
          WRITE(numout,*) ' MIN val e3    t ', MINVAL(   e3t_0(:,:,:) ), ' f ', MINVAL(   e3f_0(:,:,:) ),  &
             &                          ' u ', MINVAL(   e3u_0(:,:,:) ), ' u ', MINVAL(   e3v_0(:,:,:) ),  &
@@ -177,5 +177,5 @@
 
          WRITE(numout,*) ' MAX val depth t ', MAXVAL( gdept_0(:,:,:) ),   &
-            &                          ' w ', MAXVAL( gdepw_0(:,:,:) ), '3w ', MAXVAL( gde3w_0(:,:,:) )
+            &                          ' w ', MAXVAL( gdepw_0(:,:,:) )
          WRITE(numout,*) ' MAX val e3    t ', MAXVAL(   e3t_0(:,:,:) ), ' f ', MAXVAL(   e3f_0(:,:,:) ),  &
             &                          ' u ', MAXVAL(   e3u_0(:,:,:) ), ' u ', MAXVAL(   e3v_0(:,:,:) ),  &
@@ -484,25 +484,4 @@
          risfdep(:,:)=0.e0
          misfdep(:,:)=1
-         !
-         ! (ISF) TODO build ice draft netcdf file for isomip and build the corresponding part of code
-         IF( cp_cfg == "isomip" .AND. ln_isfcav ) THEN 
-            risfdep(:,:)=200.e0 
-            misfdep(:,:)=1 
-            ij0 = 1 ; ij1 = 40 
-            DO jj = mj0(ij0), mj1(ij1) 
-               risfdep(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp 
-            END DO 
-            WHERE( bathy(:,:) <= 0._wp )  risfdep(:,:) = 0._wp 
-         ! 
-         ELSEIF ( cp_cfg == "isomip2" .AND. ln_isfcav ) THEN
-         ! 
-            risfdep(:,:)=0.e0
-            misfdep(:,:)=1
-            ij0 = 1 ; ij1 = 40
-            DO jj = mj0(ij0), mj1(ij1)
-               risfdep(:,jj)=700.0_wp-(gphit(:,jj)+80.0_wp)*125.0_wp
-            END DO
-            WHERE( bathy(:,:) <= 0._wp )  risfdep(:,:) = 0._wp
-         END IF
          !
          DEALLOCATE( idta, zdta )
@@ -857,5 +836,4 @@
          gdept_0(:,:,jk) = gdept_1d(jk)
          gdepw_0(:,:,jk) = gdepw_1d(jk)
-         gde3w_0(:,:,jk) = gdepw_1d(jk)
          e3t_0  (:,:,jk) = e3t_1d  (jk)
          e3u_0  (:,:,jk) = e3t_1d  (jk)
@@ -1095,27 +1073,8 @@
       IF( MINVAL( gdept_0(:,:,:) ) <  0._wp )   CALL ctl_stop( '    zgr_zps :   e r r o r   gdept_0 <  0' )
       IF( MINVAL( gdepw_0(:,:,:) ) <  0._wp )   CALL ctl_stop( '    zgr_zps :   e r r o r   gdepw_0 <  0' )
-     
-      ! Compute gde3w_0 (vertical sum of e3w)
-      IF ( ln_isfcav ) THEN ! if cavity
-         WHERE( misfdep == 0 )   misfdep = 1
-         DO jj = 1,jpj
-            DO ji = 1,jpi
-               gde3w_0(ji,jj,1) = 0.5_wp * e3w_0(ji,jj,1)
-               DO jk = 2, misfdep(ji,jj)
-                  gde3w_0(ji,jj,jk) = gde3w_0(ji,jj,jk-1) + e3w_0(ji,jj,jk) 
-               END DO
-               IF( misfdep(ji,jj) >= 2 )   gde3w_0(ji,jj,misfdep(ji,jj)) = risfdep(ji,jj) + 0.5_wp * e3w_0(ji,jj,misfdep(ji,jj))
-               DO jk = misfdep(ji,jj) + 1, jpk
-                  gde3w_0(ji,jj,jk) = gde3w_0(ji,jj,jk-1) + e3w_0(ji,jj,jk) 
-               END DO
-            END DO
-         END DO
-      ELSE ! no cavity
-         gde3w_0(:,:,1) = 0.5_wp * e3w_0(:,:,1)
-         DO jk = 2, jpk
-            gde3w_0(:,:,jk) = gde3w_0(:,:,jk-1) + e3w_0(:,:,jk)
-         END DO
-      END IF
-      !
+      !
+      ! if in the future gde3w_0 need to be compute, use the function defined in NEMO
+      ! for now gde3w_0 computation is removed as not an output of domcfg
+
       DEALLOCATE( zprt )
       !
@@ -2136,5 +2095,5 @@
          WRITE(numout,*) ' MIN val mbathy  ', MINVAL( mbathy(:,:)    ), ' MAX ', MAXVAL( mbathy(:,:) )
          WRITE(numout,*) ' MIN val depth t ', MINVAL( gdept_0(:,:,:) ),   &
-            &                          ' w ', MINVAL( gdepw_0(:,:,:) ), '3w '  , MINVAL( gde3w_0(:,:,:) )
+            &                          ' w ', MINVAL( gdepw_0(:,:,:) )
          WRITE(numout,*) ' MIN val e3    t ', MINVAL( e3t_0  (:,:,:) ), ' f '  , MINVAL( e3f_0  (:,:,:) ),   &
             &                          ' u ', MINVAL( e3u_0  (:,:,:) ), ' u '  , MINVAL( e3v_0  (:,:,:) ),   &
@@ -2143,5 +2102,5 @@
 
          WRITE(numout,*) ' MAX val depth t ', MAXVAL( gdept_0(:,:,:) ),   &
-            &                          ' w ', MAXVAL( gdepw_0(:,:,:) ), '3w '  , MAXVAL( gde3w_0(:,:,:) )
+            &                          ' w ', MAXVAL( gdepw_0(:,:,:) )
          WRITE(numout,*) ' MAX val e3    t ', MAXVAL( e3t_0  (:,:,:) ), ' f '  , MAXVAL( e3f_0  (:,:,:) ),   &
             &                          ' u ', MAXVAL( e3u_0  (:,:,:) ), ' u '  , MAXVAL( e3v_0  (:,:,:) ),   &
@@ -2246,13 +2205,13 @@
       REAL(wp) ::   ztmpu1, ztmpv1, ztmpf1
       !
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3           
       !!----------------------------------------------------------------------
 
-      ALLOCATE( z_gsigw3 (jpi,jpj,jpk), z_gsigt3 (jpi,jpj,jpk), z_gsi3w3 (jpi,jpj,jpk) )
+      ALLOCATE( z_gsigw3 (jpi,jpj,jpk), z_gsigt3 (jpi,jpj,jpk) )
       ALLOCATE( z_esigt3 (jpi,jpj,jpk), z_esigw3 (jpi,jpj,jpk), z_esigtu3(jpi,jpj,jpk), z_esigtv3(jpi,jpj,jpk) )
       ALLOCATE( z_esigtf3(jpi,jpj,jpk), z_esigwu3(jpi,jpj,jpk), z_esigwv3(jpi,jpj,jpk) )
 
-      z_gsigw3  = 0._wp   ;   z_gsigt3  = 0._wp   ;   z_gsi3w3  = 0._wp
+      z_gsigw3  = 0._wp   ;   z_gsigt3  = 0._wp
       z_esigt3  = 0._wp   ;   z_esigw3  = 0._wp 
       z_esigtu3 = 0._wp   ;   z_esigtv3 = 0._wp   ;   z_esigtf3 = 0._wp
@@ -2281,10 +2240,4 @@
             z_esigt3(ji,jj,jpk) = 2._wp * ( z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk) )
             !
-            ! Coefficients for vertical depth as the sum of e3w scale factors
-            z_gsi3w3(ji,jj,1) = 0.5_wp * z_esigw3(ji,jj,1)
-            DO jk = 2, jpk
-               z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk)
-            END DO
-            !
             DO jk = 1, jpk
                zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp)
@@ -2292,5 +2245,4 @@
                gdept_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigt3(ji,jj,jk)+rn_hc*zcoeft )
                gdepw_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsigw3(ji,jj,jk)+rn_hc*zcoefw )
-               gde3w_0(ji,jj,jk) = ( scosrf(ji,jj) + (hbatt(ji,jj)-rn_hc)*z_gsi3w3(ji,jj,jk)+rn_hc*zcoeft )
             END DO
            !
@@ -2337,5 +2289,5 @@
       END DO
       !
-      DEALLOCATE( z_gsigw3, z_gsigt3, z_gsi3w3                                      )
+      DEALLOCATE( z_gsigw3, z_gsigt3                                                        )
       DEALLOCATE( z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 )
       !
@@ -2365,13 +2317,13 @@
       REAL(wp) ::   ztmpu1, ztmpv1, ztmpf1
       !
-      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3, z_gsi3w3
+      REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_gsigw3, z_gsigt3
       REAL(wp), ALLOCATABLE, DIMENSION(:,:,:) :: z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3           
       !!----------------------------------------------------------------------
       !
-      ALLOCATE( z_gsigw3 (jpi,jpj,jpk), z_gsigt3 (jpi,jpj,jpk), z_gsi3w3 (jpi,jpj,jpk) )
+      ALLOCATE( z_gsigw3 (jpi,jpj,jpk), z_gsigt3 (jpi,jpj,jpk) )
       ALLOCATE( z_esigt3 (jpi,jpj,jpk), z_esigw3 (jpi,jpj,jpk), z_esigtu3(jpi,jpj,jpk), z_esigtv3(jpi,jpj,jpk))
       ALLOCATE( z_esigtf3(jpi,jpj,jpk), z_esigwu3(jpi,jpj,jpk), z_esigwv3(jpi,jpj,jpk) )
 
-      z_gsigw3  = 0._wp   ;   z_gsigt3  = 0._wp   ;   z_gsi3w3  = 0._wp
+      z_gsigw3  = 0._wp   ;   z_gsigt3  = 0._wp
       z_esigt3  = 0._wp   ;   z_esigw3  = 0._wp 
       z_esigtu3 = 0._wp   ;   z_esigtv3 = 0._wp   ;   z_esigtf3 = 0._wp
@@ -2425,14 +2377,7 @@
           z_esigt3(ji,jj,jpk) = 2.0_wp * (z_gsigt3(ji,jj,jpk) - z_gsigw3(ji,jj,jpk))
 
-          ! Coefficients for vertical depth as the sum of e3w scale factors
-          z_gsi3w3(ji,jj,1) = 0.5 * z_esigw3(ji,jj,1)
-          DO jk = 2, jpk
-             z_gsi3w3(ji,jj,jk) = z_gsi3w3(ji,jj,jk-1) + z_esigw3(ji,jj,jk)
-          END DO
-
           DO jk = 1, jpk
              gdept_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigt3(ji,jj,jk)
              gdepw_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsigw3(ji,jj,jk)
-             gde3w_0(ji,jj,jk) = (scosrf(ji,jj)+hbatt(ji,jj))*z_gsi3w3(ji,jj,jk)
           END DO
 
@@ -2503,5 +2448,5 @@
       CALL lbc_lnk('domzgr',e3uw_0,'T',1.) ; CALL lbc_lnk('domzgr',e3vw_0,'T',1.)
       !
-      DEALLOCATE( z_gsigw3, z_gsigt3, z_gsi3w3                                      )
+      DEALLOCATE( z_gsigw3, z_gsigt3                                                        )
       DEALLOCATE( z_esigt3, z_esigw3, z_esigtu3, z_esigtv3, z_esigtf3, z_esigwu3, z_esigwv3 )
       !
@@ -2521,12 +2466,12 @@
       INTEGER  ::   ji, jj, jk       ! dummy loop argument
       REAL(wp) ::   zcoeft, zcoefw   ! temporary scalars
-      REAL(wp), ALLOCATABLE, DIMENSION(:) :: z_gsigw, z_gsigt, z_gsi3w
+      REAL(wp), ALLOCATABLE, DIMENSION(:) :: z_gsigw, z_gsigt
       REAL(wp), ALLOCATABLE, DIMENSION(:) :: z_esigt, z_esigw
       !!----------------------------------------------------------------------
 
-      ALLOCATE( z_gsigw(jpk), z_gsigt(jpk), z_gsi3w(jpk) )
+      ALLOCATE( z_gsigw(jpk), z_gsigt(jpk) )
       ALLOCATE( z_esigt(jpk), z_esigw(jpk) )
 
-      z_gsigw  = 0._wp   ;   z_gsigt  = 0._wp   ;   z_gsi3w  = 0._wp
+      z_gsigw  = 0._wp   ;   z_gsigt  = 0._wp
       z_esigt  = 0._wp   ;   z_esigw  = 0._wp 
 
@@ -2547,10 +2492,4 @@
       z_esigt(jpk) = 2._wp * ( z_gsigt(jpk) - z_gsigw(jpk) )
       !
-      ! Coefficients for vertical depth as the sum of e3w scale factors
-      z_gsi3w(1) = 0.5_wp * z_esigw(1)
-      DO jk = 2, jpk
-         z_gsi3w(jk) = z_gsi3w(jk-1) + z_esigw(jk)
-      END DO
-!!gm: depuw, depvw can be suppressed (modif in ldfslp) and depw=dep3w can be set (save 3 3D arrays)
       DO jk = 1, jpk
          zcoeft = ( REAL(jk,wp) - 0.5_wp ) / REAL(jpkm1,wp)
@@ -2558,7 +2497,6 @@
          gdept_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigt(jk) + hift(:,:)*zcoeft )
          gdepw_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsigw(jk) + hift(:,:)*zcoefw )
-         gde3w_0(:,:,jk) = ( scosrf(:,:) + (hbatt(:,:)-hift(:,:))*z_gsi3w(jk) + hift(:,:)*zcoeft )
-      END DO
-!!gm: e3uw, e3vw can be suppressed  (modif in dynzdf, dynzdf_iso, zdfbfr) (save 2 3D arrays)
+      END DO
+
       DO jj = 1, jpj
          DO ji = 1, jpi
@@ -2576,6 +2514,6 @@
       END DO
       !
-      DEALLOCATE( z_gsigw, z_gsigt, z_gsi3w )
-      DEALLOCATE( z_esigt, z_esigw          )
+      DEALLOCATE( z_gsigw, z_gsigt )
+      DEALLOCATE( z_esigt, z_esigw )
       !
    END SUBROUTINE s_tanh
