<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Thanks for reply. Yes, I got the problem, I should
disable fwrite before the next new fwrite. </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Lijuan </FONT></DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=hmjbarbosa@GMAIL.COM href="mailto:hmjbarbosa@GMAIL.COM">Henrique
Barbosa</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=GRADSUSR@LIST.CINECA.IT
href="mailto:GRADSUSR@LIST.CINECA.IT">GRADSUSR@LIST.CINECA.IT</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Saturday, October 15, 2005 4:26
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: defining new variable</DIV>
<DIV><BR></DIV>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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">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></BLOCKQUOTE></BODY></HTML>