using lat as a varbale in script.

Arlindo da Silva dasilva at ALUM.MIT.EDU
Sun Aug 10 09:54:51 EDT 2008


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



More information about the gradsusr mailing list