<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Tracey,
<div class=""><br class="">
</div>
<div class="">That’s getting into the difference in a grads script variable and variables used on command line and such.  Anything you put in quotes would be something you could type into a Grads command line session.</div>
<div class=""><br class="">
</div>
<div class="">If you modify your script like:</div>
<div class=""><br class="">
</div>
<div class="">lonmine = 360 - lonmin<br class="">
lonmaxe = 360 - lonmax<br class="">
say lonmine<br class="">
say lonmaxe</div>
<div class=""><br class="">
</div>
<div class="">It should work.</div>
<div class=""><br class="">
</div>
<div class="">Colleen</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On Jul 12, 2018, at 1:08 PM, Tracey <<a href="mailto:tdorian10@gmail.com" class="">tdorian10@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<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 class="">
</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" class=""><br class="">
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">grads -lc "<a href="http://script.gs/" class="">script.gs</a> 25 50 -130 -60"</font></div>
<div class="gmail_default"><br class="">
</div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">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" class=""><span class=""> </span></span></div>
<div class="gmail_default"><span style="font-family:"times new roman",serif;font-size:large" class="">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" class=""><br class="">
</span></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">
<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 class="">....</div>
</font></div>
<div class="gmail_default">
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">'set lat 'latmin' 'latmax</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">'set lon 'lonmin' 'lonmax</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000" class=""><b class="">'define lonmine = 360 - 'lonmin</b></font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000" class=""><b class="">'define lonmaxe = 360 - 'lonmax</b></font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000" class=""><b class="">say lonmine</b></font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000" class=""><b class="">say lonmaxe</b></font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" color="#ff0000" class=""><b class=""><br class="">
</b></font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">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" class=""><br class="">
</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">Thanks,</font></div>
<div class="gmail_default"><font face="arial, helvetica, sans-serif" class="">Tracey</font></div>
</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Thu, Jul 12, 2018 at 7:39 AM, Bill Bua - NOAA Affiliate
<span dir="ltr" class=""><<a href="mailto:bill.bua@noaa.gov" target="_blank" class="">bill.bua@noaa.gov</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">Hi Tracey --
<div class=""><br class="">
</div>
<div class="">There's a difference between a script variable and what I believe is called an
<i class="">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 class=""><br class="">
</div>
<div class="">"d lon"</div>
<div class="">lonw = subwrd(result,<leftmost character position>, <rightmost character position>)</div>
<div class=""><br class="">
</div>
<div class="">where leftmost and rightmost refer to the left and right position in the line that includes the variable lonw.</div>
<div class="">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 class="">
</div>
<div class=""><br class="">
</div>
<div class="">lonline=sublin(result, 2)</div>
<div class="">then do subwrd(lonline, <leftmost>,<rightmost>) as above.</div>
<div class=""><br class="">
</div>
<div class="">Finally, you'd define your lone = 360 - lonw ("define lone = 360 - lonw").
<br class="">
</div>
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">Bill<br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<div class="gmail_extra"><br clear="all" class="">
<div class="">
<div class="m_-4249727468387831462gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class="">
<div dir="ltr" class="">
<div class="">Dr. William R. (Bill) Bua<br class="">
UCAR/COMET/NCEP/EMC<br class="">
5830 University Research Court #2784<br class="">
College Park, MD 20740<br class="">
<br class="">
</div>
</div>
</div>
</div>
</div>
</div>
<div class="">
<div class="h5"><br class="">
<div class="gmail_quote">On Wed, Jul 11, 2018 at 6:49 PM, Tracey <span dir="ltr" class="">
<<a href="mailto:tdorian10@gmail.com" target="_blank" class="">tdorian10@gmail.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr" class="">
<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 class="">
</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 class="">
</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 class="">
<div class="gmail_quote">On Wed, Jul 11, 2018 at 6:31 PM, Bill Reilly <span dir="ltr" class="">
<<a href="mailto:bill_reilly@compuserve.com" target="_blank" class="">bill_reilly@compuserve.com</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF" class="">360 - degW = degE<br class="">
<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 class="">
<div class="m_-4249727468387831462m_-3195620121486446381h5">
<div class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620moz-cite-prefix">
On 12/07/2018 00:14, Tracey wrote:<br class="">
</div>
</div>
</div>
<blockquote type="cite" class="">
<div class="">
<div class="m_-4249727468387831462m_-3195620121486446381h5">
<div dir="ltr" class="">
<div class="gmail_default">​Hi GrADS users, </div>
<div class="gmail_default"><br class="">
</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 class="">
</div>
<div class="gmail_default">Thanks in advance for any help,</div>
<div class="gmail_default">Tracey​</div>
</div>
<br class="">
<fieldset class="m_-4249727468387831462m_-3195620121486446381m_4194839856421112620mimeAttachmentHeader">
</fieldset> <br class="">
</div>
</div>
<pre class="">______________________________<wbr class="">_________________
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 class="">stinfo/gradsusr</a>
</pre>
</blockquote>
<br class="">
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
gradsusr mailing list<br class="">
<a href="mailto:gradsusr@gradsusr.org" target="_blank" class="">gradsusr@gradsusr.org</a><br class="">
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank" class="">http://gradsusr.org/mailman/li<wbr class="">stinfo/gradsusr</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
gradsusr mailing list<br class="">
<a href="mailto:gradsusr@gradsusr.org" target="_blank" class="">gradsusr@gradsusr.org</a><br class="">
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank" class="">http://gradsusr.org/mailman/li<wbr class="">stinfo/gradsusr</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
______________________________<wbr class="">_________________<br class="">
gradsusr mailing list<br class="">
<a href="mailto:gradsusr@gradsusr.org" class="">gradsusr@gradsusr.org</a><br class="">
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank" class="">http://gradsusr.org/mailman/<wbr class="">listinfo/gradsusr</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
_______________________________________________<br class="">
gradsusr mailing list<br class="">
<a href="mailto:gradsusr@gradsusr.org" class="">gradsusr@gradsusr.org</a><br class="">
http://gradsusr.org/mailman/listinfo/gradsusr<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>