[gradsusr] Templates for TRMM data
Muhammad Rahiz
muhammad.rahiz at ouce.ox.ac.uk
Sun Feb 6 16:12:56 EST 2011
The following code would allow you to open multiple files but you need to
make a list of files you want to open as *.txt (e.g. inputfiles.txt)
n = 10 # where n is the total number of files in inputfiles.txt
m = 1
while(m< n+1)
ifile = 'inputfiles.txt'
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 ''a''
'quit'
m = m +1
endwhile
If you're using GrADS in Linux/Unix environment, the following would work
as well;
#!/bin/bash
for i in $(ls *.nc); do
cat > grads.gs << EOF
'sdfopen $i'
say '$i'
'quit'
EOF
grads -blc 'run grads.gs'
done
HTH,
---
Muhammad Rahiz
Researcher & DPhil Candidate (Climate Systems & Policy)
School of Geography & the Environment
University of Oxford
On Sun, 6 Feb 2011, Subash Yeggina wrote:
> Hi! Muhammad,
> sdfopen inputfile.nc is to read one file. I would like to know how to read
> all the files using 'templates'.
>
>
> Thanks,
> Subash
>
> On Sun, Feb 6, 2011 at 9:50 PM, Muhammad Rahiz
> <muhammad.rahiz at ouce.ox.ac.uk> wrote:
>
> sdfopen inputfile.nc
>
>
>
> Muhammad Rahiz
> Researcher & DPhil Candidate (Climate Systems & Policy)
> School of Geography & the Environment
> University of Oxford
>
> On Sun, 6 Feb 2011, Subash Yeggina wrote:
>
> > Hi! All,
> > I have 1 year 3B42 3hr TRMM data in NetCDF format. My question is
> how to
> > write the template file to read all the data is GrADS.
> >
> >
> > Thanks & Regards,
> > Subash
> >
> >
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
>
>
More information about the gradsusr
mailing list