looping over a series of separate files

From: Ioana Colfescu <colfescu_at_nyahnyahspammersnyahnyah>
Date: Mon Jan 27 2014 - 10:48:38 MST

Hi,

I want to apply a series commands to every series of files ( X series of
files in total),that are in different directories and nothing to do with
each other.

Using NCL and shell script is like :
foreach model ( 1 2 3 4 5 )
cat << EOR > tmp.ncl
begin
f=addfile("amoc_Cont${model}.nc","r")
moc5=f1->AMOC
....
end
EOR
ncl tmp.ncl
end

But in this I keep the files/data separate and I use cshell too.
My question is, if I want to do this just inside NCL and have all data
together (and not just write by hand f1=addgfile1,f2=addfile2 etc)
what's the syntax/way to do it in NCL ?.
More exactly how do I create a loop that is something like

do i=1,6
f(i)=addfile("amoc_Cont(i).nc","r")
...
end

The syntax I tried didn't work.

Thanks,
Ioana

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jan 27 10:48:48 2014

This archive was generated by hypermail 2.1.8 : Fri Feb 07 2014 - 16:39:11 MST