Re: string

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Wed, 19 Dec 2007 10:06:14 -0700 (MST)

Hi Siji,

I've often wished I could do just what you're asking. We do have this
capability for *attribute* names. For example, you can do this:

  Var_name=(/"tc","ua"/)
  do nn=0,1
     temp$Var_name(nn)$ = wrf_user_getvar(a,Var_name(nn),it)
  end do

"temp" will then end up with attributes "temp_at_tc" and "temp_at_ua".
This won't work on the above, though, because I think wrf_user_getvar
wants to attach other attributes and coordinate arrays, and you
can't do this with a variable that's already an attribute.

We currently have it on our priority list to allow the "$...$" syntax
to be used as its own variable, like this:

  Var_name=(/"tc","ua"/)

  do nn=0,1
     $Var_name(nn)$ = wrf_user_getvar(a,Var_name(nn),it)
  end do

I will see if we can get this bumped up in the priority list, as
this is becoming a popular request.

--Mary

On Wed, 19 Dec 2007, Sijikumar S wrote:

> Hi,
>
> A simple question,
> instead of the following lines
>
> tc=wrf_user_getvar(a,"tc",it)
> ua=wrf_user_getvar(a,"ua",it)
>
> How can I use the following loop
>
> Var_name=(/"tc","ua"/)
> do nn=0,1
> temp = wrf_user_getvar(a,Var_name(nn),it)
> end do
>
> I would like to get the variable name "temp" as "tc" and "ua" and it
> would reads from "Var_name" .
> thanks
> Siji
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Dec 19 2007 - 10:06:14 MST

This archive was generated by hypermail 2.2.0 : Mon Dec 31 2007 - 09:18:02 MST