{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# CMIP6 Precipitation Frequency Analysis\n", "\n", "This notebook shows an advanced analysis case. The calculation was inspired by Angie Pendergrass’s work on precipitation statistics, as described in the following websites / papers:\n", "\n", "- https://journals.ametsoc.org/doi/full/10.1175/JCLI-D-16-0684.1\n", "- https://climatedataguide.ucar.edu/climate-data/gpcp-daily-global-precipitation-climatology-project\n", "\n", "We use [xhistogram](https://xhistogram.readthedocs.io/) to calculate the distribution of precipitation intensity and its changes in a warming climate." ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2020-10-08T16:04:55.299948Z", "iopub.status.busy": "2020-10-08T16:04:55.299167Z", "iopub.status.idle": "2020-10-08T16:04:57.169205Z", "shell.execute_reply": "2020-10-08T16:04:57.168370Z" } }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/srv/conda/envs/notebook/lib/python3.7/site-packages/ipykernel_launcher.py:8: TqdmExperimentalWarning: Using `tqdm.autonotebook.tqdm` in notebook mode. Use `tqdm.tqdm` instead to force console mode (e.g. in jupyter console)\n", " \n" ] } ], "source": [ "import os\n", "\n", "from matplotlib import pyplot as plt\n", "import numpy as np\n", "import pandas as pd\n", "import xarray as xr\n", "import fsspec\n", "from tqdm.autonotebook import tqdm\n", "\n", "from xhistogram.xarray import histogram\n", "\n", "%matplotlib inline\n", "plt.rcParams['figure.figsize'] = 12, 6\n", "%config InlineBackend.figure_format = 'retina' " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Compute Cluster\n", "\n", "Here we use a dask cluster to parallelize our analysis. The cluster scales up and down adaptively." ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2020-10-08T16:04:57.174930Z", "iopub.status.busy": "2020-10-08T16:04:57.174235Z", "iopub.status.idle": "2020-10-08T16:05:07.540022Z", "shell.execute_reply": "2020-10-08T16:05:07.540818Z" } }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "136826834be94c209aa6b520f2365760", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='
\n", " | activity_id | \n", "institution_id | \n", "source_id | \n", "experiment_id | \n", "member_id | \n", "table_id | \n", "variable_id | \n", "grid_label | \n", "zstore | \n", "dcpp_init_year | \n", "version | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "AerChemMIP | \n", "AS-RCEC | \n", "TaiESM1 | \n", "histSST | \n", "r1i1p1f1 | \n", "AERmon | \n", "od550aer | \n", "gn | \n", "gs://cmip6/AerChemMIP/AS-RCEC/TaiESM1/histSST/... | \n", "NaN | \n", "20200310 | \n", "
1 | \n", "AerChemMIP | \n", "BCC | \n", "BCC-ESM1 | \n", "histSST | \n", "r1i1p1f1 | \n", "AERmon | \n", "mmrbc | \n", "gn | \n", "gs://cmip6/AerChemMIP/BCC/BCC-ESM1/histSST/r1i... | \n", "NaN | \n", "20190718 | \n", "
2 | \n", "AerChemMIP | \n", "BCC | \n", "BCC-ESM1 | \n", "histSST | \n", "r1i1p1f1 | \n", "AERmon | \n", "mmrdust | \n", "gn | \n", "gs://cmip6/AerChemMIP/BCC/BCC-ESM1/histSST/r1i... | \n", "NaN | \n", "20191127 | \n", "
3 | \n", "AerChemMIP | \n", "BCC | \n", "BCC-ESM1 | \n", "histSST | \n", "r1i1p1f1 | \n", "AERmon | \n", "mmroa | \n", "gn | \n", "gs://cmip6/AerChemMIP/BCC/BCC-ESM1/histSST/r1i... | \n", "NaN | \n", "20190809 | \n", "
4 | \n", "AerChemMIP | \n", "BCC | \n", "BCC-ESM1 | \n", "histSST | \n", "r1i1p1f1 | \n", "AERmon | \n", "mmrso4 | \n", "gn | \n", "gs://cmip6/AerChemMIP/BCC/BCC-ESM1/histSST/r1i... | \n", "NaN | \n", "20191127 | \n", "
Name: prod.73cab6ed5e464f939b8b42ef3a9a1cb8
" } }, "355e888c3a034891896e6a65f2925ce1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "FloatProgressModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "FloatProgressModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "ProgressView", "bar_style": "success", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_dce61358e69d40ddb0d40d4ce8381b53", "max": 4.0, "min": 0.0, "orientation": "horizontal", "style": "IPY_MODEL_01f8fc290d8a4485945682876d30e2e9", "value": 4.0 } }, "495309cceae446fc822ae94118c1a843": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "IntTextModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "IntTextModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "IntTextView", "continuous_update": false, "description": "Minimum", "description_tooltip": null, "disabled": false, "layout": "IPY_MODEL_c0c9b24b42074410addc7f455c527ff2", "step": 1, "style": "IPY_MODEL_a4268ec5d2cb453e80f40e58f9d756eb", "value": 0 } }, "4bf904d225334be8a04cd8d12c859b0e": { "model_module": "@jupyter-widgets/base", "model_module_version": "1.2.0", "model_name": "LayoutModel", "state": { "_model_module": "@jupyter-widgets/base", "_model_module_version": "1.2.0", "_model_name": "LayoutModel", "_view_count": null, "_view_module": "@jupyter-widgets/base", "_view_module_version": "1.2.0", "_view_name": "LayoutView", "align_content": null, "align_items": null, "align_self": null, "border": null, "bottom": null, "display": null, "flex": null, "flex_flow": null, "grid_area": null, "grid_auto_columns": null, "grid_auto_flow": null, "grid_auto_rows": null, "grid_column": null, "grid_gap": null, "grid_row": null, "grid_template_areas": null, "grid_template_columns": null, "grid_template_rows": null, "height": null, "justify_content": null, "justify_items": null, "left": null, "margin": null, "max_height": null, "max_width": null, "min_height": null, "min_width": null, "object_fit": null, "object_position": null, "order": null, "overflow": null, "overflow_x": null, "overflow_y": null, "padding": null, "right": null, "top": null, "visibility": null, "width": null } }, "4c5abb5aa915469bb097f495b1d1195f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HBoxModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HBoxModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HBoxView", "box_style": "", "children": [ "IPY_MODEL_495309cceae446fc822ae94118c1a843", "IPY_MODEL_caa3a54dc1b44483b2f4817e00be5f03", "IPY_MODEL_1ca11e6dbe24475c824d679bf1292f32" ], "layout": "IPY_MODEL_57f063fc61874c7aaea5dc202890e605" } }, "5170d2fba181438cb14a783670fb5b83": { "model_module": "@jupyter-widgets/controls", "model_module_version": "1.5.0", "model_name": "HTMLModel", "state": { "_dom_classes": [], "_model_module": "@jupyter-widgets/controls", "_model_module_version": "1.5.0", "_model_name": "HTMLModel", "_view_count": null, "_view_module": "@jupyter-widgets/controls", "_view_module_version": "1.5.0", "_view_name": "HTMLView", "description": "", "description_tooltip": null, "layout": "IPY_MODEL_ead7abb2177d44e1942a40523d095eb6", "placeholder": "", "style": "IPY_MODEL_03ccb76e1e7641f8b3aade51a8124493", "value": "\nWorkers | 20 |
---|---|
Cores | 40 |
Memory | 85.90 GB |