<div dir="ltr">Another option, ditch the &quot;  and could even ditch the &#39; .  I think you only need them when you&#39;re passings strings in.  Which is what you&#39;re inadvertently doing at the moment which is why it fails.  Below should treat you fine if the vars are numeric. <div><br></div><div>Throw in a print(timeb) at the top, and you&#39;ll see at the moment it&#39;s of string type using the quotes. <br><div><br></div><div><span style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px">ncl timeb=$var1  timee=$var2  timed=$var3   abc.ncl</span><br></div><div><span style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"><br></span></div><div>~Alan</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 10, 2014 at 11:58 AM, Rick Brownrigg <span dir="ltr">&lt;<a href="mailto:brownrig@ucar.edu" target="_blank">brownrig@ucar.edu</a>&gt;</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><div><div><div>Hi Mark,<br><br></div>I take it your $var1, $var2, etc., are shell variables?<br><br></div>Try      ncl timeb=\&quot;$var1\&quot; ....<br><br></div>HTH,<br></div>Rick<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 10, 2014 at 9:38 AM, Mark Chan <span dir="ltr">&lt;<a href="mailto:cym263@yahoo.com" target="_blank">cym263@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div>Dear NCL users,</div><div><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">I have a ncl script as in the below with name as &quot;abc.ncl&quot;, and I would run it as:</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">ncl    &#39;timeb=&quot;&#39;$var1&#39;&quot;&#39;     &#39;timee=&quot;&#39;$var2&#39;&quot;&#39;       &#39;timed=&quot;&#39;$var3&#39;&quot;&#39;   abc.ncl</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">here var1=31; var2=32; var3=31.5  (this is examples and the values would be calculated)</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">The operation above doesn&#39;t work, however the following operation works:</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">ncl   &#39;timeb=31&#39;    &#39;timee=32&#39;    &#39;timed=31.5&#39;   abc.ncl</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">Can one kindly give any suggestion?</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">Thanks very much in advance!</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">Mark<br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">-------abc.ncl--------------<br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;background-color:transparent;font-style:normal">begin<br> time_bnds=new((/1,2/),&quot;double&quot;,&quot;No_FillValue&quot;)<br> write_file=addfile(&quot;./<a href="http://rub.nc" target="_blank">rub.nc</a>&quot;,&quot;w&quot;)<br> time_bnds(0,0:1) = (/timeb,timee/)<br> time = (/timed/)<br> write_file-&gt;time_bnds=time_bnds(0:0,0:1)<br> write_file-&gt;time=time<br>end<br><br></div><div><br></div></div></div><br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
<br>_______________________________________________<br>
ncl-talk mailing list<br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>