<div dir="ltr">Hi Yohan,<div>Actually your data does have NaNs at two identical locations in both the U and V data files:</div><div><br></div><div><div>ncl 19> var1 = f1->va850_dtrend_Mean</div><div>ncl 20> print(var1(84,127))</div>
<div><br></div><div><br></div><div>Variable: var1 (subsection)</div><div>Type: float</div><div>Total Size: 4 bytes</div><div> 1 values</div><div>Number of Dimensions: 1</div><div>Dimensions and sizes: [1]</div>
<div>Coordinates:</div><div>Number Of Attributes: 4</div><div> lon : 318.75</div><div> lat : 79.88764</div><div> average_op_ncl : dim_avg_n over dimension(s): time</div><div> _FillValue : -1e+10</div><div>(0) nan</div>
<div>ncl 21> print(var1(63,18))</div><div><br></div><div><br></div><div>Variable: var1 (subsection)</div><div>Type: float</div><div>Total Size: 4 bytes</div><div> 1 values</div><div>Number of Dimensions: 1</div>
<div>Dimensions and sizes: [1]</div><div>Coordinates:</div><div>Number Of Attributes: 4</div><div> lon : 46.25</div><div> lat : 37.41573</div><div> average_op_ncl : dim_avg_n over dimension(s): time</div><div> _FillValue : -1e+10</div>
<div>(0) nan</div></div><div><br></div><div>CurlyVector drawing is more sensitive than ordinary vector drawing to the presence of NaNs because more than one grid point is involved in producing each glyph. NCL graphics are not documented to be NaN-proof, so you need to remove all the NaNs prior to calling any graphics routines.<br>
</div><div>It is easily done using replace_nanieee:</div><div><br></div><div><div> var1 = f1->$varname1$</div><div> var2 = f2->$varname2$</div><div> replace_ieeenan(var1,var1@_FillValue,0)<br></div><div> replace_ieeenan(var2,var2@_FillValue,0)</div>
</div><div><div> lat = f1->$"lat"$</div><div> lon = f1->$"lon"$</div></div><div><br></div><div>Your script works fine in CurlyVector mode after adding the replace_ieeenan lines.</div><div>
-dave</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 11:25 AM, David Brown <span dir="ltr"><<a href="mailto:dbrown@ucar.edu" target="_blank">dbrown@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">Thanks Yohan,<div><br></div><div>I have reproduced the seg fault with your script and data. I'll let you know what the problem is as soon as I figure it out.</div>
<div> -dave</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Fri, Aug 8, 2014 at 12:22 PM, <span dir="ltr"><<a href="mailto:ruprich@cerfacs.fr" target="_blank">ruprich@cerfacs.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Dave,<br>
<br>
I put my u and v component files on the ftp site. Their name are:<br>
<a href="http://CM2.1_DJFM_501_4000_ua850_dtrend_Mean.nc" target="_blank">CM2.1_DJFM_501_4000_ua850_dtrend_Mean.nc</a><br>
<a href="http://CM2.1_DJFM_501_4000_va850_dtrend_Mean.nc" target="_blank">CM2.1_DJFM_501_4000_va850_dtrend_Mean.nc</a><br>
<br>
And please see attached my simplify script that target the problem, or you<br>
can find it on the ftp site as well:<br>
Plot_Clim_Test_For_Dave.ncl<br>
<br>
Many thanks,<br>
Yohan<br>
<div><div><br>
> Well as I said, I would like to run your script here. There should not be<br>
> a<br>
> seg fault, so there must be a bug somewhere that I would like to fix. So<br>
> if<br>
> you can upload your data and script to the ftp site as described in the<br>
> bug<br>
> report page, I would appreciate it. I am going to be off work for the rest<br>
> of this week, but I will take a look at this first thing next Monday if I<br>
> have the files.<br>
> -dave<br>
><br>
><br>
> On Wed, Aug 6, 2014 at 7:09 PM, <<a href="mailto:ruprich@cerfacs.fr" target="_blank">ruprich@cerfacs.fr</a>> wrote:<br>
><br>
>> Hi Dave,<br>
>><br>
>> thank you for your answer.<br>
>><br>
>> Actually, my data look fine. I already ploted the u and v components<br>
>> with<br>
>> ferret to verify it and I also print the Min and Max of those components<br>
>> with NCL and everything look normal.<br>
>> When I run the same script with the standard option "LineArrow" of the<br>
>> vcGlyphStyle resource my script works and I obtain a nice plot with<br>
>> westerlies and esterlies at good places. An excpetion should be note at<br>
>> the longitude 0 where vectors seem to overlap each other.<br>
>> But, if I switch the vcGlyphStyle option to "CurlyVector", it leads to a<br>
>> segmentation fault.<br>
>><br>
>> Also, I tried to plot it with a different approach, using the SfXArray<br>
>> and<br>
>> SfYArray resources. Again, I obtain good results when I run my script<br>
>> with<br>
>> the standard vcGlyphStyle option but a segmentation fault when I use the<br>
>> "CurlyVector" option.<br>
>><br>
>> Many thanks,<br>
>> Yohan<br>
>><br>
>><br>
>> > Hi Yohan,<br>
>> ><br>
>> > I would first want to make sure your data is valid: try printing the<br>
>> max<br>
>> > and min of each variable. Also make sure that there are no NaN values<br>
>> in<br>
>> > the data. You can use isnan_ieee to discover whether there are NaNs in<br>
>> the<br>
>> > data. If the data seems okay, then I would like to take a look at your<br>
>> > complete script along with the data. Please look at "Report bugs"<br>
>> under<br>
>> > the "Support" tab on the NCL web site. Let me know offline when you<br>
>> have<br>
>> > uploaded the relevant files. Thank you.<br>
>> > -dave<br>
>> ><br>
>> ><br>
>> > On Wed, Aug 6, 2014 at 5:33 PM, <<a href="mailto:ruprich@cerfacs.fr" target="_blank">ruprich@cerfacs.fr</a>> wrote:<br>
>> ><br>
>> >> Dear NCL users,<br>
>> >><br>
>> >> I have some problem using the vcGlyphStyle resource. When I chose the<br>
>> >> option "CurlyVector", my script leads to a Segmentation fault.<br>
>> >> Do you know any reason for that?<br>
>> >><br>
>> >> Here is some pieces of my script:<br>
>> >><br>
>> >> 1) I load 2 variables:<br>
>> >><br>
>> >> Variable: var1<br>
>> >> Type: float<br>
>> >> Total Size: 51840 bytes<br>
>> >> 12960 values<br>
>> >> Number of Dimensions: 2<br>
>> >> Dimensions and sizes: [lat | 90] x [lon | 144]<br>
>> >> Coordinates:<br>
>> >> lat: [-89.49438..89.49438]<br>
>> >> lon: [1.25..358.75]<br>
>> >> Number Of Attributes: 2<br>
>> >> _FillValue : -1e+10<br>
>> >> average_op_ncl : dim_avg_n over dimension(s): time<br>
>> >><br>
>> >><br>
>> >> Variable: var2<br>
>> >> Type: float<br>
>> >> Total Size: 51840 bytes<br>
>> >> 12960 values<br>
>> >> Number of Dimensions: 2<br>
>> >> Dimensions and sizes: [lat | 90] x [lon | 144]<br>
>> >> Coordinates:<br>
>> >> lat: [-89.49438..89.49438]<br>
>> >> lon: [1.25..358.75]<br>
>> >> Number Of Attributes: 2<br>
>> >> _FillValue : -1e+10<br>
>> >> average_op_ncl : dim_avg_n over dimension(s): time<br>
>> >><br>
>> >><br>
>> >><br>
>> >> 2) I define the resources for my plot:<br>
>> >> res = True<br>
>> >><br>
>> >> res@gsnDraw = False ; don't draw<br>
>> >> res@gsnFrame = False ; don't advance<br>
>> frame<br>
>> >> res@gsnAddCyclic = True<br>
>> >> res@vcGlyphStyle = "CurlyVector"<br>
>> >><br>
>> >><br>
>> >><br>
>> >> 3) I plot:<br>
>> >> wks = gsn_open_wks(pltTypeLocal, plotDir+plotName)<br>
>> >> plot = new(1, "graphic")<br>
>> >><br>
>> >> plot(0) = gsn_csm_vector_map(wks, var1, var2, res)<br>
>> >><br>
>> >> draw(wks)<br>
>> >> frame(wks)<br>
>> >><br>
>> >><br>
>> >><br>
>> >> That's pretty much it... And if I run this script without the<br>
>> >> "CurlyVector" option it works.<br>
>> >><br>
>> >> Than you,<br>
>> >> Yohan<br>
>> >><br>
>> >> PS: I am running this script with the 6.1.2 ncl version<br>
>> >><br>
>> >> _______________________________________________<br>
>> >> ncl-talk mailing list<br>
>> >> List instructions, subscriber options, unsubscribe:<br>
>> >> <a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
>> >><br>
>> ><br>
>><br>
>><br>
>><br>
><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>