Hourly Rain Fall Rate From Accumulated Precipitation

You would like to plot the time series of hourly rainfall rate, but the rainfall in your file is accumulated rainfall with time step of one hour... how you do it?

Well, here is one way you can do it

ga-> set x 1
ga-> set y 1
ga-> set t 2 365
ga-> define var1=aave(prec(t-1),lon=-70,lon=-50,lat=-15,lat=0)
ga-> define var2=aave(prec,lon=-70,lon=-50,lat=-15,lat=0)
ga-> d var2-var1

As you see, the first thing is to fix lat/lon dimensions and let only t vary. If you don't do that you'll have problems with the area average function aave(). By the way, the coordinates correspond to the Amazon basin.

Now notice the (t-1), it will displace the time in -1 time step, and we do that only for the first variable. In this way, var1 and var2 will be:

var1(t=2) = mean precipitation over Amazon for t=1
var1(t=3) = mean precipitation over Amazon for t=2    
...

and

var2(t=2) = mean precipitation over Amazon for t=2
var2(t=3) = mean precipitation over Amazon for t=3
...                                                   

In this way, when you display var2-var1, you are actually calculating the precipitation in that particular hour:

(rain fall between t=1 and t=2)  is equal to
        (accumulated rain fall up to t=2) - (accumulated rain fall up to t=1)

WARN: In this way, the graph will show the rain fall between t=1 and t=2 at time t=2. If you need it to be t=1, then do the reverse:

ga-> set t 1 364
ga-> define var1=aave(prec,lon=-70,lon=-50,lat=-15,lat=0)
ga-> define var2=aave(prec(t+1),lon=-70,lon=-50,lat=-15,lat=0)

GrADS pages you should read:

ave()

Page last modified on May 26, 2015, at 05:38 PM
Powered by PmWiki