{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Exercise 2, melting the snowball earth\n", "\n", "> Start after finishing excercise 1 " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In the last lectures we implemented a energy balance model. The energy balance equation is give by\n", "\n", "\\begin{gather}\n", "\\color{brown}{C \\frac{dT}{dt}}\n", "\\; \\color{black}{=} \\; \\color{orange}{\\frac{(1 - α)S}{4}}\n", "\\; \\color{black}{-} \\; \\color{blue}{(A - BT)}\n", "\\; \\color{black}{+} \\; \\color{grey}{a \\ln \\left( \\frac{[\\text{CO}₂]}{[\\text{CO}₂]_{\\text{PI}}} \\right)},\n", "\\end{gather}\n", "\n", "Recall that in the last lecture we implemented a simplied ice albedo feedback by allowing the albedo to depend on temperature:\n", "\n", "$$\\alpha(T) = \\begin{cases}\n", "\\alpha_{i} & \\text{if }\\;\\; T \\leq -10\\text{°C} &\\text{(completely frozen)}\\\\\n", "\\alpha_{i} + (\\alpha_{0}-\\alpha_{i})\\frac{T + 10}{20} & \\text{if }\\;\\; -10\\text{°C} \\leq T \\leq 10\\text{°C} &\\text{(partially frozen)}\\\\\n", "\\alpha_{0} &\\text{if }\\;\\; T \\geq 10\\text{°C} &\\text{(no ice)}\n", "\\end{cases}$$\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "One thing that we did not adress in the last lecture was the impact of CO$_2$ increase. We simply set:\n", "\n", "$\\ln \\left( \\frac{ [\\text{CO}₂]_{\\text{PI}} }{[\\text{CO}₂]_{\\text{PI}}} \\right) = \\ln(1) = 0$\n", "\n", "We then evaluated how an increasing solar constant changes the equalibirum temperature on earth. In this excercise you keep $S$ at $1368 W/m^2$ and instead increase the $CO_2$ concentration.\n", "\n", "Replot the bifurcations diagramm for $CO_2$ increase instead of solar radiation.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import xarray as xr\n", "import matplotlib.pyplot as plt\n", "\n", "from ipywidgets import interact, interactive, fixed, interact_manual\n", "import ipywidgets as widgets\n", "\n", "from IPython.display import HTML\n", "from IPython.display import display\n", "\n", "from energy_balance_model import ebm" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "def CO2_change(t): \n", " return 280 + co2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Note that `co2` is a global variable here. In general all variables that are assigned in a function call are private (only accessible within the function). However, if this variable is not defined within the function, python looks for a global variable that is called `co2` (in your complete code). Therefore, remember to increase `co2` for the following task.\n", "\n", "Start by running the model for with different C02 concentrations and plot the equlibrium temperature. \n", "\n", "Hint: You can copy nearly all code from the Lecture *Snowball earth*" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "plt.figure(figsize = (8,6))\n", "plt.plot(co2vec[0:len(co2vec)//2], tvec[0:len(co2vec)//2], color = \"blue\", label = \"cool branch\", alpha = 0.3)\n", "plt.plot(co2vec[len(co2vec)//2:], tvec[len(co2vec)//2:], color = \"red\", label = \"warm branch\", alpha = 0.3)\n", "plt.axvline(1368, color = \"yellow\", lw = 5, alpha = 0.2, label = \"Pre-industiral / present insolation\")\n", "\n", "plt.plot(420, 14, marker=\"o\", label=\"Our preindustrial climate\", color=\"orange\", markersize=8)\n", "plt.plot(420, -38, marker=\"o\", label=\"Alternate preindustrial climate\", color=\"lightblue\", markersize=8)\n", "plt.plot(280, -48, marker=\"o\", label=\"neoproterozoic (700 Mya)\", color=\"lightgrey\", markersize=8)\n", "\n", "plt.xlabel(\"CO$_2$ concentration [ppm]\")\n", "plt.ylabel(\"Global temperature T [°C]\")\n", "\n", "plt.legend()\n", "plt.grid()" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 4 }