[gradsusr] [gradsusr^ unability to run some coomands & iterations

Eduardo Agosta Scarel eduardo.agosta at gmail.com
Mon Feb 7 07:52:01 EST 2011


Hola Mario,

Espero que estés bien.

Una pregunta, ¿cuando utilizas los comandos while, if, etc., previenes de
ponerlos sin entrecomillados? Por ejemplo,

....
i=0
while (i <=10)
'define x'i' = uwnd(t='i')'
i=i+1
endwhile
'set gxout contour'
'd x1'

lo de arriba es un script-invento literal para mostrarte mi pregunta.

Un abrazo,

Eduardo.

2011/2/7 Mario Caffera <rmcaffera at yahoo.com>

> Hi grads users.
>
>  I never be able to do any iteration in grads, nor apply any command as
> "while" "if" or "for". It appears some explanations like "unknown command"
> or so on.
>  I'm running grads in a Win32 mahine. Could be that the cause?
>
>   thanks in advance
>
>                    Mario
>
> --- On Sun, 2/6/11, Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk> wrote:
>
> > From: Muhammad Rahiz <muhammad.rahiz at ouce.ox.ac.uk>
> > Subject: Re: [gradsusr] Templates for TRMM data
> > To: "GrADS Users Forum" <gradsusr at gradsusr.org>
> > Date: Sunday, February 6, 2011, 7:12 PM
> > 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
> > >
> > >
> > >
> > >
> > -----Inline Attachment Follows-----
> >
> > _______________________________________________
> > gradsusr mailing list
> > gradsusr at gradsusr.org
> > http://gradsusr.org/mailman/listinfo/gradsusr
> >
>
>
>
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>



-- 
Eduardo Agosta Scarel

eduardo.agosta at conicet.gov.ar
eduardo_agosta at uca.edu.ar

"Hay que encontrar una manera de hablar sugerente y plástica que no declare
y amoneste, sino que abra los sentidos interiores, que guíe al hombre hacia
el acontecer sacro y promueva su realización."
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20110207/57880637/attachment-0003.html 


More information about the gradsusr mailing list