Changeset 142 for trunk/SRC/ToBeReviewed/CALCULS/depth2level.pro
- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/CALCULS/depth2level.pro
r134 r142 3 3 ;------------------------------------------------------------ 4 4 ;+ 5 ; NAME: depth2level6 5 ; 7 ; PURPOSE: permet de passer d''un tableau 2d de profondeur au tableau8 ; 2d correspondant de niveaux.6 ; @file_comments 7 ; Allows to pass from a 2d depth array to a corresponding 2d level array. 9 8 ; 10 ; CATEGORY: SANS BOUCLE 9 ; @categories 10 ; Without loop 11 11 ; 12 ; CALLING SEQUENCE: res=depth2level(depth2d) 12 ; @param TAB 13 ; 2d depth array (or a structure respecting litchamp critrions) 13 14 ; 14 ; INPUTS: depth2d tableau 2d de profondeur (ou une structure repondant15 ; aux criteres de litchamp)15 ; @keyword UPPER 16 ; (activated by default) We select the level just above the depth 16 17 ; 17 ; KEYWORD PARAMETERS: 18 ; @keyword LOWER 19 ; We select the level just below the depth 18 20 ; 19 ; /UPPER: (active par defaut) on selectionne le niveau20 ; directement au dessus de la profondeur21 ; @keyword CLOSER 22 ; We select the depth's closer level 21 23 ; 22 ; /LOWER: on selectionne le niveau directement au dessous de la23 ; profondeur24 ; @keyword NOMASK 25 ; To do not mask land points 24 26 ; 25 ; /CLOSER: on selectionne le niveau le plus proche de la26 ; profondeur27 ; @returns 28 ; It is a 2d array containing level's values. 27 29 ; 28 ; /NOMASK: pour ne pas masquer les points terres 30 ; @uses 31 ; common.pro 29 32 ; 30 ; OUTPUTS: un tableau 2d contenant les valeurs des niveaux. 33 ; @restrictions 34 ; For depthes out of gdep's values, the value !values.f_nan is sent back. 35 ; if the depth is superior to this one of the bottom, we send back jpk-1 in 36 ; the upper case, and !values.f_nan in the lower case. 31 37 ; 32 ; COMMON BLOCKS:common.pro 33 ; 34 ; SIDE EFFECTS:pour les profondeurs hors des valeurs de gdep, la 35 ; valeur !values.f_nan est retournee. 36 ; Si la profondeur est superieur a celle du fond, on retourne 37 ; jpk-1dans le cas upper, et !values.f_nan ds le cas lower. 38 ; 39 ; RESTRICTIONS: 40 ; 41 ; EXAMPLE: 42 ; 43 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 38 ; @history 39 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 44 40 ; 17/6/1999 45 41 ; 15/6/2000 accepte !values.f_nan 42 ; 43 ; @version 44 ; $Id$ 46 45 ;- 47 46 ;------------------------------------------------------------ … … 53 52 compile_opt idl2, strictarrsubs 54 53 ; 55 tempsun = systime(1) ; pour key_performance54 tempsun = systime(1) ; for key_performance 56 55 @common 57 56 ;------------------------------------------------------------ … … 59 58 if keyword_set(lower) THEN upper = 0 60 59 ;------------------------------------------------------------ 61 ; lecture du champ d''entree et recuperation de la taille du sous 62 ; domaine utilise 60 ; Reading of the input field and recuperation of the used subdomain's size 63 61 ;------------------------------------------------------------ 64 62 in = litchamp(tab) 65 63 grille,mask,-1,-1,gdep,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 66 64 ;--------------------------------------------------------------- 67 ; verification de la coherence entre la taille du tableau et le domaine definit par domdef65 ; Verification of the coherence between array's size and the defined by domdef domain 68 66 ;--------------------------------------------------------------- 69 67 IF ny EQ 1 THEN in = reform(in, nx, ny, /over) … … 78 76 ;------------------------------------------------------------ 79 77 ;------------------------------------------------------------ 80 ; vire les points a!values.f_nan78 ; delete points at !values.f_nan 81 79 notanumber = where(finite(in, /nan) EQ 1) 82 80 if notanumber[0] NE -1 then in[notanumber] = 0 83 81 ;------------------------------------------------------------ 84 ; on transforme le tableau 2d de profondeur en tableau 2d de niveaux 85 ; correspondant aux profondeurs 82 ; We transform the 2d deth value in a 2d array of levels corresponding to depthes 86 83 ;------------------------------------------------------------ 87 ; on passe en tableaux qui ont la taille des tableaux 3d84 ; We go on array who have the size of 3d arrays 88 85 prof=replicate(1,nx*ny)#gdep[firstz:lastz] 89 86 in = in[*]#replicate(1, nz) … … 99 96 IF notvalid[0] NE -1 THEN levels[notvalid] = !values.f_nan 100 97 101 ; si closer est active98 ; If closer is activated 102 99 if keyword_set(closer) then begin 103 100 test = [ [[litchamp(tab)-level2depth(levels)]] $ … … 108 105 endif 109 106 ;------------------------------------------------------------ 110 ; on replace les points a!values.f_nan107 ; We put back points at !values.f_nan 111 108 if notanumber[0] NE -1 then levels[notanumber] = !values.f_nan 112 ; on masque les points terres avalmask109 ; We mask land points at valmask 113 110 if NOT keyword_set(nomask) then begin 114 111 if n_elements(valmask) EQ 0 then valmask = 1e20
Note: See TracChangeset
for help on using the changeset viewer.