<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Alan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">You're right, that's a problem! I tried to recreate the bug myself, but wasn't doing it the way you are. Your example helps.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">The fix is pretty straightforward, so I'll get on this right away. The ticket is NCL-2714. </div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for the heads up.</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 Tue, Jan 16, 2018 at 1:52 PM, Alan Brammer <span dir="ltr"><<a href="mailto:abrammer@albany.edu" target="_blank">abrammer@albany.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 class="gmail_default" style="font-family:verdana,sans-serif">oh my bad, I followed that line incorrectly and got distracted by the line above. So it's not an int to float error, it's a float to double problem. </div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default"><div class="gmail_default"><font face="monospace, monospace">nref = 0</font></div><div class="gmail_default"><font face="monospace, monospace">ref_line = fmsg</font></div><div><font face="monospace, monospace">...</font></div><span class=""><div><font face="monospace, monospace">ref_line = get_res_value_keep(rfres,"<wbr>trYMinF",min(y))<br></font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div></span><div style="font-family:verdana,sans-serif">grep -A 19 "ref_line = fmsg" $NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl<br></div><div style="font-family:verdana,sans-serif"><br></div><div><div><font face="monospace, monospace"> ref_line = fmsg</font></div><div><font face="monospace, monospace"> ref_line_on = False</font></div><div><font face="monospace, monospace"> ref_line_color = cmsg</font></div><div><font face="monospace, monospace"> ref_line_pattern = imsg</font></div><div><font face="monospace, monospace"> ref_line_thickness = fmsg</font></div><div><font face="monospace, monospace"> ref_grtr_curve_fill_on = False</font></div><div><font face="monospace, monospace"> ref_less_curve_fill_on = False</font></div><div><font face="monospace, monospace"> ref_fill_color_g = cmsg ; greater than</font></div><div><font face="monospace, monospace"> ref_fill_color_l = cmsg ; less than</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">;</font></div><div><font face="monospace, monospace">; If neither gsnYRefLine or gsnXRefLine are set, but gsnXYBarChart has</font></div><div><font face="monospace, monospace">; been set, then assume the user wants a Y reference line, and return</font></div><div><font face="monospace, monospace">; a default value for Y ref line.</font></div><div><font face="monospace, monospace">;</font></div><div><font face="monospace, monospace"> bar_chart = get_res_value_keep(rfres,"<wbr>gsnXYBarChart",False)</font></div><div><font face="monospace, monospace"> bar_outline_only = get_res_value_keep(rfres,"<wbr>gsnXYBarChartOutlineOnly",<wbr>False)</font></div><div><font face="monospace, monospace"> if(.not.isatt(rfres,"<wbr>gsnYRefLine").and..not.isatt(<wbr>rfres,"gsnXRefLine")) then</font></div><div><font face="monospace, monospace"> if(reftype.eq."y".and.bar_<wbr>chart.and..not.bar_outline_<wbr>only) then</font></div><span class=""><div><font face="monospace, monospace"> ref_line = get_res_value_keep(rfres,"<wbr>trYMinF",min(y))</font></div></span></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Code to reproduce the error:</div><div style="font-family:verdana,sans-serif"><br></div><div><div><font face="monospace, monospace">x= fspan(0,10,11)</font></div><div><font face="monospace, monospace">y = todouble(fspan(0,10,11))</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">wks = gsn_open_wks("x11","")</font></div><div><font face="monospace, monospace">res = True</font></div><div><font face="monospace, monospace">res@gsnXYBarChart = True</font></div><div><font face="monospace, monospace">plot = gsn_csm_xy(wks, x, y, res)</font></div></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 16, 2018 at 3:27 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@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 class="gmail_default" style="font-size:small">Hi Alan,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I couldn't find the particular line you are referring to. I also grepped for "ref_line" and then "0" and don't see a reference to setting ref_line to 0. I do, however, believe this might have been a bug in an older version of NCL.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Are you sure this is NCL V6.4.0 where you saw the issue? Here's how I did the grep:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default">
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"> % grep ref_line $NCARG_ROOT/lib/ncarg/nclscrip<wbr>ts/csm/gsn_csm.ncl | grep "0"</font></span></p><p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><br></font></span></p>and here are the results that came up:</div><div class="gmail_default"><br><p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ygrtr(i,0:ngrtr(i)-5:5)<span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>= ref_lines(i)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>yless(i,0:nless(i)-5:5) = ref_lines(i)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>yequal(i,0:nequal(i)-1:5) = ref_lines(i)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace">;;<span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>return(conform_dims((/nref,4/)<wbr>,ref_line_color(0,:),1))</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_pattern := rfres@$pattern_res1$(0)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_pattern = 0</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_pattern := 0</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_thickness = rfres@$thickness_res1$(0)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_thickness = 1.0</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_thickness := 1.0</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line_pattern <span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>:= 0</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line <span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>:= get_res_value_keep(rfres,"gsn" + str_upper(reftype)+"RefLine",0<wbr>)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>ref_line<span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>:= get_res_value_keep(rfres,"gsn" + str_upper(reftype)+"RefLine",0<wbr>)</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>yref_line = yref_line_list[0]</font></span></p>
<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><font face="monospace, monospace"><span class="m_7723193945590858241m_4781133722027807004gmail-Apple-converted-space"> </span>xref_line = xref_line_list[0]</font></span></p><br>Can you type this on your end and see if you get something different?</div><div class="gmail_default"><br></div><div class="gmail_default"><br>Thanks,<br><br>--Mary<p class="m_7723193945590858241m_4781133722027807004gmail-p1" style="font-size:18px;margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:normal;font-family:Monaco;color:rgb(0,0,0);background-color:rgb(255,255,255)"><span class="m_7723193945590858241m_4781133722027807004gmail-s1" style="font-variant-ligatures:no-common-ligatures"><br></span></p></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_7723193945590858241h5">On Tue, Jan 16, 2018 at 8:34 AM, Alan Brammer via ncl-talk <span dir="ltr"><<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</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_7723193945590858241h5"><div dir="ltr"><div style="font-family:verdana,sans-serif">NCL devs:</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Came across a bug in 6.4.0 when plotting a bar chart through gsn_csm_xy() that stems to a call to get_ref_line_options()</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">at line 4588 in gsn_csm.ncl a variable is initialised as</div><div><span style="font-family:verdana,sans-serif"> </span><font face="monospace, monospace">ref_line = 0 ; </font><font face="arial, helvetica, sans-serif">setting ref_line to be an integer</font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">but then a couple lines down on line 4607 there is:</div><div><font face="monospace, monospace"> ref_line = get_res_value_keep(rfres,"trYM<wbr>inF",min(y))</font></div><div><span style="font-family:verdana,sans-serif">but unless </span><font face="monospace, monospace">y</font><font face="verdana, sans-serif"> or </font><font face="monospace, monospace">trYMinF</font><font face="verdana, sans-serif"> are integers this will fail with an Assignment Type mismatch. </font></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Easy fix is to replace = with := on line 4607 in gsn_csm.ncl (line 23 of get_ref_line_options)</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Function doesn't appear to exist in versions before 6.4.0 so seems like a new problem. </div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Thanks,</div><div style="font-family:verdana,sans-serif"><br></div><div style="font-family:verdana,sans-serif">Alan</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></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>