Ariel,

I added support for the 360 days calendar a while ago --- for processing
IPCC CMIP5 files like you do (but I think it is not on CRAN yet). Below is
what I get with the development version (on R-Forge); and that seems to be
correct. Unfortunately install from R-Forge currently does not work. I
expect this to be on CRAN in a week or two.

Robert

> r <- brick("tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc")
> r
class       : RasterBrick
dimensions  : 145, 192, 27840, 30  (nrow, ncol, ncell, nlayers)
resolution  : 1.875, 1.25  (x, y)
extent      : -0.9375, 359.0625, -90.625, 90.625  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +datum=WGS84
data source :
e:\tmp\tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc
names       : X2099.12.01, X2099.12.02, X2099.12.03, X2099.12.04,
X2099.12.05, X2099.12.06, X2099.12.07, X2099.12.08, X2099.12.09,
X2099.12.10, X2099.12.11, X2099.12.12, X2099.12.13, X2099.12.14,
X2099.12.15, ...
Date        : 2099-12-01, 2099-12-30 (min, max)
varname     : tasmin

>


On Thu, Oct 18, 2012 at 11:14 AM, Ariel Ortiz-Bobea <
aortizbobea@arec.umd.edu> wrote:

> Hello,
>
> I'm having a problem when trying to import a multi-layer netcdf file using
> brick() in the raster package. The dates in the raster/brick object are off
> by a lot and after importing the file I get the warning message:
>
>     In .doTime(r, nc, zvar, dim3) : assuming a standard calender
>
> The netcdf files corresponds to the output of a climate model with years of
> 360 days so perhaps this has to do with the problem. I suppose the .doTime
> function is having a hard time extracting this date format.
>
> I selected a small file of 30 days (3.4MB) that you can download to
> reproduce the problem:
>
> https://dl.dropbox.com/u/45311184/tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc
>
> That file contains data for time periods 2099/12/01-2099/12/30. When
> imported, the reported range of dates is 2096/06/20-2096/07/19. So it's 30
> time periods, but the wrong ones.
>
> I could manually set the time periods given that I know the boundary dates
> and the time step, but I rather have a more elegant solution.
>
> Any help would be great.
>
> Thanks,
>
> Ariel
>
>
> # Reproducible code: #-----------------
>
> # load package
>    library(raster)
>
> # Working directory where you placed the nc file
>    setwd("/Users/Ariel/Downloads")
>
> # Load file
>    r <- brick("tasmin_day_HadGEM2-ES_rcp85_r1i1p1_20991201-20991230.nc",
> varname="tasmin")
>    # here I get the following warning:
>    # Warning message:
>    # In .doTime(r, nc, zvar, dim3) : assuming a standard calender
>
> # See layer names
>    r@layernames # does not match the 2099/12/01-2099/12/30 time period,
> dates are off ~ 2.5 years
>
>
>
>
> -----
> Ariel Ortiz-Bobea
> PhD Candidate in Agricultural & Resource Economics
> University of Maryland - College Park
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/dates-with-brick-and-multilayer-netcdf-file-are-off-tp7581332.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

