[ncl-talk] wrf_user_intrp3d always interpolates to 100 levels
Trostel, John M.
john.trostel at gtri.gatech.edu
Thu Dec 14 14:24:49 MST 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171214/22dcbddd/attachment.html>
More information about the ncl-talk
mailing list