[ncl-talk] wrf_user_intrp3d always interpolates to 100 levels

Trostel, John M. john.trostel at gtri.gatech.edu
Fri Dec 15 07:31:13 MST 2017


This should have read:


When using the function to produce a cross section ALONG A RADIAL IN THE X/Y PLANE...


Sorry for any confusion.


--
John Trostel
Director - Severe Storms Research Center
Georgia Tech Research Institute
Atlanta, GA 30332-0857
________________________________
From: ncl-talk <ncl-talk-bounces at ucar.edu> on behalf of Trostel, John M. <john.trostel at gtri.gatech.edu>
Sent: Friday, December 15, 2017 9:23:39 AM
To: Barry Lynn
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] wrf_user_intrp3d always interpolates to 100 levels


When using the function to produce a cross section, the plane is oriented in the vertical direction.  One of the inputs is a height/z array.  The code ignores all but the min/max of this array and just interpolates to 100 evenly spaced points in this vertical plane.


I have a very inelegant hack of the function working in my custom version of WRFUserARW.ncl.  In the hacked version, the input z array is used to produce the vertical dimension of the output.  The interpolation, is purely in the horizontal plane.


If the function is used to produce a vertical plane, the interpolation is, as you mentioned, to that constant height.


--
John Trostel
Director - Severe Storms Research Center
Georgia Tech Research Institute
Atlanta, GA 30332-0857
________________________________
From: Barry Lynn <barry.h.lynn at gmail.com>
Sent: Friday, December 15, 2017 3:21:29 AM
To: Trostel, John M.
Cc: ncl-talk at ucar.edu
Subject: Re: [ncl-talk] wrf_user_intrp3d always interpolates to 100 levels

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<mailto: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<mailto: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/eb3e4168/attachment-0001.html>


More information about the ncl-talk mailing list