Mark,
Use string referencing. This works for variables in files but not
regular variables. It also works for attributes and coordinate
variables.
array = input->$ivar$
-dave
On Jul 6, 2009, at 6:02 PM, <Mark.Collier_at_csiro.au> wrote:
> Hi
> is there a way of using a character variable to specify and input
> or output file when readin/writing after an addfile command:
>
> for example
>
> ivar="prate"
>
> input = addfile("foo.nc","r")
> array = input->ivar
>
> doesn't work as it is looking for variable "ivar". Some how need to
> expand the variable ivar beforehand.
>
> Regards,
> Mark.
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jul 06 2009 - 18:31:57 MDT
This archive was generated by hypermail 2.2.0 : Tue Jul 07 2009 - 11:13:18 MDT