source: trunk/SRC/ToBeReviewed/CALCULS/level2mask.pro @ 325

Last change on this file since 325 was 325, checked in by pinsard, 17 years ago

modification of some headers (+some corrections) to prepare usage of the new idldoc

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.4 KB
RevLine 
[2]1;+
2;
[142]3; @file_comments
[231]4; Allow to pass from a 2d sill level array to the 3d mask array with 1s in
[142]5; levels above the sill level and 0s below (and on it)
[2]6;
[231]7; @categories
[157]8; Without loop
[2]9;
[163]10; @param TAB {in}{required}{type=2d array}
[266]11; 2d level array of sill level (or a structure respecting <pro>litchamp</pro>
12; criterions)
[2]13;
[142]14; @returns
15; It is a 3d array containing the mask associated to the 2d sill level array
[2]16;
[142]17; @uses
18; common.pro
[2]19;
[142]20; @history
[157]21; Sebastien Masson (smasson\@lodyc.jussieu.fr)
[2]22;                       17/6/1999
[266]23; Sept 2004: boundary level have 0 values and not 1 (as it was
[25]24; explained before in the header). see:
25; print, array_equal(niveau, total(level2mask(niveau),3))
26;
[142]27; @version
28; $Id$
29;
[2]30;-
31FUNCTION level2mask, tab
[114]32;
33  compile_opt idl2, strictarrsubs
34;
[142]35   tempsun = systime(1)         ; To key_performance
[2]36@common
37;------------------------------------------------------------
[142]38; Reading of the input field and recovery of the size of the used subdomain
[2]39;------------------------------------------------------------
40   niveaux = litchamp(tab)
[25]41   grille,maskterre, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz
[2]42;---------------------------------------------------------------
[142]43; verification of the coherence between the array's size and the defined by domdef domain
[2]44;---------------------------------------------------------------
45   IF ny EQ 1 THEN niveaux = reform(niveaux, nx, ny, /over)
46   taille = size(niveaux)
47   if taille[0] NE 2 then return, report('le champ en entree doit contenir un tableau 2d')
48   case 1 of
[25]49      taille[1] eq jpi and taille[2] eq jpj:niveaux=niveaux[firstx:lastx, firsty:lasty]
[2]50      taille[1] eq  nx and taille[2] eq  ny:
51      else:return, report('Probleme d''adequation entre les tailles du domaine et celle du champ.')
52   endcase
53;------------------------------------------------------------
54;------------------------------------------------------------
[142]55; We transform the 2d leval array in 3d mask array
[2]56;------------------------------------------------------------
57   mask = reform( niveaux[*]#(1./(indgen(nz)+1)), nx, ny, nz )
58   mask = floor(temporary(mask)) < 1
59   mask = temporary(mask)*temporary(maskterre)
60;------------------------------------------------------------
61;------------------------------------------------------------
62;------------------------------------------------------------
[231]63   if keyword_set(key_performance) THEN print, 'temps level2mask', systime(1)-tempsun
[2]64   return, mask
65end
Note: See TracBrowser for help on using the repository browser.