<div dir="ltr">This is untested. May/May-not yield what you want. <br><div><div><div><br></div>The fortran performs linear interpolation. Likely, a builtin function using fortran would be faster but the following *may* be a thumb in the dike NCL-based solution.<br><br></div><div>undef("TEST")<br></div><div>function TEST (a, wrf_var[1]:string, PBL:numeric)<br></div><div>local x, z, zPBL, xPBL<br></div><div>begin<br></div><div><pre> x = wrf_user_getvar(a,wrf_var,-1)
;printVarSummary(x) ; x(time,nz,ny,nx)
;printMinMax(x, 0) ; 0 1 2 3<br><br> z = wrf_user_getvar(a,"height",tim<wbr>e)<br> printVarSummary(z) ; z(time,nz,ny,nx) <br>
zPBL = conform(x, PBL, (/0,2,3/) ) ; broadcast (replicate)<br></pre><pre> xPBL = int2p_n_Wrap (z, x, zPBL, 0, 1)
;printVarSummary(xPBL)
;printMinMax(xPBL, 0)<br></pre><pre> return(xPBL)<br>end<br></pre></div><div> ;====> MAIN <====<br></div><div><pre> PBL ; (time,ny,nx); meters<br><br>;---<br> <br></pre><pre> a = addfile(....)<br></pre><pre> tcPBL = TEST(a, "tc", PBL)
printVarSummary(tcPBL)
printMinMax(tcPBL, 0)<br><br> <br> rhPBL = TEST(a, "rh", PBL)</pre><pre> uPBL = TEST(a, "u", PBL)</pre></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 10, 2016 at 2:39 PM, Matthew Scutter <span dir="ltr"><<a href="mailto:yellowplantain@gmail.com" target="_blank">yellowplantain@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Bill, I think this is what I am after.<div>Would be great to have this as an NCL function someday.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Nov 11, 2016 at 4:24 AM, Bill Ladwig <span dir="ltr"><<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Also, attached is the Fortran code if you want to try using wrapit.<span class="m_-9019754331590681863HOEnZb"><font color="#888888"><br></font></span></div><span class="m_-9019754331590681863HOEnZb"><font color="#888888"><div><br></div><div>Bill</div></font></span></div><div class="m_-9019754331590681863HOEnZb"><div class="m_-9019754331590681863h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 10, 2016 at 10:17 AM, Bill Ladwig <span dir="ltr"><<a href="mailto:ladwig@ucar.edu" target="_blank">ladwig@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I think this is the same question as:<div><br></div><div><a href="http://mailman.ucar.edu/pipermail/ncl-talk/2016-October/006923.html" target="_blank">http://mailman.ucar.edu/piperm<wbr>ail/ncl-talk/2016-October/0069<wbr>23.html</a><br></div><div><br></div><div>The user ended up modifying the Fortran code for <i style="color:rgb(0,0,0)">DINTERP3DZ </i>and then wrapped it in using WRAPIT. </div><div><br></div><div>Here's the full email chain:</div><div><br></div><div><a href="http://mailman.ucar.edu/pipermail/ncl-talk/2016-October/006960.html" target="_blank">http://mailman.ucar.edu/piperm<wbr>ail/ncl-talk/2016-October/0069<wbr>60.html</a><br></div><div><br></div><div>Good luck,</div><div><br></div><div>Bill</div></div><div class="m_-9019754331590681863m_4852608314092359948HOEnZb"><div class="m_-9019754331590681863m_4852608314092359948h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Nov 10, 2016 at 8:45 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>The question is not clear to me. Is the following <br><br></div><div>I think the following will do what you want. They are essentiall the same<br><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/int2p_n_Wrap.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Contributed/int2p<wbr>_n_Wrap.shtml</a><br><a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/linint1_n_Wrap.shtml" target="_blank">http://www.ncl.ucar.edu/Docume<wbr>nt/Functions/Contributed/linin<wbr>t1_n_Wrap.shtml</a><br></div><div><br>====<br>See .... some examples here<br><br><a href="http://www.ncl.ucar.edu/Applications/isent.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/isent.shtml</a><br></div><div>Example 2<br></div><div><br></div><div>Also:<br></div><a href="http://www.ncl.ucar.edu/Applications/iso.shtml" target="_blank">http://www.ncl.ucar.edu/Applic<wbr>ations/iso.shtml</a><br><br><br></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-9019754331590681863m_4852608314092359948m_8276297041483664532h5">On Thu, Nov 10, 2016 at 3:59 AM, Matthew Scutter <span dir="ltr"><<a href="mailto:yellowplantain@gmail.com" target="_blank">yellowplantain@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-9019754331590681863m_4852608314092359948m_8276297041483664532h5"><div dir="ltr">I'm trying to do this without resorting to C if at all possible...<div><br>I have a 2D array of the PBL, and I want to extract other parameters (RH, wind, etc) from the levels defined in this PBL 2D array.</div><div>Kind of like wrf_user_intrp3d, except I want to pass an array of the same dimensions with each point representing the height to extract the parameter from, rather than the scalar to the loc (level/height) parameter of wrf_user_intrp3d.<br><br>Is there in inbuilt function for this, or does anyone have an idea as to how to approach this efficiently?</div></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">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/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</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></div>