{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Analyzing the ClimEx Large Ensemble\n", "\n", "[ClimEx](https://www.climex-project.org/) is a project investigating the influence of climate change on hydro-meteorological extremes. To understand the effect of natural variability on the occurrence of rare extreme events, ClimEx ran 50 independent simulations, increasing the sample size available.\n", "\n", "Analyzing simulation outputs from large ensembles can get tedious due to the large number of individual netCDF files to handle. To simplify data access, we've created an aggregated view of daily precipitation and temperature for all 50 ClimEx realizations from 1955 to 2100.\n", "\n", "The first step is to open the dataset, whose path can be found in the `climex` catalog. Although there are currently 36 250 individual netCDF files, there is only one link in the catalog." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", " | license_type | \n", "title | \n", "institution | \n", "driving_model_id | \n", "driving_experiment | \n", "type | \n", "processing | \n", "project_id | \n", "frequency | \n", "modeling_realm | \n", "variable_name | \n", "variable_long_name | \n", "path | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "permissive non-commercial | \n", "The ClimEx CRCM5 Large Ensemble | \n", "Ouranos Consortium on Regional Climatology and... | \n", "CCCma-CanESM2 | \n", "historical, rcp85 | \n", "RCM | \n", "raw | \n", "CLIMEX | \n", "day | \n", "atmos | \n", "['tasmin', 'tasmax', 'tas', 'pr', 'prsn', 'rot... | \n", "['Daily Minimum Near-Surface Temperature minim... | \n", "https://pavics.ouranos.ca/twitcher/ows/proxy/t... | \n", "
<xarray.Dataset>\n", "Dimensions: (rlat: 280, rlon: 280, time: 52924, realization: 50)\n", "Coordinates:\n", " * rlat (rlat) float64 -12.61 -12.51 -12.39 ... 17.85 17.96 18.07\n", " * rlon (rlon) float64 2.695 2.805 2.915 3.025 ... 33.17 33.28 33.39\n", " * time (time) object 1955-01-01 00:00:00 ... 2099-12-30 00:00:00\n", " * realization (realization) |S64 b'historical-r1-r10i1p1' ... b'historica...\n", " lat (rlat, rlon) float32 dask.array<chunksize=(280, 280), meta=np.ndarray>\n", " lon (rlat, rlon) float32 dask.array<chunksize=(280, 280), meta=np.ndarray>\n", "Data variables:\n", " rotated_pole |S64 ...\n", " tasmin (realization, time, rlat, rlon) float32 dask.array<chunksize=(2, 90, 280, 280), meta=np.ndarray>\n", " tasmax (realization, time, rlat, rlon) float32 dask.array<chunksize=(2, 90, 280, 280), meta=np.ndarray>\n", " tas (realization, time, rlat, rlon) float32 dask.array<chunksize=(2, 90, 280, 280), meta=np.ndarray>\n", " pr (realization, time, rlat, rlon) float32 dask.array<chunksize=(2, 90, 280, 280), meta=np.ndarray>\n", " prsn (realization, time, rlat, rlon) float32 dask.array<chunksize=(2, 90, 280, 280), meta=np.ndarray>\n", "Attributes: (12/30)\n", " Conventions: CF-1.6 \n", " DODS.dimName: string1\n", " DODS.strlen: 0\n", " EXTRA_DIMENSION.bnds: 2\n", " NCO: "4.5.2"\n", " abstract: The ClimEx CRCM5 Large Ensemble of high-resolut...\n", " ... ...\n", " project_id: CLIMEX\n", " rcm_version_id: v3331 \n", " terms_of_use: http://www.climex-project.org/sites/default/fil...\n", " title: The ClimEx CRCM5 Large Ensemble\n", " type: RCM\n", " EXTRA_DIMENSION.string1: 1
1 In this case the `realization` chunk size is not included in the netcdf file attributes as this is a virtual dimension resulting from the NcML aggregation.
" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ "<xarray.DataArray 'sdii' (realization: 50, time: 1, rlat: 280, rlon: 280)>\n", "dask.array<where, shape=(50, 1, 280, 280), dtype=float64, chunksize=(1, 1, 150, 150), chunktype=numpy.ndarray>\n", "Coordinates:\n", " * rlat (rlat) float64 -12.61 -12.51 -12.39 ... 17.85 17.96 18.07\n", " * rlon (rlon) float64 2.695 2.805 2.915 3.025 ... 33.17 33.28 33.39\n", " * realization (realization) |S64 b'historical-r1-r10i1p1' ... b'historical...\n", " lat (rlat, rlon) float32 dask.array<chunksize=(150, 150), meta=np.ndarray>\n", " lon (rlat, rlon) float32 dask.array<chunksize=(150, 150), meta=np.ndarray>\n", " * time (time) object 2000-01-01 00:00:00\n", "Attributes:\n", " units: mm d-1\n", " cell_methods: time: mean\n", " history: [2023-05-24 17:42:43] sdii: SDII(pr=pr, thresh='1 mm/day'...\n", " standard_name: lwe_thickness_of_precipitation_amount\n", " long_name: Average precipitation during days with daily precipitatio...\n", " description: Annual simple daily intensity index (sdii) or annual aver...
<xarray.Dataset>\n", "Dimensions: (time: 52924, realization: 50)\n", "Coordinates:\n", " rlat float64 0.365\n", " rlon float64 16.12\n", " * time (time) object 1955-01-01 00:00:00 ... 2099-12-30 00:00:00\n", " * realization (realization) |S64 b'historical-r1-r10i1p1' ... b'historica...\n", " lat float32 45.45\n", " lon float32 -73.7\n", "Data variables:\n", " rotated_pole |S64 b''\n", " tasmin (realization, time) float32 dask.array<chunksize=(1, 18250), meta=np.ndarray>\n", " tasmax (realization, time) float32 dask.array<chunksize=(1, 18250), meta=np.ndarray>\n", " tas (realization, time) float32 dask.array<chunksize=(1, 18250), meta=np.ndarray>\n", " pr (realization, time) float32 dask.array<chunksize=(1, 18250), meta=np.ndarray>\n", " prsn (realization, time) float32 dask.array<chunksize=(1, 18250), meta=np.ndarray>\n", "Attributes: (12/30)\n", " Conventions: CF-1.6 \n", " DODS.dimName: string1\n", " DODS.strlen: 0\n", " EXTRA_DIMENSION.bnds: 2\n", " NCO: "4.5.2"\n", " abstract: The ClimEx CRCM5 Large Ensemble of high-resolut...\n", " ... ...\n", " project_id: CLIMEX\n", " rcm_version_id: v3331 \n", " terms_of_use: http://www.climex-project.org/sites/default/fil...\n", " title: The ClimEx CRCM5 Large Ensemble\n", " type: RCM\n", " EXTRA_DIMENSION.string1: 1
<xarray.DataArray 'rx1day' (realization: 50, time: 145)>\n", "dask.array<where, shape=(50, 145), dtype=float32, chunksize=(1, 50), chunktype=numpy.ndarray>\n", "Coordinates:\n", " rlat float64 0.365\n", " rlon float64 16.12\n", " * realization (realization) |S64 b'historical-r1-r10i1p1' ... b'historical...\n", " lat float32 45.45\n", " lon float32 -73.7\n", " * time (time) object 1955-01-01 00:00:00 ... 2099-01-01 00:00:00\n", "Attributes:\n", " units: mm/day\n", " cell_methods: time: mean time: maximum over days\n", " history: [2023-05-24 17:44:17] rx1day: RX1DAY(pr=pr, freq='YS') wi...\n", " standard_name: lwe_thickness_of_precipitation_amount\n", " long_name: Maximum 1-day total precipitation\n", " description: Annual maximum 1-day total precipitation