Re: unknown array size

From: Will Hobbs <Will.Hobbs_at_nyahnyahspammersnyahnyah>
Date: Fri Mar 08 2013 - 16:35:09 MST

Micah

That's a perfectly acceptable approach.

Other approaches would include using the array_append_record() function, or the relatively new 'list' variable type; as is often the case, which method you use will probably be a balance between speed and memory size.

Without seeing your script it's impossible to know the best option

Will

From: Micah Sklut <micahs2005@gmail.com<mailto:micahs2005@gmail.com>>
Date: Saturday, 9 March 2013 10:25 AM
To: Will Hobbs <will.hobbs@utas.edu.au<mailto:will.hobbs@utas.edu.au>>
Cc: NCL_Talk <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>>
Subject: Re: unknown array size

Yes Will:

"How do I declare an array of unknown size:"
predifine/declare, whichever term you want to use. Is this possible?
My way around this thus far was just defining the array with size larger then possible with my data.

Micah

On Fri, Mar 8, 2013 at 6:20 PM, Will Hobbs <Will.Hobbs@utas.edu.au<mailto:Will.Hobbs@utas.edu.au>> wrote:
Micah

I'm not entirely sure what you mean by 'an array of unknown size'. In the error message you gave, the array 'px' has not been defined which causes the error. Do you mean to predefine an array that you don't know the size of?

Will

From: Micah Sklut <micahs2005@gmail.com<mailto:micahs2005@gmail.com>>
Date: Saturday, 9 March 2013 9:39 AM
To: NCL_Talk <ncl-talk@ucar.edu<mailto:ncl-talk@ucar.edu>>
Subject: unknown array size

My apologies for this novice question, however I couldnt find the answer in the docs.
How do I declare an array of unknown size:

px(np)= x(j)

fatal:Undefined identifier: (px) is undefined, can't continue
fatal:Execute: Error occurred at or near line 50 in file graph_gfs.ncl

The size of array, px, is unknown.

Thank you,

--
Micah Sklut
--
Micah Sklut

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Mar 8 14:35:21 2013

This archive was generated by hypermail 2.1.8 : Wed Mar 13 2013 - 14:19:38 MDT