Changeset 124 for trunk


Ignore:
Timestamp:
07/06/06 15:46:17 (18 years ago)
Author:
pinsard
Message:

improvements of Grid/*.pro header

Location:
trunk/SRC/Grid
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Grid/changemsk.pro

    r119 r124  
    1717; @returns newmsk the new 2D land-sea mask 
    1818; 
    19 ; @examples  
    20 ;  IDL> a = changemsk(tmask[*,*,0]) 
     19; @examples 
     20; IDL> a = changemsk(tmask[*,*,0]) 
    2121;  to add ocean points 
    22 ;  IDL> a = 1 - changemsk(1 - tmask[*,*,0]) 
     22; IDL> a = 1 - changemsk(1 - tmask[*,*,0]) 
    2323; 
    2424; @history 
  • trunk/SRC/Grid/computegrid.pro

    r121 r124  
    1111;       or a suitable mix... 
    1212; 
    13 ; glamt  
    14 ; glamf  
    15 ; gphit  
    16 ; gphif  
    17 ; e1t  
    18 ; e2t  
     13; glamt 
     14; glamf 
     15; gphit 
     16; gphi 
     17; e1t 
     18; e2t 
    1919; horizontal parameters 
    2020; 
     
    3030; e2f {in} 
    3131; horizontal parameters if FULLCGRID keyword is defined 
    32 ;       
    33 ; gdept  
    34 ; gdepw  
    35 ; e3t  
    36 ; e3w  
     32; 
     33; gdept 
     34; gdepw 
     35; e3t 
     36; e3w 
    3737; verticals parameters 
    3838; 
    39 ; tmask  
     39; tmask 
    4040; masks 
    4141; 
     
    4545; fmaskredy {in} 
    4646; masks if FULLCGRID keyword is defined 
    47 ;  
     47; 
    4848; triangles_list 
    4949; triangulation 
     
    5555; @param stepxin {in}{required} scalar or vector: x direction step, must be > 0 
    5656;             if vector nx is not used 
    57 ; @param stepyin {in}{required} scalar or vector: y direction step,  
     57; @param stepyin {in}{required} scalar or vector: y direction step, 
    5858;             could be > 0 (south to north) or < 0 (north to south) 
    5959;             if vector ny is not used 
    60 ; @param nxin {in}{required} scalar, number of points in x direction  
     60; @param nxin {in}{required} scalar, number of points in x direction 
    6161; @param nyin {in}{required} scalar, number of points in y direction 
    6262; 
    63 ; @keyword /FULLCGRID activate to specify that you want to compute 
     63; @keyword FULLCGRID activate to specify that you want to compute 
    6464;       all the paremeters of a C grid. Computation of glam[uv], 
    6565;       gphi[uv], e1[uvf], e2[uvf], [uv]maskred and fmaskred[xy] 
     
    7070;       we must have lon2 > lon1 and lon2 - lon1 le 360 
    7171;       key_shift will be defined automaticaly computed according to 
    72 ;       glamboundary by using the FIRST LINE of glamt but  
    73 ;       key_shift will /= 0 only if key_periodic = 1  
     72;       glamboundary by using the FIRST LINE of glamt but 
     73;       key_shift will /= 0 only if key_periodic = 1 
    7474; 
    7575; @keyword MASK to specify the mask with a 2 or 3 dimension array 
     
    7878;       key_onearth (to specify if the data are on earth -> use longitude 
    7979;       /latitude etc...). By default, key_onearth = 1. 
    80 ;       note that ONEARTH = 0 forces PERIODIC = 0, SHIFT = 0,  
     80;       note that ONEARTH = 0 forces PERIODIC = 0, SHIFT = 0, 
    8181;       and is cancelling GLAMBOUNDARY 
    8282; 
    8383; @keyword PERIODIC = 0 or 1 to force the manual definition of 
    8484;       key_periodic. By default, key_periodic is automaticaly 
    85 ;       computed by using the first line of glamt.  
    86 ; 
    87 ; @keyword /PLAIN force PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and 
    88 ;       suppress the automatic redefinition of the domain in case of  
     85;       computed by using the first line of glamt. 
     86; 
     87; @keyword PLAIN force PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and 
     88;       suppress the automatic redefinition of the domain in case of 
    8989;       x periodicity overlap, y periodicity overlap (ORCA type only) 
    9090;       and mask border to 0. 
     
    9393;       default, key_shift is automaticaly computed according to 
    9494;       glamboundary (when defined) by using the FIRST LINE of glamt. if 
    95 ;       key_periodic=0 then in any case key_shift = 0.  
     95;       key_periodic=0 then in any case key_shift = 0. 
    9696; 
    9797; @keyword STRCALLING a string containing the calling command used to 
     
    102102;       will be stored in the common (cm_4mesh) variable key_stride 
    103103; 
    104 ; @keyword XAXIS to specify longitude1 with a 1 or 2 dimension array, in  
     104; @keyword XAXIS to specify longitude1 with a 1 or 2 dimension array, in 
    105105;       this case startx, stepx and nx are not used but could be 
    106106;       necessary if the y axis is not defined with yaxis. It must be 
     
    108108;       order by shifting its elements. 
    109109; 
    110 ; @keyword YAXIS to specify latitudes with a 1 or 2 dimension array, in  
     110; @keyword YAXIS to specify latitudes with a 1 or 2 dimension array, in 
    111111;       this case starty, stepy and ny are not used but starty and 
    112112;       stepy could be necessary if the x axis is not defined with xaxis. 
     
    114114;       (along each column if 2d array). 
    115115; 
    116 ; @keyword /XYINDEX activate to specify that the horizontal grid should  
     116; @keyword XYINDEX activate to specify that the horizontal grid should 
    117117;       be simply defined by using the index of the points 
    118118;          (xaxis = findgen(nx) and yaxis = findgen(ny)) 
     
    120120; 
    121121; @keyword XMINMESH {default=0L} 
    122 ; @keyword YMINMESH {default=0L}  
    123 ; @keyword ZMINMESH {default=0L}  
     122; @keyword YMINMESH {default=0L} 
     123; @keyword ZMINMESH {default=0L} 
    124124;       to define the common variables i[xyz]minmesh 
    125125;       used to define the grid only in a zoomed part of the original 
     
    131131;       to define the common variables i[xyz]maxmesh 
    132132;       used to define the grid only in a zoomed part of the original 
    133 ;       grid. max value is jp[ijk]glo-1.  
    134 ;       if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as  
     133;       grid. max value is jp[ijk]glo-1. 
     134;       if [XYZ]MAXMESH is negative, then we define i[xyz]maxmesh as 
    135135;       jp[ijk]glo - 1 + [XYZ]MAXMESH instead of [XYZ]MAXMESH    
    136136; 
     
    177177                 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 
    178178                 , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 
    179                  , _extra = ex  
     179                 , _extra = ex 
    180180;--------------------------------------------------------- 
    181181; 
     
    200200; xaxis related parameters 
    201201; 
    202   if n_elements(xaxis) NE 0 then BEGIN  
     202  if n_elements(xaxis) NE 0 then BEGIN 
    203203    CASE (size(xaxis))[0] OF 
    204204      0:nx = 1L 
     
    206206      2:nx = (size(xaxis))[1] 
    207207    ENDCASE 
    208   ENDIF ELSE BEGIN  
    209     IF n_elements(startx) EQ 0 THEN BEGIN  
     208  ENDIF ELSE BEGIN 
     209    IF n_elements(startx) EQ 0 THEN BEGIN 
    210210      dummy = report('If xaxis is not given, startx must be defined') 
    211211      return 
    212212    ENDIF 
    213213    CASE n_elements(stepxin) OF 
    214       0:BEGIN  
     214      0:BEGIN 
    215215        dummy = report('If xaxis is not given, stepxin must be defined') 
    216216        return 
    217217      END 
    218       1:BEGIN  
    219         IF n_elements(nxin) EQ 0 THEN BEGIN  
     218      1:BEGIN 
     219        IF n_elements(nxin) EQ 0 THEN BEGIN 
    220220          dummy = report('If xaxis is not given and stepxin has only one element, nx must be defined') 
    221221          return 
    222222        ENDIF ELSE nx = nxin 
    223223      END 
    224       ELSE:nx = n_elements(stepxin)     
     224      ELSE:nx = n_elements(stepxin) 
    225225    ENDCASE 
    226   ENDELSE  
     226  ENDELSE 
    227227; 
    228228; yaxis related parameters 
    229229; 
    230   if n_elements(yaxis) NE 0 then BEGIN  
     230  if n_elements(yaxis) NE 0 then BEGIN 
    231231    CASE (size(yaxis))[0] OF 
    232232      0:ny = 1L 
     
    234234      2:ny = (size(yaxis))[2] 
    235235    ENDCASE 
    236   ENDIF ELSE BEGIN  
    237     IF n_elements(starty) EQ 0 THEN BEGIN  
     236  ENDIF ELSE BEGIN 
     237    IF n_elements(starty) EQ 0 THEN BEGIN 
    238238      dummy = report('If yaxis is not given, starty must be defined') 
    239239      return 
    240240    ENDIF 
    241241    CASE n_elements(stepyin) OF 
    242       0:BEGIN  
     242      0:BEGIN 
    243243        dummy = report('If yaxis is not given, stepyin must be defined') 
    244244        return 
    245245      END 
    246       1:BEGIN  
    247         IF n_elements(nyin) EQ 0 THEN BEGIN  
     246      1:BEGIN 
     247        IF n_elements(nyin) EQ 0 THEN BEGIN 
    248248          dummy = report('If yaxis is not given and stepyin has only one element, ny must be defined') 
    249249          return 
    250250        ENDIF ELSE ny = nyin 
    251251      END 
    252       ELSE:ny = n_elements(stepyin)     
     252      ELSE:ny = n_elements(stepyin) 
    253253    ENDCASE 
    254254  ENDELSE 
     
    256256; zaxis related parameters 
    257257; 
    258   if n_elements(zaxis) NE 0 then BEGIN  
     258  if n_elements(zaxis) NE 0 then BEGIN 
    259259    CASE (size(zaxis))[0] OF 
    260260      0:nz = 1L 
     
    290290  IF n_elements(zmaxmesh) NE 0 THEN izmaxmesh = long(zmaxmesh[0]) ELSE izmaxmesh  = jpkglo-1 
    291291; 
    292   iymaxmesh = iymaxmesh-keyword_set(fbase2tbase)  
     292  iymaxmesh = iymaxmesh-keyword_set(fbase2tbase) 
    293293; 
    294294  IF ixmaxmesh LT 0 THEN ixmaxmesh = jpiglo -1 + ixmaxmesh 
     
    327327; 
    328328; check onearth and its consequences 
    329 ;  
     329; 
    330330  IF n_elements(onearth) EQ 0 THEN key_onearth = 1b $ 
    331   ELSE key_onearth = keyword_set(onearth)  
     331  ELSE key_onearth = keyword_set(onearth) 
    332332  IF NOT key_onearth THEN BEGIN 
    333333    periodic = 0 
     
    343343; def of glamt 
    344344; 
    345   if n_elements(xaxis) NE 0 then BEGIN  
     345  if n_elements(xaxis) NE 0 then BEGIN 
    346346    if keyword_set(xyindex) THEN glamt = findgen(jpiglo) ELSE glamt = xaxis 
    347347  ENDIF ELSE BEGIN 
     
    350350      n_elements(stepx):glamt = startx + findgen(jpiglo)*stepx 
    351351      size(stepx, /n_dimensions):glamt = startx + total(stepx, /cumulative) 
    352       ELSE:BEGIN  
     352      ELSE:BEGIN 
    353353        dummy = report('Wrong definition of stepx...') 
    354354        return 
    355       END  
     355      END 
    356356    ENDCASE 
    357357  ENDELSE 
     
    392392      n_elements(stepy):gphit = starty + findgen(jpjglo)*stepy 
    393393      size(stepy, /n_dimensions):gphit = starty + total(stepy, /cumulative) 
    394       ELSE:BEGIN  
     394      ELSE:BEGIN 
    395395        dummy = report('Wrong definition of stepy...') 
    396396        return 
    397       END  
     397      END 
    398398    ENDCASE 
    399399  ENDELSE 
     
    407407  ENDCASE 
    408408; keep 2d array even with degenerated dimension 
    409   IF jpj EQ 1 THEN gphit = reform(gphit, jpi, jpj, /over)  
     409  IF jpj EQ 1 THEN gphit = reform(gphit, jpi, jpj, /over) 
    410410; 
    411411;==================================================== 
    412412; check y periodicity... Only according to ORCA grid 
    413 ;====================================================  
     413;==================================================== 
    414414; check the peridicity if iyminmesh and iymaxmesh have the default definitions... 
    415415  IF NOT keyword_set(plain) AND key_onearth EQ 1 AND key_stride[1] EQ 1 $ 
     
    418418    CASE 1 OF 
    419419      ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 $ 
    420         AND array_equal(gphit[1:*, jpj-1], reverse(gphit[1:*, jpj-3])) EQ 1:BEGIN  
     420        AND array_equal(gphit[1:*, jpj-1], reverse(gphit[1:*, jpj-3])) EQ 1:BEGIN 
    421421; T pivot 
    422422        ymaxmesh = -1 
    423423        recall = 1 
    424       END  
     424      END 
    425425      ixminmesh EQ 1l AND ixmaxmesh eq jpiglo-2 $ 
    426          AND array_equal(gphit[*, jpj-1], reverse(shift(gphit[*, jpj-3], -1))) EQ 1:BEGIN  
     426         AND array_equal(gphit[*, jpj-1], reverse(shift(gphit[*, jpj-3], -1))) EQ 1:BEGIN 
    427427; T pivot 
    428428        ymaxmesh = -1 
    429429        recall = 1 
    430       END  
     430      END 
    431431      ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 $ 
    432        AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN  
     432       AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 
    433433; F pivot 
    434434        ymaxmesh = -1 
    435435        recall = 1 
    436       END  
     436      END 
    437437      ixminmesh EQ 1l AND ixmaxmesh eq jpiglo-2 $ 
    438          AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN  
     438         AND array_equal(gphit[*, jpj-1], reverse(gphit[*, jpj-2])) EQ 1:BEGIN 
    439439; F pivot 
    440440        ymaxmesh = -1 
    441441        recall = 1 
    442       END  
     442      END 
    443443      ELSE: 
    444444    ENDCASE 
    445   ENDIF  
     445  ENDIF 
    446446; 
    447447;==================================================== 
    448448; check x periodicity... 
    449 ;====================================================  
    450 IF n_elements(periodic) NE 0 THEN forcenoperio = 1 - keyword_set(periodic)  
     449;==================================================== 
     450IF n_elements(periodic) NE 0 THEN forcenoperio = 1 - keyword_set(periodic) 
    451451;                                                    check the peridicity if ixminmesh and ixmaxmesh have the default definitions... 
    452452  IF NOT keyword_set(plain) AND NOT keyword_set(forcenoperio) AND key_onearth EQ 1 $ 
     
    454454    CASE 0 OF 
    455455      total((glamt[0, *] - glamt[jpi-2, *]) MOD 360) $ 
    456       + total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN  
     456      + total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 
    457457        xminmesh = 1 
    458458        xmaxmesh = -1 
    459459        recall = 1 
    460       END  
    461       total((glamt[0, *] - glamt[jpi-2, *]) MOD 360):BEGIN  
     460      END 
     461      total((glamt[0, *] - glamt[jpi-2, *]) MOD 360):BEGIN 
    462462        xminmesh = 1 
    463463        recall = 1 
    464       END  
    465       total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN  
     464      END 
     465      total((glamt[1, *] - glamt[jpi-1, *]) MOD 360):BEGIN 
    466466        xmaxmesh = -1 
    467467        recall = 1 
     
    469469      ELSE: 
    470470    ENDCASE 
    471   ENDIF  
     471  ENDIF 
    472472;==================================================== 
    473473; recall computegrid if needed... 
    474 ;====================================================  
     474;==================================================== 
    475475  IF keyword_set(recall) THEN BEGIN 
    476476    computegrid, XAXIS = glamt, YAXIS = gphit, ZAXIS = zaxis $ 
     
    482482                 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 
    483483                 , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 
    484                  , _extra = ex  
     484                 , _extra = ex 
    485485    return 
    486486  ENDIF 
     
    511511        print, 'WARNING: we cannot sort the xaxis with a simple shift...' 
    512512        print, 'we force key_periodic = 0 and key_shift = 0' 
    513         print, 'only horizontal plot may be ok...'  
     513        print, 'only horizontal plot may be ok...' 
    514514        key_periodic = 0 
    515515        xnotsorted = 1 
    516       ENDIF ELSE BEGIN  
     516      ENDIF ELSE BEGIN 
    517517        key_periodic = (xtest[jpi-1]+2*(xtest[jpi-1]-xtest[jpi-2])) $ 
    518518                       GE (xtest[0]+360) 
    519519      ENDELSE 
    520520    ENDIF ELSE key_periodic = 0 
    521   ENDIF ELSE key_periodic = keyword_set(periodic)  
     521  ENDIF ELSE key_periodic = keyword_set(periodic) 
    522522; 
    523523; update key_shift 
     
    534534;==================================================== 
    535535; 
    536   if keyword_set(key_shift) then BEGIN  
     536  if keyword_set(key_shift) then BEGIN 
    537537    glamt = shift(glamt, key_shift, 0) 
    538538    gphit = shift(gphit, key_shift, 0) 
    539     IF jpj EQ 1 THEN BEGIN  
     539    IF jpj EQ 1 THEN BEGIN 
    540540      glamt = reform(glamt, jpi, jpj, /over) 
    541541      gphit = reform(gphit, jpi, jpj, /over) 
     
    581581;==================================================== 
    582582; 
    583   IF jpi GT 1 THEN BEGIN  
     583  IF jpi GT 1 THEN BEGIN 
    584584; we must compute stepxf: x distance between T(i,j) T(i+1,j+1) 
    585585    CASE 1 OF 
     
    602602          ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 
    603603        ENDELSE 
    604         IF jpj GT 1 THEN BEGIN  
     604        IF jpj GT 1 THEN BEGIN 
    605605          stepxf[*, jpj-1] = stepxf[*, jpj-2] 
    606606          stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] 
     
    612612; 
    613613  IF keyword_set(key_periodic) AND (max(glamf)-min(glamt)) GE 360 THEN BEGIN 
    614     IF NOT keyword_set(glamboundary) THEN BEGIN  
     614    IF NOT keyword_set(glamboundary) THEN BEGIN 
    615615      bigger = where(glamf GE min(glamt)+360) 
    616616      glamf[bigger] = glamf[bigger]-360. 
     
    624624;==================================================== 
    625625; 
    626   IF jpj GT 1 THEN BEGIN  
     626  IF jpj GT 1 THEN BEGIN 
    627627; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 
    628628    CASE 1 OF 
     
    636636            stepyf[jpi-1, *] = stepyf[jpi-2, *] 
    637637          stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 
    638         ENDIF  
    639       END  
     638        ENDIF 
     639      END 
    640640    ENDCASE 
    641641    gphif = gphit + 0.5 * stepyf 
     
    660660          stepxu = [ [[stepxu]], [[stepxu + 360]], [[stepxu - 360]] ] 
    661661          stepxu = min(abs(stepxu), dimension = 3) 
    662         ENDIF ELSE BEGIN  
     662        ENDIF ELSE BEGIN 
    663663          stepxu = shift(glamt, -1, 0) - glamt 
    664664          stepxu[jpi-1, *] = stepxf[jpi-2, *] 
    665         ENDELSE  
     665        ENDELSE 
    666666      ENDIF ELSE stepxu = stepxf 
    667667      IF jpj EQ 1 THEN stepxu = reform(stepxu, jpi, jpj, /over) 
    668668      e1t = 0.5*(stepxu+shift(stepxu, 1, 0)) 
    669669      IF NOT keyword_set(key_periodic) THEN $ 
    670         e1t[0, *] = e1t[1, *]  
     670        e1t[0, *] = e1t[1, *] 
    671671    ENDIF ELSE e1t = replicate(stepx, jpi, jpj) 
    672672  ENDIF ELSE e1t = replicate(1b, jpi, jpj) 
     
    750750;==================================================== 
    751751; 
    752     IF keyword_set(key_irregular) THEN $         
     752    IF keyword_set(key_irregular) THEN $ 
    753753      gphiv = gphit + 0.5 * stepyv $ 
    754754    ELSE gphiv = gphif 
     
    769769; 
    770770    IF keyword_set(key_irregular) THEN BEGIN 
    771       e2u = gphif - shift(gphif, 0, 1)  
     771      e2u = gphif - shift(gphif, 0, 1) 
    772772      e2u[*, 0] = e2u[*, 1] 
    773773      IF key_onearth THEN e2u = r * !pi/180. * temporary(e2u) 
     
    783783      IF keyword_set(key_periodic) THEN BEGIN 
    784784        e1v = (glamf + 720) MOD 360 
    785         e1v = e1v - shift(e1v, 1, 0)  
     785        e1v = e1v - shift(e1v, 1, 0) 
    786786        e1v = [ [[e1v]], [[e1v + 360]], [[e1v - 360]] ] 
    787787        e1v = min(abs(e1v), dimension = 3) 
    788       ENDIF ELSE BEGIN  
     788      ENDIF ELSE BEGIN 
    789789        e1v = glamf - shift(glamf, 1, 0) 
    790790        e1v[0, *] = stepxf[1, *] 
    791       ENDELSE  
    792     ENDIF ELSE e1v = e1t  
     791      ENDELSE 
     792    ENDIF ELSE e1v = e1t 
    793793; 
    794794    IF jpj EQ 1 THEN e1v = reform(e1v, jpi, jpj, /over) 
     
    813813        e1f = [ [[e1f]], [[e1f + 360]], [[e1f - 360]] ] 
    814814        e1f = min(abs(e1f), dimension = 3) 
    815       ENDIF ELSE BEGIN  
     815      ENDIF ELSE BEGIN 
    816816        e1f = shift(glamv, -1, 0) - glamt 
    817817        e1f[jpi-1, *] = stepxf[jpi-2, *] 
    818       ENDELSE  
     818      ENDELSE 
    819819    ENDIF ELSE e1f = e1u 
    820820; 
     
    850850  ENDIF 
    851851; 
    852   IF jpj EQ 1 THEN BEGIN  
     852  IF jpj EQ 1 THEN BEGIN 
    853853    e1t = reform(e1t, jpi, jpj, /over) 
    854854    IF keyword_set(fullcgrid) THEN BEGIN 
     
    856856      e1v = reform(e1v, jpi, jpj, /over) 
    857857      e1f = reform(e1f, jpi, jpj, /over) 
    858     ENDIF   
    859   ENDIF   
     858    ENDIF 
     859  ENDIF 
    860860; 
    861861;==================================================== 
     
    868868    e1u = !values.f_nan & e1v = !values.f_nan & e1f = !values.f_nan 
    869869    e2u = !values.f_nan & e2v = !values.f_nan & e2f = !values.f_nan 
    870     firstxu = !values.f_nan & lastxu = !values.f_nan & nxu = !values.f_nan   
    871     firstyu = !values.f_nan & lastyu = !values.f_nan & nyu = !values.f_nan   
    872     firstxv = !values.f_nan & lastxv = !values.f_nan & nxv = !values.f_nan   
    873     firstyv = !values.f_nan & lastyv = !values.f_nan & nyv = !values.f_nan   
     870    firstxu = !values.f_nan & lastxu = !values.f_nan & nxu = !values.f_nan 
     871    firstyu = !values.f_nan & lastyu = !values.f_nan & nyu = !values.f_nan 
     872    firstxv = !values.f_nan & lastxv = !values.f_nan & nxv = !values.f_nan 
     873    firstyv = !values.f_nan & lastyv = !values.f_nan & nyv = !values.f_nan 
    874874  ENDIF 
    875875; 
     
    878878;==================================================== 
    879879; 
    880 ; z axis    
     880; z axis 
    881881; 
    882882    CASE n_elements(zaxis) OF 
     
    890890      END 
    891891      ELSE:BEGIN 
    892         gdept = zaxis[izminmesh:izmaxmesh]  
     892        gdept = zaxis[izminmesh:izmaxmesh] 
    893893        IF jpk GT 1 THEN BEGIN 
    894894          if gdept[0] GT gdept[1] then begin 
     
    945945      fmaskredy = tmask[jpi-1, *, *] 
    946946      fmaskredx = tmask[*, jpj-1, *] 
    947     ENDIF  
    948   ENDIF ELSE BEGIN  
     947    ENDIF 
     948  ENDIF ELSE BEGIN 
    949949    tmask = replicate(1b, jpi, jpj, jpk) 
    950950    IF keyword_set(fullcgrid) THEN BEGIN 
     
    953953      fmaskredy = replicate(1b, jpj, jpk) 
    954954      fmaskredx = replicate(1b, jpi, jpk) 
    955     ENDIF  
     955    ENDIF 
    956956  ENDELSE 
    957957; 
     
    974974                     , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 
    975975                     , FBASE2TBASE = fbase2tbase, STRCALLING = strcalling $ 
    976                      , _extra = ex  
     976                     , _extra = ex 
    977977        return 
    978   ENDIF  
     978  ENDIF 
    979979; 
    980980  IF NOT keyword_set(fullcgrid) THEN BEGIN 
     
    10091009    e3w = e3w[0:*:stride[2]] 
    10101010; we must recompute glamf and gphif... 
    1011     IF jpi GT 1 THEN BEGIN  
     1011    IF jpi GT 1 THEN BEGIN 
    10121012      if (keyword_set(key_onearth) AND keyword_set(xnotsorted)) $ 
    10131013        OR (keyword_set(key_periodic) AND key_irregular) then BEGIN 
     
    10241024          ELSE stepxf[jpi-1, *] = stepxf[jpi-2, *] 
    10251025      ENDELSE 
    1026       IF jpj GT 1 THEN BEGIN  
     1026      IF jpj GT 1 THEN BEGIN 
    10271027        stepxf[*, jpj-1] = stepxf[*, jpj-2] 
    10281028        stepxf[jpi-1, jpj-1] = stepxf[jpi-2, jpj-2] 
     
    10301030      glamf = glamt + 0.5 * stepxf 
    10311031    ENDIF ELSE glamf = glamt + 0.5 
    1032     IF jpj GT 1 THEN BEGIN  
     1032    IF jpj GT 1 THEN BEGIN 
    10331033; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 
    10341034      stepyf = shift(gphit, -1, -1) - gphit 
     
    10381038          stepyf[jpi-1, *] = stepyf[jpi-2, *] 
    10391039        stepyf[jpi-1, jpj-1] = stepyf[jpi-2, jpj-2] 
    1040       ENDIF  
     1040      ENDIF 
    10411041      gphif = gphit + 0.5 * stepyf 
    10421042    ENDIF ELSE gphif = gphit + 0.5 
    10431043; 
    1044     IF jpj EQ 1 THEN BEGIN  
     1044    IF jpj EQ 1 THEN BEGIN 
    10451045      glamt = reform(glamt, jpi, jpj, /over) 
    10461046      gphit = reform(gphit, jpi, jpj, /over) 
     
    10661066      fmaskredy = (temporary(fmaskredy))[0, 0:*:stride[1], 0:*:stride[2]] 
    10671067      fmaskredx = (temporary(fmaskredx))[0:*:stride[0], 0, 0:*:stride[2]] 
    1068       IF jpj EQ 1 THEN BEGIN  
     1068      IF jpj EQ 1 THEN BEGIN 
    10691069        glamu = reform(glamu, jpi, jpj, /over) 
    10701070        gphiu = reform(gphiu, jpi, jpj, /over) 
     
    10981098    IF jpiglo EQ 182 AND jpi EQ 181 AND jpjglo EQ 149 AND jpj EQ 148 THEN $ 
    10991099       triangles_list = triangule() ELSE triangles_list = triangule(/keep_cont) 
    1100   ENDELSE  
     1100  ENDELSE 
    11011101; 
    11021102;==================================================== 
     
    11041104;==================================================== 
    11051105; 
    1106   IF n_elements(time) EQ 0 OR n_elements(jpt) EQ 0 THEN BEGIN  
     1106  IF n_elements(time) EQ 0 OR n_elements(jpt) EQ 0 THEN BEGIN 
    11071107    jpt = 1 
    11081108    time = 0 
     
    11161116;==================================================== 
    11171117; 
    1118   IF NOT keyword_set(strcalling) THEN BEGIN  
     1118  IF NOT keyword_set(strcalling) THEN BEGIN 
    11191119    IF n_elements(ccmeshparameters) EQ 0 THEN strcalling = 'computegrid' $ 
    11201120    ELSE strcalling = ccmeshparameters.filename 
     
    11251125    gphiinfo = moment(gphit) 
    11261126    IF finite(gphiinfo[2]) EQ 0 THEN gphiinfo = gphiinfo[0:1] 
    1127   ENDIF ELSE BEGIN  
     1127  ENDIF ELSE BEGIN 
    11281128    glaminfo = glamt 
    11291129    gphiinfo = gphit 
    1130   ENDELSE  
     1130  ENDELSE 
    11311131  ccmeshparameters = {filename:strcalling  $ 
    11321132          , glaminfo:float(string(glaminfo, format = '(E11.4)')) $ 
     
    11531153  return 
    11541154end 
    1155  
  • trunk/SRC/Grid/micromeshmask.pro

    r118 r124  
    3232;+ 
    3333; 
    34 ;      @param ncfilein {in}{required} 
    35 ;      1) the name of the meshmask file to be reduced. In that case, 
    36 ;      there is only one meshmask file 
    37 ; 
    38 ;      OR 
    39 ; 
    40 ;      2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 
    41 ;      xxx.mask.nc. In that case, the meshmask is split into 3 files. 
     34; @param ncfilein {in}{required} 
     35; 1) the name of the meshmask file to be reduced. In that case, 
     36; there is only one meshmask file 
     37; 
     38; OR 
     39; 
     40; 2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 
     41; xxx.mask.nc. In that case, the meshmask is split into 3 files. 
    4242; 
    4343; @param ncfileout {in}{optional} the name of the uniq reduced meshmask file. 
  • trunk/SRC/Grid/ncdf_meshread.pro

    r121 r124  
    2323;    key_shift will be automaticaly defined according to GLAMBOUNDARY. 
    2424; 
    25 ; @keyword /CHECKDAT Suppressed. Use micromeshmask.pro to create an 
     25; @keyword CHECKDAT Suppressed. Use micromeshmask.pro to create an 
    2626;    appropriate meshmask. 
    2727; 
  • trunk/SRC/Grid/smallmeshmask.pro

    r121 r124  
    3232; fields. 
    3333; 
    34 ;    @keyword IODIR to define the files path. 
    35 ;      @param ncfilein {in}{required} 
    36 ;      1) the name of the meshmask file to be reduced. In that case, 
    37 ;      there is only one meshmask file 
    38 ; 
    39 ;      OR 
    40 ; 
    41 ;      2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 
    42 ;      xxx.mask.nc. In that case, the meshmask is split into 3 files. 
    43 ; 
    44 ;      @param ncfileout {in}{optional}{default=smallmeshmask.nc}  
    45 ;      the name of the reduced meshmask file.  
     34; @keyword IODIR to define the files path. 
     35; @param ncfilein {in}{required} 
     36; 1) the name of the meshmask file to be reduced. In that case, 
     37; there is only one meshmask file 
     38; 
     39; OR 
     40; 
     41; 2) the xxx part in the names: xxx.mesh_hgr.nc xxx.mesh_zgr.nc 
     42; xxx.mask.nc. In that case, the meshmask is split into 3 files. 
     43; 
     44; @param ncfileout {in}{optional}{default=smallmeshmask.nc}  
     45; the name of the reduced meshmask file.  
    4646; 
    4747; @examples 
    48 ;    IDL> meshdir='/d1fes2-raid2/smasson/DATA/ORCA05/' 
    49 ;    IDL> smallmeshmask, 'meshmask_ORCA_R05.nc',iodir=meshdir 
     48; IDL> meshdir='/d1fes2-raid2/smasson/DATA/ORCA05/' 
     49; IDL> smallmeshmask, 'meshmask_ORCA_R05.nc',iodir=meshdir 
    5050; 
    5151; @categories for OPA meshmask files 
Note: See TracChangeset for help on using the changeset viewer.