{ "cells": [ { "cell_type": "markdown", "id": "aaaea21f-bd4a-4b18-aa67-5cefe8017ac8", "metadata": {}, "source": [ "# Analyse regional projections" ] }, { "cell_type": "code", "execution_count": 1, "id": "2e7297c8-8117-4957-a6f8-944955d4a6e3", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "2026-06-05 11:12:48: oggm.cfg: Reading default parameters from the OGGM `params.cfg` configuration file.\n", "2026-06-05 11:12:48: oggm.cfg: Multiprocessing switched OFF according to the parameter file.\n", "2026-06-05 11:12:48: oggm.cfg: Multiprocessing: using all available processors (N=32)\n", "2026-06-05 11:12:48: oggm.utils: Checking the download verification file checksum...\n", "2026-06-05 11:12:49: oggm.utils: /home/users/fmaussion/.oggm/downloads.sha256.hdf changed or invalid, deleting.\n", "2026-06-05 11:12:49: oggm.utils: Downloading https://cluster.klima.uni-bremen.de/data/downloads.sha256.hdf to /home/users/fmaussion/.oggm/downloads.sha256.hdf...\n", "2026-06-05 11:12:50: oggm.utils: Done downloading.\n", "2026-06-05 11:12:50: oggm.utils: Checking the download verification file checksum...\n" ] } ], "source": [ "from oggm import cfg, workflow, utils, shop\n", "import pandas as pd\n", "import os, glob\n", "import numpy as np\n", "import xarray as xr\n", "import seaborn as sns\n", "import matplotlib.pyplot as plt\n", "sns.set_style(\"whitegrid\")\n", "cfg.initialize()\n", "import seaborn as sns\n", "sns.set_context('talk')\n", "import oggm\n", "import geopandas as gpd\n", "\n", "from func_add_terrafirma import scenarios, color_scenario, ls_scenario, ls_scenario_tuple" ] }, { "cell_type": "code", "execution_count": 2, "id": "59dacced-0534-4cc2-9b5e-5fd8a385d60b", "metadata": {}, "outputs": [], "source": [ "rgi_regs = []\n", "for rgi_reg in np.arange(1,20,1):\n", " if rgi_reg < 10:\n", " rgi_reg = '0'+str(rgi_reg)\n", " else:\n", " rgi_reg = str(rgi_reg)\n", " rgi_regs.append(rgi_reg)\n", "df_itmix = pd.read_hdf(oggm.utils.get_demo_file('rgi62_itmix_df.h5'))\n", "rgidf_dict = {}\n", "for rgi_reg in rgi_regs:\n", " path_rgi = oggm.utils.get_rgi_region_file(rgi_reg, version='6')\n", " rgidf = gpd.read_file(path_rgi)\n", " # Greenland periphery : all glaciers with connectivity level 0 and 1 should be included, level 2 glaciers should be excluded (as was the case for GlacierMIP2)\n", " # total RGI area: 89,651km2\n", " if rgi_reg == '05':\n", " rgidf = rgidf.loc[(rgidf['Connect'] == 0) | (rgidf['Connect'] ==1)]\n", " rgidf_dict[rgi_reg] = rgidf\n", " rgidf_dict[rgi_reg] = rgidf_dict[rgi_reg].set_index('RGIId')\n", " df_itmix.loc[rgidf.RGIId.values,'rgi_region'] = rgi_reg\n", "# remove 05-connectivity 2 glaciers \n", "df_itmix = df_itmix.loc[~df_itmix.rgi_region.isna()]\n", "\n", "pd_rgi6 = pd.read_csv(utils.file_downloader('https://cluster.klima.uni-bremen.de/~oggm/rgi/rgi62_stats.csv'))\n", "pd_rgi6 = pd_rgi6.loc[pd_rgi6.Connect !=2]\n", "pd_rgi6 = pd_rgi6.set_index('RGIId')\n", "\n", "# just necessary to get the glacier-area weighte median RGI date \n", "pd_gmip3_area_weighted_median = pd.read_csv('/home/www/lschuster/GlacierMIP3/data/table_S3.csv', index_col='rgi_reg')\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "8e7e0ad5-05a9-43b9-a6b8-9384f1deaaeb", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | Unnamed: 0 | \n", "Year$^a$ (glacier-area weighted median) | \n", "Glacier area$^a$ (km²) | \n", "Glacier surface slope$^a$ (glacier-area weighted average, °) | \n", "Glacier mass$^a$ (Gt) | \n", "Glacier mass in 2020$^b$ (Gt) | \n", "2000-2019 observed glacier mass loss$^b$ (rel. to 2000, %) | \n", "Simulation time (years) | \n", "
|---|---|---|---|---|---|---|---|---|
| rgi_reg | \n", "\n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " | \n", " |
| global | \n", "Global | \n", "2000 | \n", "705739 | \n", "11.4 | \n", "142341 | \n", "137491 | \n", "3.9 | \n", "NaN | \n", "
| 19 | \n", "Sub- & Antarctic Islands (19) | \n", "1986 | \n", "132867 | \n", "3.6 | \n", "41820 | \n", "41377 | \n", "1.1 | \n", "5000.0 | \n", "
| 03 | \n", "Arctic Canada N (03) | \n", "1999 | \n", "105111 | \n", "9.6 | \n", "25498 | \n", "24851 | \n", "2.5 | \n", "5000.0 | \n", "
| 01 | \n", "Alaska (01) | \n", "2010 | \n", "86725 | \n", "13.9 | \n", "17081 | \n", "16246 | \n", "8.0 | \n", "5000.0 | \n", "
| 05 | \n", "Greenland Periphery (05) | \n", "2001 | \n", "89717 | \n", "10.3 | \n", "14123 | \n", "13410 | \n", "5.3 | \n", "5000.0 | \n", "
| 09 | \n", "Russian Arctic (09) | \n", "2001 | \n", "51592 | \n", "11.9 | \n", "13176 | \n", "12965 | \n", "1.7 | \n", "5000.0 | \n", "
| 04 | \n", "Arctic Canada S (04) | \n", "2001 | \n", "40888 | \n", "11.5 | \n", "7750 | \n", "7212 | \n", "7.2 | \n", "5000.0 | \n", "
| 07 | \n", "Svalbard (07) | \n", "2008 | \n", "33959 | \n", "8.8 | \n", "6723 | \n", "6566 | \n", "3.3 | \n", "5000.0 | \n", "
| 17 | \n", "Southern Andes (17) | \n", "2000 | \n", "29429 | \n", "14.9 | \n", "4806 | \n", "4368 | \n", "9.1 | \n", "5000.0 | \n", "
| 06 | \n", "Iceland (06) | \n", "2000 | \n", "11060 | \n", "6.7 | \n", "3393 | \n", "3194 | \n", "5.8 | \n", "5000.0 | \n", "
| 13 | \n", "Central Asia (13) | \n", "2007 | \n", "49303 | \n", "19.5 | \n", "2944 | \n", "2771 | \n", "6.8 | \n", "2000.0 | \n", "
| 14 | \n", "South Asia W (14) | \n", "2001 | \n", "33568 | \n", "22.3 | \n", "2579 | \n", "2485 | \n", "3.7 | \n", "2000.0 | \n", "
| 02 | \n", "W Canada & US (02) | \n", "2004 | \n", "14524 | \n", "18.3 | \n", "942 | \n", "795 | \n", "16.8 | \n", "2000.0 | \n", "
| 15 | \n", "South Asia E (15) | \n", "2002 | \n", "14734 | \n", "21.1 | \n", "790 | \n", "656 | \n", "18.2 | \n", "2000.0 | \n", "
| 08 | \n", "Scandinavia (08) | \n", "2002 | \n", "2949 | \n", "11.9 | \n", "269 | \n", "237 | \n", "12.9 | \n", "2000.0 | \n", "
| 10 | \n", "North Asia (10) | \n", "2011 | \n", "2410 | \n", "18.4 | \n", "122 | \n", "109 | \n", "19.6 | \n", "2000.0 | \n", "
| 11 | \n", "Central Europe (11) | \n", "2003 | \n", "2092 | \n", "20.9 | \n", "115 | \n", "85 | \n", "29.7 | \n", "2000.0 | \n", "
| 16 | \n", "Low Latitudes (16) | \n", "2000 | \n", "2341 | \n", "25.3 | \n", "89 | \n", "69 | \n", "22.3 | \n", "2000.0 | \n", "
| 18 | \n", "New Zealand (18) | \n", "1978 | \n", "1162 | \n", "25.6 | \n", "66 | \n", "53 | \n", "20.8 | \n", "2000.0 | \n", "
| 12 | \n", "Caucasus & Middle East (12) | \n", "2001 | \n", "1307 | \n", "24.2 | \n", "57 | \n", "43 | \n", "25.0 | \n", "2000.0 | \n", "
<xarray.Dataset> Size: 1MB\n",
"Dimensions: (scenario: 6, rgi_reg: 19, time: 696)\n",
"Coordinates:\n",
" * scenario (scenario) <U22 528B 'hist' ... 'up2p0-gwl4p0-50y-dn2p0'\n",
" * rgi_reg (rgi_reg) <U2 152B '01' '02' '03' ... '17' '18' '19'\n",
" * time (time) float64 6kB 1.975e+03 1.976e+03 ... 2.67e+03\n",
" gcm <U16 64B ...\n",
" n_all_running_rgis int64 8B ...\n",
"Data variables:\n",
" volume (scenario, rgi_reg, time) float32 317kB ...\n",
" volume_bsl (scenario, rgi_reg, time) float32 317kB ...\n",
" area (scenario, rgi_reg, time) float32 317kB ...\n",
" mm_slr_since_1975 (rgi_reg, scenario, time) float32 317kB ...\n",
"Attributes:\n",
" OGGM_version: oggm_v163\n",
" RGI_version: rgiv62\n",
" info: Reanalysis dataset used for calibration: W5E5.\\nBias corr...\n",
" time_validity: All variables describe the state at the beginning of the ...\n",
" rgi_reg_info: sum over all rgi_reg to get global estimates