<div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Hi Bill,</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Thanks for your response! I'm still a little bit confused though. I am passing into the script a grid, for example: </div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">grads -lc "<a href="http://script.gs">script.gs</a> 25 50 -130 -60"</font></div><div class="gmail_default"><br></div><div class="gmail_default"><font color="#000000" face="arial, helvetica, sans-serif">Where 25 and 50 are latmin and latmax, and -130 and -60 are lonmin and lonmax. It is necesary in my GrADS script to use both degrees east and degrees west longitude.</font></div><div class="gmail_default">
<span style="font-family:"times new roman",serif;font-size:large;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span> </span></span></div><div class="gmail_default"><span style="font-family:"times new roman",serif;font-size:large">So in my GrADS script, is there a way to just do something like the following in the bold red color?</span></div><div class="gmail_default"><span style="font-family:"times new roman",serif;font-size:large"><br></span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000"><div class="gmail_default">function main(arg)</div><div class="gmail_default">latmin=subwrd(arg,1)</div><div class="gmail_default">latmax=subwrd(arg,2)</div><div class="gmail_default">lonmin=subwrd(arg,3)</div><div class="gmail_default">lonmax=subwrd(arg,4)</div><div>....</div></font></div><div class="gmail_default"><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">'set lat 'latmin' 'latmax</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">'set lon 'lonmin' 'lonmax</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000"><b>'define lonmine = 360 - 'lonmin</b></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000"><b>'define lonmaxe = 360 - 'lonmax</b></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000"><b>say lonmine</b></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000"><b>say lonmaxe</b></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000"><b><br></b></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">The above in red doesn't seem to work and I'm not sure why. Maybe I have quotations in the wrong places?</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">Thanks,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#000000">Tracey</font></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 12, 2018 at 7:39 AM, Bill Bua - NOAA Affiliate <span dir="ltr"><<a href="mailto:bill.bua@noaa.gov" target="_blank">bill.bua@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Tracey --<div><br></div><div>There's a difference between a script variable and what I believe is called an <i>intrinsic</i> variable, in GrADS. With script variables, you would indeed use "define". But for intrinsic variables (and this from my experience needs to be in a script), I believe you'd have to pull the values from a string of display-ed data. That is:</div><div><br></div><div>"d lon"</div><div>lonw = subwrd(result,<leftmost character position>, <rightmost character position>)</div><div><br></div><div>where leftmost and rightmost refer to the left and right position in the line that includes the variable lonw.</div><div>If there are multiple lines in the display, you'll have to first choose the line that contains the longitude. If it were the 2nd line, you'd have the command <br></div><div><br></div><div>lonline=sublin(result, 2)</div><div>then do subwrd(lonline, <leftmost>,<rightmost>) as above.</div><div><br></div><div>Finally, you'd define your lone = 360 - lonw ("define lone = 360 - lonw"). <br></div><div><br></div><div>I'm doing this from memory ... it's been awhile since I wrote a script. I'll check it out once I'm where I can write a test script and see if this works.</div><div><br></div><div>Bill<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_-4249727468387831462gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Dr. William R. (Bill) Bua<br>UCAR/COMET/NCEP/EMC<br>5830 University Research Court #2784<br>
College Park, MD 20740<br><br></div></div></div></div></div></div><div><div class="h5">
<br><div class="gmail_quote">On Wed, Jul 11, 2018 at 6:49 PM, Tracey <span dir="ltr"><<a href="mailto:tdorian10@gmail.com" target="_blank">tdorian10@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Hi Bill,</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Thanks, how would I use this arithmetic in the GrADS script with 'lonmax' and 'lonmin' arguments? This is what I'm having trouble with. Would I use "define"?</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Sincerely,</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Tracey</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 11, 2018 at 6:31 PM, Bill Reilly <span dir="ltr"><<a href="mailto:bill_reilly@compuserve.com" target="_blank">bill_reilly@compuserve.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
360 - degW = degE<br>
<pre class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-signature" cols="72">--
Bill Reilly
(+34) 686-110-748
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-abbreviated" href="mailto:bill@passageweather.com" target="_blank">bill@passageweather.com</a>
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-abbreviated" href="http://www.passageweather.com" target="_blank">www.passageweather.com</a>
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-abbreviated" href="mailto:bill@brwebworks.com" target="_blank">bill@brwebworks.com</a>
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-abbreviated" href="http://www.brwebworks.com" target="_blank">www.brwebworks.com</a>
</pre><div><div class="m_-4249727468387831462m_-3195620121486446381h5">
<div class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-cite-prefix">On 12/07/2018 00:14, Tracey wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="m_-4249727468387831462m_-3195620121486446381h5">
<div dir="ltr">
<div class="gmail_default">Hi GrADS users, </div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Is there a GrADS function
or script that converts degrees west longitude into degrees
east? For example, if I input "lonmin" and "lonmax" arguments
into a GrADS script and I wanted to convert those longitudes
from degrees west to degrees east within the script by
defining new "lonmin" and "lonmax" variables?</div>
<div class="gmail_default"><br>
</div>
<div class="gmail_default">Thanks in advance for any
help,</div>
<div class="gmail_default">Tracey</div>
</div>
<br>
<fieldset class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
gradsusr mailing list
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a>
<a class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/li<wbr>stinfo/gradsusr</a><br>
<br></blockquote></div><br></div></div></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br></div>