<div dir="ltr"><div><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">Hello Jennifer and Jeff, thank you very much, I solved the problem in the plot of the figure.</span> <span class="gmail-">I had tried to do it in a similar way, but I did not use the correct notation.</span> <span class="gmail-">It was very useful.<br><br></span></span></div><span id="gmail-result_box" class="gmail-" lang="en"><span class="gmail-">Isilda<br></span></span></div><div class="gmail_extra"><br><div class="gmail_quote">2017-01-05 22:57 GMT+00:00 Jennifer M Adams <span dir="ltr"><<a href="mailto:jadams21@gmu.edu" target="_blank">jadams21@gmu.edu</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hi, Isilda —
<div>With ‘define’, everything that comes before the = sign is the variable name, which must be alphanumeric. I believe the syntax you’re looking for might be something like this:</div>
<div><br>
</div>
<div><font style="font-size:14px" face="Courier">nfiles=124</font></div>
<div><font style="font-size:14px" face="Courier">i=1</font></div>
<div><font style="font-size:14px" face="Courier">while (i<=nfiles)</font></div>
<div><font style="font-size:14px" face="Courier"> if (i=1)</font></div>
<div><font style="font-size:14px" face="Courier"> ‘sum=tmp2m.’i’(t=1)’</font></div>
<div><font style="font-size:14px" face="Courier"> else</font></div>
<div><font style="font-size:14px" face="Courier"> ‘sum=sum+’tmp2m.’i’(t=1)’</font></div>
<div><font style="font-size:14px" face="Courier"> endif</font></div>
<div><font style="font-size:14px" face="Courier"> i=i+1</font></div>
<div><font style="font-size:14px" face="Courier">endwhile</font></div>
<div><font style="font-size:14px" face="Courier">'ave=sum/‘nfiles</font></div>
<div><br>
</div>
<div>—Jennifer</div>
<div><br>
<div><div><div class="h5">
<div>On Jan 5, 2017, at 5:36 PM, Isilda Menezes <<a href="mailto:isilda@uevora.pt" target="_blank">isilda@uevora.pt</a>> wrote:</div>
<br class="m_-1519704950861441847Apple-interchange-newline">
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>Hello, I want created a ave in a gs script with multiple open files with the same time=1.<br>
<br>
</div>
I made a loop like this,<br>
<div>
<div><br>
i=1<br>
while (i<124)<br>
'set dfile 'i<br>
'define ll(t='i')=TMP2m'<br>
i=i+1<br>
endwhile<br>
'd ave(ll,t=1,t=124)'<br>
<br>
</div>
<div>But a have this error:<br>
<br>
DEFINE error: Name too long; missing '='<br>
Syntax Error: Invalid Operand <br>
'll' not a variable or function name<br>
Operation Error: Error from ave function<br>
Error ocurred at column 1<br>
DISPLAY error: Invalid expression <br>
Expression = ave(ll,t=1,t=124)<br>
Error opening script file: <a href="http://cbarn.gs/" target="_blank">cbarn.gs</a><br>
<br>
</div>
<div><span id="m_-1519704950861441847gmail-result_box" class="m_-1519704950861441847gmail-" lang="en"><span class="m_-1519704950861441847gmail-">I've been trying to do it in other ways but I always get errors.</span>
<span class="m_-1519704950861441847gmail-">Can someone give me some advice how to solve this problem.<br>
<br>
</span></span></div>
<div><span id="m_-1519704950861441847gmail-result_box" class="m_-1519704950861441847gmail-" lang="en">Thanks,<br>
</span></div>
<div><span id="m_-1519704950861441847gmail-result_box" class="m_-1519704950861441847gmail-" lang="en">Isilda<br>
</span></div>
<div><br>
</div>
</div>
</div></div></div><span class="">
______________________________<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" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
</span></blockquote>
</div>
<br>
<div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word">
<div style="font-size:12px">--</div>
<div style="font-size:12px">Jennifer Miletta Adams<br>
Center for Ocean-Land-Atmosphere Studies (COLA)<br>
George Mason University<br>
<br>
<br>
</div>
</div>
</div>
</div>
<br>
</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>