<div style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: Arial">Dear </span></div>
<div style="BACKGROUND: white; MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: Arial">I want to overlay tow composite maps of vector wind and omega from CDC NOAA. How can I do it in GrADS? If you do it please attach to me its script. </span></div>
<p style="BACKGROUND: white; MARGIN: 0cm 0cm 12pt"><span style="FONT-FAMILY: Arial">Best Regards</span></p><br><br>
<div><span class="gmail_quote">On 9/16/08, <b class="gmail_sendername">Arlindo da Silva</b> <<a href="mailto:dasilva@alum.mit.edu">dasilva@alum.mit.edu</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div dir="ltr">
<div class="gmail_quote">
<div><span class="e" id="q_11c69178e181f4ee_1">On Mon, Sep 15, 2008 at 12:09 PM, P.Romero <span dir="ltr"><<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:romero619@hotmail.com" target="_blank">romero619@hotmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I need to implement the FLOOR function.</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">What's the best/easiest way to get this done?</span></font></p>
<p><font face="Arial" size="2"><span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I'm guessing as a UDF, but I need some help on setting up the C code…</span></font></p></div></div></blockquote>
<div><br> </div></span></div>
<div>It should be relatively simple to do it as a dynamic UDF for v1.9.0-rc1. Here is the example of the sqrt function implemented as such:</div>
<div><br> </div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://opengrads.cvs.sourceforge.net/*checkout*/opengrads/grads/udf/dll/my_sqrt.c?revision=1.2" target="_blank">http://opengrads.cvs.sourceforge.net/*checkout*/opengrads/grads/udf/dll/my_sqrt.c?revision=1.2</a><br>
</div>
<div><br> </div>
<div>Basically, you just need to replace the sqrt() call with floor() and removed the test for positive values. Everything else should stay the same. (You could start with a global search+replace "sqrt" -> "floor").</div>
<div><br> </div>
<div>Here are some quick instructions to have your function built. Start with the sources from </div>
<div><br> </div>
<div><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://downloads.sourceforge.net/opengrads/grads-1.9.0-rc1-gex-r2.tar.gz?modtime=1207263579&big_mirror=0" target="_blank"> grads-1.9.0-rc1-gex-r2.tar.gz</a><br>
</div>
<div><br> </div>
<div>Then</div>
<div><br> </div>
<div>% tar xvfz grads-1.9.0-rc1-gex-r2.tar.gz</div>
<div>% cd grads-1.9.0-rc1-gex-rc2/extensions</div>
<div><br> </div>
<div>Make a directory for your function and copy some basic files in it:</div>
<div><br> </div>
<div>% mkdir floor</div>
<div>% cp hello/GNUmakefile floor</div>
<div><br> </div>
<div>Now place your floor.c function in this new directory, and add a file named "<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://floor.udxt.in/" target="_blank">floor.udxt.in</a>" with something like:</div>
<div><br> </div>
<div># Type Name Function Library</div>
<div># ------ --------------- ---------------- -------------------------------- </div>
<div> udf floor gaudf floor.gex.@DLLEXT@<br> </div>
<div><br> </div>
<div>Then build your function</div>
<div><br> </div>
<div>% cd floor</div>
<div>% make</div>
<div><br> </div>
<div>This should create <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://floor.gex.so/" target="_blank">floor.gex.so</a> (or floor.gex.dylib on Mac OS X) and floor.udxt . It is just a bit more complicated to do this on Windows but it can be done. </div>
<div><br> </div>
<div>To test it run grads from this directory and</div>
<div><br> </div>
<div>% export GAUDXT="./floor.udxt"</div>
<div>% export LD_LIBRARY_PATH=`pwd`</div>
<div>% gradsnc -l</div>
<div>ga-> open something</div>
<div>ga-> q udft</div>
<div>(should show your floor function)</div>
<div>ga-> display floor(whatever)</div>
<div>(it should work)</div>
<div><br> </div>
<div>Once you are convinced that it works install it. Add the contents of floor.udxt to your main udxt file and put <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://floor.gex.so/" target="_blank">floor.gex.so</a> alongside your other extensions. That is it.</div>
<div><br> </div>
<div>Additional information about the opengrads extensions are here:<br> </div>
<div><br> </div>
<div> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://opengrads.org/wiki/index.php?title=User_Defined_Extensions" target="_blank">http://opengrads.org/wiki/index.php?title=User_Defined_Extensions</a><br>
</div>
<div><br> </div>
<div>VERY IMPORTANT: This is the procedure in v1.9.0-rc1 and details will very likely change for grads v2. So, any function developed for v1.9 will need to be ported to v2.0. Therefore, unless you need something that cannot wait, there is no much point in developing new functions for v1.9.</div>
<div><br> </div>
<div> Good Luck,</div>
<div><br> </div>
<div> Arlindo</div>
<div><br> </div></div>-- <br>Arlindo da Silva<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:dasilva@alum.mit.edu" target="_blank">dasilva@alum.mit.edu</a><br> </div></blockquote></div><br>