Re: How to work with lists?

From: Sebastian Schubert <sebastian.schubert_at_nyahnyahspammersnyahnyah>
Date: Thu May 06 2010 - 01:56:58 MDT

Thanks for the explanation!

So I'm glad I didn't miss anything in the documentation.

Sebastian

On Thursday, 6. May 2010 00:09:11 David Brown wrote:
> Hi Sebastian,
>
> NCL's facilities for working with the list type are rudimentary and
> undocumented.
> There are functions NewList, ListPush, and ListPop:
>
> ncl 0> l = NewList("join")
> ncl 1> ListPush(l,"a string")
> ncl 2> i = (/20,30,40/)
> ncl 3> ListPush(l,i)
> ncl 4> x = ListPop(l)
> ncl 5> print(x)
>
>
> Variable: x
> Type: string
> Total Size: 4 bytes
> 1 values
> Number of Dimensions: 1
> Dimensions and sizes: [1]
> Coordinates:
> (0) a string
>
>
> The current version of NCL does not give any useful information if
> you try to print the contents of a list, and there is no function to
> return the number of elements in the list. We are currently working
> on some enhancements for the list type to make it more functional.
> -dave
>
> On May 4, 2010, at 3:46 AM, Sebastian Schubert wrote:
> > Hi,
> >
> > the addfiles command returns a list. How can I work with these
> > lists more
> > than just using it for input? Especially, how can I
> > * get the length of a list (a dimsizes for lists),
> > * create a list manually?
> >
> > Can lists be used for collecting arrays of different dimensions?
> >
> > Cheers,
> > Sebastian
>

-- 
Potsdam Institute for Climate Impact Research (PIK)
Research Domain II - Climate Impacts & Vulnerabilities
http://www.pik-potsdam.de/members/schubert/

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk

Received on Thu May 6 02:01:47 2010

This archive was generated by hypermail 2.1.8 : Fri May 07 2010 - 10:36:00 MDT