[ncl-talk] Issue using linint2_points
Dennis Shea
shea at ucar.edu
Wed Nov 29 16:18:19 MST 2017
Hello Manda,
[1] The following 'cheat' should *not *be used*. *Depending on your grid,
this could lead to interpolation issues. Maybe that is the source of your
problem!?!
lon2d = f->gridlon_0
lat = lat2d(:,0) ; <=== left edge of grid
lon = lon2d(0,:) ; <=== bottom edge of grd
===============
[2] I am not very familiar with 'ruc' files. I assume you are calculating
the potential temperatures at each level because they are not available on
the file. Correct?
%> ncl_filedump ruc....grb | less
===============
[3] Cross section interpolation:
[a] Use gc_latlon with the beginning and end locations to get the
total distance. [ie: No do loop']
GCDIST = *gc_latlon*(lat_cx(0),lon_cx(0),lat_cx(npts-1),lon_cx(npts-1),2,4)
print(GCDIST) ; total great circle distance between beginning and end
[b] Generate the lat and lon locations along the great cicle path.
gcdist = gc_latlon(lat_cx,lon_cx, lat_cx,lon_cx ,3,4)
print(gcdist) ; *LOOK* at the output
*print *(gcdist at gclat+" "+gcdist at gclon ) ; print the 'npts' [ cx ] locations
The gclat and gclon attributes are the locations to which you want to
interpolate.
[4] Although 'slow', use 'r*cm2points_Wrap*' to perform the
interpolation to the desired cross-section locations.
https://www.ncl.ucar.edu/Document/Functions/Contributed/rcm2points_Wrap.shtml
https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml
cx = *rcm2points* (lat2d, lon2d, x, gcdist at gclat, gcdist at gclon, 0)
printVarSummary(cx)
printMinMax(cx,0)
WHen you plot you will get locations like
*https://www.ncl.ucar.edu/Applications/Images/narr_5_3_lg.png
<https://www.ncl.ucar.edu/Applications/Images/narr_5_3_lg.png>*
====================
****NOTE****
*Sadly, there will be no lat/lon coordinate variables for the
cross-section :-(Happily, the byproduct will be that you will get the
correct results! :-)*=====================
There are other approaches.
For example, you could use ESMF regridding to interpolate the
curvilinear RUC grid
to a rectilinear grid and then use 'ininnt2_points_Wrap'
https://www.ncl.ucar.edu/Applications/ESMF.shtml
https://www.ncl.ucar.edu/Applications/ESMF.shtml#ex30
https://www.ncl.ucar.edu/Document/Functions/Contributed/linint2_points_Wrap.shtml
https://www.ncl.ucar.edu/Applications/narr.shtml
See examples 5 and 6
Good luck
On Wed, Nov 29, 2017 at 9:04 AM, Chasteen, Manda B. <manda.chasteen at ou.edu>
wrote:
> Hi Adam,
>
>
> Thank you for the quick response. I checked what you suggested and the
> latitude and longitude arrays are of the same format. The issue is that the
> values seem to increase upon interpolation for whatever reason.
>
>
> Thanks,
>
>
> Manda
>
>
> *____________________________________________________*
>
> *Manda Chasteen*
>
> Graduate Research Assistant
>
> Cooperative Institute for Mesoscale Meteorological Studies
>
> School of Meteorology
>
> University of Oklahoma
>
> *manda.chasteen at ou.edu <manda.chasteen at ou.edu>*
>
> *manda.chasteen at noaa.gov <manda.chasteen at noaa.gov>*
> ------------------------------
> *From:* Adam Phillips <asphilli at ucar.edu>
> *Sent:* Wednesday, November 29, 2017 9:52:10 AM
> *To:* Chasteen, Manda B.
> *Cc:* ncl-talk at ucar.edu
> *Subject:* Re: [ncl-talk] Issue using linint2_points
>
> Hi Manda,
> Make sure that the range of your lon/lat arrays match the range of your
> lon_cx/lat_cx arrays. Specifically, you are specifying -95 and -87 for your
> longitudes that go into lon_cx. When you call linint2_points:
> rhint = linint2_points_Wrap(lon,lat,rh,False,lon_cx,lat_cx,2)
> you need to make sure that lon contains negative longitudes as well.
> (Similarly, you need to make sure the latitudes specified in lat_cx are
> within the range of latitudes in your lat array.)
>
> Hope that helps. If not, or if you have any further questions please
> respond to the ncl-talk email list.
> Adam
>
> On Tue, Nov 28, 2017 at 11:57 PM, Chasteen, Manda B. <
> manda.chasteen at ou.edu> wrote:
>
> Hello,
>
>
> I am using the linint2_points_Wrap function in NCL version 6.4.0 to
> interpolate RUC data to a cross-section of lat/lons. The function is
> working; however, the values aren't quite right. I am wondering if you know
> why this may be and have a fix for this issue.
>
>
> I have attached the script, an example cross section plot, and screen
> shots of the printed values at the inflow point from the raw potential
> temperature field and that interpolated to this cross section (black
> contours).
>
>
> *____________________________________________________*
>
> *Manda Chasteen*
>
> Graduate Research Assistant
>
> Cooperative Institute for Mesoscale Meteorological Studies
>
> School of Meteorology
>
> University of Oklahoma
>
> *manda.chasteen at ou.edu <manda.chasteen at ou.edu>*
>
> *manda.chasteen at noaa.gov <manda.chasteen at noaa.gov>*
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__mailman.ucar.edu_mailman_listinfo_ncl-2Dtalk&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=OT__ZeTERsSHknu29rw_oqBkpfZqQbt7Y28v3NtReqg&e=>
>
>
>
>
> --
> Adam Phillips
> Associate Scientist, Climate and Global Dynamics Laboratory, NCAR
> www.cgd.ucar.edu/staff/asphilli/
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cgd.ucar.edu_staff_asphilli_&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=64dHcmEDeZlwmEuT8rIP-BYt_CFFuw9ralbyNY52jXw&e=>
> 303-497-1726 <(303)%20497-1726>
>
>
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cgd.ucar.edu_staff_asphilli&d=DwMFaQ&c=qKdtBuuu6dQK9MsRUVJ2DPXW6oayO8fu4TfEHS8sGNk&r=2Yak6HLcZ9Ge-HyAzp8wvmrwDPBjL31zf4WX0slB0dw&m=8H9aMtOc_rW14vF13tUUEkKKP3Vx026pjwS4IluZPyQ&s=Z6eoLXoa6FxwtAVQCHyCQ0Sa0U-ZCF_MVxT5_3HDW34&e=>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171129/84066e42/attachment.html>
More information about the ncl-talk
mailing list