Skip to contents

Returns a data.table with information by splitting the netcdf files into their components (GCM, variable, experiment, ...) and aggregates over years.

Usage

get_inventory_cmip5(path, add_files = TRUE)

Arguments

path

Path that will be searched recursively for .nc files.

add_files

Boolean (default TRUE), if TRUE, will add a column containing lists of associated files with their full paths (useful e.g. for further processing).

Value

A data.table with the inventory information.

See also

check_inventory_cmip5 for performing some checks.

Examples

# some empty example files
fn_zip <- system.file("extdata", "inv-test-files-cmip5.zip", package = "eurocordexr")
tmpdir <- tempdir()
unzip(fn_zip, exdir = tmpdir)

dat_inv <- get_inventory_cmip5(fs::path(tmpdir, "testdata-cmip5", "basic"))
print(dat_inv)
#>      variable timefreq          gcm experiment ensemble date_start   date_end
#>        <char>   <char>       <char>     <char>   <char>     <Date>     <Date>
#>  1: areacella       fx      CanESM2 historical   r0i0p0       <NA>       <NA>
#>  2: areacella       fx IPSL-CM5A-LR historical   r0i0p0       <NA>       <NA>
#>  3:      orog       fx    FGOALS-g2 historical   r0i0p0       <NA>       <NA>
#>  4:        pr     Amon    ACCESS1-0 historical   r1i1p1 1850-01-01 2005-12-01
#>  5:        pr     Amon    ACCESS1-0 historical   r2i1p1 1850-01-01 2005-12-01
#>  6:        pr     Amon    ACCESS1-0 historical   r3i1p1 1850-01-01 2005-12-01
#>  7:        pr     Amon    ACCESS1-0      rcp45   r1i1p1 2006-01-01 2100-12-01
#>  8:        pr     Amon    CMCC-CESM historical   r1i1p1 1855-01-01 1879-12-01
#>  9:        pr      day     CNRM-CM5 historical   r1i1p1 1990-01-01 2005-12-31
#> 10:        pr      day     CNRM-CM5      rcp26   r1i1p1 2006-01-01 2025-12-31
#> 11:       tas     Amon     CMCC-CMS      rcp85   r1i1p1 2070-01-01 2100-12-01
#> 12:       tas     Amon   CNRM-CM5-2 historical   r1i1p1 1850-01-01 2005-12-01
#> 13:       tas      day    NorESM1-M historical   r1i1p1 1850-01-01 2005-12-31
#> 14:    tasmax      day   HadGEM2-ES      rcp85   r1i1p1 2279-12-01 2299-12-30
#> 15:    tasmax      day IPSL-CM5A-MR historical   r1i1p1 1850-01-01 2005-12-31
#> 4 variables not shown: nn_files <int>, total_simulation_years <int>, period_contiguous <lgcl>, list_files <list>