{ "cells": [ { "cell_type": "markdown", "id": "ddeeea4b-753f-4dc0-8427-5ed695d5790b", "metadata": {}, "source": [ "# Some very simple GMIP3 data example use cases" ] }, { "cell_type": "markdown", "id": "f62b9987-26b9-4c59-b0d9-0286dc474fd1", "metadata": {}, "source": [ "- [1. I want to get the glacier model simulations from an individual glacier model for a specific period and compare it with my study/model](#1.-I-want-to-get-the-glacier-model-simulations-from-the-individual-glacier-models-and-compare-it-with-my-study-...)\n", "- [2. I want to analyse the relationship of steady-state mass changes of a glacier model to global warming for a specific region](#2.-I-want-to-analyse-the-relationship-of-steady-state-mass-changes-of-a-glacier-model-to-global-warming-for-a-specific-region) \n", "- [3. I want to extract LOWESS fitted steady-state glacier mass estimates](#3.-I-want-to-extract-LOWESS-fitted-steady-state-glacier-mass-estimates)\n", "- [4. Ask us to get more use case examples! -> contact](mailto:lilian.schuster@uibk.ac.at,harry.zekollari@vub.be)\n", " \n", "--> all code for the first GlacierMIP3 manuscript analysis and creation of the figures is available at: [https://github.com/GlacierMIP/GlacierMIP3](https://github.com/GlacierMIP/GlacierMIP3)" ] }, { "cell_type": "code", "execution_count": 1, "id": "6fcc4a11-541c-4a10-a782-79a07caf3e44", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\n", "import xarray as xr\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns" ] }, { "cell_type": "markdown", "id": "20d86f5c-90ca-4c41-b0fe-6ed12a9c3bc8", "metadata": {}, "source": [ "\n", "## 1. I want to get the glacier model simulations from the individual glacier models and compare it with my study ...\n", " " ] }, { "cell_type": "code", "execution_count": 2, "id": "891a039a-9838-4d87-b789-cb4afbcb3148", "metadata": {}, "outputs": [], "source": [ "ds = xr.open_dataset('GMIP3_reg_glacier_model_data/glacierMIP3_Feb12_2024_models_all_rgi_regions_sum.nc')" ] }, { "cell_type": "code", "execution_count": 3, "id": "dc0c6dd3-a17d-4ba2-97ae-50933c80c9ba", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset>\n",
"Dimensions: (model_author: 10, simulation_year: 5001, gcm: 5,\n",
" rgi_reg: 19, period_scenario: 16)\n",
"Coordinates:\n",
" * model_author (model_author) <U14 'CISM2' 'GO' ... 'GloGEMflow3D'\n",
" * simulation_year (simulation_year) int16 0 1 2 3 4 ... 4997 4998 4999 5000\n",
" * gcm (gcm) <U13 'gfdl-esm4' 'ipsl-cm6a-lr' ... 'ukesm1-0-ll'\n",
" * rgi_reg (rgi_reg) <U2 '01' '02' '03' '04' ... '16' '17' '18' '19'\n",
" * period_scenario (period_scenario) <U16 '1851-1870_hist' ... '2081-2100_s...\n",
"Data variables:\n",
" volume_m3 (model_author, gcm, rgi_reg, simulation_year, period_scenario) float32 ...\n",
" area_m2 (model_author, gcm, rgi_reg, simulation_year, period_scenario) float32 ...<xarray.DataArray 'model_author' (model_author: 10)>\n",
"array(['CISM2', 'GO', 'PyGEM-OGGM_v13', 'GloGEMflow', 'Kraaijenbrink', 'GLIMB',\n",
" 'OGGM_v153', 'OGGM_v16', 'OGGM-VAS', 'GloGEMflow3D'], dtype='<U14')\n",
"Coordinates:\n",
" * model_author (model_author) <U14 'CISM2' 'GO' ... 'OGGM-VAS' 'GloGEMflow3D'"
],
"text/plain": [
"<xarray.DataArray 'gcm' (gcm: 5)>\n",
"array(['gfdl-esm4', 'ipsl-cm6a-lr', 'mpi-esm1-2-hr', 'mri-esm2-0',\n",
" 'ukesm1-0-ll'], dtype='<U13')\n",
"Coordinates:\n",
" * gcm (gcm) <U13 'gfdl-esm4' 'ipsl-cm6a-lr' ... 'ukesm1-0-ll'<xarray.DataArray 'period_scenario' (period_scenario: 16)>\n",
"array(['1851-1870_hist', '1901-1920_hist', '1951-1970_hist', '1995-2014_hist',\n",
" '2021-2040_ssp126', '2021-2040_ssp370', '2021-2040_ssp585',\n",
" '2041-2060_ssp126', '2041-2060_ssp370', '2041-2060_ssp585',\n",
" '2061-2080_ssp126', '2061-2080_ssp370', '2061-2080_ssp585',\n",
" '2081-2100_ssp126', '2081-2100_ssp370', '2081-2100_ssp585'],\n",
" dtype='<U16')\n",
"Coordinates:\n",
" * period_scenario (period_scenario) <U16 '1851-1870_hist' ... '2081-2100_s..."
],
"text/plain": [
"<xarray.DataArray 'experiments' (experiments: 80)>\n",
"array([('gfdl-esm4', '1851-1870_hist'), ('gfdl-esm4', '1901-1920_hist'),\n",
" ('gfdl-esm4', '1951-1970_hist'), ('gfdl-esm4', '1995-2014_hist'),\n",
" ('gfdl-esm4', '2021-2040_ssp126'), ('gfdl-esm4', '2021-2040_ssp370'),\n",
" ('gfdl-esm4', '2021-2040_ssp585'), ('gfdl-esm4', '2041-2060_ssp126'),\n",
" ('gfdl-esm4', '2041-2060_ssp370'), ('gfdl-esm4', '2041-2060_ssp585'),\n",
" ('gfdl-esm4', '2061-2080_ssp126'), ('gfdl-esm4', '2061-2080_ssp370'),\n",
" ('gfdl-esm4', '2061-2080_ssp585'), ('gfdl-esm4', '2081-2100_ssp126'),\n",
" ('gfdl-esm4', '2081-2100_ssp370'), ('gfdl-esm4', '2081-2100_ssp585'),\n",
" ('ipsl-cm6a-lr', '1851-1870_hist'), ('ipsl-cm6a-lr', '1901-1920_hist'),\n",
" ('ipsl-cm6a-lr', '1951-1970_hist'), ('ipsl-cm6a-lr', '1995-2014_hist'),\n",
" ('ipsl-cm6a-lr', '2021-2040_ssp126'),\n",
" ('ipsl-cm6a-lr', '2021-2040_ssp370'),\n",
" ('ipsl-cm6a-lr', '2021-2040_ssp585'),\n",
" ('ipsl-cm6a-lr', '2041-2060_ssp126'),\n",
" ('ipsl-cm6a-lr', '2041-2060_ssp370'),\n",
" ('ipsl-cm6a-lr', '2041-2060_ssp585'),\n",
" ('ipsl-cm6a-lr', '2061-2080_ssp126'),\n",
" ('ipsl-cm6a-lr', '2061-2080_ssp370'),\n",
" ('ipsl-cm6a-lr', '2061-2080_ssp585'),\n",
" ('ipsl-cm6a-lr', '2081-2100_ssp126'),\n",
" ('ipsl-cm6a-lr', '2081-2100_ssp370'),\n",
" ('ipsl-cm6a-lr', '2081-2100_ssp585'),\n",
" ('mpi-esm1-2-hr', '1851-1870_hist'),\n",
" ('mpi-esm1-2-hr', '1901-1920_hist'),\n",
" ('mpi-esm1-2-hr', '1951-1970_hist'),\n",
" ('mpi-esm1-2-hr', '1995-2014_hist'),\n",
" ('mpi-esm1-2-hr', '2021-2040_ssp126'),\n",
" ('mpi-esm1-2-hr', '2021-2040_ssp370'),\n",
" ('mpi-esm1-2-hr', '2021-2040_ssp585'),\n",
" ('mpi-esm1-2-hr', '2041-2060_ssp126'),\n",
" ('mpi-esm1-2-hr', '2041-2060_ssp370'),\n",
" ('mpi-esm1-2-hr', '2041-2060_ssp585'),\n",
" ('mpi-esm1-2-hr', '2061-2080_ssp126'),\n",
" ('mpi-esm1-2-hr', '2061-2080_ssp370'),\n",
" ('mpi-esm1-2-hr', '2061-2080_ssp585'),\n",
" ('mpi-esm1-2-hr', '2081-2100_ssp126'),\n",
" ('mpi-esm1-2-hr', '2081-2100_ssp370'),\n",
" ('mpi-esm1-2-hr', '2081-2100_ssp585'), ('mri-esm2-0', '1851-1870_hist'),\n",
" ('mri-esm2-0', '1901-1920_hist'), ('mri-esm2-0', '1951-1970_hist'),\n",
" ('mri-esm2-0', '1995-2014_hist'), ('mri-esm2-0', '2021-2040_ssp126'),\n",
" ('mri-esm2-0', '2021-2040_ssp370'), ('mri-esm2-0', '2021-2040_ssp585'),\n",
" ('mri-esm2-0', '2041-2060_ssp126'), ('mri-esm2-0', '2041-2060_ssp370'),\n",
" ('mri-esm2-0', '2041-2060_ssp585'), ('mri-esm2-0', '2061-2080_ssp126'),\n",
" ('mri-esm2-0', '2061-2080_ssp370'), ('mri-esm2-0', '2061-2080_ssp585'),\n",
" ('mri-esm2-0', '2081-2100_ssp126'), ('mri-esm2-0', '2081-2100_ssp370'),\n",
" ('mri-esm2-0', '2081-2100_ssp585'), ('ukesm1-0-ll', '1851-1870_hist'),\n",
" ('ukesm1-0-ll', '1901-1920_hist'), ('ukesm1-0-ll', '1951-1970_hist'),\n",
" ('ukesm1-0-ll', '1995-2014_hist'), ('ukesm1-0-ll', '2021-2040_ssp126'),\n",
" ('ukesm1-0-ll', '2021-2040_ssp370'),\n",
" ('ukesm1-0-ll', '2021-2040_ssp585'),\n",
" ('ukesm1-0-ll', '2041-2060_ssp126'),\n",
" ('ukesm1-0-ll', '2041-2060_ssp370'),\n",
" ('ukesm1-0-ll', '2041-2060_ssp585'),\n",
" ('ukesm1-0-ll', '2061-2080_ssp126'),\n",
" ('ukesm1-0-ll', '2061-2080_ssp370'),\n",
" ('ukesm1-0-ll', '2061-2080_ssp585'),\n",
" ('ukesm1-0-ll', '2081-2100_ssp126'),\n",
" ('ukesm1-0-ll', '2081-2100_ssp370'),\n",
" ('ukesm1-0-ll', '2081-2100_ssp585')], dtype=object)\n",
"Coordinates:\n",
" * experiments (experiments) object MultiIndex\n",
" * gcm (experiments) <U13 'gfdl-esm4' ... 'ukesm1-0-ll'\n",
" * period_scenario (experiments) <U16 '1851-1870_hist' ... '2081-2100_ssp585'\n",
" temp_ch_ipcc (experiments) float64 0.2314 0.4783 0.3923 ... 5.84 6.884<xarray.Dataset>\n",
"Dimensions: (simulation_year: 5001, experiments: 80)\n",
"Coordinates:\n",
" model_author <U14 'Kraaijenbrink'\n",
" * simulation_year (simulation_year) int16 0 1 2 3 4 ... 4997 4998 4999 5000\n",
" rgi_reg <U2 '13'\n",
" * experiments (experiments) object MultiIndex\n",
" * gcm (experiments) <U13 'gfdl-esm4' ... 'ukesm1-0-ll'\n",
" * period_scenario (experiments) <U16 '1851-1870_hist' ... '2081-2100_ssp585'\n",
" temp_ch_ipcc (experiments) float64 0.2314 0.4783 0.3923 ... 5.84 6.884\n",
"Data variables:\n",
" volume_m3 (simulation_year, experiments) float32 3.271e+12 ... nan\n",
" area_m2 (simulation_year, experiments) float32 4.93e+10 ... nan"
],
"text/plain": [
"<xarray.Dataset>\n",
"Dimensions: (model_author: 8, year_after_2020: 5051,\n",
" period_scenario: 16, gcm: 5, rgi_reg: 19)\n",
"Coordinates:\n",
" * model_author (model_author) <U14 'CISM2' ... 'PyGEM-...\n",
" * year_after_2020 (year_after_2020) float32 -50.0 ... 5e+03\n",
" * period_scenario (period_scenario) <U16 '1851-1870_hist'...\n",
" * gcm (gcm) <U13 'gfdl-esm4' ... 'ukesm1-0-ll'\n",
" * rgi_reg (rgi_reg) <U2 '01' '02' '03' ... '18' '19'\n",
"Data variables:\n",
" simulation_year (model_author, rgi_reg, year_after_2020, period_scenario, gcm) float64 ...\n",
" temp_ch_ipcc (model_author, rgi_reg, year_after_2020, period_scenario, gcm) float64 ...\n",
" yrs_w_most_similar_state_to_2020 (model_author, rgi_reg, year_after_2020, period_scenario, gcm) float32 ...\n",
" volume_rel_2020_% (model_author, rgi_reg, year_after_2020, period_scenario, gcm) float64 ...\n",
" volume_m3 (model_author, rgi_reg, year_after_2020, period_scenario, gcm) float64 ...| \n", " | temp_ch | \n", "0.05 | \n", "0.17 | \n", "0.25 | \n", "0.5 | \n", "0.75 | \n", "0.83 | \n", "0.95 | \n", "frac | \n", "region | \n", "year | \n", "it | \n", "N | \n", "
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1726 | \n", "2.2 | \n", "18.448355 | \n", "22.158413 | \n", "24.513387 | \n", "35.15934 | \n", "59.677833 | \n", "63.699423 | \n", "69.69257 | \n", "0.21 | \n", "13 | \n", "5000 | \n", "2 | \n", "500 | \n", "