[gradsusr] multiple files

Muhammad Rahiz muhammad.rahiz at ouce.ox.ac.uk
Fri Mar 11 03:18:23 EST 2011


Perhaps something along these lines?


*** Start of script ***
m = 1
while(m <= 10)          # where 10 is the no. of records in 'files.txt'
   ifile = 'files.txt'   # files.txt contains a list of your netcdf files
   rec = read(ifile)

   IO = sublin(rec,1)
   if(IO = 1)
     say ifile' > File open error'
   endif
   if (IO = 0)
     a = subwrd(rec,2)
   endif

'sdfopen 'a''
say ''
say ' Filename: 'a''
say ' File no: 'm''

'q file'
vx  = sublin(result,7) # takes the first variable, 
var.'m' = subwrd(vx,1)

'close 1'
m = m + 1
endwhile

'define mn = var.1 + var.2 + var.3 ... '
'd 'mn''
*** End of script ***

-- 
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford

On Fri, 11 Mar 2011, madhu latha wrote:

> hi
> 
>    I want to get mean profile parameters of 50 ctl files
> how can i wrie script.
> please give necessary information.
> 
> Thanks in advance.
> 
> --
> With Regards
> Madhu Latha Akkisetti
> JRF,NARL
> Gadanki
> 
>


More information about the gradsusr mailing list