On Fri, Apr 22, 2011 at 1:43 PM, Jeffrey Duda <span dir="ltr"><<a href="mailto:jdduda@iastate.edu">jdduda@iastate.edu</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;">
Meredith,<br>I know the way Grads scripting works can be confusing with the quoting of commands and calling of functions. That's all you're doing wrong. I've attached an edited version of your <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> file to show you how to do it. Notice that I only changed the top few lines. To work this, you need to run the <a href="http://zinterp.gs" target="_blank">zinterp.gs</a> script. Your <a href="http://test3.gs" target="_blank">test3.gs</a> script would work but you need to remove the call from any quotes and you need the actual code that makes up the function to be located within the script file. Unfortunately Grads doesn't know that your function is sitting in some other .gs file, even if it is in the same directory.<br>
<br></blockquote><div><br></div><div>If you are using an opengrads build, another possibility is to implement <a href="http://zinterp.gs">zinterp.gs</a> as a GS udf as explained here:</div><div><br></div><div> <a href="http://opengrads.org/doc/udxt/gsudf/">http://opengrads.org/doc/udxt/gsudf/</a></div>
<div><br></div><div>Better yet, the opengrads bundle comes with zinterp() implemented as an extension:</div><div><br></div><div> <a href="http://opengrads.org/doc/udxt/libbjt/libbjt.html#zinterp_field_zgrid_zlev__l_s_p__">zinterp(FIELD,ZGRID,ZLEV,[-l|-s|-p])</a></div>
<div><br></div><div> so just use it.</div><div><br></div><div> Arlindo</div><div><br></div><div><br></div><div><br></div><div><br></div></div><br clear="all"><br>-- <br>Arlindo da Silva<br><a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a><br>