[ncl-talk] Attribute multi-dimension segfault

Kyle Griffin ksgriffin2 at wisc.edu
Fri Dec 18 09:35:23 MST 2015


Hi all,

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:

ares = True
ares at cnLineColors = read_colormap_file("BlRe")

I then tried three different operations.
1) print(ares at cnLineColors) ----> results in full Nx4 array output on
screen.
2) print(ares at cnLineColors(0:10,:) ----> Warning that attributes are only
one dimension (not a true statement), no output
3) print(ares at cnLineColors(0:10) -----> Segfault, no warning received, in
contrast to most other attempts to read with wrong number of subscripts.

Warning is received as expected if indices exceed dimensions, regardless of
dimensions included/referenced in the subscripts.

Seems like this may have been overlooked at some point. Further, is support
for any 2+ dimensioned attributes an intended feature?

Full output for cases 1-3 below.


Kyle


 Copyright (C) 1995-2015 - All Rights Reserved

 University Corporation for Atmospheric Research

 NCAR Command Language Version 6.3.0

 The use of this software is governed by a License Agreement.

 See http://www.ncl.ucar.edu/ for more details.

ncl 0> ares=True

ncl 1> ares at cnLineColors = read_colormap_file("BlRe")

ncl 2> print(ares at cnLineColors(0:10))

Segmentation fault (core dumped)


 Copyright (C) 1995-2015 - All Rights Reserved

 University Corporation for Atmospheric Research

 NCAR Command Language Version 6.3.0

 The use of this software is governed by a License Agreement.

 See http://www.ncl.ucar.edu/ for more details.

ncl 0> ares=True

ncl 1> ares at cnLineColors = read_colormap_file("BlRe")

ncl 2> print(ares at cnLineColors(0:10,:))

fatal:Attributes only have one dimension, 2 subscripts used

fatal:["Execute.c":8573]:Execute: Error occurred at or near line 2


ncl 3> print(ares at cnLineColors)

(0,0) 0

(0,1) 0

(0,2) 0.5019608

(0,3) 1

(1,0) 0

(1,1) 0

(1,2) 0.5215687

(1,3) 1

(2,0) 0

(2,1) 0

(2,2) 0.5411765

(2,3) 1

.......
----------------------------------------
Kyle S. Griffin
Department of Atmospheric and Oceanic Sciences
University of Wisconsin - Madison
Room 1407
1225 W Dayton St, Madison, WI 53706
Email: ksgriffin2 at wisc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20151218/b0db127d/attachment.html 


More information about the ncl-talk mailing list