<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Mark,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">[I&#39;m posting back to ncl-talk here.]</div><div class="gmail_default" style="font-size:small"><br>Thanks for providing the data file. I was able to reproduce the problem, and unfortunately I&#39;m not sure about a work-around at this time.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">That&#39;s not entirely true: if I don&#39;t reverse the Y axis, then the bug goes away.  But, with a pressure/height plot, you want to reverse the Y axis. I tried a few things, like reversing the leftmost dimension of your data (that didn&#39;t work), and reversing the Y axis myself and then just using gsn_csm_contour (that didn&#39;t work either because then a different contour showed up white).</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I have filed a bug report using your small data file and a modified version of your script.  The bug report is NCL-2478 for your reference. I&#39;m sorry I couldn&#39;t find a work-around. Hopefully this isn&#39;t a difficult bug to fix.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 19, 2016 at 10:49 AM, Mark Branson <span dir="ltr">&lt;<a href="mailto:mark@atmos.colostate.edu" target="_blank">mark@atmos.colostate.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Mary.</div><div><br></div>Wow, what a cool debugging tool.  Attached is the resulting <a href="http://mary_debug.nc" target="_blank">mary_debug.nc</a> file.  If need be, I can definitely upload the original data file (<a href="http://uandps.nc" target="_blank">uandps.nc</a>).  That file size is around 1GB.<div><br></div><div>Thanks!</div><span class="HOEnZb"><font color="#888888"><div>Mark</div><div><br></div><div></div></font></span></div><br><div style="word-wrap:break-word"><div></div><div><br><div><blockquote type="cite"><div>On Aug 19, 2016, at 10:41 AM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-size:small">[Offline for a bit.]</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Yeah, this must point to the coordinate somehow, but this is a little odd.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Would you be able to provide the data? I think if you set this unadvertised resource before you call gsn_csm_contour:</div><div class="gmail_default" style="font-size:small"><p><span>res@gsnDebugWriteFileName = &quot;mary_debug&quot;</span></p><p>Then it should create a &quot;<a href="http://mary_debug.nc/" target="_blank">mary_debug.nc</a>&quot; NetCDF file, with just the &quot;uwnd&quot; data you&#39;re plotting, along with the coordinate arrays. This way you don&#39;t have to provide me with the full data file if you don&#39;t want.</p><p>The &quot;mary_debug,nc&quot; file should probably be small enough to just attach in an email.  I think a &quot;mary_debug.ncl&quot; script will also get created, and you can email that to me, although I don&#39;t need it since I have your original script.</p><p>Thanks,</p><p>--Mary</p><p><br></p></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 19, 2016 at 10:34 AM, Mark Branson <span dir="ltr">&lt;<a href="mailto:mark@atmos.colostate.edu" target="_blank">mark@atmos.colostate.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Mary.</div><div><br></div>Here is that.  Interestingly, the problem has gone away.  So perhaps the coordinate arrays are indeed the source of the problem?<span><font color="#888888"><div><br></div><div>Mark</div><div><br></div><div></div></font></span></div><br><div style="word-wrap:break-word"><div></div><div><br><div><blockquote type="cite"><div>On Aug 19, 2016, at 10:26 AM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:</div><br><div><div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Mark,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">That is a little odd. You did good work debugging the problem, so missing values and nans are ruled out.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">To further debug this, can you try plotting a very basic contour plot, without the pressure /height axes, and without any coordinate information and send the image:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"> plot = gsn_contour (wks,uwind,res) </span><br style="font-size:12.8px"></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px">The gsn_contour script ignores any coordinate arrays, which I want to make sure are not the source of the problem.</span></div><div class="gmail_default" style="font-size:small"><span style="font-size:12.8px"><br></span></div><div class="gmail_default" style="font-size:small">Thanks,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 19, 2016 at 10:07 AM, Mark Branson <span dir="ltr">&lt;<a href="mailto:mark@atmos.colostate.edu" target="_blank">mark@atmos.colostate.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">Hello.<br><br>I&#39;m running ncl v6.2.1 and here is what I&#39;m doing in the attached script:<br><br>1) read in a long time series of zonal wind and surface pressure data from CAM output.<br>2) interpolate them to constant pressure levels using vinth2p.<br>3) compute long-term monthly means with clmMonTLLL.<br>4) compute the annual mean of the monthly means.<br>5) subtract off the annual mean from the monthly means.<br>6) select one latitude (the equator), and then take the mean of all longitudes.<br>6) make a color-filled height versus time cross section plot.<br><br>I get the plot (see attached), but some of the contours near the top are white.  I thought maybe it was because there were some missing or bogus values, so I inserted a check for those with the ismissing and isnan_ieee functions and it seems the data is fine.<br><br>Any ideas?<br><br>Thanks,<br>Mark Branson<br><br><br>begin<br> a = addfile(&quot;/pool/mark/spcam_nlev<wbr>51/<a href="http://spcam_nlev51.cam.h0.0003-01.nc/" target="_blank">spcam_nlev51.cam.h0.0003-01<wbr>.nc</a>&quot;,&quot;r&quot;)<br> hyam = a-&gt;hyam<br> hybm = a-&gt;hybm<br><br> b = addfile(&quot;/pool/mark/spcam_nlev<wbr>51/<a href="http://uandps.nc/" target="_blank">uandps.nc</a>&quot;,&quot;r&quot;)<br> u = b-&gt;U         ;u = [time | 338] x [lev | 53] x [lat | 96] x [lon | 144]<br> ps = b-&gt;PS       ;ps = [time | 338] x [lat | 96] x [lon | 144]<br> u@_FillValue = default_fillvalue(&quot;float&quot;)<br><br> if (any(ismissing(u))) then<br>   print(&quot;### original u array contains some missing data ###&quot;)<br> end if<br><br>; interpolation variables<br> plvlM = (/ 30.,50.,70.,100.,150.,200.,250<wbr>.,300.,350.,400.,450.,500.,550<wbr>., \<br>           600.,650.,700.,750.<wbr>,800.,850./)<br> plvlM@units = &quot;mb&quot;<br> nplvlM = dimsizes(plvlM)<br><br> p0     = 1000.     ; mb required by vinth2p<br> interp = 2         ; log interpolation<br> extrap = False     ; no extrapolation past psfc.<br><br> tmp = vinth2p(u,hyam,hybm,plvlM,ps,i<wbr>nterp,p0,1,extrap)<br> if (typeof(tmp).eq.&quot;double&quot;) then<br>   uwind1 = dble2flt(tmp)<br> else<br>   uwind1 = tmp<br> end if<br><br>; compute long-term monthly means<br> uclm = clmMonTLLL(uwind1)       ;uclm = [month | 12] x [lev_p | 33] x [lat | 96] x [lon | 144]<br><br>; annual mean of monthly means<br> uann = dim_avg_n_Wrap(uclm,0)   ;uann = [lev_p | 33] x [lat | 96] x [lon | 144]<br><br>; subtract off annual mean from monthly means<br> do i = 0,11<br>   uclm(i,:,:,:) = (/ uclm(i,:,:,:) - uann(:,:,:) /)<br> end do<br><br> uwind2 = uclm(:,:,47,:)              ; select the equator for the latitude<br> uwind3 = dim_avg_Wrap(uwind2)        ; mean of all longitudes<br> uwind = uwind3(lev_p|:,month|:)      ; swap the array dimensions:  month,level --&gt; level,month<br><br> printMinMax(uwind,False)<br><br> if (any(ismissing(uwind))) then<br>   print(&quot;### uwind array contains some missing data ###&quot;)<br> end if<br> if (any(isnan_ieee(uwind))) then<br>   print(&quot;### uwind array contains some NaNs ###&quot;)<br> end if<br><br> uwind@long_name = &quot;SP-CAM, 51 levels, Monthly Means&quot;<br><br> wks   = gsn_open_wks (&quot;eps&quot;, &quot;test1&quot;)           ; send graphics to EPS file<br> gsn_define_colormap(wks,&quot;BlRe<wbr>&quot;)<br><br> res                      = True                  <br> res@cnFillOn             = True                 <br> res@cnLinesOn            = True                <br> res@lbLabelBarOn         = True              <br> res@cnInfoLabelOn        = False<br><br>; change labels for monthly mean plot<br> res@tmXBMode = &quot;Explicit&quot;<br> res@tmXBLabelFontHeightF = 0.015<br> res@tmXBLabels=(/&quot;Jan&quot;,&quot;Feb&quot;,<wbr>&quot;Mar&quot;,&quot;Apr&quot;,&quot;May&quot;,&quot;Jun&quot;,&quot;Jul&quot;,<wbr>&quot;Aug&quot;,&quot;Sep&quot;, \<br>                  &quot;Oct&quot;,&quot;Nov&quot;,<wbr>&quot;Dec&quot;,&quot;Jan&quot;/)<br> res@tmXBValues = ispan(0,12,1)<br><br> plot = gsn_csm_pres_hgt (wks,uwind,res) <br>end<br><br>** OUTPUT FROM THE SCRIPT **<br><br>/Users/mark/mmf/SPCAM5/stratos<wbr>phere_gwdrag/spcam_nlev51&gt; ncl hvstime.ncl<br>Copyright (C) 1995-2014 - All Rights Reserved<br>University Corporation for Atmospheric Research<br>NCAR Command Language Version 6.2.1<br>The use of this software is governed by a License Agreement.<br>See <a href="http://www.ncl.ucar.edu/" target="_blank">http://www.ncl.ucar.edu/</a> f<wbr>or more details.<br>(0)<span style="white-space:pre-wrap">        </span>min=-9.835   max=6.77056<br><br></div><br><div style="word-wrap:break-word"></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>
______________________________<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" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br></div></blockquote></div><br></div></div><br></blockquote></div><br></div>
</div></blockquote></div><br></div></div><br></blockquote></div><br></div>