interpolate from grid to random single point (rcm2rgrid)

From: Greg Thompson (gthompsn AT XXXXXX)
Date: Mon Dec 03 2001 - 13:49:06 MST

  • Next message: Mary Haley: "Re: repressing automatic units plotting"

    Hi,

    given a grid of temperature at the points shown, I'd like to compute
    the interpolated (method of bi-linear interp would be great) temp
    at the "x" location. The lat/lon of the gridpoints is not regular
    (not equi-spaced lat/lon is what I mean) as this is the RUC-2 model
    (lambert conformal projection).

       (61,58) (62,58)
          +----------------+
          | |
          | |
          | (lat,lon) |
          | x | the lat/lon of "x" is known like a station (DEN) and
          +----------------+ and the lat/lons of the grid are stored in 2-D arrays.
       (61,57) (62,57)

    At first, I figured the routine "linint2_points" was tailor-made. It appears
    this isn't the case as the arguments need to increase monotomically which my
    lat/lons do not. Dennis S suggested I use rcm2rgrid but this too is sub-optimal
    for my purposes. For reasons that aren't clear to me the point "x" needs to
    contain more than a single lat/lon and the output value is then multi-dimensional.
    The code I got to work is shown here:
    ;
    begin
    ;
    ; Ingest GRIB file for RUC data
        gribfile = "200131812.F00.RUCp.grb"
        file1 = addfile (gribfile,"r")

        lon2d = file1->gridlon_236
        lat2d = file1->gridlat_236

        temp=file1->TMP_236_ISBL({500},:,:)-273.16
        tempsfc=file1->TMP_236_HTGL(:,:)-273.16

        lonDen = (/-104.867, -102.0/)
        latDen = (/39.75, 38.0/)

        denTemp500 = rcm2rgrid (lat2d, lon2d, temp, latDen, lonDen, 0)
    end

    I really want denTemp500 to automagically be either a scalar or
    array depending on whether the input (latDen, lonDen) is scalar
    or array. Also, given the code above, I expect "denTemp500" to
    be a one-dimensional array yet it is two. Why? Shouldn't it
    simply contain a value at the first point I ask and then the second
    point? Does anyone have any alternate suggestions to perform
    this type of operation? THANKS!

    -- Greg T. NCAR/RAP



    This archive was generated by hypermail 2b29 : Mon Dec 10 2001 - 10:42:48 MST