Skip to contents

Some simple checks for multiple time frequencies, domains, ensembles, downscale realizations, and completeness of simulation periods. Can also run compare_variables_in_inventory to check for completeness of variables for all models. 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(data_inventory, check_hist = FALSE, check_vars = 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.

check_vars

Boolean, if TRUE, runs compare_variables_in_inventory to check if all variables are available in all models.

Value

An object of class "eurocordexr_inv_check" (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 domains (EUR-11, EUR-44, ...)

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

  • for multiple downscale realizations (v1, v2, ..)

  • for complete periods of simulations: historical usually goes approx. from 1950/70 - 2005, and rcp* from 2006 - 2100; evaluation is not checked, because it has very heterogeneous periods; cordex-adjust has historical and rcp* combined

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

  • that all variables (tas, pr, ...) are available for all models (optional, off by default)

Examples

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

dat_inv <- get_inventory(fs::path(tmpdir, "testdata"))
check_inventory(dat_inv)
#> Checks performed: 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> No multiple time frequencies. 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> No multiple domains. 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Multiple ensembles in 1 cases: 
#>    variable domain              gcm                institute_rcm experiment
#>      <char> <char>           <char>                       <char>     <char>
#> 1:       pr EUR-11 MPI-M-MPI-ESM-LR CLMcom-ETH-COSMO-crCLIM-v1-1 historical
#>    downscale_realisation timefreq     N      ensembles
#>                   <char>   <char> <int>         <char>
#> 1:                    v1      day     2 r1i1p1, r2i1p1
#> ------------------------------------------------------
#> ------------------------------------------------------
#> No multiple downscale realisations 
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Following model runs do not have complete periods: 
#>    variable domain                   gcm institute_rcm experiment ensemble
#>      <char> <char>                <char>        <char>     <char>   <char>
#> 1:       pr EUR-11 CNRM-CERFACS-CNRM-CM5 CNRM-ALADIN63 historical   r1i1p1
#>    downscale_realisation timefreq nn_files date_start   date_end
#>                   <char>   <char>    <int>     <Date>     <Date>
#> 1:                    v2      day        5 1951-01-01 1985-12-31
#>    total_simulation_years period_contiguous
#>                     <int>            <lgcl>
#> 1:                     25             FALSE
#> ------------------------------------------------------
#> ------------------------------------------------------
#> Finished checks. 
#> ------------------------------------------------------
#> ------------------------------------------------------