<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Tracey,</p>
<p>It should work. Maybe it's how you're converting from an
argument to a variable. This little script is an example:</p>
<p>function main(arg)<br>
if ( arg = "" )<br>
say "You need to supply an arg"<br>
else<br>
region = subwrd(arg,1)<br>
if ( region = 'conus' ); say "Cont US"; endif<br>
endif <br>
return<br>
</p>
<p>With the examples:</p>
<p>ga-> sample_script <br>
You need to supply an arg<br>
ga-> sample_script conus<br>
Cont US<br>
ga-> sample_script pacific<br>
ga-> <br>
<br>
</p>
<div class="moz-cite-prefix">On 11/26/18 10:21 AM, Tracey wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEKv=Fx6+SdiLr0XZF++5uM7pJyLGWPkQDd1wawXOra+mEizWA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif">Hi Bill,</font></div>
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif">It still doesn't seem to work even
when I take out the parentheses. Appreciate your suggestion
though! Can GrADS handle argument strings in if/else
statements?</font></div>
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif">Thanks,</font></div>
<div class="gmail_default" style=""><font face="arial,
helvetica, sans-serif">Tracey</font></div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Nov 26, 2018 at 3:08 PM Bill Reilly <<a
href="mailto:bill_reilly@compuserve.com"
moz-do-not-send="true">bill_reilly@compuserve.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"> Tracey:<br>
<br>
Try taking out the parentheses () and see if it works.<br>
<br>
Bill<br>
<pre class="m_3185393409181370346moz-signature" cols="72">--
Bill Reilly
(+34) 686-110-748
<a class="m_3185393409181370346moz-txt-link-abbreviated" href="mailto:bill@passageweather.com" target="_blank" moz-do-not-send="true">bill@passageweather.com</a>
<a class="m_3185393409181370346moz-txt-link-abbreviated" href="http://www.passageweather.com" target="_blank" moz-do-not-send="true">www.passageweather.com</a>
<a class="m_3185393409181370346moz-txt-link-abbreviated" href="mailto:bill@brwebworks.com" target="_blank" moz-do-not-send="true">bill@brwebworks.com</a>
<a class="m_3185393409181370346moz-txt-link-abbreviated" href="http://www.brwebworks.com" target="_blank" moz-do-not-send="true">www.brwebworks.com</a>
</pre>
<div class="m_3185393409181370346moz-cite-prefix">On
26/11/2018 20:18, Tracey wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">
<div class="gmail_default"><font face="arial,
helvetica,
 sans-serif" color="#000000">Hi
Jeff,</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">The
input string is being read into the script
correctly, as I've put a "</font><font
face="arial, helvetica, sans-serif"
color="#000000">say region" into the script right
before the if statement and it is correctly
outputting "conus." So it seems to be the actual
if statement that is not working for some reason.</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>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Nov 26, 2018 at 2:03 PM Jeff Duda
<<a href="mailto:jeffduda319@gmail.com"
target="_blank" moz-do-not-send="true">jeffduda319@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">First test whether the input string is
being read into the script correctly. Then check to
see if the if block is being tripped by inserting
print statements.
<div><br>
</div>
<div>Jeff Duda</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr">On Mon, Nov 26, 2018 at 11:56 AM
Tracey <<a href="mailto:tdorian10@gmail.com"
target="_blank" moz-do-not-send="true">tdorian10@gmail.com</a>>
wrote:<br>
</div>
<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">
<div class="gmail_default"
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font
face="arial, helvetica, sans-serif">Hi,</font></div>
<div class="gmail_default"
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><br>
</div>
<div class="gmail_default"
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font
face="arial, helvetica, sans-serif">I was
wondering if any GrADS users could help me
with this issue I am having. </font><span
style="font-family:arial,helvetica,sans-serif">In my GrADS script, I
have:</span></div>
<div class="gmail_default"
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font
face="arial, helvetica, sans-serif"><br>
</font></div>
<div class="gmail_default"
style="font-family:Arial,Helvetica,sans-serif;font-size:small"><font
face="arial, helvetica, sans-serif">
<div class="gmail_default">if (region
='conus')</div>
<div class="gmail_default"> 'set lat 25
58'</div>
<div class="gmail_default"> 'set lon 230
297'</div>
<div class="gmail_default">endif</div>
<div><br>
</div>
<div>But the above lines are not working.
When I run the GrADS script, I input a
"region" as an argument. I want to say
if the region is "conus", then set the
longitudes and latitudes to these set
numbers. No matter how I change the
quotations and the spaces, it doesn't
seem to be re-setting the latitudes and
longitudes. What am I doing wrong? </div>
<div><br>
</div>
<div>Thank you,</div>
<div>Tracey</div>
</font></div>
</div>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org"
target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
<a
href="http://gradsusr.org/mailman/listinfo/gradsusr"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr"
class="m_3185393409181370346m_1855870370453814240gmail_signature"
data-smartmail="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr">
<div dir="ltr"><font size="2"><span>Jeff
Duda, Research Scientist</span></font></div>
<div dir="ltr"><font size="2"><span></span></font>University
of Colorado Boulder</div>
<div dir="ltr"><font size="2"><span></span></font>Cooperative
Institute for Research in
Environmental Sciences</div>
<div dir="ltr">NOAA/OAR/ESRL/Global
Systems Division<br>
<font size="2"><span> <span>Boulder,
CO<br>
</span></span></font> </div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank"
moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
<a
href="http://gradsusr.org/mailman/listinfo/gradsusr"
rel="noreferrer" target="_blank"
moz-do-not-send="true">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote>
</div>
<br>
<fieldset
class="m_3185393409181370346mimeAttachmentHeader"></fieldset>
<br>
<pre>_______________________________________________
gradsusr mailing list
<a class="m_3185393409181370346moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org" target="_blank" moz-do-not-send="true">gradsusr@gradsusr.org</a>
<a class="m_3185393409181370346moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr" target="_blank" moz-do-not-send="true">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
<br>
</div>
_______________________________________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org" target="_blank"
moz-do-not-send="true">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr"
rel="noreferrer" target="_blank" moz-do-not-send="true">http://gradsusr.org/mailman/listinfo/gradsusr</a><br>
</blockquote>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gradsusr mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a>
<a class="moz-txt-link-freetext" href="http://gradsusr.org/mailman/listinfo/gradsusr">http://gradsusr.org/mailman/listinfo/gradsusr</a>
</pre>
</blockquote>
</body>
</html>