Interpolates data on a curvilinear grid (i.e. RCM, WRF, NARR) to an unstructured grid.
function rcm2points ( lat2d [*][*] : numeric, lon2d [*][*] : numeric, fi : numeric, lat [*] : numeric, lon [*] : numeric, opt : integer ) return_val : numeric
A two-dimensional array that specifies the latitude locations of fi. The latitudes should proceed from south-to-north.lon2d
A two-dimensional array that specifies the longitude locations of fi. The longitudes should be proceed left to right.fi
A multi-dimensional array to be interpolated. The rightmost two dimensions (latitude, longitude) are the dimensions to be interpolated.lat
A one-dimensional array that specifies the latitude coordinates of the output locations.lon
A one-dimensional array that specifies the longitude coordinates of the output locations.opt
opt=0 or 1 means use an inverse distance weight interpolation.
opt=2 means use a bilinear interpolation. (starting with v5.2.1)
A multi-dimensional array of the same size as fi except that the rightmost two dimensions have been replaced by the number of coordinate pairs (lat,lon). Double if fi is double, otherwise float.
Interpolates data on
A inverse distance squared algorithm is used to perform the interpolation.
Missing values are allowed and no extrapolation is performed.
Interpolate to two locations near Denver, Colorado:
lonDen = (/-104.867, -102.0/) latDen = (/ 39.75, 38.0/) f = addfile ("some_RCM_file.nc", "r") lat2d = f->xlat ; size = (nlat,nlon) lon2d = f->xlon ; size = (nlat,nlon) x = f->X xDen = rcm2points (lat2d, lon2d, x, lat, lon, 0)
If the input x was of size:
x(nlat,nlon) ==> xDen(2) x(ntim,nlat,nlon) ==> xDen(ntim,2) x(ntim,klev,nlat,nlon) ==> xDen(ntim,klev,2)
If only one coordinate pair was specified by the user, the result would be returned as a scalar.