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