# Re: [ExternalEmail] [ferret_users] RE: How to calculate seasonal rainfall totals from daily gridded rainfall?

```

Hi,

```
You will need to create a time grid which encompasses the seasons. The best way would be to use a variation of the usual method to create a monthly axis using the DAYS1900 function and DEFINE AXIS/EDGES
```
http://ferret.pmel.noaa.gov/Ferret/documentation/users-guide/commands-reference/DEFINE

```
A slight modification to the definition of the variable indices in the example makes the step 3 months rather than 1 month.
```

yes? LET start_year = 1950
yes? LET nyears = 20
yes? LET indices = L[L=1:`nyears*12`:3]*3
yes? LET month = MOD(indices-1,12)+1
yes? LET year = start_year + INT((indices-1)/12)
yes? DEFINE AXIS/UNITS=days/T0=1-jan-1900/EDGES truemonth = DAYS1900(year,month,1)

yes? show axis truemonth
name       axis              # pts   start                end
TRUEMONTH TIME                79 i   16-APR-1950 00:00    16-OCT-1969 12:00
T0 = 1-JAN-1900

We see that the start of the seasons (DMJS) are correct.

yes? SHOW AXIS/T=1-jan-1958:1-jan-1959 truemonth
name       axis              # pts   start                end
TRUEMONTH TIME                79 i   16-APR-1950 00:00 16-OCT-1969 12:00
T0 = 1-JAN-1900
Axis span (to cell edges) = 7215

L     T                   TBOX      TBOXLO TSTEP (DAYS)
32>  15-JAN-1958 00:00:00  90         01-DEC-1957 00:00:00    21198
33>  16-APR-1958 00:00:00  92         01-MAR-1958 00:00:00    21289
34>  17-JUL-1958 00:00:00  92         01-JUN-1958 00:00:00    21381
35>  16-OCT-1958 12:00:00  91         01-SEP-1958 00:00:00    21472.5
36>  15-JAN-1959 00:00:00  90         01-DEC-1958 00:00:00    21563

The appropriate averages for the seasons  can be easily done

let pr_seas=pr[gt=truemonth@ave]

Cheers,
Russ

On 29/07/14 15:03, Yun.Li@xxxxxxxx wrote:
```
```Dear Colleague,

I am trying to calculate seasonal (DJF, MAM, JJA and SON) rainfall totals from daily gridded rainfall.  As an example, the information of gridded daily rainfall data is as follows.

!---------
yes? show data
currently SET data sets:
1> ./pr_AWAP_day_native_2010.nc  (default)
name     title                             I         J         K         L
PR       Precipitation                    1:886     1:691     ...       1:365
!----------

Could you please let me know how to get these seasonal rainfall totals?

Many thanks,

Yun

______________________________________________

Dr Yun Li
Principal Research Scientist
Data Analytics Program
CSIRO Digital Productivity and Services Flagship
Leeuwin Centre, 65 Brockway Road
Floreat, WA 6014, Australia
Phone: +61-8-9333-6388 Fax: +61-8-9333-6121
E-mail: Yun.Li@xxxxxxxx
Web: http://www.csiro.au/people/Yun.Li.html
ResearcherID

```
```

```

• References: