Wu,<br>
<br>
You don't need to save the data, just plot it! Try this:<br>
<br>
'mean=ave(ave(temp,lon=0,lon=360),t=1,t=1000)'<br>
'd mean'<br>
<br>
There's also an error in your script. When you use fwrite,<br>
you must "display" the variable to have it written to the file.<br>
And I think it would be better to fclose the file before a<br>
new fwrite.<br>
<br>
x's<br>
Henrique<br><br><div><span class="gmail_quote">On 10/14/05, <b class="gmail_sendername">L Wu</b> <<a href="mailto:lijuanwu@atmos.uiuc.edu">lijuanwu@atmos.uiuc.edu</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi, all, I have a question about defining new variables in grads.<br><br>I have variable temp(96,80,14), if I want to define new variable like<br>1000-day average of zonal mean temperature, and then plot the new variable,
<br>I did it this way:<br><br>define tz=ave(temp,x=1,x=96)<br>set fwrite tz.dat<br>set gxout fwrite<br>define tmean=ave(tz, t=1,t=1000)<br>set fwrite tmean.dat<br>set gxout fwrite<br>set cint 5<br>set clab forced<br>set clskip 2
<br>d tmean<br><br>but I cannot get the right plot, can anybody help me to see where is wrong,<br>and whether need I to use set fwrite... and set gxout fwrite twice?<br><br>Thanks in advance!<br><br></blockquote></div><br>