<div dir="ltr">Hi all,<div><br></div><div>Interesting little problem when trying to read colors assigned to attributes. A Nx4 array of colors can be assigned but not properly subscripted. Given the code below:</div><div><br></div><div>ares = True</div><div>ares@cnLineColors = read_colormap_file(&quot;BlRe&quot;)</div><div><br></div><div>I then tried three different operations.</div><div>1) print(ares@cnLineColors) ----&gt; results in full Nx4 array output on screen.</div><div>2) print(ares@cnLineColors(0:10,:) ----&gt; Warning that attributes are only one dimension (not a true statement), no output</div><div>3) print(ares@cnLineColors(0:10) -----&gt; Segfault, no warning received, in contrast to most other attempts to read with wrong number of subscripts.</div><div><br></div><div>Warning is received as expected if indices exceed dimensions, regardless of dimensions included/referenced in the subscripts.</div><div><br></div><div>Seems like this may have been overlooked at some point. Further, is support for any 2+ dimensioned attributes an intended feature?</div><div><br></div><div>Full output for cases 1-3 below.</div><div><br></div><div><br></div><div>Kyle</div><div><br></div><div>







<p class=""><br></p>
<p class=""><span class=""> Copyright (C) 1995-2015 - All Rights Reserved</span></p>
<p class=""><span class=""> University Corporation for Atmospheric Research</span></p>
<p class=""><span class=""> NCAR Command Language Version 6.3.0</span></p>
<p class=""><span class=""> The use of this software is governed by a License Agreement.</span></p>
<p class=""><span class=""> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.</span></p>
<p class=""><span class="">ncl 0&gt; ares=True</span></p>
<p class=""><span class="">ncl 1&gt; ares@cnLineColors = read_colormap_file(&quot;BlRe&quot;)</span></p>
<p class=""><span class="">ncl 2&gt; print(ares@cnLineColors(0:10))</span></p>
<p class=""><span class="">Segmentation fault (core dumped)</span></p>
<p class=""><br></p>
<p class=""><span class=""> Copyright (C) 1995-2015 - All Rights Reserved</span></p>
<p class=""><span class=""> University Corporation for Atmospheric Research</span></p>
<p class=""><span class=""> NCAR Command Language Version 6.3.0</span></p>
<p class=""><span class=""> The use of this software is governed by a License Agreement.</span></p>
<p class=""><span class=""> See <a href="http://www.ncl.ucar.edu/">http://www.ncl.ucar.edu/</a> for more details.</span></p>
<p class=""><span class="">ncl 0&gt; ares=True</span></p>
<p class=""><span class="">ncl 1&gt; ares@cnLineColors = read_colormap_file(&quot;BlRe&quot;)</span></p>
<p class=""><span class="">ncl 2&gt; print(ares@cnLineColors(0:10,:))</span></p>
<p class=""><span class="">fatal:Attributes only have one dimension, 2 subscripts used</span></p>
<p class=""><span class="">fatal:[&quot;Execute.c&quot;:8573]:Execute: Error occurred at or near line 2</span></p>
<p class=""><span class=""></span><br></p>
<p class=""><span class="">ncl 3&gt; print(ares@cnLineColors)</span></p>
<p class=""><span class="">(0,0)<span class="">        </span> 0</span></p>
<p class=""><span class="">(0,1)<span class="">        </span> 0</span></p>
<p class=""><span class="">(0,2)<span class="">        </span>0.5019608</span></p>
<p class=""><span class="">(0,3)<span class="">        </span> 1</span></p>
<p class=""><span class="">(1,0)<span class="">        </span> 0</span></p>
<p class=""><span class="">(1,1)<span class="">        </span> 0</span></p>
<p class=""><span class="">(1,2)<span class="">        </span>0.5215687</span></p>
<p class=""><span class="">(1,3)<span class="">        </span> 1</span></p>
<p class=""><span class="">(2,0)<span class="">        </span> 0</span></p>
<p class=""><span class="">(2,1)<span class="">        </span> 0</span></p>
<p class=""><span class="">(2,2)<span class="">        </span>0.5411765</span></p>
<p class=""><span class="">(2,3)<span class="">        </span> 1</span></p><p class=""><span class="">.......</span></p><div><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr">----------------------------------------<div>Kyle S. Griffin</div><div>Department of Atmospheric and Oceanic Sciences</div><div>University of Wisconsin - Madison</div><div>Room 1407</div><div>1225 W Dayton St, Madison, WI 53706</div><div>Email: <a href="mailto:ksgriffin2@wisc.edu" target="_blank">ksgriffin2@wisc.edu</a></div></div></div></div></div></div>
</div></div>