Ignore:
Timestamp:
07/21/06 14:47:49 (18 years ago)
Author:
navarro
Message:

english and nicer header (2a)

Location:
trunk/SRC/ToBeReviewed/CALCULS
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/ToBeReviewed/CALCULS/curl.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:curl 
    6 ; 
    7 ; PURPOSE:calcule la composante verticale du rotationnel d''un champ 
    8 ; de vecteur horizontaux 
    9 ; 
    10 ; CATEGORY:calcule sur les matrices 
    11 ; 
    12 ; CALLING SEQUENCE:res=curl(u,v) 
    13 ; 
    14 ; INPUTS: 
    15 ;       u et v deux matrices representant les coordonnes d''un 
    16 ;       champ de vecteur 
    17 ; 
    18 ; KEYWORD PARAMETERS: 
    19 ; 
    20 ; OUTPUTS:res: une matrice 2d 
    21 ; 
    22 ; COMMON BLOCKS: 
    23 ;       common.pro 
    24 ; 
    25 ; SIDE EFFECTS: 
    26 ; 
    27 ; RESTRICTIONS: 
    28 ; les matrices u et v peuvent de 2 a 4 dimensions. 
    29 ; attention pour distinger les differents configurations de u et v 
    30 ; (xy, xyz, xyt, xyzt), on regarde la variable du common  
    31 ;        -time qui contient le calendrier en jour julien d''IDL auquel 
    32 ;        se rapportent u et v ansi que la variable  
    33 ;        -jpt qui est le nombre de pas de temps a considerer ds time. 
    34 ; les tableaux u et v sont decoupes sur le meme domaine 
    35 ; geographique. A cause du decalage des grilles T, U, V et F il est 
    36 ; possiible que ces 2 tableaux n''aient pas la meme taille et se 
    37 ; repportent a des indices differents. Si tel est le cas les tableaux 
    38 ; sont redecoupes sur les indices qu'ils ont en commun et le dommaine 
    39 ; est redefinit pour qu'il colle a ces indices communs. 
    40 ; pour eviter ces redecoupes utiliser le mot cles /memeindice ds 
    41 ; domdef.pro 
    42 ; 
    43 ; 
    44 ; les points sur le bord du dessin sont mis a !values.f_nan  
    45 ; 
    46 ; EXAMPLE: 
    47 ; 
    48 ; MODIFICATION HISTORY:Guillaume Roullet (grlod@ipsl.jussieu.fr) 
     5; 
     6; @file_comments 
     7; Calculate the vertical component of the curl of a field of horizontal vectors 
     8; 
     9; @categories 
     10; Calculation on matrixes 
     11;  
     12; @param UU 
     13; Matrix representing coordinates of a field of vectors 
     14; 
     15; @param VV  
     16; Matrix representing coordinates of a field of vectors 
     17; 
     18; @returns RES 
     19; A 2d matrix 
     20; 
     21; @uses 
     22; common.pro 
     23; 
     24; @restrictions 
     25; U and V matrixes can be 2 or 4d. 
     26; Beware, to discern differents configuration of U and V (xy, xyz, xyt, xyzt),  
     27; we look at the variable of the common  
     28;        -time which contain the calendar in IDL julian days to which U and  
     29; V refered to, in the same way as the variable  
     30;        -jpt which is the number of time's step to consider in time. 
     31; U and V arrays ae cut in the same geographic domain. Because of the gap of  
     32; T, U, V and F grids, it is possible that these two arrays hase not the same  
     33; size and refered to different indexes. In this case, arrays are recut on  
     34; common indexesand the domain is redifined to match with these common  
     35; indexes. To avoid these recuts, use the keyword /memeindice in domdef.pro 
     36; 
     37; 
     38; Points on the drawing edge are at !values.f_nan  
     39; 
     40; @history  
     41; Guillaume Roullet (grlod@ipsl.jussieu.fr) 
    4942;  
    5043;                      Sebastien Masson (smasson@lodyc.jussieu.fr) 
     
    5346;                      21/5/1999: valeurs manquantes a !values.f_nan 
    5447;periodicite  
     48;  
     49; @version 
     50; $Id$ 
     51; 
    5552;- 
    5653;------------------------------------------------------------ 
     
    6259; 
    6360@common 
    64    tempsun = systime(1)         ; pour key_performance 
     61   tempsun = systime(1)         ; To key_performance 
    6562; 
    6663   IF finite(glamu[0])*finite(gphiu[0])*finite(glamv[0])*finite(gphiv[0]) EQ 0 THEN $ 
     
    7673 
    7774;------------------------------------------------------------ 
    78 ; on trouve les points que u et v ont en communs 
     75; We find common points between U and V 
    7976;------------------------------------------------------------ 
    8077   indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] 
     
    9592         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
    9693;------------------------------------------------------------ 
    97 ; extraction de u et v sur le domaine qui convient 
     94; extraction of U and V on the appropriated domain 
    9895;------------------------------------------------------------ 
    9996         case 1 of 
     
    117114         endcase 
    118115;------------------------------------------------------------ 
    119 ; calcul du rotationnel 
     116; calculation of the curl 
    120117;------------------------------------------------------------ 
    121118         coefu = (e1u[indice2d])[*]#replicate(1, nzt) 
     
    142139         psi = tabf*psi 
    143140;------------------------------------------------------------ 
    144 ; mise a !values.f_nan de la bordure 
     141; Edging put at !values.f_nan 
    145142;------------------------------------------------------------ 
    146143         if NOT keyword_set(key_periodic)  OR nx NE jpi then begin 
     
    155152         if terref[0] NE -1 then psi[temporary(terref)] = valmask 
    156153;------------------------------------------------------------ 
    157 ; pour le trace graphique 
     154; For the graphic drawing 
    158155;------------------------------------------------------------ 
    159156         domdef, (glagmt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, gridtype = ['t', 'f'] 
     
    171168         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
    172169;------------------------------------------------------------ 
    173 ; extraction de u et v sur le domaine qui convient 
     170; extraction of U and V on the appropriated domain 
    174171;------------------------------------------------------------ 
    175172         case 1 of 
     
    196193         endcase 
    197194;---------------------------------------------------------------------------- 
    198 ; calcul du rotationnel 
     195; Calculation of the curl 
    199196;---------------------------------------------------------------------------- 
    200197         coefu = e1u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] 
     
    214211         tabf = reform(tabf, nx, ny, jpt, /over) 
    215212;------------------------------------------------------------ 
    216 ; calcul du rotationnel 
     213; Calculation of the curl 
    217214;------------------------------------------------------------ 
    218215         zu = u*temporary(coefu) 
     
    222219         psi = tabf*psi 
    223220;------------------------------------------------------------ 
    224 ; mise a !values.f_nan de la bordure 
     221; extraction of U and V on the appropriated domain 
    225222;------------------------------------------------------------ 
    226223         if NOT keyword_set(key_periodic) OR nx NE jpi then begin 
     
    255252         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
    256253;------------------------------------------------------------ 
    257 ; extraction de u et v sur le domaine qui convient 
    258254;------------------------------------------------------------ 
    259255         case 1 of 
     
    278274         endcase 
    279275;------------------------------------------------------------ 
    280 ; calcul du rotationnel 
     276; Calculation of the curl 
    281277;------------------------------------------------------------ 
    282278         coefu = e1u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] 
     
    295291 
    296292;------------------------------------------------------------ 
    297 ; mise a !values.f_nan de la bordure 
     293; Edging put at !values.f_nan 
    298294;------------------------------------------------------------ 
    299295         if  NOT keyword_set(key_periodic) OR nx NE jpi then begin 
     
    308304         if terref[0] NE -1 then psi[temporary(terref)] = valmask 
    309305;------------------------------------------------------------ 
    310 ; pour le trace graphique 
     306; for the graphic drawing 
    311307;------------------------------------------------------------ 
    312308         domdef, (glamt[indice2d])[0, 0], (glamf[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphif[indice2d])[0, ny-1], vert1, vert2, gridtype = ['t', 'f'] 
  • trunk/SRC/ToBeReviewed/CALCULS/depth2floatlevel.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:depth2floatlevel 
     5; @file_comments 
     6; Rather comparable to depth2level but here, the calculated level is in float.  
     7; For example, the level 5.4 correspond to a depth equal  
     8; to gdep[5]+.4*(gdep[6]-gdep[5]) 
    69; 
    7 ; PURPOSE: assez comparable a depth2level mais ici le niveau calcule 
    8 ; est en float. Par ex le niveau 5.4 correspond a une profondeur egale 
    9 ; a gdep[5]+.4*(gdep[6]-gdep[5]) 
     10; @categories  
     11; Without loop. 
    1012; 
    11 ; CATEGORY: SANS BOUCLE 
     13; @param TAB {in}{required} 
     14; 2d depth array (or a structure respecting litchamp criterions) 
    1215; 
    13 ; CALLING SEQUENCE:res=depth2floatlevel(depth2d) 
    14 ;  
    15 ; INPUTS: depth2d tableau 2d de profondeur (ou une structure repondant 
    16 ; aux criteres de litchamp) 
     16; @keyword NOMASK 
     17; To do not mask land points 
    1718; 
    18 ; KEYWORD PARAMETERS:  
    19 ;       /NOMASK: pour ne pas masquer les points terres 
     19; @returns 
     20; An 2d array of float containing levels's values. 
    2021; 
    21 ; OUTPUTS: un tableau 2d de float contenant les valeurs des niveaux. 
     22; @uses 
     23; common.pro 
    2224; 
    23 ; COMMON BLOCKS:common.pro 
     25; @restrictions 
     26; Accept values at !values.f_nan and mask land points at valmask. 
    2427; 
    25 ; SIDE EFFECTS:accepte les vcaleurs a !values.f_nan et masque les 
    26 ; points terres a valmask. 
    27 ; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; EXAMPLE: 
    31 ; 
     28; @examples 
    3229;    IDL> a=(jpk-1)/(1.*jpi*jpj)*findgen(jpi,jpj) 
    3330;    IDL> plt, 1e6*(a-floatlevel2depth(depth2floatlevel(a))),/nocontour 
     
    3532;  ->champ nul a 1e-6 pres 
    3633; 
    37 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     34; @history  
     35; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3836;                      15/06/2000 
     37;  
     38; @version 
     39; $Id$ 
     40; 
    3941;- 
    4042;------------------------------------------------------------ 
     
    4547  compile_opt idl2, strictarrsubs 
    4648; 
    47    tempsun = systime(1)         ; pour key_performance 
     49   tempsun = systime(1)         ; for key_performance 
    4850@common 
    4951;------------------------------------------------------------ 
     
    5557   levellow = depth2level(depthin, /lower, /nomask) 
    5658   depthlow = level2depth(levellow, /nomask) 
    57 ; calcule de la distance depthlow-depthup et gestion du cas ou cette 
    58 ; distance est nulle ou egale a !values.f_nan 
     59; calculate the distance depthlow-depthup and management of the case  
     60; of this distance is null or eqal to !values.f_nan 
    5961   divi = depthlow-depthup 
    6062   nan = where(finite(divi) EQ 0) 
     
    6264   nan = where(divi EQ 0) 
    6365   if nan[0] NE -1 then divi[nan] = !values.f_nan 
    64 ; calcule du resultat 
     66; calculation of the result 
    6567   res = levelup+(depthin-depthup)/divi 
    66 ; on masque les points terre a valmask 
     68; We mask land point at valmask 
    6769   if NOT keyword_set(nomask) then begin 
    6870      grille,mask 
  • trunk/SRC/ToBeReviewed/CALCULS/depth2level.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: depth2level 
    65; 
    7 ; PURPOSE: permet de passer d''un tableau 2d de profondeur au tableau 
    8 ; 2d correspondant de niveaux. 
     6; @file_comments  
     7; Allows to pass from a 2d depth array to a corresponding 2d level array. 
    98; 
    10 ; CATEGORY: SANS BOUCLE 
     9; @categories 
     10; Without loop 
    1111; 
    12 ; CALLING SEQUENCE: res=depth2level(depth2d) 
     12; @param TAB  
     13; 2d depth array (or a structure respecting litchamp critrions) 
    1314; 
    14 ; INPUTS: depth2d tableau 2d de profondeur (ou une structure repondant 
    15 ; aux criteres de litchamp) 
     15; @keyword UPPER 
     16; (activated by default) We select the level just above the depth 
    1617; 
    17 ; KEYWORD PARAMETERS: 
     18; @keyword LOWER 
     19; We select the level just below the depth  
    1820; 
    19 ;      /UPPER: (active par defaut) on selectionne le niveau 
    20 ;      directement au dessus de la profondeur 
     21; @keyword CLOSER  
     22; We select the depth's closer level  
    2123; 
    22 ;      /LOWER: on selectionne le niveau directement au dessous de la 
    23 ;      profondeur  
     24; @keyword NOMASK  
     25; To do not mask land points 
    2426; 
    25 ;      /CLOSER: on selectionne le niveau le plus proche de la 
    26 ;      profondeur  
     27; @returns  
     28; It is a 2d array containing level's values. 
    2729; 
    28 ;      /NOMASK: pour ne pas masquer les points terres 
     30; @uses 
     31; common.pro 
    2932; 
    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. 
    3137; 
    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) 
    4440;                       17/6/1999 
    4541;                       15/6/2000 accepte !values.f_nan 
     42; 
     43; @version 
     44; $Id$ 
    4645;- 
    4746;------------------------------------------------------------ 
     
    5352  compile_opt idl2, strictarrsubs 
    5453; 
    55    tempsun = systime(1)         ; pour key_performance 
     54   tempsun = systime(1)         ; for key_performance 
    5655@common 
    5756;------------------------------------------------------------ 
     
    5958   if keyword_set(lower) THEN upper = 0 
    6059;------------------------------------------------------------ 
    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 
    6361;------------------------------------------------------------ 
    6462   in = litchamp(tab) 
    6563   grille,mask,-1,-1,gdep,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 
    6664;--------------------------------------------------------------- 
    67 ; verification de la coherence entre la taille du tableau et le domaine definit par domdef 
     65; Verification of the coherence between array's size and the defined by domdef domain 
    6866;--------------------------------------------------------------- 
    6967   IF ny EQ 1 THEN in = reform(in, nx, ny, /over) 
     
    7876;------------------------------------------------------------ 
    7977;------------------------------------------------------------ 
    80 ; vire les points a !values.f_nan 
     78; delete points at !values.f_nan 
    8179   notanumber = where(finite(in, /nan) EQ 1) 
    8280   if notanumber[0] NE -1 then in[notanumber] = 0 
    8381;------------------------------------------------------------ 
    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 
    8683;------------------------------------------------------------ 
    87 ; on passe en tableaux qui ont la taille des tableaux 3d 
     84; We go on array who have the size of 3d arrays 
    8885   prof=replicate(1,nx*ny)#gdep[firstz:lastz]  
    8986   in = in[*]#replicate(1, nz) 
     
    9996   IF notvalid[0] NE -1 THEN levels[notvalid] = !values.f_nan 
    10097 
    101 ; si closer est active 
     98; If closer is activated 
    10299   if keyword_set(closer) then begin 
    103100      test = [ [[litchamp(tab)-level2depth(levels)]] $ 
     
    108105   endif 
    109106;------------------------------------------------------------ 
    110 ; on replace les points a !values.f_nan 
     107; We put back points at !values.f_nan 
    111108   if notanumber[0] NE -1 then levels[notanumber] = !values.f_nan 
    112 ; on masque les points terres a valmask 
     109; We mask land points at valmask 
    113110   if NOT keyword_set(nomask) then begin 
    114111      if n_elements(valmask) EQ 0 then valmask = 1e20 
  • trunk/SRC/ToBeReviewed/CALCULS/depth2mask.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: depth2mask 
    65; 
    7 ; PURPOSE: permet de passer d''un tableau 2d de profondeur seuil au 
    8 ; tableau 3d de mask avec des 1 ds les niveaux au dessus de la 
    9 ; profondeur seuil et des 0 en dessous. 
     6; @file_comments  
     7; Allows to pass from a 2d depth sill array to a 3d array of mask  
     8; with one of levels above the sill depth and 0s below. 
    109; 
    11 ; CATEGORY: SANS BOUCLE 
     10; @categories 
     11; Without loop 
    1212; 
    13 ; CALLING SEQUENCE: res=depth2mask(depht2d) 
     13; @param TAB  
     14; 2d sill depth array (or a structure respecting litchamp critrions) 
    1415; 
    15 ; INPUTS: depht2d tableau 2d de profondeur seuil (ou une structure repondant 
    16 ; aux criteres de litchamp) 
    17 ; 
    18 ; KEYWORD PARAMETERS: 
    19 ; 
    20 ;      /UPPER: (active par defaut) on selectionne le niveau 
    21 ;      directement au dessus de la profondeur 
    22 ; 
    23 ;      /LOWER: on selectionne le niveau directement au dessous de la 
    24 ;      profondeur  
    25 ; 
    26 ;      /CLOSER: on selectionne le niveau le plus proche de la 
    27 ;      profondeur  
    28 ; 
    29 ; OUTPUTS: un tableau 3d contenant le mask associe au tableau 2d de 
     16; @keyword _EXTRA 
     17; used to pass your keywords 
     18;  
     19; @returns 
     20; It is a 3d array containing the mas associated to the 2d sill depth array 
    3021; profondeurs seuil 
    3122; 
    32 ; COMMON BLOCKS: 
    33 ;       common.pro 
     23; @uses 
     24; common.pro 
    3425; 
    35 ; SIDE EFFECTS: 
     26; @history 
     27; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     28;                       17/6/1999 
    3629; 
    37 ; RESTRICTIONS: 
     30; @version 
     31; $Id$ 
    3832; 
    39 ; EXAMPLE: 
    40 ; 
    41 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
    42 ;                       17/6/1999 
    4333;- 
    4434;------------------------------------------------------------ 
     
    5040  compile_opt idl2, strictarrsubs 
    5141; 
    52    tempsun = systime(1)         ; pour key_performance 
     42   tempsun = systime(1)         ; For key_performance 
    5343@common 
    5444;------------------------------------------------------------ 
    55 ; on transforme le tableau 2d de profondeur en tableau 2d de niveaux 
    56 ; correspondant aux profondeurs 
     45; We transform the 2d deth value in a 2d array of levels corresponding to depthes 
    5746;------------------------------------------------------------ 
    5847   niveaux = depth2level(tab, _extra = ex) 
    5948   IF niveaux[0] EQ -1 THEN return,  -1 
    6049;------------------------------------------------------------ 
    61 ; on transforme le tableau 2d de niveaux en tableau 3d de mask 
     50; We transform the 2d array in a 3d array of mask 
    6251;------------------------------------------------------------ 
    6352   mask = level2mask(niveaux) 
  • trunk/SRC/ToBeReviewed/CALCULS/determ2.pro

    r134 r142  
    11;+ 
    2 ; NAME:determ2 
    32; 
    4 ; PURPOSE: computes the determinant of n 2 by 2 arrays 
     3; file_comments 
     4; computes the determinant of n 2 by 2 arrays 
     5; Z2DS is an 2*2*n array 
    56; 
    6 ; CATEGORY: no DO loops and better accuracy 
     7; @categories  
     8; Without loop 
     9;  
     10; @param A {in}{required} 
     11; n element array 
     12; Defined as z2ds[0, 0, *] = z1d00 
    713; 
    8 ; CALLING SEQUENCE: 2 cases: 
    9 ;     res = determ2(z2ds) 
    10 ;     res = determ2(z1d00,z1d01,z1d10,z1d11) 
     14; @param B {in}{required} 
     15; n element array 
     16; Defined as z2ds[0, 1, *] = z1d01 
    1117; 
    12 ; INPUTS: 
    13 ;     z2ds: an 2*2*n array 
    14 ;     or 
    15 ;     z1d00,z1d01,z1d10,z1d11: the four n elements arrays 
    16 ;     defined as: 
    17 ;              z2ds[0, 0, *] = z1d00 
    18 ;              z2ds[0, 1, *] = z1d01 
    19 ;              z2ds[1, 0, *] = z1d10 
    20 ;              z2ds[1, 1, *] = z1d11 
     18; @param C {in}{required} 
     19; n element array 
     20; Defined as z2ds[1, 0, *] = z1d10 
    2121; 
    22 ; OUTPUTS: n elements array, the determinent of each 2*2 arrrays 
     22; @param D {in}{required} 
     23; n element array 
     24; Defined as z2ds[1, 1, *] = z1d11 
    2325; 
    24 ; EXAMPLE: 
     26; @returns  
     27; n elements array, the determinent of each 2*2 arrrays 
    2528; 
     29; @examples 
    2630; a=findgen(2,2,5) 
    2731; print, determ2(a) 
    2832; FOR i=0,4 DO print, determ(a[*,*,i]) ; IDL solution 
    2933; 
    30 ; MODIFICATION HISTORY: 
     34; @history 
    3135;           S. Masson (smasson@lodyc.jussieu.fr) 
    3236;           July 11th, 2002 
     37; 
     38; @version 
     39; $Id$ 
     40; 
    3341;- 
    3442FUNCTION determ2, a, b, c, d 
  • trunk/SRC/ToBeReviewed/CALCULS/determ3.pro

    r134 r142  
    11;+ 
    2 ; NAME:determ3 
    32; 
    4 ; PURPOSE: computes the determinant of n 3 by 3 arrays 
     3; @file_comments 
     4; computes the determinant of n 3 by 3 arrays. 
     5; Z2DS is an 3*3*n array 
    56; 
    6 ; CATEGORY: no DO loops and better accuracy 
     7; @categories 
     8; Without loop 
    79; 
    8 ; CALLING SEQUENCE:2 cases: 
    9 ;     res = determ2(z2ds) 
    10 ;     res = determ2(in00, in01, in02, in10, in11, in12, in20, in21, in22) 
     10; @param IN00 {in}{required} 
     11; It is an n element array 
     12; defined by in00 = z2ds[0, 0, *] 
    1113; 
    12 ; INPUTS: 
    13 ;     z2ds: an 3*3*n array 
    14 ;     or 
    15 ;     in00, in01, in02, in10, in11, in12, in20, in21, in22: the nine n 
    16 ;     elements arrays defined as: 
    17 ;           in00 = z2ds[0, 0, *] 
    18 ;           in01 = z2ds[0, 1, *] 
    19 ;           in02 = z2ds[0, 2, *] 
    20 ;           in10 = z2ds[1, 0, *] 
    21 ;           in11 = z2ds[1, 1, *] 
    22 ;           in12 = z2ds[1, 2, *] 
    23 ;           in20 = z2ds[2, 0, *] 
    24 ;           in21 = z2ds[2, 1, *] 
    25 ;           in22 = z2ds[2, 2, *] 
     14; @param IN01 {in}{required} 
     15; It is an n element array 
     16; defined by in01 = z2ds[0, 1, *] 
    2617; 
    27 ; OUTPUTS: n elements array, the determinent of each 3*3 arrrays 
     18; @param IN02 {in}{required} 
     19; It is an n element array 
     20; defined by in02 = z2ds[0, 2, *] 
    2821; 
    29 ; EXAMPLE: 
     22; @param IN10 {in}{required} 
     23; It is an n element array 
     24; defined by in10 = z2ds[1, 0, *] 
    3025; 
     26; 
     27; @param IN11 {in}{required} 
     28; It is an n element array 
     29; defined by in11 = z2ds[1, 1, *] 
     30; 
     31; 
     32; @param IN12 {in}{required} 
     33; It is an n element array 
     34; defined by in12 = z2ds[1, 2, *] 
     35; 
     36; 
     37; @param IN20 {in}{required} 
     38; It is an n element array 
     39; defined by in20 = z2ds[2, 0, *] 
     40; 
     41; 
     42; @param IN21 {in}{required} 
     43; It is an n element array 
     44; defined by in21 = z2ds[2, 1, *] 
     45; 
     46; 
     47; @param IN22 {in}{required} 
     48; It is an n element array 
     49; defined by in22 = z2ds[2, 2, *] 
     50; 
     51; @returns  
     52; n elements array, the determinent of each 3*3 arrrays 
     53; 
     54; @examples 
    3155; a=findgen(3,3,5) 
    3256; print, determ3(a^2) 
    3357; FOR i=0,4 DO print, determ((a[*,*,i])^2) ; IDL solution 
    3458; 
    35 ; MODIFICATION HISTORY: 
     59; @history 
    3660;           S. Masson (smasson@lodyc.jussieu.fr) 
    3761;           July 11th, 2002 
     62; 
     63; @version 
     64; $Id$ 
     65; 
    3866;- 
    3967FUNCTION determ3, in00, in01, in02, in10, in11, in12, in20, in21, in22 
  • trunk/SRC/ToBeReviewed/CALCULS/div.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:div 
    6 ; 
    7 ; PURPOSE:calcule la divergence d'un champ 2D 
    8 ; 
    9 ; CATEGORY:calcule sur les matrices 
    10 ; 
    11 ; CALLING SEQUENCE:res=div(u,v) 
    12 ; 
    13 ; INPUTS: 
    14 ;       u et v deux matrices representant les coordonnes d''un 
    15 ;       champ de vecteur 
    16 ; 
    17 ; KEYWORD PARAMETERS: 
    18 ; 
    19 ; OUTPUTS:res: une matrice 2d 
    20 ; 
    21 ; COMMON BLOCKS: 
    22 ;       common.pro 
    23 ; 
    24 ; SIDE EFFECTS: 
    25 ; 
    26 ; RESTRICTIONS: 
    27 ; les matrices u et v peuvent de 2 a 4 dimensions. 
    28 ; attention pour distinger les differents configurations de u et v 
    29 ; (xy, xyz, xyt, xyzt), on regarde la variable du common  
    30 ;        -time qui contient le calendrier en jour julien d''IDL auquel 
    31 ;        se rapportent u et v ansi que la variable  
    32 ;        -jpt qui est le nombre de pas de temps a considerer ds time. 
    33 ; les tableaux u et v sont decoupes sur le meme domaine 
    34 ; geographique. A cause du decalage des grilles T, U, V et F il est 
    35 ; possiible que ces 2 tableaux n''aient pas la meme taille et se 
    36 ; repportent a des indices differents. Si tel est le cas les tableaux 
    37 ; sont redecoupes sur les indices qu'ils ont en commun et le dommaine 
    38 ; est redefinit pour qu'il colle a ces indices communs. 
    39 ; pour eviter ces redecoupes utiliser le mot cles /memeindice ds 
    40 ; domdef.pro 
    41 ; 
    42 ; les points sur le bord du dessin sont mis a !values.f_nan 
    43 ; 
    44 ; EXAMPLE: 
    45 ; 
    46 ; MODIFICATION HISTORY:Guillaume Roullet (grlod@ipsl.jussieu.fr) 
     5; 
     6; @file_comments 
     7; calculation of the divergence of a 2d field 
     8; 
     9; @categories 
     10; Calculation on matrixes 
     11; 
     12; @param UU  
     13; Matrix representing coordinates of a field of vectors 
     14; 
     15; @param VV  
     16; Matrix representing coordinates of a field of vectors 
     17; 
     18; @returns RES 
     19; A 2d matrix 
     20; 
     21; @uses 
     22; common.pro 
     23; 
     24; @restrictions 
     25; U and V matrixes can be 2 or 4d. 
     26; Beware, to discern differents configuration of U and V (xy, xyz, xyt, xyzt),  
     27; we look at the variable of the common  
     28;        -time which contain the calendar in IDL julian days to which U and  
     29; V refered to, in the same way as the variable  
     30;        -jpt which is the number of time's step to consider in time. 
     31; U and V arrays ae cut in the same geographic domain. Because of the gap of  
     32; T, U, V and F grids, it is possible that these two arrays hase not the same  
     33; size and refered to different indexes. In this case, arrays are recut on  
     34; common indexesand the domain is redifined to match with these common  
     35; indexes. To avoid these recuts, use the keyword /memeindice in domdef.pro 
     36; 
     37; 
     38; Points on the drawing edge are at !values.f_nan  
     39; 
     40; 
     41; @history 
     42; Guillaume Roullet (grlod@ipsl.jussieu.fr) 
    4743;                      Creation : printemps 1998 
    4844;                      Sebastien Masson (smasson@lodyc.jussieu.fr) 
    4945;                      adaptation pour marcher avec un domaine reduit 
    50 ;                      12/1/2000 
     46;                      12/1/2000; 
     47; 
     48; @version 
     49; $Id$ 
     50; 
    5151;- 
    5252;------------------------------------------------------------ 
     
    5757  compile_opt idl2, strictarrsubs 
    5858; 
    59    tempsun = systime(1)         ; pour key_performance 
     59   tempsun = systime(1)         ; For key_performance 
    6060@common 
    6161; 
     
    7272 
    7373;------------------------------------------------------------ 
    74 ; on trouve les points que u et v ont en communs 
     74; We find common points between U and V 
    7575;------------------------------------------------------------ 
    7676   indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] 
     
    9191      (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN  
    9292;------------------------------------------------------------ 
    93 ; extraction de u et v sur le domaine qui convient 
     93; extraction of U and V on the appropriated domain 
    9494;------------------------------------------------------------ 
    9595         case 1 of 
     
    139139          *tmask[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt:lastzt] 
    140140;------------------------------------------------------------ 
    141 ; mise a !values.f_nan de la bordure 
     141; Edging put at !values.f_nan 
    142142;------------------------------------------------------------ 
    143143         if  NOT keyword_set(key_periodic) OR nx NE jpi then begin 
     
    154154         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 
    155155;------------------------------------------------------------ 
    156 ; pour le trace graphique 
     156; For the graphic drawing 
    157157;------------------------------------------------------------ 
    158158         vargrid = 'T' 
     
    169169      date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN  
    170170;------------------------------------------------------------ 
    171 ; extraction de u et v sur le domaine qui convient 
     171; extraction of U and V on the appropriated domain 
    172172;------------------------------------------------------------ 
    173173         case 1 of 
     
    191191         endcase 
    192192;------------------------------------------------------------ 
    193 ; calcul de la divergence 
     193; Calculation of the divergence 
    194194;------------------------------------------------------------ 
    195195         zu = e2u[indice2d]*(umask())[indice2d+jpi*jpj*firstzt] 
     
    213213         zdiv = temporary(zdiv)*(zu-shift(zu, 1, 0, 0)+zv-shift(zv, 0, 1, 0)) 
    214214;------------------------------------------------------------ 
    215 ; mise a !values.f_nan de la bordure 
     215; Edging put at !values.f_nan 
    216216;------------------------------------------------------------ 
    217217         if  NOT keyword_set(key_periodic) OR nx NE jpi then begin 
     
    225225         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 
    226226;------------------------------------------------------------ 
    227 ; pour le trace graphique 
     227; for the graphic drawing 
    228228;------------------------------------------------------------ 
    229229         vargrid = 'T' 
     
    250250         indice3d = indice3d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, firstzt] 
    251251;------------------------------------------------------------ 
    252 ; extraction de u et v sur le domaine qui convient 
     252; extraction of U and V on the appropriated domain 
    253253;------------------------------------------------------------ 
    254254         case 1 of 
     
    275275         endcase 
    276276;------------------------------------------------------------ 
    277 ; calcul de la divergence 
     277; Calculation of the divergence 
    278278;------------------------------------------------------------ 
    279279         zu = temporary(u)*e2u[indice2d]*(umask())[indice3d] 
     
    286286         zdiv = temporary(zdiv)*tmask[indice3d]/(e1t[indice2d]*e2t[indice2d]) 
    287287;------------------------------------------------------------ 
    288 ; mise a !values.f_nan de la bordure 
     288; Edging put at !values.f_nan 
    289289;------------------------------------------------------------ 
    290290         if  NOT keyword_set(key_periodic) OR nx NE jpi then begin 
     
    301301         if terre[0] NE -1 then zdiv[temporary(terre)] = valmask 
    302302;------------------------------------------------------------ 
    303 ; pour le trace graphique 
     303; for the graphic drawing 
    304304;------------------------------------------------------------ 
    305305         vargrid = 'T' 
  • trunk/SRC/ToBeReviewed/CALCULS/floatlevel2depth.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:floatlevel2depth 
    65; 
    7 ; PURPOSE: assez comparable a level2depth. C'est la fonction inverse 
    8 ; de depth2floatlevel 
     6; @file_comments  
     7; Rather comparable to level2depth. It is the invert funcion of depth2floatlevel 
    98; 
    10 ; CATEGORY:SANS BOUCLE 
     9; @categories 
     10; Without loop 
    1111; 
    12 ; CALLING SEQUENCE:res=floatlevel2depth(niveau) 
    13 ;  
    14 ; INPUTS: tableau 2d de niveaux seuil (ou une structure repondant aux 
    15 ; criteres de litchamp) 
     12; @param TAB 
     13; 2d array of sill levels (or a structure respecting litchamp criterions) 
    1614; 
    17 ; KEYWORD PARAMETERS: 
    18 ;       /NOMASK: pour ne pas masquer les points terres 
     15; @keyword NOMASK 
     16; To do not mask land points 
    1917; 
    20 ; OUTPUTS: un tableau 2d contenant des profondeurs 
     18; @returns 
     19; 2d array containing depthes 
    2120; 
    22 ; COMMON BLOCKS:common.pro 
     21; @uses 
     22; common.pro 
    2323; 
    24 ; SIDE EFFECTS: 
    25 ; 
    26 ; RESTRICTIONS: 
    27 ; 
    28 ; EXAMPLE: 
    29 ; 
     24; @examples 
    3025;    IDL> a=gdept[jpk-1]/(1.*jpi*jpj)*findgen(jpi,jpj) 
    3126;    IDL> plt, 1e6*(a-floatlevel2depth(depth2floatlevel(a))),/nocontour 
    3227; 
    33 ;  ->champ nul a 1e-6 pres 
     28;  ->null field at 1e-6 pres 
    3429; 
    35 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     30; @history 
     31; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3632;                      15/6/2000 
     33; 
     34; @version 
     35; $Id$ 
     36; 
    3737;- 
    3838;------------------------------------------------------------ 
     
    4343  compile_opt idl2, strictarrsubs 
    4444; 
    45    tempsun = systime(1)         ; pour key_performance 
     45   tempsun = systime(1)         ; To key_performance 
    4646@common 
    4747;------------------------------------------------------------ 
    4848   flevelin = litchamp(tab) 
    49 ; on vire les points a !values.f_nan 
     49; We delete points at !values.f_nan 
    5050   notanumber = where(finite(flevelin, /nan) EQ 1) 
    5151   if notanumber[0] NE -1 then flevelin[notanumber] = 0 
    52 ; on seuil (vire les points terres a valmask par ex) 
     52; We sill (delete land points at valmask for example) 
    5353   flevelin = 0 > flevelin < (jpk-1) 
    54 ; on calcule la profondeur  
     54; We caculate the depth  
    5555   depthup = level2depth(floor(flevelin), /nomask) 
    5656   depthlow= level2depth(ceil(flevelin), /nomask) 
    5757   weight = flevelin-floor(flevelin) 
    5858   res = depthup+weight*(depthlow-depthup) 
    59 ; on replace les points a !values.f_nan 
     59; We put back points at !values.f_nan 
    6060   if notanumber[0] NE -1 then res[notanumber] = !values.f_nan 
    61 ; on masque les points terres a valmask 
     61; We mask land points at valmask 
    6262   if NOT keyword_set(nomask) then begin 
    6363      grille,mask 
  • trunk/SRC/ToBeReviewed/CALCULS/fsfzpt.pro

    r134 r142  
    1212;               annex 6 freezing point of seawater F.J.Millero pp.29-35 
    1313;       checkvalue: fsfzpt=-2.588567 deg.c,for s=40.0,p=500 decibars 
     14; 
     15; @todo seb 
     16; 
    1417;- 
    1518FUNCTION fsfzpt, pfs, pfp 
  • trunk/SRC/ToBeReviewed/CALCULS/grad.pro

    r134 r142  
    2626; 
    2727; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     28; 
     29; @todo seb: remplir les truc! 
     30; 
    2831; 
    2932;- 
  • trunk/SRC/ToBeReviewed/CALCULS/grossemoyenne.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: grossemoyenne 
    6 ; 
    7 ; PURPOSE:  averages a 3- or 4-d time serie field over a selected 
    8 ;           geographical area or along the time axis. For one ore more 
    9 ;           selected axes (x, y, z, t) 
    10 ; 
    11 ; CATEGORY: 
    12 ; 
    13 ; CALLING SEQUENCE: result = grossemoyenne(tab,'direc',BOXZOOM=boxzoom) 
    14 ; 
    15 ; INPUTS:       tab = 3 or 4d field 
    16 ;               direc ='x' 'y' 'z' 't' 'xy' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 
    17 ;               'xyt' 'xzt' 'yzt' or 'xyzt'  
    18 ; 
    19 ; KEYWORD PARAMETERS: 
    20 ; 
    21 ;               boxzoom = [xmin,xmax,ymin,ymax (,(zmin,)zmax)] pour plus 
    22 ;               de detail cf domdef 
    23 ;               boxzoom peut prendre 5 formes:  
    24 ;               [vert2], [vert1, vert2],[lon1, lon2, lat1, lat2],   
    25 ;               [lon1, lon2, lat1, lat2, vert2],[lon1, lon2, lat1, lat2, vert1,vert2] 
     5; 
     6; @file_comments   
     7; averages a 3- or 4-d time serie field over a selected 
     8; geographical area or along the time axis. For one ore more 
     9; selected axes (x, y, z, t) 
     10; 
     11; @categories 
     12; 
     13; @param TAB {in}{required} 
     14; 3 or 4d field 
     15; 
     16; @param DIREC {in}{required} 
     17; 'x' 'y' 'z' 't' 'xy' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 
     18; 'xyt' 'xzt' 'yzt' or 'xyzt'  
     19; 
     20; @keyword BOXZOOM   
     21; [xmin,xmax,ymin,ymax (,(zmin,)zmax)] to more details, see domdef 
     22; boxzoom can have 5 forms:  
     23; [vert2], [vert1, vert2],[lon1, lon2, lat1, lat2],   
     24; [lon1, lon2, lat1, lat2, vert2],[lon1, lon2, lat1, lat2, vert1,vert2] 
    2625;              
    27 ;               NAN: not a number, a activer si l''on peut faire veut 
    28 ;               faire une moyenne sans tenir compte de certaines 
    29 ;               valeurs masques de tab. 
    30 ;               si les valeurs masques de tab sont la valeur consacree 
    31 ;               par IDL (!values.f_nan), il suffit de mettre /NAN. 
    32 ;               si les valeurs masques de tab on pour valeur a (a doit 
    33 ;               etre differente de 1 (correspond a nan = 
    34 ;               !values.f_nan) et de 0 (qui desactive nan). 
    35 ;               Il faut mettre NAN=a.  
    36 ;               Rq: en sorties les points de result qui sont NAN 
    37 ;               auront pour valeur a ou !values.f_nan. 
     26; @keyword NAN  
     27; not a number, we activate it if we want to average without considerate some masked values of TAB. 
     28; If masked values of TAB are values consecrated by IDL(!values.f_nan), wr just have to put NAN. 
     29; If masked values of TAB are valued a (a must be different of 1, corresponding to nan = 
     30; !values.f_nan and of 0, which desactivate nan). We have to put NAN=a.  
     31; Comment: In output, rsult points which are NAN will be valued a or !values.f_nan. 
    3832;             
    39 ;               NODOMDEF: activer si l''on ne veut pas passer ds 
    40 ;               domdef bien que le mot cle boxzoom soit present (comme 
    41 ;               c''est le cas qd grossemoyenne est appelee via 
    42 ;               checkfield) 
    43 ; 
    44 ;               INTEGRATION: pour faire une integrale plutot qu''une 
    45 ;               moyenne 
    46 ; 
    47 ;               /SPATIALFIRST, when performing at the same time 
    48 ;               spatial and temporal mean, grossemoyenne is assuming 
    49 ;               that the mask is not changing with the time. In 
    50 ;               consequence, grossemoyenne performs temporal mean 
    51 ;               first and then call moyenne. Activate /SPATIALFIRST if 
    52 ;               you want to perform the spatial mean before the 
    53 ;               temporal mean. Note that if NAN is activated, then 
    54 ;               SPATIALFIRST is activated automatically. 
    55 ; 
    56 ;               /TEMPORALFIRST: to force to perform first temporal 
    57 ;               mean even if nan is activated (see SPATIALFIRST 
    58 ;               explanations...) 
     33; @keyword NODOMDEF 
     34; We activate it if we do not want to pass in domdef even if the keyword boxzoom  
     35; is present (like when grossemoyenne is called via checkfield) 
     36; 
     37; @keyword INTEGRATION  
     38; To make an integral rather than an average 
     39; 
     40; @keyword SPATIALFIRST  
     41; when performing at the same time 
     42; spatial and temporal mean, grossemoyenne is assuming 
     43; that the mask is not changing with the time. In 
     44; consequence, grossemoyenne performs temporal mean 
     45; first and then call moyenne. Activate /SPATIALFIRST if 
     46; you want to perform the spatial mean before the 
     47; temporal mean. Note that if NAN is activated, then 
     48; SPATIALFIRST is activated automatically. 
     49; 
     50; @keyword TEMPORALFIRST  
     51; to force to perform first temporal 
     52; mean even if nan is activated (see SPATIALFIRST 
     53; explanations...) 
    5954; 
    6055;  
    61 ;         /WDEPTH: to specify that the field is at W depth instad of T  
    62 ;         depth (automatically activated if vargrid eq 'W') 
    63 ;             
    64 ; OUTPUTS:  
    65 ; 
    66 ; COMMON BLOCKS:   result:un tableau  
    67 ;       common    domdef 
    68 ; 
    69 ; SIDE EFFECTS: met les valeurs correspondants a la terre a 1e20 
    70 ; 
    71 ; RESTRICTIONS: 
    72 ; 
    73 ; EXAMPLE: 
    74 ; 
    75 ; MODIFICATION HISTORY: Jerome Vialard (jv@lodyc.jussieu.fr) 
     56; @keyword WDEPTH  
     57; to specify that the field is at W depth instad of T  
     58; depth (automatically activated if vargrid eq 'W')  
     59; 
     60; @uses 
     61; result:un tableau  
     62; common 
     63; domdef 
     64; 
     65; @restrictions Put values corresponding to land at 1.e20 
     66; 
     67; @history  
     68; Jerome Vialard (jv@lodyc.jussieu.fr) 
    7669;                       2/7/98 
    7770;                       Sebastien Masson (smasson@lodyc.jussieu.fr) 
    78 ; adaptation pour les tableaux comportants une dimension temporelle 
     71; adaptation array containing a temporal dimension  
    7972;                       14/8/98 
    8073;                       15/1/98 
    81 ;                       12/3/99 adaptation pour NAN et utilisation de TEMPORARY 
     74;                       12/3/99 adaptation for NAN and utilisation of TEMPORARY 
     75; 
     76; @version 
     77; $Id$ 
    8278;- 
    83 ;------------------------------------------------------------ 
    84 ;------------------------------------------------------------ 
    85 ;------------------------------------------------------------ 
    86 ; PLAN DU PROGRAMME: 
    87 ;------------------------------------------------------------ 
    88 ;------------------------------------------------------------ 
    89 ;I) preliminaires 
    90 ;   I.1) determination des directions de moyennes d''apres direc 
    91 ;   I.2) verification de la taille du tableau d''entree 
    92 ;   I.3) obtention des facteurs d''echelles et du masque sur le sous 
    93 ;   domaine concerne par la moyenne  
    94 ;II) moyennes pour les tableaux 3d (x,y,t) 
    95 ;   II.1) verification de la coherence de la taille du tableau a 
    96 ;   moyenner  
    97 ;   II.2) renvoie sur moyenne qd une moyenne sur t est demandee 
    98 ;   II.3) differents types de moyennes possibles 
    99 ;III) moyennes pour les tableaux 4d (x,y,z,t) 
    100 ;   III.1) verification de la coherence de la taille du tableau a 
    101 ;   moyenner  
    102 ;   III.2) differents types de moyennes possibles 
    103 ;IV ) finitions 
    104 ;   IV.1) on masque les terres par une valeur a 1e+20 
    105 ;   IV.2) on remplace, quand nan ne 1, !values.f_nan par nan 
    106 ;   IV.3) on revient au sous domaine initial. 
    107 ;------------------------------------------------------------ 
    108 ;------------------------------------------------------------ 
    109 ;------------------------------------------------------------ 
     79 
    11080function grossemoyenne, tab, direc, BOXZOOM = boxzoom, INTEGRATION = integration $ 
    11181                        , NAN = nan, NODOMDEF = nodomdef, WDEPTH = wdepth $ 
     
    12494  ENDIF 
    12595;--------------------------------------------------------- 
    126   tempsun = systime(1)          ; pour key_performance 
    127 ;------------------------------------------------------------ 
    128 ;I) preliminaires 
     96  tempsun = systime(1)          ; For key_performance 
     97;------------------------------------------------------------ 
     98;I) preliminaries 
    12999;------------------------------------------------------------ 
    130100  dirt = 0 
     
    134104  dim  = 'aa' 
    135105;------------------------------------------------------------ 
    136 ; I.1) direction(s) suivants lesquelles on integre 
     106; I.1) Directions(s) we follow to integrate 
    137107;------------------------------------------------------------ 
    138108  if ( strpos(direc, 't') ge 0 ) then dirt = 1 
     
    144114  IF keyword_set(temporalfirst) THEN spatialfirst = 0 
    145115;------------------------------------------------------------ 
    146 ; I.2) verification de la taille du tableau d'entree 
     116; I.2) verification of the input array's size 
    147117;------------------------------------------------------------ 
    148118  taille = size(tab) 
     
    161131  endcase 
    162132;------------------------------------------------------------ 
    163 ;   I.4) obtention des facteurs d''echelles et du masque sur le sous 
    164 ;   domaine concerne par la moyenne  
    165 ; redefinition du domaine ajuste a boxzoom (a 6 elements) 
    166 ; ceci va nous permetre de faire les calcules que sur le sous domaine 
    167 ; comcerne par la moyenne. domdef, suivit de grille nous donne tous 
    168 ; les tableaux de la grille sur le sous domaine  
     133;   I.3) Obtainment of scale's factors and of the mask on the subdomain concernedby the average. 
     134; Redefinition of the domain ajusted at boxzoom (at 6 elements) 
     135; This will allowed us to calculate only in the domain concerned by the average. 
     136; Domdef, followed by grid give us all arrays of the grid on the subdomain  
    169137;------------------------------------------------------------ 
    170138  if keyword_set(boxzoom) then BEGIN  
     
    184152  ENDIF  
    185153;--------------------------------------------------------------- 
    186 ; attribution du mask et des tableaux de longitude et latitude... 
     154; attribution of the mask and of longitude and latitude arrays... 
    187155;--------------------------------------------------------------- 
    188156  grille, mask, glam, gphi, gdep, nx, ny, nz, firstx, firsty, firstz, lastx, lasty, lastz, e1, e2, e3, WDEPTH = wdepth 
    189157;------------------------------------------------------------ 
    190 ; I.3) si dirt eq 1 on fait la moyenne temporelle et on envoie ds moyenne 
     158; I.4) if dirt equal 1, we make the temporal average and we send it in moyenne 
    191159;------------------------------------------------------------ 
    192160  if dirt EQ 1 AND NOT keyword_set(spatialfirst) then begin 
     
    252220;------------------------------------------------------------ 
    253221;------------------------------------------------------------ 
    254 ; II) Cas serie tableaux 2d (tab3d) 
     222; II) Case 2d arrays series (tab3d) 
    255223;------------------------------------------------------------ 
    256224;------------------------------------------------------------ 
    257225  if (dim eq '3d') then begin 
    258226;--------------------------------------------------------------- 
    259 ;   II.1) verification de la coherence de la taille du tableau a 
    260 ;   moyenner  
    261 ; verification de la coherence entre la taille du tableau et le 
    262 ; domaine definit par domdef 
    263 ; le tableau en entree doit avoir soit la taille du domaine total 
    264 ; (jpi,jpj,jpt) soit celle du domaine reduit (nx,ny,jpt) 
     227;   II.1) verification of the coherence of the array's size to average 
     228; Verification of the coherence between the array's size and the domain defined by domdef 
     229; The input array must have either the total domain's size (jpi,jpj,jpt) or this  
     230; one of the reduced domain (nx,ny,jpt) 
    265231;--------------------------------------------------------------- 
    266232    case 1 of 
     
    275241    endcase 
    276242    if keyword_set(nan) NE 0 then BEGIN  
    277       if nan NE 1 then BEGIN    ; si nan n''est pas !values.f_nan  
    278 ; on le met a !values.f_nan 
     243      if nan NE 1 then BEGIN    ; If nan is not !values.f_nan  
     244; we put it at !values.f_nan 
    279245        if abs(nan) LT 1e6 then notanumber = where(res EQ nan) $ 
    280246        ELSE notanumber = where(abs(res) GT abs(nan)/10.) 
     
    283249    ENDIF 
    284250;--------------------------------------------------------------- 
    285 ; rq IL FAUT FAIRE ATTENTION AUX CAS OU LA DIM A MOYENNER = 1, ET 
    286 ; S'ASSURER QU'ELLE EXISTE BIEN. D'OU LES reform(...,nx,ny,...) QUI 
    287 ; PEUVENT SEMBLER INUTILE AU DEPART 
     251; Comment : WE HAVE TO BE CAREFUL ABOUT CASES WHERE THE DIMENSION TO AVERAGE = 1,  
     252; AND MAKE SURE THAT IT EXIST. THAT IS WHY WE USE reform(...,nx,ny,...) WHICH CAN  
     253; LOOK USELESS AT THE BEGINNING 
    288254;--------------------------------------------------------------- 
    289255    if nx EQ 1 OR ny EQ 1 then BEGIN  
     
    295261      mask =  reform(mask, nx, ny, nz, /over) 
    296262;--------------------------------------------------------------- 
    297 ; II.3) differents types de moyennes 
     263; II.3) Different types of average 
    298264;--------------------------------------------------------------- 
    299265    if keyword_set(nan) NE 0 then msknan = finite(res) ELSE msknan = -1 
     
    352318;------------------------------------------------------------ 
    353319;------------------------------------------------------------ 
    354 ; III) Cas serie tableaux 3d (tab4d) 
     320; III) Case 3d arrays series (tab4d) 
    355321;------------------------------------------------------------ 
    356322  if (dim eq '4d') then begin 
    357323;--------------------------------------------------------------- 
    358 ; III.1) verification de la coherence de la taille du tableau a 
    359 ; moyenner  
    360 ; verification de la coherence entre la taille du tableau et le 
    361 ; domaine definit par domdef  
    362 ; le tableau en entree doit avoir soit la taille du domaine total 
    363 ; (jpi,jpj,jpk,jpt) soit celle du domaine reduit (nx,ny,ny,jpt) 
     324; III.1) Verification of the coherence of the array to average size  
     325; Verification of the coherence between the array's size and the domain  
     326; defind by domdef  
     327; The input array must have either the total domain size (jpi,jpj,jpk,jpt)  
     328; or this one of the reduced domain (nx,ny,ny,jpt) 
    364329;--------------------------------------------------------------- 
    365330    case 1 of 
     
    382347    if nx EQ 1 OR ny EQ 1 OR nz EQ 1 OR jpt EQ 1 then res = reform(res, nx, ny, nz, jpt, /over) 
    383348    if keyword_set(nan) NE 0 then BEGIN  
    384       if nan NE 1 then BEGIN    ; si nan n''est pas !values.f_nan  
    385 ; on le met a !values.f_nan 
     349      if nan NE 1 then BEGIN    ; if nan is not !values.f_nan  
     350; we put it at !values.f_nan 
    386351        if abs(nan) LT 1e6 then notanumber = where(res EQ nan) $ 
    387352        ELSE notanumber = where(abs(res) GT abs(nan)/10.) 
     
    390355    ENDIF 
    391356;--------------------------------------------------------------- 
    392 ; rq IL FAUT FAIRE ATTENTION AUX CAS OU LA DIM A MOYENNER = 1, ET 
    393 ; S'ASSURER QU'ELLE EXISTE BIEN. D'OU LES reform(...,nx,ny,...) QUI 
    394 ; PEUVENT SEMBLER INUTILE AU DEPART 
     357; Comment : WE HAVE TO BE CAREFUL ABOUT CASES WHERE THE DIMENSION TO AVERAGE = 1,  
     358; AND MAKE SURE THAT IT EXIST. THAT IS WHY WE USE reform(...,nx,ny,...) WHICH CAN  
     359; LOOK USELESS AT THE BEGINNING 
    395360;--------------------------------------------------------------- 
    396361    if nx EQ 1 OR ny EQ 1 OR nz EQ 1 then BEGIN  
     
    410375    ENDIF ELSE bottom = -1 
    411376;--------------------------------------------------------------- 
    412 ; III.2) differents types de moyennes 
     377; III.2) different average types 
    413378;--------------------------------------------------------------- 
    414379    IF keyword_set(nan) NE 0 THEN msknan = finite(res) ELSE msknan = -1 
     
    608573;------------------------------------------------------------ 
    609574;------------------------------------------------------------ 
    610 ;IV ) finitions 
    611 ;------------------------------------------------------------ 
    612 ;------------------------------------------------------------ 
    613 ; IV.1) on masque les terres par une valeur a 1e+20 
     575;IV ) finishing 
     576;------------------------------------------------------------ 
     577;------------------------------------------------------------ 
     578; IV.1) We mask land by a value equal to 1.e+20 
    614579;------------------------------------------------------------ 
    615580  valmask = 1e+20 
     
    619584  ENDIF  
    620585;------------------------------------------------------------ 
    621 ; IV.2) on remplace, quand nan ne 1, !values.f_nan par nan 
     586; IV.2) We replace, when nan equal 1, !values.f_nan by nan 
    622587;------------------------------------------------------------ 
    623588  if keyword_set(nan) NE 0 then BEGIN  
     
    630595  ENDIF 
    631596;------------------------------------------------------------ 
    632 ; IV.3) on se remplace ds le sous domaine qui etait definit a l''entree de 
    633 ; moyenne  
     597; IV.3) We replace in the domain whch was defined at the entry of average 
    634598;------------------------------------------------------------ 
    635599  if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4grmoyenne.dat' 
  • trunk/SRC/ToBeReviewed/CALCULS/hdyn.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:hdyn 
    65; 
    7 ; PURPOSE:calcule la hauteur dynamique par rapport a un etat de 
    8 ; reference pour une profondeur de reference. Cf les mots cles pour 
    9 ; les differentes possibilites.  
    10 ; Par defaut l''etat de reference est 
    11 ; rho=1020 et la profondeur de reference est gdepw[ka] avec ka le 
    12 ; premier niveau W directement au dessus de 1000 m.  
     6; @file_comments 
     7; Calculate the height by rapport to a reference state for a depth reference.  
     8; See keywords for different possibilities. By default, the state reference  
     9; is rho=1020 and the depth reference is gdepw[ka] with ka the first W level  
     10; directly above 1000 m.  
    1311; 
    14 ; CATEGORY: calculs de post-traitement 
     12; @categories 
     13; Post-traiment calculation 
    1514; 
    16 ; CALLING SEQUENCE:res=hdyn(sn,tn) 
     15; @param TABSN {in}{required} 
     16; array representing the salinity 
    1717; 
    18 ; INPUTS:sn et tn sont des tableaux de meme taille representant la 
    19 ; salinite et la temperature. 
     18; @param TABTN {in}{required} 
     19; array representing the temperature.Has the same size than SN 
    2020; 
    21 ; KEYWORD PARAMETERS: 
     21; @keyword GILL We activate this key if we want to calculate the dinamic height  
     22; like in the GILL page 215, which means by rapport to a reference state which  
     23; vary in depth and which is determinated by a reference temperature tref at 0°C  
     24; and a reference salinity sref at 35psu 
    2225; 
    23 ;        GILL: activer cette cle si on veut faire le calcul de la 
    24 ;        hauteur dynamique comme ds le GILL page 215 cad par rapport a 
    25 ;        un etat de reference qui varie en profondeur et qui est 
    26 ;        determine par une temperature de reference tref a 0 degre et 
    27 ;        une salinite de reference sref a 35psu 
     26; @keyword LEVEL 
     27; It is the same reference level to take. This level is defined like  
     28; that gdepw[level] is the reference depth 
     29;  
     30; @keyword SREF  
     31; Give a value to this keyword to change the reference salinity used in the  
     32; calculation when GILL  is activated.  
     33;    
     34; @keyword TREF 
     35; Give a value to this keyword to change the reference temperature used in the  
     36; calculation when GILL  is activated. 
     37;  
     38; @keyword PROFREF 
     39; Give a depth to this keyword which will be considerated as the refeence depth  
     40; (in this case, LEVEL has not any effect). the calculation will be effectuated  
     41; until this depth effecting an interpolation between the the last W level above  
     42; PROFREF and PROFREF. 
    2843; 
    29 ;        LEVEL: C''est le niveau de reference a prendre. Ce niveau est 
    30 ;        definit tel que gdepw[level] est la profondeur de reference 
     44; @keyword SURFACE_LEVEL  
     45; It is the level where we wan to calculate the dynamic height. By default, it is  
     46; the level 0. 
    3147; 
    32 ;        SREF: donner une valeur a ce mot cle pour changer la salinite 
    33 ;        de reference utiliser ds le calcul lorsque GILL est active. 
    34 ;    
    35 ;        TREF: donner une valeur a ce mot cle pour changer la temperature 
    36 ;        de reference utiliser ds le calcul lorsque GILL est active. 
     48; @returns 
     49; An array of the same size of sn and tn representing the dynamic height calculated  
     50; from a reference depth nd by rapport to a reference state. 
    3751; 
    38 ;        PROFREF: donner a ce mot cle une profondeur qui sera prise comme 
    39 ;        la profondeur de reference (ds ce cas LEVEL n'' a aucun 
    40 ;        effet). le calcul sera alors effectue jusqu''a cette 
    41 ;        profondeur en effectuant une interpolation entre le dernier 
    42 ;        niveau W au dessus de PROFREF et PROFREF. 
     52; @uses  
     53; common.pro 
    4354; 
    44 ;        SURFACE_LEVEL: C''est le niveau auquel on veut calculer la 
    45 ;        hauteur dynamique. Par defaut c''est le niveau 0. 
     55; @restrictions 
     56; Points for which we can not calculate the dynamic height (whose the batymetry  
     57; is less deep than the reference depth) are put at the value !values.f_nan 
    4658; 
    47 ; OUTPUTS:un tableau de la meme taille que sn et tn representant la 
    48 ; hauteur dynamique calculee a partir d''une profondeur de reference 
    49 ; et par rapport a un etat de reference. 
     59; @restrictions 
     60; approximation: The pressure in decibars is equal to the depth in meters (the pressure increase of 1bar all 10m) 
    5061; 
    51 ; COMMON BLOCKS: 
    52 ;       common.pro 
     62; @history 
     63; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    5364; 
    54 ; SIDE EFFECTS: 
    55 ; les points pour lesquels on nje peut calcule la hauteur dynamique 
    56 ; (dont la batymetrie est moins profonde que la profondeur de 
    57 ; reference) sont mis a la valeur !values.f_nan 
    58 ; 
    59 ; RESTRICTIONS:approximation: la pression en decibars est egale a la 
    60 ; profondeur en metres (la pression augmente de 1bar tous les 10m) 
    61 ; 
    62 ; EXAMPLE: 
    63 ; 
    64 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     65; @version 
     66; $Id$ 
    6567; 
    6668;- 
     
    7274  compile_opt idl2, strictarrsubs 
    7375; 
    74    tempsun = systime(1)         ; pour key_performance 
     76   tempsun = systime(1)         ; for key_performance 
    7577@common 
    7678 
    7779   if NOT keyword_set(surface_level) then surface_level = 0 
    78 ; utile si GILL est active 
     80; useful if GILL is activated 
    7981   if NOT keyword_set(tref) then tref = 0. 
    8082   if NOT keyword_set(sref) then sref = 35. 
    81 ; on determine si besoin est la profondeur de reference et le niveau 
    82 ; W situe directement au dessus. 
     83; If needed, we determinate the reference depth and the W level situated directly above. 
    8384   if keyword_set(profref) then begin 
    8485      rien = where(gdepw LE profref, level) 
  • trunk/SRC/ToBeReviewed/CALCULS/level2depth.pro

    r134 r142  
    44;------------------------------------------------------------ 
    55;+ 
    6 ; NAME:level2depht 
    76; 
    8 ; PURPOSE: permet de passer d''un tableau 2d de niveau au 
    9 ; tableau 2d de profondeur correspondant a ces niveaux 
     7; @file_comments 
     8; Allows to pass from a 2d level array to a 2d depth array corresponding o these levels 
    109; 
    11 ; CATEGORY: SANS BOUCLE 
     10; @categories 
     11; Without loop 
    1212; 
    13 ; CALLING SEQUENCE: res=level2depth(niveau) 
     13; @param TAB {in}{required} 
     14; 2d level array of sill levels (or a structure respecting litchamp criterions) 
    1415; 
    15 ; INPUTS: niveau tableau 2d de niveaux seuil (ou une structure repondant 
    16 ; aux criteres de litchamp) 
     16; @keyword NOMASK 
     17; To do not mask land points. 
    1718; 
    18 ; KEYWORD PARAMETERS: 
    19 ;       /NOMASK: pour ne pas masquer les points terres 
     19; @returns  
     20; 2d array containing depthes 
    2021; 
    21 ; OUTPUTS: un tableau 2d contenant des profondeurs 
     22; @uses 
     23; common.pro 
    2224; 
    23 ; COMMON BLOCKS: 
    24 ;       common.pro 
    25 ; 
    26 ; SIDE EFFECTS: 
    27 ; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; EXAMPLE: 
    31 ; 
    32 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     25; @history 
     26; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3327;                       17/6/1999 
    3428;                       14/6/2000 accepte !values.f_nan 
     29; 
     30; @version 
     31; $Id$ 
     32; 
    3533;- 
    3634;------------------------------------------------------------ 
     
    4139  compile_opt idl2, strictarrsubs 
    4240; 
    43    tempsun = systime(1)         ; pour key_performance 
     41   tempsun = systime(1)         ; To key_performance 
    4442@common 
    4543;------------------------------------------------------------ 
    46 ; lecture du champ d''entree et recuperation de la taille du sous 
    47 ; domaine utilise 
     44; Reading of the input field  and recovery of the used subdomain's size 
    4845;------------------------------------------------------------ 
    4946   niveaux = litchamp(tab) 
    5047   grille,mask, -1, -1,gdep,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 
    5148;--------------------------------------------------------------- 
    52 ; verification de la coherence entre la taille du tableau et le domaine definit par domdef 
     49; verification of the coherence between array's size and the domain definied by domdef 
    5350;--------------------------------------------------------------- 
    5451   taille = size(niveaux) 
  • trunk/SRC/ToBeReviewed/CALCULS/level2index.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:level2index 
    65; 
    7 ; PURPOSE: on veut ds une matrice 3d extraire un tableau 2d (x,y) dont 
    8 ; chacun des elements a ete extrait a un niveau specifie par le 
    9 ; tableau 2d level (typiquement, on veut obtenir la salinite le long 
    10 ; d''une isopycne que l''on a reperee par son niveau). 
    11 ; level2index est une fonction qui donne en fonction de level un 
    12 ; tableau 2d d'indice qui permettra d''extraire le tableau 2d du 
    13 ; tableau 3d... 
     6; @file_comments  
     7; We want, from a 3d matrix, to extract a 2d (x,y) array whose each element  
     8; has been extract from a level specified by the 2d level array (typically,  
     9; we want to obtain the salinity along an isopycn we have repered by its level). 
     10; level2index is a function who give, in function of level, a 2d indexes array  
     11; which will allow to extract the 2d array from the 3d array... 
    1412; 
    15 ; CATEGORY: SANS BOUCLE 
     13; @categories 
     14; without loop 
    1615; 
    17 ; CALLING SEQUENCE: index=level2index(level) 
    18 ;  
    19 ; INPUTS:level: un tableau 2d de niveaux 
     16; @param LEVEL {in}{required} 
     17; A 2d level array 
    2018; 
    21 ; KEYWORD PARAMETERS: 
     19; @returns 
     20; a 2d indexes array 
    2221; 
    23 ; OUTPUTS: untableau 2d d''indices 
     22; @history 
     23; Sebastien Masson (smasson@lodyc.jussieu.fr) 
     24;                      24/11/1999 
    2425; 
    25 ; COMMON BLOCKS: 
     26; @version 
     27; $Id$ 
    2628; 
    27 ; SIDE EFFECTS: 
    28 ; 
    29 ; RESTRICTIONS: 
    30 ; 
    31 ; EXAMPLE: 
    32 ; 
    33 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
    34 ;                      24/11/1999 
    3529;- 
    3630;------------------------------------------------------------ 
     
    3832;------------------------------------------------------------ 
    3933FUNCTION level2index, level 
    40 ; un elements de tableau 3d (dont les 2 premieres dimensions sont nx et 
    41 ; ny) dont les coordonnes sont i, j et k a pour indice ds le meme 
    42 ; tableau 3d  i + j*nx + k*(nx*ny) 
    43 ; level etant donne, pour chaque points de level on connait i, j et k, 
    44 ; on peut donc calculer l''indice. 
     34; An element of 3d array (whose the two first dimensions are nx and ny) whose  
     35; coordinates are i, j and k have for index in the same 3d array i + j*nx + k*(nx*ny) 
     36; level given, for  each point of level, we know i, j et k, 
     37; so we can calculate the index 
    4538; 
    4639  compile_opt idl2, strictarrsubs 
     
    4942   nx = taille[1] 
    5043   ny = taille[2] 
    51 ; tableau k*(nx*ny) 
     44; array k*(nx*ny) 
    5245   tabknxny = (nx*ny)*long(level) 
    5346; 
  • trunk/SRC/ToBeReviewed/CALCULS/level2mask.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:level2mask 
    65; 
    7 ; PURPOSE: permet de passer d''un tableau 2d de niveau seuil au 
    8 ; tableau 3d de mask avec des 1 ds les niveaux au dessus du 
    9 ; niveau seuil et des 0 en dessous (et sur). 
     6; @file_comments 
     7; Allow to pass from a 2d sill level array to the 3d mask array with 1s in  
     8; levels above the sill level and 0s below (and on it) 
    109; 
    11 ; CATEGORY: SANS BOUCLE 
     10; @categories  
     11; without loop 
    1212; 
    13 ; CALLING SEQUENCE: res=level2mask(niveau) 
     13; @param TAB {in}{required} 
     14; 2d level array of sill level (or a structure respecting litchamp criterions) 
    1415; 
    15 ; INPUTS: niveau tableau 2d de niveaux seuil (ou une structure repondant 
    16 ; aux criteres de litchamp) 
     16; @returns 
     17; It is a 3d array containing the mask associated to the 2d sill level array 
    1718; 
    18 ; KEYWORD PARAMETERS: 
     19; @uses 
     20; common.pro 
    1921; 
    20 ; OUTPUTS: un tableau 3d contenant le mask associe au tableau 2d de 
    21 ; niveaux seuil 
    22 ; 
    23 ; COMMON BLOCKS: 
    24 ;       common.pro 
    25 ; 
    26 ; SIDE EFFECTS: 
    27 ; 
    28 ; RESTRICTIONS: 
    29 ; 
    30 ; EXAMPLE: 
    31 ; 
    32 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     22; @history 
     23; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    3324;                       17/6/1999 
    3425; Setp 2004: boundary level have 0 values and not 1 (as it was 
    3526; explained before in the header). see: 
    3627; print, array_equal(niveau, total(level2mask(niveau),3)) 
     28; 
     29; 
     30; @version 
     31; $Id$ 
    3732; 
    3833;- 
     
    4540  compile_opt idl2, strictarrsubs 
    4641; 
    47    tempsun = systime(1)         ; pour key_performance 
     42   tempsun = systime(1)         ; To key_performance 
    4843@common 
    4944;------------------------------------------------------------ 
    50 ; lecture du champ d''entree et recuperation de la taille du sous 
    51 ; domaine utilise 
     45; Reading of the input field and recovery of the size of the used subdomain 
    5246;------------------------------------------------------------ 
    5347   niveaux = litchamp(tab) 
    5448   grille,maskterre, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 
    5549;--------------------------------------------------------------- 
    56 ; verification de la coherence entre la taille du tableau et le domaine definit par domdef 
     50; verification of the coherence between the array's size and the defined by domdef domain 
    5751;--------------------------------------------------------------- 
    5852   IF ny EQ 1 THEN niveaux = reform(niveaux, nx, ny, /over) 
     
    6660;------------------------------------------------------------ 
    6761;------------------------------------------------------------ 
    68 ; on transforme le tableau 2d de niveaux en tableau 3d de mask 
     62; We transform the 2d leval array in 3d mask array 
    6963;------------------------------------------------------------ 
    7064   mask = reform( niveaux[*]#(1./(indgen(nz)+1)), nx, ny, nz ) 
  • trunk/SRC/ToBeReviewed/CALCULS/moyenne.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME: moyenne 
    6 ; 
    7 ; PURPOSE:  averages a 2- or 3-d field over a selected 
     5; 
     6; @file_comments   
     7; averages a 2- or 3-d field over a selected 
    88;           geographical area and along one ore more 
    99;           selected axes (x, y or z) 
    1010; 
    11 ; CATEGORY: 
    12 ; 
    13 ; CALLING SEQUENCE: result = moyenne(tab,'direc',BOXZOOM=boxzoom) 
    14 ; 
    15 ; INPUTS:       tab = 2 or 3d field 
    16 ;               direc = 'x' 'y' 'z' 'xy' 'xz' 'yz' or 'xyz' 
    17 ; 
    18 ; KEYWORD PARAMETERS: 
    19 ; 
    20 ;               BOXZOOM = [xmin,xmax,ymin,ymax (,(zmin,)zmax)] pour plus 
    21 ;               de detail cf domdef. 
    22 ;               boxzoom peut prendre 5 formes:  
    23 ;               [vert2], [vert1, vert2],[lon1, lon2, lat1, lat2],   
    24 ;               [lon1, lon2, lat1, lat2, vert2],[lon1, lon2, lat1, 
    25 ;               lat2, vert1,vert2] 
    26 ; 
    27 ;               NAN: not a number, a activer si l''on peut faire veut 
    28 ;               faire une moyenne sans tenir compte de certaines 
    29 ;               valeurs masques de tab. 
    30 ;               si les valeurs masques de tab sont la valeur consacree 
    31 ;               par IDL (!values.f_nan), il suffit de mettre /NAN. 
    32 ;               si les valeurs masques de tab on pour valeur a (a doit 
    33 ;               etre differente de 1 (correspond a nan = 
    34 ;               !values.f_nan) et de 0 (qui desactive nan) 
    35 ;               il faut mettre NAN=a.  
    36 ;               Rq: en sorties les points de result qui sont NAN 
    37 ;               auront pour valeur a ou !values.f_nan. 
    38 ; 
    39 ;               NODOMDEF: activer si l''on ne veut pas passer ds 
    40 ;               domdef bien que le mot cle boxzoom soit present (comme 
    41 ;               c''est le cas qd moyenne est appelee via checkfield)  
     11; @categories 
     12; 
     13; @param        TAB {in}{required} 
     14; 2 or 3d field 
     15; 
     16; @param DIREC {in}{required} 
     17; 'x' 'y' 'z' 'xy' 'xz' 'yz' or 'xyz' 
     18; 
     19; @keyword BOXZOOM   
     20; [xmin,xmax,ymin,ymax (,(zmin,)zmax)] to more details, see domdef 
     21; boxzoom can have 5 forms:  
     22; [vert2], [vert1, vert2],[lon1, lon2, lat1, lat2],   
     23; [lon1, lon2, lat1, lat2, vert2],[lon1, lon2, lat1, lat2, vert1,vert2] 
     24; 
     25; @keyword NAN  
     26; not a number, we activate it if we want to average without considerate some masked values of TAB. 
     27; If masked values of TAB are values consecrated by IDL(!values.f_nan), wr just have to put NAN. 
     28; If masked values of TAB are valued a (a must be different of 1, corresponding to nan = 
     29; !values.f_nan and of 0, which desactivate nan). We have to put NAN=a.  
     30; Comment: In output, rsult points which are NAN will be valued a or !values.f_nan. 
    4231;             
    43 ;               INTEGRATION: pour faire une integrale plutot qu''une moyenne 
     32; @keyword NODOMDEF 
     33; We activate it if we do not want to pass in domdef even if the keyword boxzoom  
     34; is present (like when grossemoyenne is called via checkfield) 
     35; 
     36; @keyword INTEGRATION  
     37; To make an integral rather than an average 
    4438;  
    45 ;         /WDEPTH: to specify that the field is at W depth instad of T  
    46 ;         depth (automatically activated if vargrid eq 'W') 
     39; @keyword WDEPTH  
     40; to specify that the field is at W depth instad of T  
     41; depth (automatically activated if vargrid eq 'W')  
    4742;             
    48 ; OUTPUTS:  result:un tableau  
    49 ; 
    50 ; COMMON BLOCKS: 
    51 ;       common   domdef 
    52 ; 
    53 ; SIDE EFFECTS:met les valeurs correspondants a la terre a 1e20 
    54 ; 
    55 ; RESTRICTIONS: 
    56 ; 
    57 ; EXAMPLE: 
    58 ; 
    59 ; MODIFICATION HISTORY: Jerome Vialard (jv@lodyc.jussieu.fr) 
     43; @returns 
     44; An array  
     45; 
     46; @uses 
     47; common 
     48; domdef 
     49; 
     50; @restrictions Put values corresponding to land at 1.e20 
     51; 
     52; @history 
     53;  Jerome Vialard (jv@lodyc.jussieu.fr) 
    6054;                       2/7/98 
    6155;                       Sebastien Masson (smasson@lodyc.jussieu.fr) 
    62 ;                       mise au propre de certains truc (les terres...) 
    6356;                       14/8/98 
    6457;                       15/1/98 
    65 ;                       11/3/99 adaptation pour NAN 
    66 ;                       28/7/99 moyennes tableaux 1d 
     58;                       11/3/99 adaptation for NAN 
     59;                       28/7/99 Averages 1d arrays 
     60; 
     61; @version 
     62; $Id$ 
     63; 
    6764;- 
    68 ;------------------------------------------------------------ 
    69 ;------------------------------------------------------------ 
    70 ; PLAN DU PROGRAMME: 
    71 ;------------------------------------------------------------ 
    72 ;------------------------------------------------------------ 
    73 ;I) preliminaires 
    74 ;   I.1) determination des directions de moyennes d''apres direc 
    75 ;   I.2) verification de la taille du tableau d''entree 
    76 ;   I.3) obtention des facteurs d''echelles et du masque sur le sous 
    77 ;   domaine concerne par la moyenne  
    78 ;  ) moyennes pour les tableaux 1d (x,y) 
    79 ;II) moyennes pour les tableaux 2d (x,y) 
    80 ;   II.1) verification de la coherence de la taille du tableau a 
    81 ;   moyenner  
    82 ;   II.2) differents types de moyennes possibles 
    83 ;III) moyennes pour les tableaux 3d (x,y,z) 
    84 ;   III.1) verification de la coherence de la taille du tableau a 
    85 ;   moyenner  
    86 ;   III.2) differents types de moyennes possibles 
    87 ;IV ) finitions 
    88 ;   IV.1) on masque les terres par une valeur a 1e+20 
    89 ;   IV.2) on remplace, quand nan ne 1, !values.f_nan par nan 
    90 ;   IV.3) on revient au sous domaine initial. 
    91 ;------------------------------------------------------------ 
    92 ;------------------------------------------------------------ 
     65 
    9366function moyenne, tab, direc, BOXZOOM = boxzoom, INTEGRATION = integration $ 
    9467                  , NAN = nan, NODOMDEF = nodomdef, WDEPTH = wdepth $ 
     
    10679  ENDIF 
    10780;--------------------------------------------------------- 
    108   tempsun = systime(1)          ; pour key_performance 
    109 ;------------------------------------------------------------ 
    110 ;I) preliminaires 
     81  tempsun = systime(1)          ; To key_performance 
     82;------------------------------------------------------------ 
     83;I) preliminaries 
    11184;------------------------------------------------------------ 
    11285  dirt = 0 
     
    11588  dirz = 0 
    11689;------------------------------------------------------------ 
    117 ; I.1) direction(s) suivants lesquelles on integre 
     90; I.1) Directions(s) we follow to integrate 
    11891;------------------------------------------------------------ 
    11992  if ( strpos(direc, 't') ge 0 ) then dirt = 1 
     
    12396  if (dirx eq 0 and diry eq 0 and dirz eq 0) then return, tab 
    12497;------------------------------------------------------------ 
    125 ; I.2) verification de la taille du tableau d'entree 
     98; I.2) verification of the input array's size 
    12699;------------------------------------------------------------ 
    127100  taille = size(tab) 
     
    139112  endcase 
    140113;------------------------------------------------------------ 
    141 ;   I.3) obtention des facteurs d''echelles et du masque sur le sous 
    142 ;   domaine concerne par la moyenne  
    143 ; redefinition du domaine ajuste a boxzoom (a 6 elements) 
    144 ; ceci va nous permetre de faire les calcules que sur le sous domaine 
    145 ; comcerne par la moyenne. domdef, suivit de grille nous donne tous 
    146 ; les tableaux de la grille sur le sous domaine  
     114;   I.3) Obtainment of scale's factors and of the mask on the subdomain concernedby the average. 
     115; Redefinition of the domain ajusted at boxzoom (at 6 elements) 
     116; This will allowed us to calculate only in the domain concerned by the average. 
     117; Domdef, followed by grid give us all arrays of the grid on the subdomain  
    147118;------------------------------------------------------------ 
    148119  if keyword_set(boxzoom) then BEGIN  
     
    162133  ENDIF  
    163134;--------------------------------------------------------------- 
    164 ; attribution du mask et des tableaux de longitude et latitude... 
     135; attribution of the mask and of longitude and latitude arrays... 
    165136;--------------------------------------------------------------- 
    166137  IF vargrid EQ 'W' THEN wdepth = 1 
     
    168139;------------------------------------------------------------ 
    169140;------------------------------------------------------------ 
    170 ; II) Cas du tableau 1d 
     141; II) Case of the 1d array 
    171142;------------------------------------------------------------ 
    172143;------------------------------------------------------------ 
     
    177148    ENDIF 
    178149    case 1 of 
    179       nx EQ 1 AND ny EQ 1:BEGIN ;vecteur suivant z 
     150      nx EQ 1 AND ny EQ 1:BEGIN ;vector following z 
    180151        case n_elements(tab) of 
    181152          jpk:res = tab[firstz:lastz] 
     
    194165        ENDELSE  
    195166      END 
    196       ny EQ 1:BEGIN             ;vecteur suivant x 
     167      ny EQ 1:BEGIN             ;vector following x 
    197168        case n_elements(tab) of 
    198169          jpi:res = tab[firstx:lastx] 
     
    211182        ENDELSE 
    212183      END 
    213       nx EQ 1:BEGIN             ;vecteur suivant y 
     184      nx EQ 1:BEGIN             ;vector following y 
    214185        case n_elements(tab) of 
    215186          jpj:res = tab[firsty:lasty] 
     
    232203;------------------------------------------------------------ 
    233204;------------------------------------------------------------ 
    234 ; II) Cas du tableau 2d 
     205; II) Case of the 2d array 
    235206;------------------------------------------------------------ 
    236207;------------------------------------------------------------ 
    237208  if (dim eq '2d') then begin 
    238209;--------------------------------------------------------------- 
    239 ;   II.1) verification de la coherence de la taille du tableau a 
    240 ;   moyenner  
    241 ; verification de la coherence entre la taille du tableau et le 
    242 ; domaine definit par domdef 
    243 ; le tableau en entree doit avoir soit la taille du domaine total 
    244 ; (jpi,jpj) soit celle du domaine reduit (nx,ny) 
     210;   II.1) verification of the coherence of the array's size to average 
     211; Verification of the coherence between the array's size and the domain defined by domdef 
     212; The input array must have either the total domain's size (jpi,jpj) or this  
     213; one of the reduced domain (nx,ny) 
    245214;--------------------------------------------------------------- 
    246215    case 1 of 
     
    254223    ENDCASE 
    255224    if keyword_set(nan) NE 0 then BEGIN  
    256       if nan NE 1 then BEGIN    ; si nan n''est pas !values.f_nan  
    257 ; on le met a !values.f_nan 
     225      if nan NE 1 then BEGIN    ; If nan is not !values.f_nan  
     226; we put it at !values.f_nan 
    258227        if abs(nan) LT 1e6 then notanumber = where(res EQ nan) $ 
    259228        ELSE notanumber = where(abs(res) GT abs(nan)/10.) 
     
    262231    ENDIF 
    263232;--------------------------------------------------------------- 
    264 ; rq IL FAUT FAIRE ATTENTION AUX CAS OU LA DIM A MOYENNER = 1, ET 
    265 ; S'ASSURER QU'ELLE EXISTE BIEN. D'OU LES reform(...,nx,ny,...) QUI 
    266 ; PEUVENT SEMBLER INUTILE AU DEPART 
     233; Comment : WE HAVE TO BE CAREFUL ABOUT CASES WHERE THE DIMENSION TO AVERAGE = 1,  
     234; AND MAKE SURE THAT IT EXIST. THAT IS WHY WE USE reform(...,nx,ny,...) WHICH CAN  
     235; LOOK USELESS AT THE BEGINNING 
    267236;--------------------------------------------------------------- 
    268237    if nx EQ 1 OR ny EQ 1 then BEGIN  
     
    274243      mask =  reform(mask, nx, ny, nz, /over) 
    275244;--------------------------------------------------------------- 
    276 ; II.3) differents types de moyennes 
     245; II.3) Different types of average 
    277246;--------------------------------------------------------------- 
    278247    mask = mask[*, *, 0] 
     
    330299;------------------------------------------------------------ 
    331300;------------------------------------------------------------ 
    332 ; III) Cas du tableau 3d 
     301; III) Case 3d arrays series (tab4d) 
    333302;------------------------------------------------------------ 
    334303;------------------------------------------------------------ 
    335304  if (dim eq '3d') then begin 
    336305;--------------------------------------------------------------- 
    337 ; III.1) verification de la coherence de la taille du tableau a 
    338 ; moyenner  
    339 ; verification de la coherence entre la taille du tableau et le 
    340 ; domaine definit par domdef  
    341 ; le tableau en entree doit avoir soit la taille du domaine total 
    342 ; (jpi,jpj,jpk) soit celle du domaine reduit (nx,ny,ny) 
     306; III.1) Verification of the coherence of the array to average size  
     307; Verification of the coherence between the array's size and the domain  
     308; defind by domdef  
     309; The input array must have either the total domain size (jpi,jpj,jpk)  
     310; or this one of the reduced domain (nx,ny,ny) 
    343311;--------------------------------------------------------------- 
    344312    case 1 of 
     
    356324    endcase 
    357325    if keyword_set(nan) NE 0 then BEGIN  
    358       if nan NE 1 then BEGIN    ; si nan n''est pas !values.f_nan  
    359 ; on le met a !values.f_nan 
     326      if nan NE 1 then BEGIN    ; if nan is not !values.f_nan  
     327; we put it at !values.f_nan 
    360328        if abs(nan) LT 1e6 then notanumber = where(res EQ nan) $ 
    361329        ELSE notanumber = where(abs(res) GT abs(nan)/10.) 
     
    364332    ENDIF 
    365333;--------------------------------------------------------------- 
    366 ; rq IL FAUT FAIRE ATTENTION AUX CAS OU LA DIM A MOYENNER = 1, ET 
    367 ; S'ASSURER QU'ELLE EXISTE BIEN. D'OU LES reform(...,nx,ny,...) QUI 
    368 ; PEUVENT SEMBLER INUTILE AU DEPART 
     334; Comment : WE HAVE TO BE CAREFUL ABOUT CASES WHERE THE DIMENSION TO AVERAGE = 1,  
     335; AND MAKE SURE THAT IT EXIST. THAT IS WHY WE USE reform(...,nx,ny,...) WHICH CAN  
     336; LOOK USELESS AT THE BEGINNING 
    369337;--------------------------------------------------------------- 
    370338    if nx EQ 1 OR ny EQ 1 OR nz EQ 1 then BEGIN  
     
    387355    ENDIF ELSE bottom = -1 
    388356;--------------------------------------------------------------- 
    389 ; III.2) differents types de moyennes 
     357; III.2) different average types 
    390358;--------------------------------------------------------------- 
    391359    if keyword_set(nan) NE 0 then msknan = finite(res) ELSE msknan = -1 
     
    570538;------------------------------------------------------------ 
    571539;------------------------------------------------------------ 
    572 ;IV ) finitions 
    573 ;------------------------------------------------------------ 
    574 ;------------------------------------------------------------ 
    575 ; IV.1) on masque les terres par une valeur a 1e+20 
     540;IV ) finishing 
     541;------------------------------------------------------------ 
     542;------------------------------------------------------------ 
     543; IV.1) We mask land by a value equal to 1.e+20 
    576544;------------------------------------------------------------ 
    577545  valmask = 1e+20 
     
    581549  ENDIF   
    582550;------------------------------------------------------------ 
    583 ; IV.2) on remplace, quand nan ne 1, !values.f_nan par nan 
     551; IV.2) We replace, when nan equal 1, !values.f_nan by nan 
    584552;------------------------------------------------------------ 
    585553  if keyword_set(nan) NE 0 then BEGIN  
     
    592560  ENDIF 
    593561;------------------------------------------------------------ 
    594 ; IV.3) on se remplace ds le sous domaine qui etait definit a l''entree de 
    595 ; moyenne  
     562; IV.3) We replace in the domain whch was defined at the entry of average 
    596563;------------------------------------------------------------ 
    597564  if keyword_set(savedbox) THEN restoreboxparam, 'boxparam4moyenne.dat' 
  • trunk/SRC/ToBeReviewed/CALCULS/norme.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:norme 
    6 ; 
    7 ; PURPOSE: calcule la norme d''un champ de vecteurs, puis fait une 
    8 ; moyenne eventuelle. 
    9 ;          Rq1: le champ de vecteur peut etre, 2d:xy, 3d: xyz ou xyt, 
    10 ;          4d: xyzt 
    11 ;          Rq2: le calcul de la norme est fait avant l''eventuelle 
    12 ;          moyenne spatiale ou temporelle car la moyenne de la norme 
    13 ;          n''est pas egale a la norme des moyennes. 
    14 ; 
    15 ; CATEGORY: calcul de post traitement 
    16 ; 
    17 ; CALLING SEQUENCE:res=norme(champ_de_vecteurs) 
    18 ; 
    19 ; INPUTS:un tableau 2d, 3d ou 4d 
    20 ; 
    21 ; KEYWORD PARAMETERS: 
    22 ; 
    23 ;       BOXZOOM: boxzoom sur laquelle moyenner (par defaut le domaine 
    24 ;       selectionner par le dernier domdef effectue) 
    25 ; 
    26 ;       DIREC:'t' 'x' 'y' 'z' 'xy' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 
    27 ;       'xzt' 'yzt' 'xyzt' directions selon lesquelles effectuer les 
    28 ;       moyennes  
    29 ; 
    30 ; OUTPUTS:tableau a tracer avec plt, pltz ou pltt. 
    31 ; 
    32 ; COMMON BLOCKS: 
    33 ;       common.pro 
    34 ; 
    35 ; SIDE EFFECTS: 
    36 ; 
    37 ;      La norme est calculee aux points T. Pour faire ce calcul, on 
    38 ;      moyenne les champs U et V aux points T avant de calculer la norme. 
    39 ;      Au bord des cotes et du domaine, on ne peut pas calculer les 
    40 ;      champs U et V aux points T, ces points sont donc a la valeur 
    41 ;      !values.f_nan.  
     5; 
     6; @file_comments  
     7; calculate the norme of a field of vectors, then make a possible average. 
     8;   Comment 1: The field of vector can be, 2d:xy, 3d: xyz or xyt, 
     9; 4d: xyzt 
     10;   Comment 2: 
     11; The calculation of the norme is made before the possible spatial or  
     12; temporal average because the average of the norme is not equal to the  
     13; norme of averages 
     14 
     15; 
     16; @categories 
     17; Post traitment calculation 
     18; 
     19; @param COMPOSANTEU {in}{required} 
     20; an 2d, 3d or 4d array 
     21; 
     22; @param COMPOSANTEV {in}{required} 
     23; an 2d, 3d or 4d array 
     24; 
     25; @keyword BOXZOOM 
     26; boxzoom on which do the average (by default the domain selected  
     27; by the last domdef done) 
     28; 
     29; @keyword DIREC 
     30; 't' 'x' 'y' 'z' 'xys' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 
     31;       'xzt' 'yzt' 'xyzt' Direction on which do averages  
     32; 
     33; @returns 
     34; Array to trace with plt, pltz or pltt. 
     35; 
     36; @uses 
     37; common.pro 
     38; 
     39; @restrictions  
     40; The norme is calculated on points TTo do this calculation, we average  
     41; field U and Von points T before calculate the norme. At the edge of  
     42; coast and of domain, we can not calculate fields U and V at points T,  
     43; that is why these points are at value !values.f_nan.  
    4244;  
    43 ;      lorsqu''on fait le calcul sur un domaine geographique reduit, 
    44 ;      les champs U et V ne comprennent pas forcement le meme nombre 
    45 ;      de points. Dans ce cas on redecoupe U et V pour ne garder que 
    46 ;      les points en commun. Au passage on refait un domdef qui 
    47 ;      redefinit un domaine geographique sur lequel les champs U et V 
    48 ;      sont extraits sur les meme points. 
    49 ; 
    50 ; RESTRICTIONS: 
    51 ; 
    52 ;      pour savoir a quel type de tableau on a a faire, on teste la 
    53 ;      taille de celui-ci et les dates donnees par time[0] et 
    54 ;      time[jpt-1] pour savoir si il y a une dimension 
    55 ;      temporelle. Avant de lancer norme s''assurer que time et jpt 
    56 ;      sont bien definis comme il faut!  
    57 ; 
    58 ; EXAMPLE: 
    59 ; 
    60 ;     pour calculer la moyenne de la norme des courants sur tout le 
    61 ;     dommaine entre 0 et 50: 
     45; When we calculate on a reduce geographic domain, field U and V have not  
     46; necessarily the same number of point. In this case, we recut U and V to  
     47; keep only common points. We profit of this to redo a domdef which redefine  
     48; a geographic domain on which fields U and V are extracted on same points 
     49; 
     50; @restrictions 
     51; To know what type of array we work with, we  test its size and dates  
     52; gave by time[0] and time[jpt-1] to know if thee is a temporal dimension.  
     53; Before to start norme, make sure that time and jpt are defined how  
     54; they have to!  
     55; 
     56; @examples 
     57; To calculate the average of the norme of streams on all the domain  
     58; between 0 et 50: 
    6259;      IDL> res=norme(un,vn,boxzoom=[0,50],dir='xyz') 
    6360; 
    64 ; MODIFICATION HISTORY: Sebastien Masson (smasson@lodyc.jussieu.fr) 
     61; @history 
     62; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    6563;                       9/6/1999 
     64; 
     65; @version 
     66; $Id$ 
     67; 
    6668;- 
    6769;------------------------------------------------------------ 
     
    8183  ENDIF 
    8284;--------------------------------------------------------- 
    83    tempsun = systime(1)         ; pour key_performance 
     85   tempsun = systime(1)         ; To key_performance 
    8486; 
    8587   IF finite(glamu[0])*finite(gphiu[0])*finite(glamv[0])*finite(gphiv[0]) EQ 0 THEN $ 
     
    101103;------------------------------------------------------------ 
    102104   if NOT keyword_set(direc) then direc = 0 
    103 ; construction de u et v aux pts T 
     105; construction of u and v at points T 
    104106   u = litchamp(composanteu) 
    105107   v = litchamp(composantev) 
     
    130132 
    131133;------------------------------------------------------------ 
    132 ; on trouve les points que u et v ont en communs 
     134; We find common points between u and v 
    133135;------------------------------------------------------------ 
    134136   indicexu = (lindgen(jpi))[firstxu:firstxu+nxu-1] 
     
    154156         indice3d = indice3d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt] 
    155157;------------------------------------------------------------ 
    156 ; extraction de u et v sur le domaine qui convient 
     158; extraction of u and v on the appropriated domain 
    157159;------------------------------------------------------------ 
    158160         case 1 of 
     
    191193         endcase 
    192194;------------------------------------------------------------------ 
    193 ; on reform u et v pour s'assurer qu'aucune dimension n'a ete ecrasee 
     195; We reshape u and v to make sure that no dimension has been erased 
    194196;------------------------------------------------------------------ 
    195197         if nzt EQ 1 then begin 
     
    198200         endif 
    199201;------------------------------------------------------------------ 
    200 ; construction de u et v aux pts T 
     202; construction of u and v at points T 
    201203;----------------------------------------------------------- 
    202204         a=u[0,*,*] 
     
    207209         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*]=a 
    208210;---------------------------------------------------------------------------- 
    209 ; attribution du mask et des tableau de longitude et latitude 
     211; attribution of the mask and of logitude and latitude arrays 
    210212;---------------------------------------------------------------------------- 
    211213         mask = tmask[indice3d] 
     
    222224         mask = where(mask eq 0) 
    223225         IF mask[0] NE -1 THEN res[mask] = valmask 
    224 ; moyennes en tous genres 
     226; All kind of average 
    225227         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, /meme 
    226228         if keyword_set(direc) then res = moyenne(res,direc,/nan, boxzoom = boxzoom, /nodomdef) 
     
    236238         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
    237239;------------------------------------------------------------ 
    238 ; extraction de u et v sur le domaine qui convient 
     240; extraction of u and v on the appropriated domain 
    239241;------------------------------------------------------------ 
    240242         case 1 of 
     
    258260         endcase 
    259261;------------------------------------------------------------------ 
    260 ; construction de u et v aux pts T 
     262; construction of u and v at points T 
    261263;----------------------------------------------------------- 
    262264         a=u[0,*,*] 
     
    267269         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*]=a 
    268270;---------------------------------------------------------------------------- 
    269 ; attribution du mask et des tableau de longitude et latitude 
    270 ; on recupere la grille complette pour etablir un grand mask etendu ds les 4 
    271 ; directions pour couvrir les points pour lesquels un pt terre a ete pris en 
    272 ; compte (faire un petit dessin...) 
     271; attribution of the mask and of longitude and latitude arrays. 
     272; We recover the complete grid to establish a big mask extent in the four  
     273; direction to cover pointsfor which a land point has been  
     274; considerated (make a small drawing) 
    273275;---------------------------------------------------------------------------- 
    274276         mask = tmask[indice2d+jpi*jpj*firstzt] 
    275277         if ny EQ 1 then mask = reform(mask, nx, ny, /over) 
    276278;----------------------------------------------------------- 
    277 ; construction de terre qui contient tous les point a masquer 
     279; construction of land containing all points to mask 
    278280;----------------------------------------------------------- 
    279281         if n_elements(valmask) EQ 0 THEN valmask = 1e20 
     
    308310         indice3d = indice3d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt] 
    309311;------------------------------------------------------------ 
    310 ; extraction de u et v sur le domaine qui convient 
     312; extraction of u and v on the appropriated domain 
    311313;------------------------------------------------------------ 
    312314         case 1 of 
     
    345347         endcase 
    346348;------------------------------------------------------------------ 
    347 ; construction de u et v aux pts T 
     349; construction of u and v at points T 
    348350;----------------------------------------------------------- 
    349351         a=u[0,*,*,*] 
     
    354356         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*,*]=a 
    355357;---------------------------------------------------------------------------- 
    356 ; attribution du mask et des tableau de longitude et latitude 
     358; attribution of the mask and of logitude and latitude arrays 
    357359;---------------------------------------------------------------------------- 
    358360         mask = tmask[indice3d] 
     
    375377            res[temporary(mask)] = valmask 
    376378         ENDIF 
    377 ; moyennes en tous genres 
     379; All kind of average 
    378380         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, /meme 
    379381         if keyword_set(direc) then res = grossemoyenne(res,direc,/nan, boxzoom = boxzoom, /nodomdef) 
     
    388390         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
    389391;------------------------------------------------------------ 
    390 ; extraction de u et v sur le domaine qui convient 
     392; extraction of u and v on the appropriated domain 
    391393;------------------------------------------------------------ 
    392394         case 1 of 
     
    410412         endcase 
    411413;------------------------------------------------------------------ 
    412 ; on reform u et v pour s'assurer qu'aucune dimension n'a ete ecrasee 
     414; We reshape u and v to make sure that no dimension has been erased 
    413415;------------------------------------------------------------------ 
    414416         if ny EQ 1 then begin 
     
    417419         endif 
    418420;------------------------------------------------------------------ 
    419 ; construction de u et v aux pts T 
     421; construction of u and v at points T 
    420422;----------------------------------------------------------- 
    421423         a=u[0,*] 
     
    426428         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0]=a 
    427429;---------------------------------------------------------------------------- 
    428 ; attribution du mask et des tableau de longitude et latitude 
    429 ; on recupere la grille complette pour etablir un grand mask etendu ds les 4 
    430 ; directions pour couvrir les points pour lesquels un pt terre a ete pris en 
    431 ; compte (faire un petit dessin...) 
     430; attribution of the mask and of longitude and latitude arrays. 
     431; We recover the complete grid to establish a big mask extent in the four  
     432; direction to cover pointsfor which a land point has been  
     433; considerated (make a small drawing) 
    432434;---------------------------------------------------------------------------- 
    433435         mask = tmask[indice2d+jpi*jpj*firstzt] 
    434436         if nyt EQ 1 THEN mask = reform(mask, nx, ny, /over) 
    435437;----------------------------------------------------------- 
    436 ; construction de terre qui contient tous les point a masquer 
     438; construction of land containing all points to mask 
    437439;----------------------------------------------------------- 
    438440         if n_elements(valmask) EQ 0 THEN valmask = 1e20 
     
    446448         mask = where(mask eq 0) 
    447449         IF mask[0] NE -1 THEN res[mask] = valmask 
    448 ; moyennes en tous genres 
     450; All kind of average 
    449451         domdef, (glamt[indice2d])[0, 0], (glamu[indice2d])[nx-1, 0],(gphit[indice2d])[0, 0], (gphiv[indice2d])[0, ny-1], vert1, vert2, /meme 
    450452         if keyword_set(direc) then res = moyenne(res,direc,/nan, boxzoom = boxzoom, /nodomdef) 
  • trunk/SRC/ToBeReviewed/CALCULS/projectondepth.pro

    r134 r142  
    33;------------------------------------------------------------ 
    44;+ 
    5 ; NAME:projectondepth 
    65; 
    7 ; PURPOSE: routine permettant de projeter un champ 3d suivant un 
    8 ; tableau de profondeurs. 
     6; @file_comments 
     7; Allows to project a 3d field following a depth array. 
    98; 
    10 ; CATEGORY: sans boucles 
     9; @categories 
     10; without loop 
    1111; 
    12 ; CALLING SEQUENCE:res=projectondepth(arrayin, depthin) 
     12; @param ARRAYIN  
     13; It is a 3d array whose 3rd dimension must be equal to jpk 
    1314;  
    14 ; INPUTS: 
    15 ;       arrayin: un tableau 3d dont la 3eme dimension doit etre egale 
    16 ;       a jpk 
    17 ;       depthin: un tableau 2d indiquant n chaque point a quel 
    18 ;       profondeur projeter 
     15; @param DEPTHIN  
     16; It is a 2d array indicating for each point n, at which depth to project 
    1917;        
    20 ; KEYWORD PARAMETERS:none 
     18; @returns 
     19; A 2d array which is the projection of the 3d array following depthes indicated by depthin 
    2120; 
    22 ; OUTPUTS:res: un tableau 2d projection du tableau 3d suivant les 
    23 ; profondeurs indiquees par depthin 
     21; @uses 
     22; common.pro 
    2423; 
    25 ; COMMON BLOCKS:common.pro 
     24; @restrictions  
     25; points at !values.f_nan impossible calculation. Land points masked at valmask. 
    2626; 
    27 ; SIDE EFFECTS: points a !values.f_nan qd calcul impossible. points 
    28 ; terres masques a Valmask. 
    29 ; 
    30 ; RESTRICTIONS: 
    31 ; 
    32 ; EXAMPLE: 
    33 ; 
    34 ; on contruit un tableau de profondeurs possibles 
     27; @examples 
     28; we build a possible depthes array 
    3529;   IDL> a=gdept[jpk-1]/(1.*jpi*jpj)*findgen(jpi,jpj) 
    36 ; on contruit un tableau a projeter sur ces profondeurs. pour le test 
    37 ; on construit un tableau 3d dont chaque vecteur suivant z est la 
    38 ; profondeur.  
     30; We build an array to project on these depthes. For the test, 
     31; we build a 3d array whose each vector following z is the depth.  
    3932;   IDL> arraytest=replicate(1,jpi*jpj)#gdept 
    4033;   IDL> arraytest=reform(arraytest,jpi,jpj,jpk, /over) 
    41 ; on test la projection du tabeau profondeur sur la profondeur... 
     34; We test the projection of the depth array on the depth... 
    4235;   IDL> plt, 1e6*(a-projectondepth(arraytest,a)),/nocontour 
    43 ;   ->champ nul a 1e-6 pres 
     36;   ->null field at 1e-6 pres 
    4437;  
    45 ;  verifcation en projettant la temperature sur la profondeur de la 20 
    46 ;  degres par exemple... 
     38;  verifcation projecting the temperature of 20°C for example... 
    4739; 
    48 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) 
     40; @history 
     41; Sebastien Masson (smasson@lodyc.jussieu.fr) 
    4942;                      15/6/2000 
     43; 
     44; @version 
     45; $Id$ 
     46; 
    5047;- 
    5148;------------------------------------------------------------ 
     
    5653  compile_opt idl2, strictarrsubs 
    5754; 
    58    tempsun = systime(1)         ; pour key_performance 
     55   tempsun = systime(1)         ; To key_performance 
    5956@common 
    6057;------------------------------------------------------------ 
    6158   depth = litchamp(depthin) 
    6259   array = litchamp(arrayin) 
    63 ; petites verifications 
     60; Small verifications 
    6461   tailledepth = size(depth) 
    6562   taillearray = size(array) 
    6663   if tailledepth[0] NE 2 THEN return, report('Depth array must have 2 dimensions') 
    6764   if taillearray[0] NE 3 THEN return, report('Array in must have 3 dimensions') 
    68 ; verification de la coherence entre la taille du tableau et le 
    69 ; domaine  
     65; verification of the coherence between array's size and the domain  
    7066   grille, mask, -1, -1, -1,nx,ny,nz,firstx,firsty,firstz,lastx,lasty,lastz 
    7167   case 1 of 
     
    8480; 
    8581   flevel = depth2floatlevel(depth) 
    86 ; on vire les points a !values.f_nan 
     82; we delete points at !values.f_nan 
    8783   notanumber = where(finite(flevel, /nan) EQ 1) 
    8884   if notanumber[0] NE -1 then flevel[notanumber] = 0 
    89 ; on seuil (vire les points terres a valmask par ex) 
     85; we sill (delete land points at valmask for example) 
    9086   flevel = 0 > flevel < (jpk-1) 
    9187; 
     
    9995   res = res+weight*(array[indexlow]-res) 
    10096; 
    101 ; on replace les points a !values.f_nan 
     97; We put back points at !values.f_nan 
    10298   if notanumber[0] NE -1 then res[notanumber] = !values.f_nan 
    10399   if out[0] NE -1 then res[out] = !values.f_nan 
    104 ; on masque les points terres a valmask 
     100; We mask land points at valmask 
    105101   if n_elements(valmask) EQ 0 then valmask = 1e20 
    106102   terre = where((temporary(mask))[*, *, 0] EQ 0) 
  • trunk/SRC/ToBeReviewed/CALCULS/remplit.pro

    r134 r142  
    1414;    and stays at !values.f_nan. 
    1515; 
     16; 
     17; @todo seb 
    1618; 
    1719;- 
  • trunk/SRC/ToBeReviewed/CALCULS/rhon.pro

    r134 r142  
    77   ;; par seb. 
    88   ;; 
     9; 
     10; @todo seb 
     11; 
    912;- 
    1013FUNCTION rhon, sn, tn, INSITU = insitu, SIGMA_N = sigma_n 
Note: See TracChangeset for help on using the changeset viewer.