Ignore:
Timestamp:
12/09/08 10:36:41 (15 years ago)
Author:
smasson
Message:

introduce meridional and barotropic stream functions, see ticket:59

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/GRILLE/decoupeterre.pro

    r386 r388  
    3434; @keyword USETRI 
    3535; 
     36; @keyword MASKDTA 
     37; 2d array defining the mask that must be applied to the data instead 
     38; of the default mask which is defined according to the grid (t/u/v/f mask) 
     39; 
    3640; @keyword _EXTRA 
    3741; Used to pass keywords 
     
    6468PRO decoupeterre, mask, glam, gphi, gdep $ 
    6569                , TYPE=type, TRI=tri, INDICEZOOM=indicezoom $ 
    66                 , COINMONTE=coinmonte, COINDESCEND=coindescend $ 
     70                , COINMONTE=coinmonte, COINDESCEND=coindescend, MASKDTA = maskdta $ 
    6771                , WDEPTH=wdepth, REALSECTION=realsection, USETRI=usetri $ 
    6872                , _EXTRA=ex 
     
    193197;------------------------------------------------------------ 
    194198  if keyword_set(wdepth)  then begin 
    195     firstz = 0 > (min([firstzt, firstzw])-1) 
    196     lastz = (max([lastzt, lastzw])+1) < (jpk-1) 
     199    firstzw = 0 > (min([firstzt, firstzw])-1) 
     200    lastzw = (max([lastzt, lastzw])+1) < (jpk-1) 
     201    nzw = lastzw - firstzw + 1 
     202    firstz = firstzw 
     203    lastz = lastzw 
     204    nz = nzw 
    197205  ENDIF ELSE BEGIN 
    198206    firstz = firstzt 
    199207    lastz = lastzt 
     208    nz = nzt 
    200209  ENDELSE 
    201   nz = lastz-firstz+1 
    202210;------------------------------------------------------------ 
    203211; mask 
    204212;------------------------------------------------------------ 
     213  IF keyword_set(maskdta) THEN BEGIN 
     214    mask = byte(fitintobox(maskdta)) 
     215    IF keyword_set(wdepth) THEN BEGIN 
     216      mask = shift(temporary(mask), 0, 1) 
     217      mask[*, 0] = 0b 
     218    ENDIF 
     219  ENDIF ELSE BEGIN  
    205220  case type of 
    206221    'xy':BEGIN 
     
    221236    END 
    222237    ELSE:mask = tmask[firstx:lastx, firsty:lasty, firstz:lastz] 
    223   endcase 
     238  ENDCASE 
     239ENDELSE 
    224240;------------------------------------------------------------ 
    225241; vertical axis 
     
    240256; in that case, the z axis is a 2d array and we modify the depth of 
    241257; the last level ocean with hdepw that is the real depth of the bottom. 
     258; in domzgr:  hdepw(ji,jj) = gdepw(ji,jj,ik+1) 
    242259    CASE 1 OF 
    243       keyword_set(key_partialstep) and type EQ 'xz' $ 
     260      keyword_set(key_partialstep) AND type EQ 'xz' $ 
    244261        AND ny EQ 1 AND keyword_set(realsection):BEGIN 
    245         bottom = total(mask, 3) 
     262        bottom = total(mask, 3 - keyword_set(maskdta)) 
    246263        good = where(bottom NE 0 AND bottom NE nz) 
    247         bottom = lindgen(nx)+(bottom)*nx 
    248264        IF good[0] NE -1 THEN BEGIN 
     265          bottom = lindgen(nx)+(bottom)*nx 
    249266          bottom = bottom[good] 
    250267          gdep = replicate(1, nx)#gdep 
     
    253270        ENDIF 
    254271      END 
    255       keyword_set(key_partialstep) and type EQ 'yz' $ 
     272      keyword_set(key_partialstep) AND type EQ 'yz' $ 
    256273        AND nx EQ 1 AND keyword_set(realsection):BEGIN 
    257         bottom = total(mask, 3) 
     274        bottom = total(mask, 3 - keyword_set(maskdta)) 
    258275        good = where(bottom NE 0 AND bottom NE nz) 
    259         bottom = lindgen(ny)+(bottom)*ny 
    260276        IF good[0] NE -1 THEN BEGIN 
     277          bottom = lindgen(ny)+(bottom)*ny 
    261278          bottom = bottom[good] 
    262279          gdep = replicate(1, ny)#gdep 
Note: See TracChangeset for help on using the changeset viewer.