Re: Dynamic variable names

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Mar 04 2010 - 09:09:31 MST

Ekin,

Unfortunately, there's no way to do what you are requesting. We've
had other users request this as well,
and it's on our list of things to add to NCL.

There may be ways to rewrite your code so that you can get the
functionality that you want.

What do you need to do with all of these variables once you read them
in? Is it possible that you
can read the values from one variable to a dummy variable, do the
processing you need, and then delete that
dummy variable before the next time through the loop?

--Mary

On Mar 4, 2010, at 7:32 AM, Ekin Akoglu wrote:

> Dear Users,
>
> I am reading data from netcdf file and there are many variables in
> it. I would like to read all variables into NCL with the same name
> or appending a prefix
> to the variable names in the netcdf file. Below is my code:
>
> blacksea = addfile("blacksea.nc","r") ; load netcdf file
>
> names = getfilevarnames(blacksea) ; get variable namelist
> from file
>
> do i=0, dimsizes(names)-1
> $names(1)$ = blacksea->$names(1)$ ; for all the
> variables use the same name to import them into NCL
> end do
>
> but as you will guess it does not work. Could you help me to
> overcome this problem?
>
> Regards,
>
> --
> Ekin Akoglu
>
> Institute of Marine Sciences
> Middle East Technical University
> P.O. Box 28, 33731
> Erdemli, Mersin
> Turkey
>
> Web: www.ims.metu.edu.tr
> Email: ekin@ims.metu.edu.tr
> Phone: +90 324 521 34 34
> GSM: +90 506 554 03 90
> _______________________________________________
> 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 Thu Mar 4 09:10:12 2010

This archive was generated by hypermail 2.1.8 : Thu Mar 04 2010 - 15:07:06 MST