[gradsusr] Decadal average plot

Mubashar Ahmad mubashardogar at gmail.com
Thu Sep 5 09:43:38 EDT 2013


Hi Lopez,

Thanks for your suggestion. Actually I tried the same, but you know
the problem with fwrite is that it doesn't work for more than one
variables even if I use the appending -ap option. For more than one
variables the first value written in file is for first displayed
variable and 2nd value is written from 2nd variable and so on. When we
display the values using "ctl" file the time series plot is wrong
(because the first value is from first variable and 2nd value from 2nd
variable and so on). Is there any fix to this problem? This works fine
for single variable.

Thanks,

Mubashar



On 9/5/13, Hosmay Lopez <hlopez at rsmas.miami.edu> wrote:
> 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
>


-- 
Muhammad Mubashar Ahmad Dogar
Scientific Officer (Climatology Section),
Global Change Impact Studies Centre (GCISC),
NCP complex, Quaid-e-Azam University Campus,
Shahdra road, Islamabad, Pakistan.
Tel:  +92519230226
Mob:+923315144169
email: mubashardogar at yahoo.com
          mubashar.ahmad at gcisc.org.pk



More information about the gradsusr mailing list