[gradsusr] Suggestion for an internal call.
Arlindo da Silva
dasilva at alum.mit.edu
Wed Jan 11 10:47:18 EST 2012
On Tue, Jan 10, 2012 at 5:57 PM, Ryglicki, David CIV FNMOC <
david.ryglicki at navy.mil> wrote:
> (Let's try sending this to the correct email address, shall we.)
>
> Hey-hey, GrADS list.
>
> I need a little bit of guidance. I want to create, I guess, a "translate"
> function. To put it more clearly, when you get model output, you'll get
> something like airtemp or t2m or precip or ugrdprs... you get the idea. I'm
> writing a script that'll translate, say, "t2m" to "Air Temperature @ 2m."
> I'm trying to make this as modular as possible for a whole host of
> variables. My question is should I create another .gs script that uses
> arguments or should I create my own .gsf function? For my purposes, is the
> only different between the two as simple as:
>
> Translate.gs <variable name> <args args args...>
>
> Translate(<variable name>, <args args args...>)
>
> I suppose I'm a little unclear as to the difference between the two. Maybe
> for this specific instance they aren't that different?
>
> And oh yes, GrADS v2.0.1, Linux OS, OpenGrADS is not an option (well, not
> for a few months, anyway). Thanks for any help from the list I can get!
>
>
In the COLA releases of GrADS v2.0.1
1) There are 2 type of functions: script functions and "expression
functions" that are used in a display command, e.g.,
ga-> d sqrt(ua*ua+va*va)
In this case sqrt() is an "expression function".
2) Script functions can be either in a .gs file (when the function is
called in the same .gs file it is defined), or placed in a script library
(.gsf). Read this section of the documentation to learn about script
libraries: http://grads.iges.org/grads/gadoc/gsf.html
3) GrADS 2.0.1 from COLA does not yet provides a mechanism for user defined
functions, that is, you cannot create your own "expression functions"
4) Script functions and expession functions do not mix.
The OpenGrADs releases extends the basic functionality from COLA by
allowing you to write your own "user defined functions" (we call them
extensions). You can do so in Fortran, C or even as a grads script function
from a .gsf file (as described here: http://opengrads.org/doc/udxt/gsudf/).
In fact, a whole set of extensions were written as grads scripts, for
example http://opengrads.org/doc/udxt/saakeskus/
Arlindo
--
Arlindo da Silva
dasilva at alum.mit.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20120111/c7adb9f6/attachment-0003.html
More information about the gradsusr
mailing list