Climate Scenarios#
Working with climate projection data, especially when combining historical and
projection experiments, can often be complex. To streamline data selection and
avoid manual preprocessing steps, CLIX allows you to select files based on Data
Reference Syntax (DRS) elements defined in a YAML configuration file, using the
--input argument.
Defining Input with a YAML File#
Within the YAML file, you must first specify a root_directory where your
simulation data is stored. Following this, you set a DRS standard (supported
standards can be listed with pyku.drs.list_drs_standards). Finally, you
define various DRS facets and their values to select one or multiple
experiments or variables.
Facets can be specified as direct key: value pairs or as key: [list, of,
values].
Note
If a facet is not explicitly provided in the YAML file, it defaults to a
wildcard character (e.g., version: "*"). This is useful when multiple
versions need to be considered.
Below is an example YAML configuration for selecting regional climate projection data from the CMIP5 era:
---
root_dir: /path/to/CORDEX/data/cordex/
standard: cordex
facets:
product: output
CORDEX_domain: EUR-11
institute_id: CLMcom
driving_model_id: CCCma-CanESM2
driving_model_ensemble_member: r1i1p1
driving_experiment_name:
- historical
- rcp85
model_id: CLMcom-CCLM4-8-17
rcm_version_id: v1
frequency: day
version: v20171121
variable_name: tas
In this example, a single model is selected across two RCP scenarios. All specified facets are evaluated against the cordex standard. The selected NetCDF files are then loaded into a dataframe and merged into a single time series, beginning with the historical simulation files and extending with the RCP8.5 scenario files.
Applying Climate Indicators to Climate Scenarios#
To produce a single time series for a full simulation run (combining historical and scenario data) and apply a climate indicator, use the CLIX command with your YAML configuration:
clixrun --input config_CORDEX-CMIP5.yaml --frequency year txge25
This command will result in a yearly time series of summer days (txge25).
Calculating Climate Change Response#
Combining input files specified via a YAML configuration with the --anomaly
argument is powerful for computing the change in a climate indicator between
two distinct time periods.
The following example demonstrates how to compute the change in the diurnal temperature range using the CORDEX-CMIP6 standard and its facets:
---
root_dir: /path/to/CORDEX-CMIP6/
standard: cordex_cmip6
facets:
project_id: CORDEX-CMIP6
activity_id: DD
domain_id: EUR-12
institution_id: CLMcom-DWD
driving_source_id: MPI-ESM1-2-HR
driving_variant_label: r1i1p1f1
driving_experiment_id:
- historical
- ssp370
source_id: ICON-CLM-202407-1-1
version_realization: v1-r1
frequency: day
version: v20240920
variable_name:
- tasmax
- tasmin
clixrun --input config_CORDEX-CMIP6.yaml --frequency season \
--ref_date_range 19710101 20001231 --date_range 20710101 21001231 \
--anomaly abs dtr
This command will output the absolute change of the diurnal temperature range for the end of the century (2071-2100) compared to the reference period of 1971-2000.
Tip
To determine the necessary facet names for standards not explicitly shown in
the examples, use the pyku.drs.get_facets_from_file_parent and
pyku.drs.get_facets_from_file_stem functions. These functions require a
sample file that adheres to a standard listed in
pyku.drs.list_drs_standards.