Changeset 388


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

introduce meridional and barotropic stream functions, see ticket:59

Location:
trunk/SRC
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Grid/restoreboxparam.pro

    r371 r388  
    7373     nzt = boxzoomparam.indexes[28] 
    7474     nzw = boxzoomparam.indexes[29] 
    75      key_irregular = boxzoomparam.key 
     75     key_shift    = boxzoomparam.key[0] 
     76     key_periodic = boxzoomparam.key[1] 
     77     key_stride   = boxzoomparam.key[2] 
     78     key_gridtype = boxzoomparam.key[3] 
     79     key_yreverse = boxzoomparam.key[4] 
     80     key_zreverse = boxzoomparam.key[5] 
     81     key_partialstep = boxzoomparam.key[6] 
     82     key_onearth  = boxzoomparam.key[7] 
    7683; 
    7784      boxzoomparam = -1 
  • trunk/SRC/Grid/saveboxparam.pro

    r371 r388  
    4242      boxzoomparam = {bound:[lon1, lon2, lat1, lat2, vert1, vert2] $ 
    4343       , indexes:[firstxt, lastxt, firstyt, lastyt $ 
    44        , firstxu, lastxu, firstyu, lastyu $ 
    45        , firstxv, lastxv, firstyv, lastyv $ 
    46        , firstxf, lastxf, firstyf, lastyf $ 
    47        , firstzt, lastzt, firstzw, lastzw $ 
    48        , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw] $ 
    49        , key:key_irregular} 
     44                , firstxu, lastxu, firstyu, lastyu $ 
     45                , firstxv, lastxv, firstyv, lastyv $ 
     46                , firstxf, lastxf, firstyf, lastyf $ 
     47                , firstzt, lastzt, firstzw, lastzw $ 
     48                , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw] $ 
     49       , key:[key_shift, key_periodic, key_stride, key_gridtype $ 
     50            , key_yreverse, key_zreverse, key_partialstep, key_onearth]} 
    5051; 
    5152   ENDIF ELSE BEGIN 
     
    5859       , firstzt, lastzt, firstzw, lastzw $ 
    5960       , nxt, nyt, nxu, nyu, nxv, nyv, nxf, nyf, nzt, nzw $ 
    60        , key_irregular, filename = myuniquetmpdir + filename 
     61       , key_shift, key_periodic, key_stride, key_gridtype $ 
     62       , key_yreverse, key_zreverse, key_partialstep, key_onearth $ 
     63       , filename = myuniquetmpdir + filename 
    6164; 
    6265   ENDELSE 
  • 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 
  • trunk/SRC/ToBeReviewed/GRILLE/grille.pro

    r378 r388  
    2121; This keyword is used in <pro>plt</pro>. 
    2222; 
    23 ; @keyword WDEPTH 
     23; @keyword GRID {default=vargrid defined in <pro>cm_4data</pro>}  
     24; To specify on which grid are located the data 
     25; 
     26; @keyword WDEPTH {default=0}  
    2427; To specify that the field is at W depth instead of T 
    2528; depth (automatically activated if vargrid eq 'W') 
     
    114117          , e1, e2, e3 $ 
    115118          , TRI=tri, NOTRI=notri, TOUT=tout, FORPLT=forplt $ 
    116           , TYPE=type, WDEPTH=wdepth, _EXTRA=ex 
     119          , TYPE=type, WDEPTH=wdepth, GRID = grid, _EXTRA=ex 
    117120; 
    118121  compile_opt idl2, strictarrsubs 
     
    129132  vargrid = strupcase(strmid(vargrid,0,/reverse_offset)) 
    130133; 
     134  IF size(grid, /type) EQ 7 THEN vargrid = strupcase(grid) 
    131135  if vargrid eq 'W' then wdepth = 1 
    132136  if keyword_set(tout) then begin 
     
    356360  ENDELSE 
    357361; for the vertical sections with partial steps 
     362; from domzgh: hdept(ji,jj) = gdept(ji,jj,ik  ) 
     363;              hdepw(ji, jj) = gdepw(ji, jj, ik+1) 
    358364  IF keyword_set(type) AND keyword_set(key_partialstep) THEN BEGIN 
    359365    CASE 1 OF 
    360366      type EQ 'xz' AND ny EQ 1:BEGIN 
    361367        bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 
    362         good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) 
    363         bottom = lindgen(nx)+(bottom-1l+keyword_set(wdepth))*nx 
     368        good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth)) 
    364369        IF good[0] NE -1 THEN BEGIN 
     370          bottom = lindgen(nx)+(bottom-(1l+keyword_set(wdepth)))*nx 
    365371          bottom = bottom[good] 
    366372          IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw) 
     
    374380      type EQ 'yz' AND nx EQ 1:BEGIN 
    375381        bottom = total(tmask[firstx:lastx, firsty:lasty, firstz:lastz], 3) 
    376         good = where(bottom NE 0 AND bottom NE nz+keyword_set(wdepth)) 
    377         bottom = lindgen(ny)+(bottom-1l+keyword_set(wdepth))*ny 
     382        good = where(bottom NE 0 AND bottom NE nz-1+keyword_set(wdepth)) 
    378383        IF good[0] NE -1 THEN BEGIN 
     384          bottom = lindgen(ny)+(bottom-(1l+keyword_set(wdepth)))*ny 
    379385          bottom = bottom[good] 
    380386          IF lastz EQ jpk-1 THEN gdep[nz-1] = max(hdepw) 
  • trunk/SRC/ToBeReviewed/PLOTS/DESSINE/pltz.pro

    r378 r388  
    9393; For these ones traced by a trait, use CONTLABEL. 
    9494; 
     95; @keyword MASKFILL 
     96; set to 0 to avoid to fill the masked values 
     97; 
    9598; @keyword MAXIN 
    9699; to specify the max value we want to plot with a keyword instead of with the 
     
    109112; @keyword NOFILL 
    110113; To make just isolines with no filling 
     114; 
     115; @keyword NOMASK 
     116; activate to supress the use of the land-sea mask when plotting the field 
     117;  
     118; @keyword NO_PARTIALSTEP 
     119; activate to supress the use of partial steps (force key_partialstep = 0 within pltz) 
    111120; 
    112121; @keyword NOTRI 
     
    116125; the keyword CELL_FILL=2. 
    117126; Comment: if the field contain points !values.f_nan, then we even do a triangulation. 
     127; 
     128; @keyword MASKDTA 
     129; 2d array defining the mask that must be applied to the data instead 
     130; of the default mask which is defined according to the grid (t/u/v/f mask) 
    118131; 
    119132; @keyword OVERPLOT 
     
    172185        , STYLE=style, CONTMAX=contmax, SIN=sin, TYPEIN=typein $ 
    173186        , CONTMIN=contmin, NLEVEL=nlevel, CONTNLEVEL=contnlevel $ 
    174         , NOFILL=nofill, NOTRI=notri, USETRI=usetri, FILLXDIR=fillxdir $ 
     187        , NOFILL=nofill, NOMASK = nomask, NO_PARTIALSTEP = no_partialstep, NOTRI=notri $ 
     188        , USETRI = usetri, FILLXDIR = fillxdir $ 
    175189        , ZOOM=zoom, XZ=xz, YZ=yz, MININ=minin, MAXIN=maxin $ 
    176         , STRICTFILL=strictfill, OVERPLOT=overplot, MASKFILL=maskfill $ 
    177         , WDEPTH=wdepth, REALSECTION=realsection $ 
     190        , STRICTFILL=strictfill, OVERPLOT=overplot $ 
     191        , WDEPTH=wdepth, REALSECTION=realsection, MASKFILL=maskfill, MASKDTA = maskdta $ 
    178192        , _EXTRA=ex 
    179193; 
     
    197211; 
    198212  if n_elements(contour) ne 4 THEN saveboxparam, 'boxparam4pltz.dat' 
     213  key_partialstep = keyword_set(key_partialstep) * (1b - keyword_set(no_partialstep))  
    199214;-------------------------------------------------------------- 
    200215;  Reading of the field. 
     
    262277; to draw from bottom to top (avoid using cell_fill) 
    263278  z2d = reverse(z2d, 2) 
     279  szmsk = size(mask, /dimensions) 
     280  IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1])  
     281  IF keyword_set(maskdta) THEN mask = byte(fitintobox(maskdta)) 
    264282;----------------------------------------------------------------------------- 
    265283; Determination of the mi:min and of the ma:max of z2d in the same way 
     
    355373    if keyword_set(nan) then trinan = triangule(masknan, /basic, coinmonte = coinmontenan, coindescend = coindescendnan) 
    356374    maskorg = mask 
    357     decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection 
     375    decoupeterre, mask, glammsk, gphimsk, gdepmsk, type = type, WDEPTH = wdepth, REALSECTION = realsection, MASKDTA = maskdta 
    358376    axis4pltz, type, mask, glammsk, gphimsk, gdepmsk, XXAXIS = xmask, ZZAXIS = zmask, SIN = sin, ZRATIO = zratio, ZOOM = zoom, PROFMAX = profmax, PROFMIN = profmin, _extra = ex 
     377    szmsk = size(mask, /dimensions) 
     378    IF keyword_set(nomask) THEN mask = replicate(1b, szmsk[0], szmsk[1])  
    359379  ENDIF ELSE BEGIN 
    360380    xmask = xxaxis 
  • trunk/SRC/Utilities/fitintobox.pro

    r375 r388  
    8989; @param lastz {in}{optional}{default=define by <pro>grille</pro>} 
    9090; 
    91 ; @keyword WDEPTH 
    92 ; To specify that we are at W level 
     91; @keyword GRID {default=vargrid defined in <pro>cm_4data</pro>}  
     92; To specify on which grid are located the data, see <pro>grille</pro> 
     93; 
     94; @keyword WDEPTH {default=0} 
     95; To specify that we are at W level, see <pro>grille</pro> 
    9396; 
    9497; @returns 
     
    120123;- 
    121124FUNCTION fitintobox, field, nx, ny, nz, firstx, firsty $ 
    122                    , firstz, lastx, lasty, lastz, WDEPTH=wdepth 
     125                     , firstz, lastx, lasty, lastz, GRID = GRID, WDEPTH = wdepth 
    123126; 
    124127  compile_opt idl2, strictarrsubs 
     
    132135  arr = litchamp(field) 
    133136  IF n_params() EQ 1 THEN grille, -1, -1, -1, -1, nx, ny, nz $ 
    134     , firstx, firsty, firstz, lastx, lasty, lastz, WDEPTH = wdepth 
     137    , firstx, firsty, firstz, lastx, lasty, lastz, GRID = GRID, WDEPTH = wdepth 
    135138;-------------------------------------------------------------- 
    136139;-------------------------------------------------------------- 
Note: See TracChangeset for help on using the changeset viewer.