{ "cells": [ { "cell_type": "markdown", "id": "86ad08b9-58ae-4c8e-ab9a-41db44d3ac6a", "metadata": {}, "source": [ "# Apply a spectral sea level equation solver to Antarctic drainage basin outlines\n", "*Author: R. Rietbroek Jan 2025 (r.rietbroek@utwente.nl)*\n", "\n", "When a surface load, e.g. a changing glacier load, is applied on the crust of the Earth it induces changes in gravity and a deformation of teh Earth. A passive but self-consistent ocean responds by adapting to the new geoid but also enforces a mass conservation (e.g. the mass from the melting glacier should be added to the ocean). This are generally considered Self Attraction and Loading (SAL) effects. The theory goes back to Woodward 1888 (\"On the form and position of mean sea level\"). A spectral approach, specialized for ocean pole tide is provided in Dahlen 1976 (\"The passive influence of the oceans upon the rotation of the Earth\").\n", "\n", "For a given surface load, the computation of a SAL response of the ocean can be done by solving the sea level equation. This notebook demonstrates the use of the specral sea level solves as provided by shxarray." ] }, { "cell_type": "markdown", "id": "7cd0eb43-03a4-4fd8-9c78-e0ff319de7eb", "metadata": {}, "source": [ "## 1. Preparations" ] }, { "cell_type": "code", "execution_count": 1, "id": "eac0fd29-ec90-4ecb-8ec7-941b37b6584b", "metadata": { "tags": [] }, "outputs": [], "source": [ "#Optionally enable autoreloading for development purposes. Note that this does not automagically reload the binary extensions\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 2, "id": "6b97642c-c3b9-4737-bbca-674ce48fe92c", "metadata": {}, "outputs": [], "source": [ "from shxarray.earth.sealevel import SpectralSeaLevelSolver\n", "import xarray as xr\n", "import os\n", "import requests\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import cartopy.crs as ccrs\n", "from shxarray.core.logging import setWarningLevel\n", "\n", "setWarningLevel()" ] }, { "cell_type": "code", "execution_count": 3, "id": "4d34dcc9-9dee-4210-abf2-d4f527e42630", "metadata": {}, "outputs": [], "source": [ "#set the maximum degree of the sea level equation solver\n", "nmax=120" ] }, { "cell_type": "markdown", "id": "1cd51201-9f13-4350-99a4-e0098345f08f", "metadata": {}, "source": [ "## 2. Get a set of Antartic grounded drainage basins to use as continental loads\n", "We're reusing the results from [this shxarray notebook](https://github.com/ITC-Water-Resources/shxarray/blob/main/docs/source/notebooks/Geometry2sphericalHarmonics.ipynb)." ] }, { "cell_type": "code", "execution_count": 4, "id": "6279a197-e2ca-4bf1-a482-8e6bf4ffc72d", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/usr/lib/python3.13/site-packages/xarray/backends/plugins.py:110: RuntimeWarning: Engine 'sinex' loading failed:\n", "module 'shxarray.io.shiobackend' has no attribute 'SINEXBackEntryPoint'\n", " external_backend_entrypoints = backends_dict_from_pkg(entrypoints_unique)\n" ] }, { "data": { "text/html": [ "
<xarray.DataArray 'ant_div' (basinid: 27, nm: 14641)> Size: 3MB\n",
"[395307 values with dtype=float64]\n",
"Coordinates:\n",
" * basinid (basinid) float64 216B 2.0 3.0 4.0 5.0 6.0 ... 25.0 26.0 27.0 27.0\n",
" * nm (nm) object 117kB MultiIndex\n",
" * n (nm) int64 117kB 0 1 1 1 2 2 2 2 ... 120 120 120 120 120 120 120\n",
" * m (nm) int64 117kB 0 -1 0 1 -2 -1 0 1 ... 114 115 116 117 118 119 120\n",
"Attributes:\n",
" Conventions: CF-1.8\n",
" source: shxarray-1.3.3.dev5+ga1b06ac.d20250527 <https://github.com/...\n",
" contact: Roelof Rietbroek <r.rietbroek@utwente.nl>\n",
" institution: ITC Faculty of Geo-Information Science and Earth Observatio...\n",
" comments: Used backend: SHTns High performance Spherical Harmonic Tra...\n",
" history: Analysis operation<xarray.Dataset> Size: 16MB\n",
"Dimensions: (nm: 14641, basinid: 27)\n",
"Coordinates:\n",
" * nm (nm) object 117kB MultiIndex\n",
" * n (nm) int64 117kB 0 1 1 1 2 2 2 2 ... 120 120 120 120 120 120 120\n",
" * m (nm) int64 117kB 0 -1 0 1 -2 -1 0 ... 115 116 117 118 119 120\n",
" * basinid (basinid) float64 216B 2.0 3.0 4.0 5.0 ... 25.0 26.0 27.0 27.0\n",
"Data variables:\n",
" quasi_sea (nm, basinid) float64 3MB -0.001249 -0.001998 ... 7.79e-11\n",
" load_sea (nm, basinid) float64 3MB -0.0009403 -0.001546 ... 8.519e-09\n",
" load_force (basinid, nm) float64 3MB ...\n",
" geoid (nm, basinid) float64 3MB 0.0 0.0 0.0 ... 1.938e-11 1.896e-11\n",
" uplift (nm, basinid) float64 3MB 0.0 0.0 0.0 ... -6.023e-11 -5.893e-11\n",
"Attributes:\n",
" history: 2025-07-08 11:43:10.115941: shxarray (SpectralSeaLevelSolver