{ "cells": [ { "cell_type": "markdown", "id": "4bf4b14d-fcb0-4b2d-8ab4-a52704028a41", "metadata": {}, "source": [ "### Regional glacier volume vs glacier area evolution\n", "\n", "- at the top: glacier volume vs area\n", "- at the bottom area res" ] }, { "cell_type": "code", "execution_count": 36, "id": "97975342-efe3-4a91-a69e-d8b41a51ab96", "metadata": {}, "outputs": [], "source": [ "import xarray as xr\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "import pandas as pd\n", "import numpy as np\n", "from scipy.optimize import curve_fit" ] }, { "cell_type": "code", "execution_count": 82, "id": "6af0caa8-ec93-4981-8213-cfc743969599", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "['PyGEM-OGGM_v13', 'GloGEMflow', 'GloGEMflow3D', 'OGGM_v16', 'GLIMB', 'Kraaijenbrink', 'GO', 'CISM2', 'OGGM-VAS'] ['model 1', 'model 2', 'model 3', 'model 4', 'model 5', 'model 6', 'model 7', 'model 8', 'model 10']\n" ] } ], "source": [ "from help_functions import pal_models, model_order, d_reg_num_name, model_order_anonymous,get_glob_temp_exp\n", "pd_global_temp_exp = pd.read_csv('../data/climate_input_data/temp_ch_ipcc_ar6_isimip3b.csv', index_col = 0)\n", "\n", "hue_order_anonymous = []\n", "\n", "pal_models_l = []\n", "hue_order = []\n", "for m, p in zip(model_order, pal_models):\n", " if (m!='OGGM_v153') and (m!='Huss'): #m!='OGGM_v153'):\n", " hue_order.append(m)\n", " pal_models_l.append(p)\n", "for m in hue_order:\n", " hue_order_anonymous.append(model_order_anonymous[m])\n", "pal_models = pal_models_l\n", "\n", "print(hue_order, hue_order_anonymous)\n", "# select the right models:\n", "pal_models = sns.color_palette(pal_models)\n", "\n", "dict_model_col = {}\n", "for c,m in zip(pal_models, hue_order):\n", " dict_model_col[m] = c\n", " \n", "# select the right models\n", "\n", "glac_models = hue_order\n", "\n", "num_dict = {0:'(a)', 1:'(b)', 2:'(c)', 3:'(d)', 4: '(e)', 5:'(f)', 6:'(g)', 7:'(h)', 8:'(i)', 9:'(j)', 10:'(k)', 11:'(l)', 12:'(m)'} \n", "\n", "ind_t = pd_global_temp_exp.groupby(['gcm','period_scenario']).mean()['temp_ch_ipcc'].index\n", "np.testing.assert_allclose(get_glob_temp_exp(region='global')['temp_ch_ipcc'].loc[ind_t].values,\n", " pd_global_temp_exp.groupby(['gcm','period_scenario']).mean()['temp_ch_ipcc'].values, rtol=1e-5)\n", "import matplotlib\n", "matplotlib.__version__\n", "pd_global_temp_exp_m = get_glob_temp_exp(region='global')\n" ] }, { "cell_type": "code", "execution_count": 83, "id": "b908da30-129c-42c3-9edb-cffd36ec2d2a", "metadata": {}, "outputs": [], "source": [ "ds = xr.open_dataset('../data/GMIP3_reg_glacier_model_data/glacierMIP3_Feb12_2024_models_all_rgi_regions_sum_scaled_extended_repeat_last_101yrs.nc')" ] }, { "cell_type": "code", "execution_count": 84, "id": "23106fd2-4486-42ad-9564-2247e9fe6794", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | simulation_year | \n", "volume_m3 | \n", "area_m2 | \n", "extend_option | \n", "
|---|---|---|---|---|
| model_author | \n", "\n", " | \n", " | \n", " | \n", " |
| CISM2 | \n", "80 | \n", "80 | \n", "80 | \n", "80 | \n", "
| GLIMB | \n", "1520 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "
| GO | \n", "80 | \n", "80 | \n", "80 | \n", "80 | \n", "
| GloGEMflow | \n", "1520 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "
| GloGEMflow3D | \n", "880 | \n", "880 | \n", "880 | \n", "880 | \n", "
| Kraaijenbrink | \n", "240 | \n", "240 | \n", "240 | \n", "240 | \n", "
| OGGM-VAS | \n", "1440 | \n", "1440 | \n", "1440 | \n", "1440 | \n", "
| OGGM_v153 | \n", "304 | \n", "304 | \n", "304 | \n", "304 | \n", "
| OGGM_v16 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "
| PyGEM-OGGM_v13 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "1520 | \n", "
<xarray.Dataset>\n",
"Dimensions: (model_author: 9, simulation_year: 5001, gcm: 5,\n",
" rgi_reg: 19, period_scenario: 16)\n",
"Coordinates:\n",
" * model_author (model_author) <U14 'PyGEM-OGGM_v13' ... 'OGGM-VAS'\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",
" extend_option <U18 'repeat_last_101yrs'\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 ...\n",
"Attributes:\n",
" description: Scaled and extended regionally aggregated glacier ...\n",
" postprocessing_phase: Volume scaled to match regional Farinotti et al. (...\n",
" dataset_version: v1.0\n",
" source: Data from Glacier Model Intercomparison Project Ph...\n",
" contact: lilian.schuster@uibk.ac.at, harry.zekollari@vub.be| \n", " | model_author | \n", "rgi_reg | \n", "year | \n", "c | \n", "gamma | \n", "r2 | \n", "pval | \n", "
|---|---|---|---|---|---|---|---|
| 0 | \n", "PyGEM-OGGM_v13 | \n", "01 | \n", "50 | \n", "0.020381 | \n", "1.19372 | \n", "0.994505 | \n", "0.0 | \n", "
| 1 | \n", "GloGEMflow | \n", "01 | \n", "50 | \n", "0.00165 | \n", "1.436355 | \n", "0.990557 | \n", "0.000005 | \n", "
| 3 | \n", "OGGM_v16 | \n", "01 | \n", "50 | \n", "0.109069 | \n", "1.060634 | \n", "0.973483 | \n", "0.000176 | \n", "
| 4 | \n", "GLIMB | \n", "01 | \n", "50 | \n", "7.496441 | \n", "0.683857 | \n", "0.991572 | \n", "0.0 | \n", "
| 8 | \n", "OGGM-VAS | \n", "01 | \n", "50 | \n", "5.962623 | \n", "0.709678 | \n", "0.986746 | \n", "0.0 | \n", "
| ... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
| 508 | \n", "GLIMB | \n", "19 | \n", "5000 | \n", "0.048274 | \n", "1.166099 | \n", "0.99493 | \n", "0.0 | \n", "
| 509 | \n", "Kraaijenbrink | \n", "19 | \n", "5000 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
| 510 | \n", "GO | \n", "19 | \n", "5000 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
| 511 | \n", "CISM2 | \n", "19 | \n", "5000 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
| 512 | \n", "OGGM-VAS | \n", "19 | \n", "5000 | \n", "NaN | \n", "NaN | \n", "NaN | \n", "NaN | \n", "
513 rows × 7 columns
\n", "