Dear NCL Community,
I would like to pass many objects to a procedure or function, but I know
the number only at run time. How can I pass multiple objects in an array
to the procedure? Consider the following small ncl script:
;For example, I have a procedure
procedure proc(x,y)
begin
print(x)
print(y)
End
begin
; here, I define an object a with an attribute attr
a=(/1,2,3/)
a@attr="a1"
; likewise the object b
b=(/4,5,6/)
b@attr="b1"
;Now I can pass those variables to the procedure
proc(a,b)
end
and I get, what I want. No problem. Now, if I had many objects
like a and b and I would like to store them in an array and pass them
to a procedure which takes an array of objects as argument.
Inside the procedure, I would like to access the elements of the arrays
including their attributes, dimensions and so on. If I create an array
of a and b such as c = (/a,b/), I loose all attributes of a and b. The
objects
May also be graphics objects.
I have found a topic in the mailing list archive, in which you announce
the type "list". Is this already implemented? When is it foreseen? What
would you suggest in the meanwhile?
A "list" type would be an extremely helpful feature of the NCL language.
Many thanks and best regards
Daniel Leuenberger
________________________________________
Daniel Leuenberger
Numerical Models
Federal Departement of Home Affairs FDHA Federal Office of Meteorology
and Climatology MeteoSwiss
Kraehbuehlstrasse 58, P.O. Box 514, CH-8044 Zurich, Switzerland
Tel. +41 44 256 97 10
Fax +41 44 256 92 78
daniel.leuenberger@meteoswiss.ch
www.meteoswiss.ch - First-hand information
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jan 27 09:39:24 2011
This archive was generated by hypermail 2.1.8 : Mon Jan 31 2011 - 10:38:24 MST