Re: String reference

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 28 Aug 2008 06:26:12 -0600

If the arrays are already in memory in
different variables, the only way I can
think of is ....

do ix...
    if (var(ix).eq."T") then
        a = TEMP
    end if
    if (var(ix).eq."S") then
        a = Salinity
    end if
    if (var(ix).eq."U") then
        a = U
    end if
    if (var(ix).eq."T") then
        a = V
    end if

end do

If they are on a file

     f = addfile (...)
     do ix ...
        a = f->$var(ix)$

Marco Pastore wrote:
> Hi All.
>
> Is possible in NCL to reference one variable from an (string) array field ?
>
> For example:
>
> var = (/"T","S","U","V"/)
>
> do ix = 0,(dimsizes(var)-1)
> a = $var(ix)$
> ..... some "fixed" graphic instruction to produce one plot using a....
> end do
>
> I tried, but it don't work...there is a way to do it ?
>
> Thanks for one answer,
>
> Marco
>
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Aug 28 2008 - 06:26:12 MDT

This archive was generated by hypermail 2.2.0 : Fri Aug 29 2008 - 07:39:20 MDT