Ignore:
Timestamp:
03/16/07 10:22:26 (17 years ago)
Author:
pinsard
Message:

corrections of some misspellings in some *.pro

File:
1 edited

Legend:

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

    r163 r226  
    44;+ 
    55; 
    6 ; @file_comments  
     6; @file_comments 
    77; calculate the norm of a field of vectors, then make a possible average. 
    88;   Comment 1: The field of vector can be, 2d:xy, 3d: xyz or xyt, 
    99; 4d: xyzt 
    1010;   Comment 2: 
    11 ; The calculation of the norm is made before the possible spatial or  
    12 ; temporal average because the average of the norm is not equal to the  
     11; The calculation of the norm is made before the possible spatial or 
     12; temporal average because the average of the norm is not equal to the 
    1313; norm of averages 
    1414 
     
    2424; 
    2525; @keyword BOXZOOM 
    26 ; boxzoom on which do the average (by default the domain selected  
     26; boxzoom on which do the average (by default the domain selected 
    2727; by the last domdef done) 
    2828; 
    2929; @keyword DIREC 
    3030; 't' 'x' 'y' 'z' 'xys' 'xz' 'yz' 'xyz' 'xt' 'yt' 'zt' 'xyt' 
    31 ;       'xzt' 'yzt' 'xyzt' Direction on which do averages  
     31;       'xzt' 'yzt' 'xyzt' Direction on which do averages 
    3232; 
    3333; @returns 
     
    3737; common.pro 
    3838; 
    39 ; @restrictions  
    40 ; The norm 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.  
    44 ;  
    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  
     39; @restrictions 
     40; The norm 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. 
     44; 
     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 
    4848; a geographic domain on which fields U and V are extracted on same points 
    4949; 
    5050; @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!  
     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! 
    5555; 
    5656; @examples 
    57 ; To calculate the average of the norme of streams on all the domain  
     57; To calculate the average of the norme of streams on all the domain 
    5858; between 0 et 50: 
    5959;      IDL> res=norme(un,vn,boxzoom=[0,50],dir='xyz') 
     
    9090; 
    9191;------------------------------------------------------------ 
    92   if keyword_set(boxzoom) then BEGIN  
     92  if keyword_set(boxzoom) then BEGIN 
    9393    Case 1 Of 
    9494      N_Elements(Boxzoom) Eq 1:bte = [lon1, lon2, lat1, lat2, 0., boxzoom[0]] 
     
    100100    ENDCASE 
    101101    domdef, boxzoom 
    102   ENDIF  
     102  ENDIF 
    103103;------------------------------------------------------------ 
    104104   if NOT keyword_set(direc) then direc = 0 
     
    120120   if grillev EQ '' then grillev = 'V' 
    121121   IF grilleu EQ 'V' AND grillev EQ 'U' THEN inverse = 1 
    122    IF grilleu EQ 'T' AND grillev EQ 'T' THEN BEGIN  
    123       interpolle  = 0  
     122   IF grilleu EQ 'T' AND grillev EQ 'T' THEN BEGIN 
     123      interpolle  = 0 
    124124      return, report('cas non code mais facile a faire!') 
    125125   ENDIF ELSE interpolle = 1 
     
    140140   indiceyv = (lindgen(jpj))[firstyv:firstyv+nyv-1] 
    141141   indicey = inter(indiceyu, indiceyv) 
    142    nx = n_elements(indicex)  
     142   nx = n_elements(indicex) 
    143143   ny = n_elements(indicey) 
    144144;---------------------------------------------------------------------------- 
     
    149149;---------------------------------------------------------------------------- 
    150150;---------------------------------------------------------------------------- 
    151       (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN  
     151      (size(u))[0] EQ 3 AND date1 EQ date2 :BEGIN 
    152152;---------------------------------------------------------------------------- 
    153153         indice2d = lindgen(jpi, jpj) 
     
    160160         case 1 of 
    161161            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 
    162              (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN  
     162             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 
    163163               case (size(u))[3] OF 
    164                   nzt:BEGIN  
     164                  nzt:BEGIN 
    165165                     if nxu NE nx then $ 
    166                       if indicex[0] EQ firstxu then u = u[0:nx-1,*,*] ELSE u = u[1: nx, *,*]  
     166                      if indicex[0] EQ firstxu then u = u[0:nx-1,*,*] ELSE u = u[1: nx, *,*] 
    167167                     IF nxv NE nx THEN $ 
    168168                      if indicex[0] EQ firstxv then v = v[0:nx-1,*,*] ELSE v = v[1: nx, *,*] 
    169169                     IF nyu NE ny THEN $ 
    170                       if indicey[0] EQ firstyu then u = u[*,0:ny-1,*] ELSE u = u[*, 1: ny,*]  
     170                      if indicey[0] EQ firstyu then u = u[*,0:ny-1,*] ELSE u = u[*, 1: ny,*] 
    171171                     IF nyv NE ny THEN $ 
    172172                      if indicey[0] EQ firstyv then v = v[*,0:ny-1,*] ELSE v = v[*, 1: ny,*] 
    173173                  end 
    174                   jpk:BEGIN  
     174                  jpk:BEGIN 
    175175                     if nxu NE nx then $ 
    176                       if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt] ELSE u = u[1: nx, *,firstzt:lastzt]  
     176                      if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt] ELSE u = u[1: nx, *,firstzt:lastzt] 
    177177                     IF nxv NE nx THEN $ 
    178178                      if indicex[0] EQ firstxv then v = v[0:nx-1, *,firstzt:lastzt] ELSE v = v[1: nx, *,firstzt:lastzt] 
    179179                     IF nyu NE ny THEN $ 
    180                       if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt] ELSE u = u[*, 1: ny,firstzt:lastzt]  
     180                      if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt] ELSE u = u[*, 1: ny,firstzt:lastzt] 
    181181                     IF nyv NE ny THEN $ 
    182182                      if indicey[0] EQ firstyv then v = v[*, 0:ny-1,firstzt:lastzt] ELSE v = v[*, 1: ny,firstzt:lastzt] 
     
    186186            END 
    187187            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND (size(u))[3] EQ jpk AND $ 
    188              (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN  
     188             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 
    189189               u = u[indice3d] 
    190190               v = v[indice3d] 
     
    209209         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*]=a 
    210210;---------------------------------------------------------------------------- 
    211 ; attribution of the mask and of logitude and latitude arrays 
     211; attribution of the mask and of longitude and latitude arrays 
    212212;---------------------------------------------------------------------------- 
    213213         mask = tmask[indice3d] 
     
    234234;---------------------------------------------------------------------------- 
    235235;---------------------------------------------------------------------------- 
    236       date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN  
     236      date1 NE date2 AND (size(u))[0] EQ 3 :BEGIN 
    237237         indice2d = lindgen(jpi, jpj) 
    238238         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
     
    242242         case 1 of 
    243243            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 
    244              (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN  
     244             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 
    245245               if nxu NE nx then $ 
    246                 if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *]  
     246                if indicex[0] EQ firstxu then u = u[0:nx-1, *, *] ELSE u = u[1: nx, *, *] 
    247247               IF nxv NE nx THEN $ 
    248248                if indicex[0] EQ firstxv then v = v[0:nx-1, *, *] ELSE v = v[1: nx, *, *] 
    249249               IF nyu NE ny THEN $ 
    250                 if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *]  
     250                if indicey[0] EQ firstyu then u = u[*, 0:ny-1, *] ELSE u = u[*, 1: ny, *] 
    251251               IF nyv NE ny THEN $ 
    252252                if indicey[0] EQ firstyv then v = v[*, 0:ny-1, *] ELSE v = v[*, 1: ny, *] 
    253253            END 
    254254            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ 
    255              (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN  
     255             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 
    256256               u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *] 
    257257               v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1, *] 
     
    270270;---------------------------------------------------------------------------- 
    271271; 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  
     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 
    274274; considerated (make a small drawing) 
    275275;---------------------------------------------------------------------------- 
     
    288288         res[*,0, *]=!values.f_nan 
    289289         mask = where(mask eq 0) 
    290          IF mask[0] NE -1 THEN BEGIN  
     290         IF mask[0] NE -1 THEN BEGIN 
    291291            coeftps = lindgen(jpt)*nx*ny 
    292292            coeftps = replicate(1, n_elements(mask))#coeftps 
     
    304304;---------------------------------------------------------------------------- 
    305305;---------------------------------------------------------------------------- 
    306       date1 NE date2 AND (size(u))[0] EQ 4:BEGIN  
     306      date1 NE date2 AND (size(u))[0] EQ 4:BEGIN 
    307307         indice2d = lindgen(jpi, jpj) 
    308308         indice2d = indice2d[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1] 
     
    314314         case 1 of 
    315315            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 
    316              (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN  
     316             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 
    317317               case (size(u))[3] OF 
    318                   nzt:BEGIN  
     318                  nzt:BEGIN 
    319319                     if nxu NE nx then $ 
    320                       if indicex[0] EQ firstxu then u = u[0:nx-1,*,*,*] ELSE u = u[1: nx, *,*,*]  
     320                      if indicex[0] EQ firstxu then u = u[0:nx-1,*,*,*] ELSE u = u[1: nx, *,*,*] 
    321321                     IF nxv NE nx THEN $ 
    322322                      if indicex[0] EQ firstxv then v = v[0:nx-1,*,*,*] ELSE v = v[1: nx, *,*,*] 
    323323                     IF nyu NE ny THEN $ 
    324                       if indicey[0] EQ firstyu then u = u[*,0:ny-1,*,*] ELSE u = u[*, 1: ny,*,*]  
     324                      if indicey[0] EQ firstyu then u = u[*,0:ny-1,*,*] ELSE u = u[*, 1: ny,*,*] 
    325325                     IF nyv NE ny THEN $ 
    326326                      if indicey[0] EQ firstyv then v = v[*,0:ny-1,*,*] ELSE v = v[*, 1: ny,*,*] 
    327327                  end 
    328                   jpk:BEGIN  
     328                  jpk:BEGIN 
    329329                     if nxu NE nx then $ 
    330                       if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt,*] ELSE u = u[1: nx, *,firstzt:lastzt,*]  
     330                      if indicex[0] EQ firstxu then u = u[0:nx-1, *,firstzt:lastzt,*] ELSE u = u[1: nx, *,firstzt:lastzt,*] 
    331331                     IF nxv NE nx THEN $ 
    332332                      if indicex[0] EQ firstxv then v = v[0:nx-1, *,firstzt:lastzt,*] ELSE v = v[1: nx, *,firstzt:lastzt,*] 
    333333                     IF nyu NE ny THEN $ 
    334                       if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt,*] ELSE u = u[*, 1: ny,firstzt:lastzt,*]  
     334                      if indicey[0] EQ firstyu then u = u[*, 0:ny-1,firstzt:lastzt,*] ELSE u = u[*, 1: ny,firstzt:lastzt,*] 
    335335                     IF nyv NE ny THEN $ 
    336336                      if indicey[0] EQ firstyv then v = v[*, 0:ny-1,firstzt:lastzt,*] ELSE v = v[*, 1: ny,firstzt:lastzt,*] 
     
    340340            END 
    341341            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND (size(u))[3] EQ jpk AND $ 
    342              (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN  
     342             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj AND (size(u))[3] EQ jpk :BEGIN 
    343343               u = u[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt, *] 
    344344               v = v[indicex[0]:indicex[0]+nx-1,indicey[0]:indicey[0]+ny-1,firstzt:lastzt, *] 
     
    356356         if NOT keyword_set(key_periodic) OR nx NE jpi then v[*,0,*,*]=a 
    357357;---------------------------------------------------------------------------- 
    358 ; attribution of the mask and of logitude and latitude arrays 
     358; attribution of the mask and of longitude and latitude arrays 
    359359;---------------------------------------------------------------------------- 
    360360         mask = tmask[indice3d] 
     
    370370         res[*,0, *, *]=!values.f_nan 
    371371         mask = where(mask eq 0) 
    372          IF mask[0] NE -1 THEN BEGIN  
     372         IF mask[0] NE -1 THEN BEGIN 
    373373            coeftps = lindgen(jpt)*nx*ny*nzt 
    374374            coeftps = replicate(1, n_elements(mask))#coeftps 
     
    394394         case 1 of 
    395395            (size(u))[1] EQ nxu AND (size(u))[2] EQ nyu AND $ 
    396              (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN  
     396             (size(v))[1] EQ nxv AND (size(v))[2] EQ nyv:BEGIN 
    397397               if nxu NE nx then $ 
    398                 if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *]  
     398                if indicex[0] EQ firstxu then u = u[0:nx-1, *] ELSE u = u[1: nx, *] 
    399399               IF nxv NE nx THEN $ 
    400400                if indicex[0] EQ firstxv then v = v[0:nx-1, *] ELSE v = v[1: nx, *] 
    401401               IF nyu NE ny THEN $ 
    402                 if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny]  
     402                if indicey[0] EQ firstyu then u = u[*, 0:ny-1] ELSE u = u[*, 1: ny] 
    403403               IF nyv NE ny THEN $ 
    404404                if indicey[0] EQ firstyv then v = v[*, 0:ny-1] ELSE v = v[*, 1: ny] 
    405405            END 
    406406            (size(u))[1] EQ jpi AND (size(u))[2] EQ jpj AND $ 
    407              (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN  
     407             (size(v))[1] EQ jpi AND (size(v))[2] EQ jpj:BEGIN 
    408408               u = u[indice2d] 
    409409               v = v[indice2d] 
     
    429429;---------------------------------------------------------------------------- 
    430430; 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  
     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 
    433433; considerated (make a small drawing) 
    434434;---------------------------------------------------------------------------- 
     
    455455   endcase 
    456456;------------------------------------------------------------ 
    457    if keyword_set(key_performance) THEN print, 'temps norme', systime(1)-tempsun  
     457   if keyword_set(key_performance) THEN print, 'temps norme', systime(1)-tempsun 
    458458   return, res 
    459459end 
Note: See TracChangeset for help on using the changeset viewer.