{ "cells": [ { "cell_type": "markdown", "id": "fdfd6b94", "metadata": { "execution": {} }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W1D5_IntroductiontoClimateModeling/instructor/W1D5_Intro.ipynb)   \"Open" ] }, { "cell_type": "markdown", "id": "089af884", "metadata": { "execution": {} }, "source": [ "# Intro" ] }, { "cell_type": "markdown", "id": "566ff52a", "metadata": { "execution": {} }, "source": [ "## Overview" ] }, { "cell_type": "markdown", "id": "632c98dc", "metadata": { "execution": {} }, "source": [ "Today you will be introduced to climate models, which are one of the primary tools of climate science. There are numerous types of climate models, each with their distinct complexity, utility, and limitations. In today’s tutorials, you will engage with a hierarchy of climate models with differing levels of complexity. You will begin by creating a simple climate model to predict Earth’s global mean surface temperature based on incoming and outgoing radiation. In later tutorials, you will extend this model to include more complexity through the addition of physics (albedo; [de]glaciation; convection) and dimensions (vertical structure of the atmosphere; latitudinal insolation variations). At the end of the day you will access, preprocess, and plot sea surface temperature in a highly complex climate model, TaiESM1, which is an Earth System Model (ESM) from the most recent Coupled Model Intercomparison Project, CMIP6.\n", "\n", "*Note that three tutorials contain solely Bonus content, that serves experienced participants and for later investigation of 0- and 1-dimensional models after the course*." ] }, { "cell_type": "markdown", "id": "14aeada1-93c7-470c-90d9-efb93d3ac19d", "metadata": { "execution": {} }, "source": [ "## Day Learning Objectives\n", "\n", "* Understand, code, and analyze radiation models of varying physical and mathematical complexity.\n", "* Explore how changes in Earth's atmosphere and surface properties affect Earth’s energy balance and surface temperature.\n", "* Access CMIP6 Earth system model data from cloud catalogs, and manipulate it by regridding and calculating global average properties." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Install and import feedback gadget\n" ] }, { "cell_type": "code", "execution_count": null, "id": "2c799e08-2a4d-407e-bbc6-ce745e770fec", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Install and import feedback gadget\n", "\n", "!pip3 install vibecheck datatops --quiet\n", "\n", "from vibecheck import DatatopsContentReviewContainer\n", "def content_review(notebook_section: str):\n", " return DatatopsContentReviewContainer(\n", " \"\", # No text prompt\n", " notebook_section,\n", " {\n", " \"url\": \"https://pmyvdlilci.execute-api.us-east-1.amazonaws.com/klab\",\n", " \"name\": \"comptools_4clim\",\n", " \"user_key\": \"l5jpxuee\",\n", " },\n", " ).render()\n", "\n", "\n", "feedback_prefix = \"W1D5_Intro\"" ] }, { "cell_type": "markdown", "id": "491d4b6d", "metadata": { "execution": {} }, "source": [ "## Video 1: Climate Modeling" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "a8dd85d1", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @markdown\n", "\n", "from ipywidgets import widgets\n", "from IPython.display import YouTubeVideo\n", "from IPython.display import IFrame\n", "from IPython.display import display\n", "\n", "\n", "class PlayVideo(IFrame):\n", " def __init__(self, id, source, page=1, width=400, height=300, **kwargs):\n", " self.id = id\n", " if source == 'Bilibili':\n", " src = f'https://player.bilibili.com/player.html?bvid={id}&page={page}'\n", " elif source == 'Osf':\n", " src = f'https://mfr.ca-1.osf.io/render?url=https://osf.io/download/{id}/?direct%26mode=render'\n", " super(PlayVideo, self).__init__(src, width, height, **kwargs)\n", "\n", "\n", "def display_videos(video_ids, W=400, H=300, fs=1):\n", " tab_contents = []\n", " for i, video_id in enumerate(video_ids):\n", " out = widgets.Output()\n", " with out:\n", " if video_ids[i][0] == 'Youtube':\n", " video = YouTubeVideo(id=video_ids[i][1], width=W,\n", " height=H, fs=fs, rel=0)\n", " print(f'Video available at https://youtube.com/watch?v={video.id}')\n", " else:\n", " video = PlayVideo(id=video_ids[i][1], source=video_ids[i][0], width=W,\n", " height=H, fs=fs, autoplay=False)\n", " if video_ids[i][0] == 'Bilibili':\n", " print(f'Video available at https://www.bilibili.com/video/{video.id}')\n", " elif video_ids[i][0] == 'Osf':\n", " print(f'Video available at https://osf.io/{video.id}')\n", " display(video)\n", " tab_contents.append(out)\n", " return tab_contents\n", "\n", "\n", "video_ids = [('Youtube', 'w0_ALij7bFY'), ('Bilibili', 'BV1rX4y1t7MD')]\n", "tab_contents = display_videos(video_ids, W=730, H=410)\n", "tabs = widgets.Tab()\n", "tabs.children = tab_contents\n", "for i in range(len(tab_contents)):\n", " tabs.set_title(i, video_ids[i][0])\n", "display(tabs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Submit your feedback\n" ] }, { "cell_type": "code", "execution_count": null, "id": "c7420af4-ba59-43b7-a946-8eeb4e5bff71", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Submit your feedback\n", "content_review(f\"{feedback_prefix}_Climate_Modeling_Video\")" ] }, { "cell_type": "markdown", "id": "f46af996", "metadata": { "execution": {} }, "source": [ "## Slides" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "bd95be61", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @markdown\n", "from IPython.display import IFrame\n", "from ipywidgets import widgets\n", "out = widgets.Output()\n", "with out:\n", " print(f\"If you want to download the slides: https://osf.io/download/y2bdn/\")\n", " display(IFrame(src=f\"https://mfr.ca-1.osf.io/render?url=https://osf.io/y2bdn/?direct%26mode=render%26action=download%26mode=render\", width=730, height=410))\n", "display(out)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Submit your feedback\n" ] }, { "cell_type": "code", "execution_count": null, "id": "8341016f-e8ab-4a65-9ff8-c619041f3da3", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Submit your feedback\n", "content_review(f\"{feedback_prefix}_Climate_Modeling_Slides\")" ] } ], "metadata": { "colab": { "collapsed_sections": [], "include_colab_link": true, "name": "W1D5_Intro", "toc_visible": true }, "kernel": { "display_name": "Python 3", "language": "python", "name": "python3" }, "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.9.19" } }, "nbformat": 4, "nbformat_minor": 5 }