Index: trunk/SRC/ToBeReviewed/GRILLE/decoupeterre.pro
===================================================================
--- trunk/SRC/ToBeReviewed/GRILLE/decoupeterre.pro	(revision 386)
+++ trunk/SRC/ToBeReviewed/GRILLE/decoupeterre.pro	(revision 388)
@@ -34,4 +34,8 @@
 ; @keyword USETRI
 ;
+; @keyword MASKDTA
+; 2d array defining the mask that must be applied to the data instead
+; of the default mask which is defined according to the grid (t/u/v/f mask)
+;
 ; @keyword _EXTRA
 ; Used to pass keywords
@@ -64,5 +68,5 @@
 PRO decoupeterre, mask, glam, gphi, gdep $
                 , TYPE=type, TRI=tri, INDICEZOOM=indicezoom $
-                , COINMONTE=coinmonte, COINDESCEND=coindescend $
+                , COINMONTE=coinmonte, COINDESCEND=coindescend, MASKDTA = maskdta $
                 , WDEPTH=wdepth, REALSECTION=realsection, USETRI=usetri $
                 , _EXTRA=ex
@@ -193,14 +197,25 @@
 ;------------------------------------------------------------
   if keyword_set(wdepth)  then begin
-    firstz = 0 > (min([firstzt, firstzw])-1)
-    lastz = (max([lastzt, lastzw])+1) < (jpk-1)
+    firstzw = 0 > (min([firstzt, firstzw])-1)
+    lastzw = (max([lastzt, lastzw])+1) < (jpk-1)
+    nzw = lastzw - firstzw + 1
+    firstz = firstzw
+    lastz = lastzw
+    nz = nzw
   ENDIF ELSE BEGIN
     firstz = firstzt
     lastz = lastzt
+    nz = nzt
   ENDELSE
-  nz = lastz-firstz+1
 ;------------------------------------------------------------
 ; mask
 ;------------------------------------------------------------
+  IF keyword_set(maskdta) THEN BEGIN
+    mask = byte(fitintobox(maskdta))
+    IF keyword_set(wdepth) THEN BEGIN
+      mask = shift(temporary(mask), 0, 1)
+      mask[*, 0] = 0b
+    ENDIF
+  ENDIF ELSE BEGIN 
   case type of
     'xy':BEGIN
@@ -221,5 +236,6 @@
     END
     ELSE:mask = tmask[firstx:lastx, firsty:lasty, firstz:lastz]
-  endcase
+  ENDCASE
+ENDELSE
 ;------------------------------------------------------------
 ; vertical axis
@@ -240,11 +256,12 @@
 ; in that case, the z axis is a 2d array and we modify the depth of
 ; the last level ocean with hdepw that is the real depth of the bottom.
+; in domzgr:  hdepw(ji,jj) = gdepw(ji,jj,ik+1)
     CASE 1 OF
-      keyword_set(key_partialstep) and type EQ 'xz' $
+      keyword_set(key_partialstep) AND type EQ 'xz' $
         AND ny EQ 1 AND keyword_set(realsection):BEGIN
-        bottom = total(mask, 3)
+        bottom = total(mask, 3 - keyword_set(maskdta))
         good = where(bottom NE 0 AND bottom NE nz)
-        bottom = lindgen(nx)+(bottom)*nx
         IF good[0] NE -1 THEN BEGIN
+          bottom = lindgen(nx)+(bottom)*nx
           bottom = bottom[good]
           gdep = replicate(1, nx)#gdep
@@ -253,10 +270,10 @@
         ENDIF
       END
-      keyword_set(key_partialstep) and type EQ 'yz' $
+      keyword_set(key_partialstep) AND type EQ 'yz' $
         AND nx EQ 1 AND keyword_set(realsection):BEGIN
-        bottom = total(mask, 3)
+        bottom = total(mask, 3 - keyword_set(maskdta))
         good = where(bottom NE 0 AND bottom NE nz)
-        bottom = lindgen(ny)+(bottom)*ny
         IF good[0] NE -1 THEN BEGIN
+          bottom = lindgen(ny)+(bottom)*ny
           bottom = bottom[good]
           gdep = replicate(1, ny)#gdep
Index: trunk/SRC/ToBeReviewed/GRILLE/grille.pro
===================================================================
--- trunk/SRC/ToBeReviewed/GRILLE/grille.pro	(revision 386)
+++ trunk/SRC/ToBeReviewed/GRILLE/grille.pro	(revision 388)
@@ -21,5 +21,8 @@
 ; This keyword is used in <pro>plt</pro>.
 ;
-; @keyword WDEPTH
+; @keyword GRID {default=vargrid defined in <pro>cm_4data</pro>} 
+; To specify on which grid are located the data
+;
+; @keyword WDEPTH {default=0} 
 ; To specify that the field is at W depth instead of T
 ; depth (automatically activated if vargrid eq 'W')
@@ -114,5 +117,5 @@
           , e1, e2, e3 $
           , TRI=tri, NOTRI=notri, TOUT=tout, FORPLT=forplt $
-          , TYPE=type, WDEPTH=wdepth, _EXTRA=ex
+          , TYPE=type, WDEPTH=wdepth, GRID = grid, _EXTRA=ex
 ;
   compile_opt idl2, strictarrsubs
@@ -129,4 +132,5 @@
   vargrid = strupcase(strmid(vargrid,0,/reverse_offset))
 ;
+  IF size(grid, /type) EQ 7 THEN vargrid = strupcase(grid)
   if vargrid eq 'W' then wdepth = 1
   if keyword_set(tout) then begin
@@ -356,11 +360,13 @@
   ENDELSE
 ; for the vertical sections with partial steps
+; from domzgh: hdept(ji,jj) = gdept(ji,jj,ik  )
+;              hdepw(ji, jj) = gdepw(ji, jj, ik+1)
   IF keyword_set(type) AND keyword_set(key_partialstep) THEN BEGIN
     CASE 1 OF
       type EQ 'xz' AND ny EQ 1:BEGIN
         bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3)
-        good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth))
-        bottom = lindgen(nx)+(bottom-1l+keyword_set(wdepth))*nx
+        good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth))
         IF good[0] NE -1 THEN BEGIN
+          bottom = lindgen(nx)+(bottom-(1l+keyword_set(wdepth)))*nx
           bottom = bottom[good]
           IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw)
@@ -374,7 +380,7 @@
       type EQ 'yz' AND nx EQ 1:BEGIN
         bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3)
-        good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth))
-        bottom = lindgen(ny)+(bottom-1l+keyword_set(wdepth))*ny
+        good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth))
         IF good[0] NE -1 THEN BEGIN
+          bottom = lindgen(ny)+(bottom-(1l+keyword_set(wdepth)))*ny
           bottom = bottom[good]
           IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw)
Index: trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro
===================================================================
--- trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro	(revision 386)
+++ trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro	(revision 388)
@@ -93,4 +93,7 @@
 ; For these ones traced by a trait, use CONTLABEL.
 ;
+; @keyword MASKFILL
+; set to 0 to avoid to fill the masked values
+;
 ; @keyword MAXIN
 ; to specify the max value we want to plot with a keyword instead of with the
@@ -109,4 +112,10 @@
 ; @keyword NOFILL
 ; To make just isolines with no filling
+;
+; @keyword NOMASK
+; activate to supress the use of the land-sea mask when plotting the field
+; 
+; @keyword NO_PARTIALSTEP
+; activate to supress the use of partial steps (force key_partialstep = 0 within pltz)
 ;
 ; @keyword NOTRI
@@ -116,4 +125,8 @@
 ; the keyword CELL_FILL=2.
 ; Comment: if the field contain points !values.f_nan, then we even do a triangulation.
+;
+; @keyword MASKDTA
+; 2d array defining the mask that must be applied to the data instead
+; of the default mask which is defined according to the grid (t/u/v/f mask)
 ;
 ; @keyword OVERPLOT
@@ -172,8 +185,9 @@
         , STYLE=style, CONTMAX=contmax, SIN=sin, TYPEIN=typein $
         , CONTMIN=contmin, NLEVEL=nlevel, CONTNLEVEL=contnlevel $
-        , NOFILL=nofill, NOTRI=notri, USETRI=usetri, FILLXDIR=fillxdir $
+        , NOFILL=nofill, NOMASK = nomask, NO_PARTIALSTEP = no_partialstep, NOTRI=notri $
+        , USETRI = usetri, FILLXDIR = fillxdir $
         , ZOOM=zoom, XZ=xz, YZ=yz, MININ=minin, MAXIN=maxin $
-        , STRICTFILL=strictfill, OVERPLOT=overplot, MASKFILL=maskfill $
-        , WDEPTH=wdepth, REALSECTION=realsection $
+        , STRICTFILL=strictfill, OVERPLOT=overplot $
+        , WDEPTH=wdepth, REALSECTION=realsection, MASKFILL=maskfill, MASKDTA = maskdta $
         , _EXTRA=ex
 ;
@@ -197,4 +211,5 @@
 ;
   if n_elements(contour) ne 4 THEN saveboxparam, 'boxparam4pltz.dat'
+  key_partialstep = keyword_set(key_partialstep) * (1b - keyword_set(no_partialstep)) 
 ;--------------------------------------------------------------
 ;  Reading of the field.
@@ -262,4 +277,7 @@
 ; to draw from bottom to top (avoid using cell_fill)
   z2d = reverse(z2d, 2)
+  szmsk = size(mask, /dimensions)
+  IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1]) 
+  IF keyword_set(maskdta) THEN mask = byte(fitintobox(maskdta))
 ;-----------------------------------------------------------------------------
 ; Determination of the mi:min and of the ma:max of z2d in the same way
@@ -355,6 +373,8 @@
     if keyword_set(nan) then trinan = triangule(masknan, /basic, coinmonte = coinmontenan, coindescend = coindescendnan)
     maskorg = mask
-    decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection
+    decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection, MASKDTA = maskdta
     axis4pltz, type, mask, glammsk, gphimsk, gdepmsk, XXAXIS = xmask, ZZAXIS = zmask, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex
+    szmsk = size(mask, /dimensions)
+    IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1]) 
   ENDIF ELSE BEGIN
     xmask = xxaxis
