Re: variable attribution syntax

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Aug 13 2010 - 19:27:26 MDT

do year=1870,2000
    f1=addfile("ts_"+year+"_daily.nc","r")
    f2=addfile("olr_"+year+"_daily.nc","r")
    f3= ...
...
end do

On 8/13/10 6:54 PM, Ioana Colfescu wrote:
> Hi,
>
> I have a certain algorithm that I want to perform each time over one year series - i.e :
>
> f1=addfile("ts_1870_daily.nc","r")
> f2=addfile("olr_1870_daily.nc","r")
> f3= ...
>
> and so on.
>
> I have a series of 130 years and I would not want to change the year 130 times by hand.
> Could someone please tell me what is the syntax to attribute a variable to the year , more exactely to say:
>
> for each i ( 1870 1880 1890 ... 1999 ) do
> f1=addfile("ts_$i_daily.nc","r")
>
> Is it actually possible to attribute a value to a file name not a variable since I didn't even open yet a file or I need to combine it with a shell script or something else ?
>
> Thank you,
>
> Ioana
>
>
> _______________________________________________
> 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 Fri Aug 13 19:27:31 2010

This archive was generated by hypermail 2.1.8 : Tue Aug 17 2010 - 15:33:24 MDT