[ncl-talk] interpolation

Dennis Shea shea at ucar.edu
Fri Nov 9 15:55:54 MST 2018


The function works. Read the documentation.

WRF data are ordered ( [time,] *bottom_top, *south_north x west_east ) ==>
(time,'z','lat','lon')

See appended script. For demonstration only 2 points are used.

Variable: x
Number of Dimensions: 3
Dimensions and sizes:   *[bottom_top | 34] *x [south_north | 160] x
[west_east | 180]

Variable: lat2d
Number of Dimensions: 2
Dimensions and sizes:   [south_north | 160] x [west_east | 180]

Variable: lon2d
Number of Dimensions: 2
Dimensions and sizes:   [south_north | 160] x [west_east | 180]


Variable: *xNew*
Number of Dimensions: 2
Dimensions and sizes:    *[34] x [2]   <== levels, 2 random points*

(0,0)    10.26271
(0,1)    -0.3363198
(1,0)    10.02834
(1,1)    -0.3514601
(2,0)    9.985236
(2,1)    -0.3351685
[snip]
(32,0)  163.538
(32,1)  168.1733
(33,0)  182.0521
(33,1)  185.6072

=============

 nt    = 0
  a     = addfile("wrfout_d01_2003-07-15_00:00:00.nc","r")
  x = a->T(nt,:,:,:)
  printVarSummary( x ) ; [bottom_top | 34] x [south_north | 160] x
[west_east | 180]
  print("-----")

  lat2d = a->XLAT(nt,:,:)
  lon2d = a->XLONG(nt,:,:)

  printVarSummary(lat2d)      ; [south_north | 160] x [west_east | 180]
  printMinMax(lat2d, True)
  printVarSummary(lon2d)      ; [south_north | 160] x [west_east | 180]
  printMinMax(lon2d, True)
  print("-----")

  latPts = (/  22.,  29./)
  lonPts = (/-100., -93./)
  xNew   = rcm2points(lat2d, lon2d, x, latPts, lonPts, 1)
  print(xNew)


On Fri, Nov 9, 2018 at 3:04 PM Raj K. Rai <rajkrai at gmail.com> wrote:

> Hi Jim, Thanks for your email. Function rcm2points may work for 2d data, but I want to interpolate variables from 3d wrfoutout field (lat, lon, and z) into the given scattered points in space (given lat, lon, and z).
>
> Thanks,
>
> Raj
>
>
> Hi Raj,
>
> I believe the function rcm2points should work for that.
> https://www.ncl.ucar.edu/Document/Functions/Built-in/rcm2points.shtml
>
> Jim
>
>
> On 11/1/2018 10:26 AM, Raj K. Rai wrote:
> >* Hi,
> *>* I am trying to interpolate variables from WRF output into the
> *>* specified set of points, which are scattered in space. I found
> *>* routines that interpolates variables into vertical and horizontal
> *>* plane, but could not figure out if there is any routine for this task.
> *>* Could you please help me finding this?
> *>* Thanks,
> *>* Raj
> *>>>* _______________________________________________
> *>* ncl-talk mailing list
> *>* ncl-talk at ucar.edu <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
> *>* List instructions, subscriber options, unsubscribe:
> *>* http://mailman.ucar.edu/mailman/listinfo/ncl-talk <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
> *
> --
> Untitled Document
>
> James D. Means, Ph.D.
> Senior Atmospheric & Climate Scientist
> California Office
> Tele: 619-495-1638 | Fax: 775-636-8430
> 930 Tahoe Blvd., Suite 802-560
> Incline Village, Nevada 89451jim at weatherextreme.com <http://mailman.ucar.edu/mailman/listinfo/ncl-talk> <mailto:jim at weatherextreme.com <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>> | vcard
> <http://www.weatherextreme.com/vcards/James%20Means.vcf>www.weatherextreme.com <http://www.weatherextreme.com/>
>
>
> On Thu, Nov 1, 2018 at 10:26 AM Raj K. Rai <rajkrai at gmail.com> wrote:
>
>> Hi,
>> I am trying to interpolate variables from WRF output into the specified
>> set of points, which are scattered in space. I found routines that
>> interpolates variables into vertical and horizontal plane, but could not
>> figure out if there is any routine for this task. Could you please help me
>> finding this?
>> Thanks,
>> Raj
>>
> _______________________________________________
> 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/20181109/e5c1367b/attachment.html>


More information about the ncl-talk mailing list