<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;" dir="ltr">
<p>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.</p>
<p><br>
</p>
<p>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.</p>
<p><br>
</p>
<p>If the function is used to produce a vertical plane, the interpolation is, as you mentioned, to that constant height.</p>
<p><br>
</p>
<div id="Signature">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
--
<div>John Trostel<br>
Director - Severe Storms Research Center<br>
Georgia Tech Research Institute<br>
Atlanta, GA 30332-0857</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Barry Lynn <barry.h.lynn@gmail.com><br>
<b>Sent:</b> Friday, December 15, 2017 3:21:29 AM<br>
<b>To:</b> Trostel, John M.<br>
<b>Cc:</b> ncl-talk@ucar.edu<br>
<b>Subject:</b> Re: [ncl-talk] wrf_user_intrp3d always interpolates to 100 levels</font>
<div> </div>
</div>
<div>
<div dir="ltr">Dear John:
<div><br>
</div>
<div>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).</div>
<div><br>
</div>
<div>Barry</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Dec 14, 2017 at 11:24 PM, Trostel, John M. <span dir="ltr">
<<a href="mailto:john.trostel@gtri.gatech.edu" target="_blank">john.trostel@gtri.gatech.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_-8142398721557378008WordSection1">
<p class="MsoNormal">I have been trying to use the function “wrf_user_intrp3d” and assumed it would work like the NCL documentation suggests.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Function wrf_user_intrp3d (var3d, vert, plot_type, loc, angle, logical)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am calling it as follows:<u></u><u></u></p>
<p class="MsoNormal"> rh_plane = wrf_user_intrp3d(rh,z,"v",<wbr>plane,0.,opts)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">where rh is my relative humidity variable from wrfout (at time “it)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">rh = wrf_user_getvar(a,"rh",it) <wbr> ; relative humidity<u></u><u></u></p>
<p class="MsoNormal">and z is my model heights<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">z = wrf_user_getvar(a, "z",it) ; grid point height<u></u><u></u></p>
<p class="MsoNormal">plane is defined as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="text-indent:.5in">; Find the ij location for the Test Site (remains constant)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">test_lat = 35.0<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">test_lon = -85.7<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">llres = True<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">llres@ReturnInt = True ; Return integer values<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">locij = wrf_user_ll_to_ij(a, test_lon, test_lat, llres)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">locij = locij - 1 ; array pointers in NCL space<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">TestX = locij(0)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">TestY = locij(1)<u></u><u></u></p>
<p class="MsoNormal">; print("TestX (" + test_lat + "): " + TestX)<u></u><u></u></p>
<p class="MsoNormal">; print("TestY (" + test_lon + "): " + TestY)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal" style="text-indent:.5in">; Find the ij location for the end point (change for different arcs)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">end_lat = 34.0<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">end_lon = -85.5<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">llres = True<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">llres@ReturnInt = True ; Return integer values<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">locij = wrf_user_ll_to_ij(a, end_lon, end_lat, llres)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">locij = locij - 1 ; array pointers in NCL space<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">EndX = locij(0)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in">EndY = locij(1)<u></u><u></u></p>
<p class="MsoNormal" style="text-indent:.5in"><u></u> <u></u></p>
<p class="MsoNormal"> plane = new(4,float)<u></u><u></u></p>
<p class="MsoNormal"> plane = (/ TestX, TestY, EndX, EndY /) ; start x;y & end x;y point<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">and, finally<u></u><u></u></p>
<p class="MsoNormal"> opts=True<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">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.<u></u><u></u></p>
<p class="MsoNormal"> z_max = max(z)<u></u><u></u></p>
<p class="MsoNormal"> z_min = 0.<u></u><u></u></p>
<p class="MsoNormal"> dz = 0.01 * z_max<u></u><u></u></p>
<p class="MsoNormal"> nlevels = tointeger( zmax/dz )<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Why doesn’t the routine use the levels that the user has input into the function?<u></u><u></u></p>
<p class="MsoNormal">Is there an improved wrf_user_intrp3d function? (Can I fix it and recompile it easily?)<u></u><u></u></p>
<p class="MsoNormal"> <u></u><u></u></p>
<p class="MsoNormal">--<u></u><u></u></p>
<p class="MsoNormal">John Trostel<u></u><u></u></p>
<p class="MsoNormal">Director – Severe Storms Research Center<u></u><u></u></p>
<p class="MsoNormal">Georgia Tech Research Institute<u></u><u></u></p>
<p class="MsoNormal">Atlanta, GA 30332-0857<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>
______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/<wbr>mailman/listinfo/ncl-talk</a><br>
<br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">Barry H. Lynn, Ph.D
<div>
<div>Senior Lecturer,</div>
<div>
<div><span style="color:rgb(136,136,136)">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)">
</div>
<span style="color:rgb(136,136,136)">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)">
<span style="color:rgb(136,136,136)">Fax: (972)-25662581</span></div>
</div>
<div><span style="color:rgb(136,136,136)"><br>
</span></div>
<div>C.E.O, Weather It Is, LTD<br>
Weather and Climate Focus<br>
<a href="http://weather-it-is.com" target="_blank">http://weather-it-is.com</a><br>
Jerusalem, Israel<br>
Local: 02 930 9525<br>
Cell: 054 7 231 170<br>
Int-IS: x972 2 930 9525<br>
US 914 432 3108<br>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>