defining new variable

Henrique Barbosa hmjbarbosa at GMAIL.COM
Sat Oct 15 17:26:54 EDT 2005


Wu,

You don't need to save the data, just plot it! Try this:

'mean=ave(ave(temp,lon=0,lon=360),t=1,t=1000)'
'd mean'

There's also an error in your script. When you use fwrite,
you must "display" the variable to have it written to the file.
And I think it would be better to fclose the file before a
new fwrite.

x's
Henrique

On 10/14/05, L Wu <lijuanwu at atmos.uiuc.edu> wrote:
>
> Hi, all, I have a question about defining new variables in grads.
>
> I have variable temp(96,80,14), if I want to define new variable like
> 1000-day average of zonal mean temperature, and then plot the new
> variable,
> I did it this way:
>
> define tz=ave(temp,x=1,x=96)
> set fwrite tz.dat
> set gxout fwrite
> define tmean=ave(tz, t=1,t=1000)
> set fwrite tmean.dat
> set gxout fwrite
> set cint 5
> set clab forced
> set clskip 2
> d tmean
>
> but I cannot get the right plot, can anybody help me to see where is
> wrong,
> and whether need I to use set fwrite... and set gxout fwrite twice?
>
> Thanks in advance!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20051015/3ade2099/attachment.html 


More information about the gradsusr mailing list