[ncl-talk] wrf_user_intrp3d always interpolates to 100 levels
Barry Lynn
barry.h.lynn at gmail.com
Fri Dec 15 01:21:29 MST 2017
Dear John:
I am not sure I follow what you are trying to do, but plane should be a
single number, like the height you want to interpolate to (in m, if z is in
m).
Barry
On Thu, Dec 14, 2017 at 11:24 PM, Trostel, John M. <
john.trostel at gtri.gatech.edu> wrote:
> I have been trying to use the function “wrf_user_intrp3d” and assumed it
> would work like the NCL documentation suggests.
>
>
>
> Function wrf_user_intrp3d (var3d, vert, plot_type, loc, angle, logical)
>
>
>
> I am calling it as follows:
>
> rh_plane = wrf_user_intrp3d(rh,z,"v",plane,0.,opts)
>
>
>
> where rh is my relative humidity variable from wrfout (at time “it)
>
> rh = wrf_user_getvar(a,"rh",it) ; relative humidity
>
> and z is my model heights
>
> z = wrf_user_getvar(a, "z",it) ; grid point height
>
> plane is defined as follows:
>
>
>
> ; Find the ij location for the Test Site (remains constant)
>
> test_lat = 35.0
>
> test_lon = -85.7
>
> llres = True
>
> llres at ReturnInt = True ; Return integer values
>
> locij = wrf_user_ll_to_ij(a, test_lon, test_lat, llres)
>
> locij = locij - 1 ; array pointers in NCL space
>
> TestX = locij(0)
>
> TestY = locij(1)
>
> ; print("TestX (" + test_lat + "): " + TestX)
>
> ; print("TestY (" + test_lon + "): " + TestY)
>
>
>
> ; Find the ij location for the end point (change for different arcs)
>
> end_lat = 34.0
>
> end_lon = -85.5
>
> llres = True
>
> llres at ReturnInt = True ; Return integer values
>
> locij = wrf_user_ll_to_ij(a, end_lon, end_lat, llres)
>
> locij = locij - 1 ; array pointers in NCL space
>
> EndX = locij(0)
>
> EndY = locij(1)
>
>
>
> plane = new(4,float)
>
> plane = (/ TestX, TestY, EndX, EndY /) ; start x;y &
> end x;y point
>
>
>
> and, finally
>
> opts=True
>
>
>
> I would expect to get back rh_plane values along the radial of the defined
> “plane” at the heights specified in z. In this case, I defined 50 heights
> for WRF, so I have a nZ of 50 for the z/interpolation variable. I was
> baffled when I got back 100 rh_plane values in the vertical. Looking
> through the source code for wrf_user_intrp3d (finally), I found that the
> function is just interpolating to a uniform 100 levels between the min and
> max Z values.
>
> z_max = max(z)
>
> z_min = 0.
>
> dz = 0.01 * z_max
>
> nlevels = tointeger( zmax/dz )
>
>
>
> Why doesn’t the routine use the levels that the user has input into the
> function?
>
> Is there an improved wrf_user_intrp3d function? (Can I fix it and
> recompile it easily?)
>
>
>
> --
>
> John Trostel
>
> Director – Severe Storms Research Center
>
> Georgia Tech Research Institute
>
> Atlanta, GA 30332-0857
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
--
Barry H. Lynn, Ph.D
Senior Lecturer,
The Institute of the Earth Science,
The Hebrew University of Jerusalem,
Givat Ram, Jerusalem 91904, Israel
Tel: 972 547 231 170
Fax: (972)-25662581
C.E.O, Weather It Is, LTD
Weather and Climate Focus
http://weather-it-is.com
Jerusalem, Israel
Local: 02 930 9525
Cell: 054 7 231 170
Int-IS: x972 2 930 9525
US 914 432 3108
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171215/c6b90565/attachment.html>
More information about the ncl-talk
mailing list