Ignore:
Timestamp:
07/06/06 16:10:25 (18 years ago)
Author:
pinsard
Message:

improvements of Interpolation/*.pro header

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SRC/Interpolation/compute_fromreg_bilinear_weigaddr.pro

    r121 r125  
    11;+ 
    2 ; @file_comments compute the weight and address needed to interpolate data from a 
    3 ;          "regular grid" to any grid using the bilinear method 
    4 ;    
     2; @file_comments  
     3; compute the weight and address needed to interpolate data from a 
     4; "regular grid" to any grid using the bilinear method 
     5; 
    56; @categories interpolation 
    67; 
    7 ; @param alonin {in}{required} longitudeof the input data  
    8 ; @param alatin  {in}{required} latitude of the input data  
    9 ; @param olonin {in}{required} longitude of the output data  
    10 ; @param olat  {in}{required} latitude of the output data  
    11 ; 
    12 ; @keyword     /NONORTHERNLINE activate if you don't whant to take into 
     8; @param alonin {in}{required} longitudeof the input data 
     9; @param alatin  {in}{required} latitude of the input data 
     10; @param olonin {in}{required} longitude of the output data 
     11; @param olat  {in}{required} latitude of the output data 
     12; 
     13; @keyword NONORTHERNLINE activate if you don't want to take into 
    1314;          account the northen line of the input data when perfoming the 
    14 ; @keyword     /NOSOUTHERNLINE activate if you don't whant to take into 
     15; @keyword NOSOUTHERNLINE activate if you don't want to take into 
    1516;          account the southern line of the input data when perfoming the 
    1617;          interpolation. 
     
    2425; 
    2526; @restrictions 
    26 ;  -  the input grid must be a "regular grid", defined as a grid for which each 
    27    lontitudes lines have the same latitude and each latitudes columns have the 
    28    same longitude. 
    29 ;  -  We supposed the data are located on a sphere, with a periodicity along 
    30    the longitude. 
    31 ;  -  points located out of the southern and northern boundaries are interpolated 
    32    using a linear interpolation only along the longitudinal direction. 
    33 ;  
     27;  - the input grid must be a "regular grid", defined as a grid for which each 
     28lontitudes lines have the same latitude and each latitudes columns have the 
     29same longitude. 
     30;  - We supposed the data are located on a sphere, with a periodicity along 
     31the longitude. 
     32;  - points located out of the southern and northern boundaries are interpolated 
     33using a linear interpolation only along the longitudinal direction. 
     34; 
    3435; @history 
    35 ;  November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr)  
    36 ;  
     36;  November 2005: Sebastien Masson (smasson\@lodyc.jussieu.fr) 
     37; 
    3738; @version $Id$ 
    3839; 
    3940;- 
    40 ; 
    41 ;---------------------------------------------------------- 
    42 ;---------------------------------------------------------- 
    4341; 
    4442PRO compute_fromreg_bilinear_weigaddr, alonin, alatin, olonin, olat, weig, addr $ 
     
    6159  IF maxalon-minalon GE 360. THEN stop 
    6260; alon must be monotonically increasing 
    63   IF array_equal(sort(alon), lindgen(jpia)) NE 1 THEN BEGIN  
     61  IF array_equal(sort(alon), lindgen(jpia)) NE 1 THEN BEGIN 
    6462    shiftx = -(where(alon EQ min(alon)))[0] 
    6563    alon = shift(alon, shiftx) 
    6664    IF array_equal(sort(alon), lindgen(jpia)) NE 1 THEN stop 
    6765  ENDIF ELSE shiftx = 0 
    68 ; for longitude periodic bondary condition we add the fist 
    69 ; column on the right side of the array and  
     66; for longitude periodic boundary condition we add the fist 
     67; column on the right side of the array and 
    7068  alon = [alon, alon[0]+360.] 
    7169  jpia = jpia+1L 
     
    7674  IF array_equal(sort(alat), lindgen(jpja)) NE 1 THEN stop 
    7775; 
    78   if keyword_set(nonorthernline) then BEGIN  
     76  if keyword_set(nonorthernline) then BEGIN 
    7977    jpja = jpja - 1L 
    8078    alat = alat[0: jpja-1L] 
    8179  ENDIF 
    82   if keyword_set(nosouthernline) then BEGIN  
     80  if keyword_set(nosouthernline) then BEGIN 
    8381    alat = alat[1: jpja-1L] 
    8482    jpja = jpja - 1L 
     
    103101; if the ocean point is out of the atm grid, we use closest neighbor 
    104102; interpolation 
    105 ;  
     103; 
    106104; for each T point of oce grid, we find in which armospheric cell it is 
    107105; located. 
     
    113111; for longitude, each ocean points must be located in atm cell. 
    114112  IF (where(pos[0, *] EQ -1))[0] NE -1 THEN stop 
    115 ; no ocean point should be located westward of the left bondary of the 
    116 ; atm cell in which it is supposed to be located  
     113; no ocean point should be located westward of the left boundary of the 
     114; atm cell in which it is supposed to be located 
    117115  IF total(olon LT alon[pos[0, *]]) NE 0 THEN stop 
    118 ; no ocean point should be located eastward of the right bondary of the 
    119 ; atm cell in which it is supposed to be located  
     116; no ocean point should be located eastward of the right boundary of the 
     117; atm cell in which it is supposed to be located 
    120118  IF total(olon GT alon[pos[0, *]+1]) NE 0 THEN stop 
    121119; 
     
    124122; we change the coordinates of each ocean points to fit into a 
    125123; rectangle defined by: 
    126 ;  
     124; 
    127125;  y2 *------------* 
    128126;     |            | 
     
    143141  IF max(indx) GT jpia-2 THEN stop ; checks... 
    144142  IF max(indy) GT jpja-2 THEN stop ; checks... 
    145 ; x coordinates of the atm cell  
     143; x coordinates of the atm cell 
    146144  x1 = alon[indx] 
    147145  x2 = alon[indx+1] 
     
    149147  divi = temporary(x2)-x1 
    150148  glamnew = (olon-x1)/temporary(divi) 
    151   x1 = -1 ; free memory  
    152   olon = -1 ; free memory  
    153 ; y coordinates of the atm cell  
     149  x1 = -1 ; free memory 
     150  olon = -1 ; free memory 
     151; y coordinates of the atm cell 
    154152  y1 = alat[indy] 
    155153  y2 = alat[indy+1]             ; 
     
    159157  IF zero[0] NE -1 THEN divi[zero] = 1. 
    160158  gphinew = (olat-y1)/temporary(divi) 
    161   y1 = -1 ; free memory  
     159  y1 = -1 ; free memory 
    162160; checks... 
    163161  IF min(glamnew) LT 0 THEN stop 
     
    166164; weight and address array used for bilinear interpolation. 
    167165  xaddr = lonarr(4, jpio*jpjo) 
    168   xaddr[0, *] = indx   
     166  xaddr[0, *] = indx 
    169167  xaddr[1, *] = indx + 1L 
    170168  xaddr[2, *] = indx + 1L 
    171   xaddr[3, *] = indx   
    172 ;  
     169  xaddr[3, *] = indx 
     170; 
    173171  yaddr = lonarr(4, jpio*jpjo) 
    174172  yaddr[0, *] = indy 
     
    181179  weig[1, *] =     glamnew  * (1.-gphinew) 
    182180  weig[2, *] =     glamnew  *     gphinew 
    183   weig[3, *] = (1.-glamnew) *     gphinew  
     181  weig[3, *] = (1.-glamnew) *     gphinew 
    184182; free memory 
    185183  gphinew = -1 
     
    190188    ybad = olat[bad] 
    191189; the ocean points that are not located into an atm cell should be 
    192 ; located northward of the northern boundary of the atm grid  
    193 ;      or southward of the southern boundary of the atm grid  
     190; located northward of the northern boundary of the atm grid 
     191;      or southward of the southern boundary of the atm grid 
    194192    IF total(ybad GE min(alat) AND ybad LE max(alat)) GE 1 THEN stop 
    195193; 
     
    223221  IF revy EQ 1 THEN yaddr = jpja - 1L - temporary(yaddr) 
    224222;                         ; 
    225   addr = temporary(yaddr)*jpia + temporary(xaddr)  
     223  addr = temporary(yaddr)*jpia + temporary(xaddr) 
    226224; 
    227225  return 
Note: See TracChangeset for help on using the changeset viewer.