using lat as a varbale in script.

Rahul S rahulsivan at TROPMET.RES.IN
Tue Aug 12 09:05:52 EDT 2008


On Sun, 10 Aug 2008 09:54:51 -0400, Arlindo da Silva wrote
> On Sun, Aug 10, 2008 at 7:02 AM, Rahul Sivan <rahulsivan at tropmet.res.in> wrote:
> > hello grads users.......
> >           I would like to know how can I use lat as a variable in grads
> > script. when I use lat for some numeric operations... for eg..
> > sn = math_sin(lat),  error message comes as 'Non-numeric args to numeric
> > operation'.
>
> The first point to understand is that GrADS Scripting does not provide
> *direct* access to GrADS data variables (those coming from files or
> defines), although there are ways to access specific values in these.
> GrADS scripting allows you to automate GrADS command line operations.
> For example, if you would like to pre-compute the sine(latitude), you
> would simply issue a define command from your gs script,
>
> 'define sn = sin(lat)'
>
> The math_sin() function is used for computing the sine of numbers that
> appear in the script, say
>
> sn = math_sin(3.141516/4)
>
>   You find useful to read this section of the User's Guide:
>
>           http://grads.iges.org/grads/gadoc/script.html
>
>    Good Luck,
>
>       Arlindo
>
> --
> Arlindo da Silva
> dasilva at alum.mit.edu

thankyou for the reply....

 My problem is that only...accessing variables that come from define commands into the
script. some of functions that ar available in grads such as hcurl, mag etc canot be use
d in script. and if we use define command and assign the value to a variable, we cannot
use it in calculations in script.

any solution to this problem?

If I use define command in every line, problem occurs when I am time averaging my
calculated parameter. the values of the parameters which I use to calcuate may be
defined only the first time interval. the variation with time I canot get, I suppose.
If loop may be ok...... but that is possible through scripting language only......

kindly help......
              Rahul






--
Open WebMail Project (http://openwebmail.org)



More information about the gradsusr mailing list