How does GrADS work internally when drawing?

Jennifer Adams jma at COLA.IGES.ORG
Thu Mar 20 12:10:05 EDT 2008


On Mar 20, 2008, at 11:53 AM, Stefan Gofferje wrote:

> Hi Jennifer,
>
> that's lots of ideas, thanks!
The formatting of all those script commands got corrupted in the
email (no newlines or indents!), but you can get the idea anyway...

>
>>> Can I
>>> define ownfunction and then just say set gxout grid; d ownfunction?
>> sure, if ownfunction is a valid GrADS expression. The syntax for
>> defining variables is:
>> 'define var = 'ownfunction
>> or the implied define:
>> 'var = 'ownfunction
>
> I had something like this in mind:
>
> --
> function snowflake()
> if (csnowsfc = 1)
>   ret="*"
> else
>   ret=""
> end if
>
> return ret
>
> ...
>
> set gxout grid
> d snowflake()
> --
>
> This would - of course - require that GrADS is going through the grid
> and provides the location to the function.
> But it would be pretty handy if this concept would work, right? :)
There are GrADS functions and expressions that operate on GrADS
variables (in the data files), and then there are functions and
variables that exist in the scripting language, and they are a bit
like apples and oranges -- not really the same. Generally, it's
through the scripting language that you can get creative and make
GrADS do wacky things with graphics. There's almost always a way to
do what you want, but getting there may not be straightforward.

Jennifer



More information about the gradsusr mailing list