[gradsusr] Decadal average plot

Hosmay Lopez hlopez at rsmas.miami.edu
Wed Sep 4 18:57:18 EDT 2013


OK, I see,

You can make use of while loops and output the averages, that is one record for each decaded totaling 20 as follows. Your averages will be output by the fwrite command, you will need a control file to read it.

***************************************
'set gxout fwrite'
'set fwrite decade_data.dat'
is = 1
while(is < = 2400)

 'set t 'is
 'd tloop(ave(temperature, t+0, t+119))'
 'c'

is = is + 120
endwhile
'disable fwrite'
'set gxout contour'
*****************************************
Hosmay Lopez
Rosenstiel School of Marine and Atmospheric Science
University of Miami
4600 Rickenbacker Causeway Miami, FL 33149
Office: MSC337
Phone: (305) 298-8006
________________________________
From: gradsusr-bounces at gradsusr.org [gradsusr-bounces at gradsusr.org] on behalf of Mubashar Ahmad [mubashardogar at gmail.com]
Sent: Wednesday, September 04, 2013 5:18 PM
To: GrADS Users Forum
Subject: Re: [gradsusr] Decadal average plot


Hi lopez,

Thanks for your input but I don't want runing mean average based on 10 years, instead I want decadal average such that after getting averaged value for first 10 years (average of 1 to 120 months) it should give value for next 10 years (average of 121 to 240th time) and so on.

Thanks,

Mubashar

On Sep 4, 2013 9:45 PM, "Hosmay Lopez" <hlopez at rsmas.miami.edu<mailto:hlopez at rsmas.miami.edu>> wrote:
Dear Mubashar,

You can use the tloop function in conjunction with the ave function as follows:

set t 61 2340
d tloop(ave(temperature,t-60,t+60))

This will create an average for decadal timescales.
Note, the time start at month 61 = beginning of year 6 and ends at month 2340 = 5 years prior to year 200 of your data.

At the end you should have a monthly time series of decadal averaged quantity.

Best,

Hosmay Lopez
Rosenstiel School of Marine and Atmospheric Science
University of Miami
4600 Rickenbacker Causeway Miami, FL 33149
Office: MSC337
Phone: (305) 298-8006

________________________________________
From: gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org> [gradsusr-bounces at gradsusr.org<mailto:gradsusr-bounces at gradsusr.org>] on behalf of Mubashar Ahmad [mubashardogar at gmail.com<mailto:mubashardogar at gmail.com>]
Sent: Wednesday, September 04, 2013 2:12 PM
To: gradsusr
Subject: [gradsusr] Decadal average plot

Dear Grads Users,

I have monthly time series data (let say surface temperature) and
wanted to plot it on decadal average basis. I mean first value of plot
will be average of first 120 months and the next value of my plot will
be average of next 120 months and so on. In total for 200 years I
should get 20 value in plot. How can I do that? Y axis will be decadal
average temperature values and x axis can be labelled 1, 2, 3 up 20
instead of months or years.

Thanks,

Mubashar
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20130904/f8a95e3e/attachment-0003.html 


More information about the gradsusr mailing list