# Re: using linint2 for WRF interpolation

From: Erik Noble <enoble_at_nyahnyahspammersnyahnyah>
Date: Sun, 18 Jan 2009 05:16:51 +0800

Dear Dennis. Thank you. Your help was more than expected help. Yes
.....I got the latitude/longitude labels backwards...:-| Thank you.

On Sun, Jan 18, 2009 at 3:54 AM, Dennis Shea <shea_at_ucar.edu> wrote:
> fi = a->T ; (Time,bottom_top,south_north,west_east)
> printVarSummary(fi) ; look at the variable
> printMinMax(fi, True ) ; contributed.ncl
>
> WRF XLAT/XLONG are (Time,south_north,west_east)
> Generally, they do not change with time.
> Hence, read then as 2D arrays
>
> ; These are [*][*] (two dimensional)
> lat2d = a->XLAT(0,:,:)
> lon2d = a->XLONG(0,:,:)
> lat2d_at_units = "degrees_north" ; not required for interpolation
> lon2d_at_units = "degrees_east"
>
> Your 'target' (rectilinear) grid is lat[*],lon[*].
> This could be from some other model
> or you could manually create via
>
> latS =-20 ; regular grid output
> latN = 35
> lonL =-35
> lonR = 35
>
> mlon = 50 ; however many points you want
> lon = fspan (lonL, lonR, mlon)
> lon!0= "lon"
> lon_at_units = "degrees_east"
>
> nlat = 40 ; however many points you want
> lat = fspan (latS,latN, nlat)
> lat!0= "lat"
> lat_at_units = "degrees_north"
>
> -----
> v5.1.0 has a faster code but the interface is exactly the same
>
> Erik Noble wrote:
>>
>> Thank you Dennis, for pointing me to the rcm2rgrid instructions.
>> Although there are examples, I'm not clear from the examples on what
>> to put for the "lat" and "lon" arguments. It says that they are 1D
>> arrays that specify the lat and lon coordinates of the regular grid
>> and that they should be monotonically increasing. My model output is
>> regional ( latitudes 35W to 35E, longitudes 20S to 35N).
>
> ?latitudes with W and E ... no
> ?longitudes with N and S ... no
>
> This is confusing
>
> Would I put
>>
>> these values in for the "lat" and "lon" arguments respectively(
>> {-35:35}",{-20:35})?
>>
>> function rcm2rgrid (
>> lat2d [*][*] : numeric,
>> lon2d [*][*] : numeric,
>> fi : numeric,
>> lat [*] : numeric,
>> lon [*] : numeric,
>> Option : numeric
>> )
>>
>> return_val : numeric
>> Thank you for your help.
>> -Erik
>> On Sat, Jan 17, 2009 at 1:13 PM, Dennis Shea <shea_at_ucar.edu> wrote:
>>>
>>> http://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2rgrid.shtml
>>>
>>> WRF data have multidimensional lat/lon arrays:
>>> XLAT[*][*], XLONG[*][*]
>>>
>>> linint2 had coordinates prototypes as one dimensional:
>>> lat[*], lon[*]
>>>
>>> The rcm2rgrid in version 5.1.0 is more efficient.
>>>
>>>
>>>
>>> Erik Noble wrote:
>>>>
>>>> Hi. I am trying to learn how to use NCL to interpolate WRF rain data
>>>> to observed precipitation from Satellite (TRMM).
>>>> Some say use the linint2 function to bilinearly interpolate.
>>>> Some don't:
>>>> http://www.ncl.ucar.edu/Support/talk_archives/2008/0484.html
>>>>
>>>> Do we have any examples of using linint2 with wrf data?
>>>> -Erik
>>>> _______________________________________________
>>>> ncl-talk mailing list
>>>> List instructions, subscriber options, unsubscribe:
>>>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>>
>>>
>>>
>
>
>
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Sat Jan 17 2009 - 14:16:51 MST

This archive was generated by hypermail 2.2.0 : Wed Jan 21 2009 - 13:09:21 MST