Skip to contents

Some simple checks for multiple time frequencies, ensembles, and completeness of simulation periods. These checks are meant as guides only, since one might not wish multiple elements of the above for climate model ensemble assessments.

Usage

check_inventory_cmip5(data_inventory, check_hist = FALSE)

Arguments

data_inventory

A data.table as resulting from get_inventory.

check_hist

Boolean, if TRUE, tests that each rcp* has a corresponding historical run.

Value

An object of class "eurocordexr_inv_check_cmip5" (an overloaded list) with results from the checks. Has a special print method, which shows a verbose summary of the results.

Details

The checks are

  • for multiple time frequency (day, month, ...)

  • for multiple ensembles (r1i1p1, r2i1p1, ...)

  • for complete periods of simulations: here complete means at least 1860-2005 for historical and 2006-2099 for rcp*

  • that each rcp* has a corresponding historical run (optional, off by default; otherwise problematic with merged hist and rcp runs)

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"))
check_inventory_cmip5(dat_inv)
#> Checks performed: 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Multiple time frequencies detected: Amon day 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Multiple ensembles in 3 cases: 
#>    variable       gcm experiment timefreq     N              ensembles
#>      <char>    <char>     <char>   <char> <int>                 <char>
#> 1:       pr ACCESS1-0 historical     Amon     3 r1i1p1, r2i1p1, r3i1p1
#> 2:      tas ACCESS1-0 historical     Amon     3 r1i1p1, r2i1p1, r3i1p1
#> 3:      tas ACCESS1-3 historical     Amon     3 r1i1p1, r2i1p1, r3i1p1
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Following model runs do not have complete periods: 
#>    variable timefreq        gcm experiment ensemble nn_files date_start
#>      <char>   <char>     <char>     <char>   <char>    <int>     <Date>
#> 1:       pr     Amon  CMCC-CESM historical   r1i1p1        2 1855-01-01
#> 2:      tas     Amon   CMCC-CMS      rcp85   r1i1p1        2 2070-01-01
#> 3:   tasmax      day HadGEM2-ES      rcp85   r1i1p1        2 2279-12-01
#> 4:   tasmin      day HadGEM2-ES      rcp26   r1i1p1       11 2005-12-01
#>      date_end total_simulation_years period_contiguous
#>        <Date>                  <int>            <lgcl>
#> 1: 1879-12-01                     10             FALSE
#> 2: 2100-12-01                     21             FALSE
#> 3: 2299-12-30                     12             FALSE
#> 4: 2139-11-30                    112             FALSE
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Finished checks. 
#> ------------------------------------------------------
#> ------------------------------------------------------