<div dir="ltr"><div><div><div><div>Hello,<br><br></div>The &#39;p_in&#39; are monotonically decreasing: 1008,. 1002.5, ....<br></div>The &#39;p_out&#39; are monotonically increasing: <br><br>Change<br>        p_out1 = fspan(87.5,987.5,37)<br></div><div>To<br></div>        p_out1 = fspan(987.5, 87.5,37)    ; match monotonicity order of p_in<br><br></div><div> Hopefully, this works.<br></div><div>===<br></div>The underlying code should handle the situation. A bug report will will have to be filed.<br><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 17, 2016 at 11:54 AM, Wei-Jen Tseng <span dir="ltr">&lt;<a href="mailto:tseng.weijen@gmail.com" target="_blank">tseng.weijen@gmail.com</a>&gt;</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>Dear NCL users,</div><div>I use the function &quot;int2p&quot; to interpolate data to the specified pressure levels.</div><div>I expect that there is no missing value in my output.</div><div><br></div><div>But I found something strange:</div><div>[1] There are 3 or 4 missing outputs but they all have values before interpolate.</div><div>[2] Some output become missing when I change the range of interpolation. (new pressure level set 237.5)</div><div><br></div><div><br></div><div>This is data:</div><div>pressure (FillValue 9999): </div><div>(0)<span style="white-space:pre-wrap">        </span>1008</div><div>(1)<span style="white-space:pre-wrap">        </span>1002.5</div><div>[SNIP]</div><div>(524)<span style="white-space:pre-wrap">        </span>48.1</div><div>(525)<span style="white-space:pre-wrap">        </span>47.8</div><div><br></div><div>altitude (FillValue 99999):</div><div>(0)<span style="white-space:pre-wrap">        </span> 4</div><div>(1)<span style="white-space:pre-wrap">        </span>52.5</div><div>[SNIP]</div><div>(524)<span style="white-space:pre-wrap">        </span>20839.2</div><div>(525)<span style="white-space:pre-wrap">        </span>20884.3</div><div><br></div><div><br></div><div>This is my script:</div><div>begin</div><div>;--- load data ---;</div><div>iFil = addfile(&quot;<a href="http://sounding_zc081041.nc" target="_blank">sounding_zc081041.nc</a>&quot;,&quot;r&quot;)</div><div>p_in = iFil-&gt;pressure</div><div>a_in = iFil-&gt;altitude</div><div><br></div><div>;--- new pressure levels ---;</div><div>p_out1 = fspan(87.5,987.5,37)</div><div>p_out2 = fspan(112.5,987.5,36)</div><div><br></div><div>;--- interpolate to new pressure levels ---;</div><div>a_out1= int2p(p_in,a_in,p_out1,2)</div><div>a_out2= int2p(p_in,a_in,p_out2,2)</div><div><br></div><div>;-- results ---;</div><div>print(&quot;Result: 1&quot;)</div><div>print(p_out1+&quot; &quot;+a_out1)</div><div>print(&quot; &quot;)</div><div>print(&quot;Result: 2&quot;)</div><div>print(p_out2+&quot; &quot;+a_out2)</div><div>end</div><div>;---end of the script ---;</div><div><br></div><div>This is the output.</div><div>Most of the outputs looks well.</div><div>I use the brackets to highlight strange outputs.</div><div><br></div><div>(0)<span style="white-space:pre-wrap">        </span>Result: 1</div><div>(0)<span style="white-space:pre-wrap">        </span>87.5 17311.2</div><div>(1)<span style="white-space:pre-wrap">        </span>112.5 15936.5</div><div>[SNIP]</div><div>(5)<span style="white-space:pre-wrap">        </span>212.5 12072.7</div><div>(6)<span style="white-space:pre-wrap">        </span>237.5 99999 &lt;=== [1,2]</div><div>(7)<span style="white-space:pre-wrap">        </span>262.5 10648.4</div><div>(8)<span style="white-space:pre-wrap">        </span>287.5 10014.1</div><div>(9)<span style="white-space:pre-wrap">        </span>312.5 9419.78</div><div>(10) 337.5 99999 &lt;=== [1]</div><div>(11) 362.5 8336.37</div><div>(12) 387.5 99999 &lt;=== [1]</div><div>(13) 412.5 7364.7</div><div>[SNIP]</div><div>(24) 687.5 3296.85</div><div>(25) 712.5 99999 &lt;=== [1]</div><div>(26) 737.5 2708.44</div><div>[SNIP]</div><div>(35) 962.5 414.551</div><div>(36) 987.5 187.77</div><div>(0)</div><div>(0)<span style="white-space:pre-wrap">        </span>Result: 2</div><div>(0)<span style="white-space:pre-wrap">        </span>112.5 15936.5</div><div>(1)<span style="white-space:pre-wrap">        </span>137.5 14779.8</div><div>[SNIP]</div><div>(4)<span style="white-space:pre-wrap">        </span>212.5 12072.7</div><div>(5)<span style="white-space:pre-wrap">        </span>237.5 11330 &lt;=== [2]</div><div>(6)<span style="white-space:pre-wrap">        </span>262.5 10648.4</div><div>(7)<span style="white-space:pre-wrap">        </span>287.5 10014.1</div><div>(8)<span style="white-space:pre-wrap">        </span>312.5 9419.78</div><div>(9)<span style="white-space:pre-wrap">        </span>337.5 99999 &lt;=== [1]</div><div>(10) 362.5 8336.37</div><div>(11) 387.5 99999 &lt;=== [1]</div><div>(12) 412.5 7364.7</div><div>[SNIP]</div><div>(23) 687.5 3296.85</div><div>(24) 712.5 99999 &lt;=== [1]</div><div>(25) 737.5 2708.44</div><div>[SNIP]</div><div>(34) 962.5 414.551</div><div>(35) 987.5 187.77</div><div><br></div><div>And I checked the source data.</div><div>The source data looks well.</div><div><br></div><div>$ ncl</div><div> NCAR Command Language Version 6.3.0 </div><div>ncl 0&gt; f=addfile(&quot;<a href="http://sounding_zc081041.nc" target="_blank">sounding_zc081041.nc</a>&quot;,&quot;r&quot;)</div><div>ncl 1&gt; p=f-&gt;pressure</div><div>ncl 2&gt; a=f-&gt;altitude</div><div>ncl 3&gt; print(p+&quot; &quot;+a)</div><div>(0)<span style="white-space:pre-wrap">        </span>1008 4</div><div>(1)<span style="white-space:pre-wrap">        </span>1002.5 52.5</div><div>[SNIP]</div><div>(82)<span style="white-space:pre-wrap">        </span>715.4 2964</div><div>(83)<span style="white-space:pre-wrap">        </span>712.5 2998.3 &lt;===</div><div>(84)<span style="white-space:pre-wrap">        </span>709.5 3034.1</div><div>[SNIP]</div><div>(219)<span style="white-space:pre-wrap">        </span>389.2 7804.3</div><div>(220)<span style="white-space:pre-wrap">        </span>387.5 7839 &lt;===</div><div>(221)<span style="white-space:pre-wrap">        </span>385.6 7875.7</div><div>[SNIP]</div><div>(245)<span style="white-space:pre-wrap">        </span>339.4 8821.9</div><div>(246)<span style="white-space:pre-wrap">        </span>337.5 8863.1 &lt;===</div><div>(247)<span style="white-space:pre-wrap">        </span>335.4 8908.6</div><div>[SNIP]</div><div>(305)<span style="white-space:pre-wrap">        </span>239.1 11286.2</div><div>(306)<span style="white-space:pre-wrap">        </span>237.5 11330 &lt;===</div><div>(307)<span style="white-space:pre-wrap">        </span>236 11375</div><div>[SNIP]</div><div>(524)<span style="white-space:pre-wrap">        </span>48.1 20839.2</div><div>(525)<span style="white-space:pre-wrap">        </span>47.8 20884.3</div><div><br></div><div>I uploaded my data to <a href="http://ftp.cgd.ucar.edu" target="_blank">ftp.cgd.ucar.edu</a>.</div><div>File name is &quot;<a href="http://sounding_zc081041.nc" target="_blank">sounding_zc081041.nc</a>&quot;.</div><div><br></div><div>I also put same data on the dropbox.</div><div><a href="https://www.dropbox.com/s/lj3l1lj70r2n95w/sounding_zc081041.nc?dl=0" target="_blank">https://www.dropbox.com/s/lj3l1lj70r2n95w/sounding_zc081041.nc?dl=0</a></div><div><br></div><div>Thank you for any suggestion.</div><div><br></div><div>best regards,</div><div>Wei-Jen</div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div><div dir="ltr">







<p></p><p style="font-family:arial;font-size:small">Wei-Jen Tseng</p><p style="font-family:arial;font-size:small">Department of Atmosphere Sciences, National Taiwan University</p><p style="font-family:arial;font-size:small">Email: <a href="mailto:tseng.weijen@gmail.com" style="color:rgb(17,85,204)" target="_blank">tseng.weijen@gmail.com</a></p><p></p></div></div>
</font></span></div>
<br>_______________________________________________<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/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>