[ncl-talk] populating lists with multidimensional arrays

Will Hobbs will.hobbs at utas.edu.au
Wed Mar 2 19:56:34 MST 2016


Hi all

My understanding from the documentation is that elements of an NCL list do not need to be the same size, but I am having trouble populating a list with arrays that are not the same size.

Consider the following test case:

P = NewList("fifo")           ;create new list
Q = NewList("fifo")          ;another new list
x = (/(/1,2,3/),(/4,5,6/)/)  ;a test array

do i = 0, 2

ListAppend(P,x)                 ;keep adding array 'x'
ListAppend(Q,x(:,:i))       ;add a different sized subset of 'x'

end do

print(P)

;returns the following (expected)
;Variable: P
;Type: list
;Total Size: 4 bytes
;            1 values;
;Number of Dimensions: 1
;Dimensions and sizes:   [1]
;Coordinates:
;Type: list <fifo>
;Total items: 3


print(Q)
;returns the following (an empty list)Variable: P
Type: list
Total Size: 4 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates:
Type: list <fifo>
Total items: 0

What am I missing here?

Many thanks

Will


University of Tasmania Electronic Communications Policy (December, 2014).
This email is confidential, and is for the intended recipient only. Access, disclosure, copying, distribution, or reliance on any of it by anyone outside the intended recipient organisation is prohibited and may be a criminal offence. Please delete if obtained in error and email confirmation to the sender. The views expressed in this email are not necessarily the views of the University of Tasmania, unless clearly intended otherwise.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160303/f6bda803/attachment.html 


More information about the ncl-talk mailing list