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

english and nicer header (2a)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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) 
Note: See TracChangeset for help on using the changeset viewer.