Changeset 252


Ignore:
Timestamp:
06/25/07 11:44:12 (17 years ago)
Author:
smasson
Message:

add yreverse and zreverse in computegrid

File:
1 edited

Legend:

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

    r240 r252  
    101101; 
    102102; @keyword PLAIN {default=0}{type=scalar: 0 or 1} 
    103 ;       Force PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and 
    104 ;       suppress the automatic redefinition of the domain in case of 
    105 ;       x periodicity overlap, y periodicity overlap (ORCA type only) 
    106 ;       and mask border to 0. 
     103;       Force YREVERSE = 0, ZREVERSE = 0, PERIODIC = 0, SHIFT = 0, STRIDE = [1, 1, 1] and 
     104;       suppress the automatic redefinition of the domain in case of x periodicity overlap, 
     105;       y periodicity overlap (ORCA type only) and mask border to 0. 
    107106; 
    108107; @keyword SHIFT {default=computed according to glamboundary}{type=scalar} 
     
    208207;       Used by xxx... 
    209208; 
     209; @keyword YREVERSE {default=computed according to gphit[0, 1:jpj-1] LT gphit[0, 0:jpj-2]}{type=scalar} 
     210;       Force the manual definition of the y reverse that must be apply to the data. 
     211;       The resulting value will be stored in the common (cm_4mesh) variable key_yreverse 
     212; 
    210213; @keyword ZAXIS {type=1D} 
    211214;       Specify the vertical axis. Must be sorted in the increasing or decreasing order 
     215; 
     216; @keyword ZREVERSE {default=computed according to gdept[0] GT gdept[1]}{type=scalar} 
     217;       Force the manual definition of the z reverse that must be apply to the data. 
     218;       The resulting value will be stored in the common (cm_4mesh) variable key_zreverse 
    212219; 
    213220; @keyword _EXTRA 
     
    219226; cm_4cal 
    220227; 
     228 
    221229; @restrictions 
    222230; if the grid has x/y periodicity overlap and/or if 
     
    249257                 , ONEARTH = onearth, PERIODIC = periodic $ 
    250258                 , PLAIN = plain, SHIFT = shift, STRIDE = stride $ 
     259                 , YREVERSE = yreverse, ZREVERSE = zreverse  $ 
    251260                 , FULLCGRID = fullcgrid, XYINDEX = xyindex $ 
    252261                 , UBASE2TBASE = ubase2tbase, VBASE2TBASE = vbase2tbase, FBASE2TBASE = fbase2tbase $ 
     
    356365; 
    357366  IF keyword_set(plain) THEN BEGIN 
     367    yreverse = 0 
     368    zreverse = 0 
    358369    periodic = 0 
    359370    shift = 0 
     
    499510;==================================================== 
    500511; check the peridicity if iyminmesh and iymaxmesh have the default definitions... 
    501   IF NOT keyword_set(plain) AND key_onearth EQ 1 AND key_stride[1] EQ 1 $ 
     512  IF NOT keyword_set(plain) AND key_onearth EQ 1 $ 
    502513    AND iyminmesh EQ 0l AND iymaxmesh eq jpjglo-1 AND jpj GE 3 AND jpi GE 2 THEN BEGIN 
    503514 
     
    537548; check the peridicity if ixminmesh and ixmaxmesh have the default definitions... 
    538549  IF NOT keyword_set(plain) AND NOT keyword_set(forcenoperio) AND key_onearth EQ 1 $ 
    539      AND key_stride[0] EQ 1 AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 AND jpi GE 3 THEN BEGIN 
     550     AND ixminmesh EQ 0l AND ixmaxmesh eq jpiglo-1 AND jpi GE 3 THEN BEGIN 
    540551    CASE 0 OF 
    541552      total((glamt[0, *] - glamt[jpi-2, *]) MOD 360) $ 
     
    576587;==================================================== 
    577588; 
    578   IF jpj GT 1 THEN BEGIN 
    579     IF total(gphit[0, 1:jpj-1] LT gphit[0, 0:jpj-2]) GT jpj/2 THEN BEGIN 
    580       key_yreverse = 1 
    581       gphit = reverse(gphit, 2) 
    582       glamt = reverse(glamt, 2) 
     589  IF n_elements(yreverse) EQ 0 THEN BEGIN  
     590    IF jpj GT 1 THEN BEGIN 
     591      IF total(gphit[0, 1:jpj-1] LT gphit[0, 0:jpj-2]) GT jpj/2 THEN key_yreverse = 1 ELSE key_yreverse = 0 
    583592    ENDIF ELSE key_yreverse = 0 
    584   ENDIF ELSE key_yreverse = 0 
     593  ENDIF ELSE key_yreverse = yreverse 
     594  IF keyword_set(key_yreverse) THEN BEGIN 
     595    gphit = reverse(gphit, 2) 
     596    glamt = reverse(glamt, 2) 
     597  ENDIF 
    585598; 
    586599;==================================================== 
     
    978991      ELSE:BEGIN 
    979992        gdept = zaxis[izminmesh:izmaxmesh] 
    980         IF jpk GT 1 THEN BEGIN 
    981           if gdept[0] GT gdept[1] then begin 
    982             gdept = reverse(gdept) 
    983             key_zreverse = 1 
     993        IF n_elements(zreverse) EQ 0 THEN BEGIN 
     994          IF jpk GT 1 THEN BEGIN 
     995            if gdept[0] GT gdept[1] then key_zreverse = 1 ELSE key_zreverse = 0 
    984996          ENDIF ELSE key_zreverse = 0 
    985         ENDIF ELSE key_zreverse = 0 
     997        ENDIF ELSE key_zreverse = zreverse 
     998        IF keyword_set(key_zreverse) THEN gdept = reverse(gdept) 
    986999      END 
    9871000    ENDCASE 
     
    11251138      glamf = glamt + 0.5 * stepxf 
    11261139    ENDIF ELSE glamf = glamt + 0.5 
     1140    IF keyword_set(key_periodic) AND (max(glamf)-min(glamt)) GE 360 THEN BEGIN 
     1141      IF NOT keyword_set(glamboundary) THEN BEGIN 
     1142        bigger = where(glamf GE min(glamt)+360) 
     1143        glamf[bigger] = glamf[bigger]-360. 
     1144      ENDIF ELSE glamf = glamboundary[0] > temporary(glamf) < glamboundary[1] 
     1145    ENDIF 
    11271146    IF jpj GT 1 THEN BEGIN 
    11281147; we must compute stepyf: y distance between T(i,j) T(i+1,j+1) 
Note: See TracChangeset for help on using the changeset viewer.