[R] 360-day calendar-netcdf

pelt pelt at knmi.nl
Tue Jul 27 13:55:41 CEST 2010


Hi,

Recently I started working with netcdf IPCC climate model data and I am 
using R to analyze these data. Some problems occur while doing this, as 
I am using the output of different climate models which are different in 
for example time calendar and grid coordinates.

To analyze monthly means I have been using the function /chron/ for 365 
day calendar time series.  Originally the time is in numbers 
(1,2....,14600). This is for the timeperiod:  1961-2000.

library(chron)
syntime <- var.get.nc(nc, "time")
time =chron(syntime, origin=c(month=1, day=1, year=1961))

jan <- months(time)=="Jan"
feb <- months(time)=="Feb" 
mar <- months(time)=="Mar"
apr <- months(time)=="Apr"
may <- months(time)=="May"
jun <- months(time)=="Jun"
jul <- months(time)=="Jul"
aug <- months(time)=="Aug"
sep <- months(time)=="Sep"
oct <- months(time)=="Oct"
nov <- months(time)=="Nov"
dec <- months(time)=="Dec

Now I can use for example mean(pr[jan]) to get the monthly average of 
precipitation (pr) for January.
However, I cannot find how I can change the 365 day in a 360 day 
calendar for the 360-day data that I have (the 360-day calendar has 
10799 days for the same 1961-2000 period). Is there anyone who can help 
me with this problem?
Thank you in advance.

Kind regards,

Saskia van Pelt



More information about the R-help mailing list