On Tue, Jan 10, 2012 at 5:57 PM, Ryglicki, David CIV FNMOC <span dir="ltr"><<a href="mailto:david.ryglicki@navy.mil">david.ryglicki@navy.mil</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
(Let's try sending this to the correct email address, shall we.)<br>
<br>
Hey-hey, GrADS list.<br>
<br>
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:<br>
<br>
Translate.gs <variable name> <args args args...><br>
<br>
Translate(<variable name>, <args args args...>)<br>
<br>
I suppose I'm a little unclear as to the difference between the two. Maybe for this specific instance they aren't that different?<br>
<br>
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!<br>
<br></blockquote><div><br></div><div>In the COLA releases of GrADS v2.0.1 </div><div><br></div><div>1) There are 2 type of functions: script functions and "expression functions" that are used in a display command, e.g.,</div>
<div><br></div><div> ga-> d sqrt(ua*ua+va*va)</div><div><br></div><div>In this case sqrt() is an "expression function".</div><div><br></div><div>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: <a href="http://grads.iges.org/grads/gadoc/gsf.html">http://grads.iges.org/grads/gadoc/gsf.html</a></div>
<div><br></div><div>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"</div><div><br></div><div>4) Script functions and expession functions do not mix.</div>
<div><br></div><div>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: <a href="http://opengrads.org/doc/udxt/gsudf/">http://opengrads.org/doc/udxt/gsudf/</a>). In fact, a whole set of extensions were written as grads scripts, for example <a href="http://opengrads.org/doc/udxt/saakeskus/">http://opengrads.org/doc/udxt/saakeskus/</a></div>
<div><br></div><div> Arlindo</div><div> </div></div>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>