Skip to content

Commit

Permalink
minor update: add reference
Browse files Browse the repository at this point in the history
  • Loading branch information
lee1043 committed Jun 4, 2021
1 parent 63299eb commit caaaed6
Showing 1 changed file with 40 additions and 1 deletion.
41 changes: 40 additions & 1 deletion doc/jupyter/Demo/Demo_6_ENSO.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,23 @@
"cells": [
{
"cell_type": "markdown",
"id": "f02518f6",
"metadata": {},
"source": [
"# ENSO"
]
},
{
"cell_type": "markdown",
"id": "1bb7a1ac",
"metadata": {},
"source": [
"This notebook provides an overview of running the ENSO metrics. More information can be found in the [README]( ). Example parameter files are located in the [PMP sample setups]( ). \n",
"\n",
"**Reference**: Planton, Y., E. Guilyardi, A. T. Wittenberg, J. Lee, P. J. Gleckler, T. Bayr, S. McGregor, M. J. McPhaden, S. Power, R. Roehrig, A. Voldoire, 2020: Evaluating El Niño in climate models with the CLIVAR 2020 ENSO metrics package. Bulletin of the American Meteorological Society. [doi: 10.1175/BAMS-D-19-0337.1](https://doi.org/10.1175/BAMS-D-19-0337.1)\n",
"\n",
"Description for individual metrics can be found at https://github.com/CLIVAR-PRP/ENSO_metrics/wiki.\n",
"\n",
"### Requirements\n",
"\n",
"The first two sections of this notebook help to set up the demo data and environment.\n",
Expand All @@ -24,13 +30,15 @@
},
{
"cell_type": "markdown",
"id": "7a6383bf",
"metadata": {},
"source": [
"## Download demo data"
]
},
{
"cell_type": "markdown",
"id": "cdc4b9e2",
"metadata": {},
"source": [
"The ENSO metric requires a different set of sample data than the rest of the PMP metrics. This section of the notebook will download that data to your chosen location and generate a basic parameter file."
Expand All @@ -39,6 +47,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "da5d715f",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -51,6 +60,7 @@
},
{
"cell_type": "markdown",
"id": "ec2d5a6a",
"metadata": {},
"source": [
"If you want to change the location where the demo data and output are stored, you can do so here:"
Expand All @@ -59,6 +69,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "8e7cc829",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -70,6 +81,7 @@
},
{
"cell_type": "markdown",
"id": "f2386574",
"metadata": {},
"source": [
"Then download the data. The total sample data size is 10.8 GB. This will take several minutes."
Expand All @@ -78,6 +90,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "520aa1c5",
"metadata": {},
"outputs": [
{
Expand All @@ -101,6 +114,7 @@
},
{
"cell_type": "markdown",
"id": "11aa0d9f",
"metadata": {},
"source": [
"After downloading the data, we generate the parameter file for this demo."
Expand All @@ -109,6 +123,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "bf31cbd1",
"metadata": {},
"outputs": [
{
Expand All @@ -128,13 +143,15 @@
},
{
"cell_type": "markdown",
"id": "81ab1e49",
"metadata": {},
"source": [
"## Environment"
]
},
{
"cell_type": "markdown",
"id": "647d09fa",
"metadata": {},
"source": [
"[ENSO Metrics package](https://github.com/CLIVAR-PRP/ENSO_metrics) and [scipy](https://www.scipy.org/) installations are needed. This section will clone the ENSO Metrics repository and *install ENSO Metrics and scipy in your current conda environment*. Set the `enso_install_location` below to chose where to clone the ENSO Metrics repository."
Expand All @@ -143,6 +160,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "d632f1ab",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -151,6 +169,7 @@
},
{
"cell_type": "markdown",
"id": "ed720426",
"metadata": {},
"source": [
"To clone and install the ENSO Metrics package, un-comment the next cell and run it (delete quotes in lines 1 & 6)."
Expand All @@ -159,6 +178,7 @@
{
"cell_type": "code",
"execution_count": 6,
"id": "aecd5bcc",
"metadata": {
"scrolled": true
},
Expand Down Expand Up @@ -186,6 +206,7 @@
},
{
"cell_type": "markdown",
"id": "137de9c7",
"metadata": {},
"source": [
"To install scipy, un-comment the next cell and run it (delete quotes in lines 1 & 3)."
Expand All @@ -194,6 +215,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "046c7468",
"metadata": {},
"outputs": [
{
Expand All @@ -215,20 +237,23 @@
},
{
"cell_type": "markdown",
"id": "ab7ac9e8",
"metadata": {},
"source": [
"## Usage"
]
},
{
"cell_type": "markdown",
"id": "44577389",
"metadata": {},
"source": [
"The ENSO driver can be run from the command line as `enso_driver.py`. In this notebook, we will use bash cell magic (cells beginning with `%%bash`) to run the ENSO driver as a subprocess."
]
},
{
"cell_type": "markdown",
"id": "b9059757",
"metadata": {},
"source": [
"For help, type: \n",
Expand All @@ -240,6 +265,7 @@
{
"cell_type": "code",
"execution_count": 8,
"id": "c113d824",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -324,13 +350,15 @@
},
{
"cell_type": "markdown",
"id": "0701dc96",
"metadata": {},
"source": [
"### Basic example"
]
},
{
"cell_type": "markdown",
"id": "46928faf",
"metadata": {},
"source": [
"Parameters for the ENSO Metrics can be set on the command line or using a parameter file. This first example will use a parameter file, which is shown below."
Expand All @@ -339,6 +367,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "70a6b070",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -386,6 +415,7 @@
},
{
"cell_type": "markdown",
"id": "92d0e015",
"metadata": {},
"source": [
"The next cell runs the ENSO driver using the basic parameter file. This may take several minutes."
Expand All @@ -394,6 +424,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "5f8ef3f9",
"metadata": {
"scrolled": false
},
Expand Down Expand Up @@ -642,6 +673,7 @@
},
{
"cell_type": "markdown",
"id": "1da57cf2",
"metadata": {},
"source": [
"This run saved metrics to two files: \n",
Expand All @@ -655,6 +687,7 @@
{
"cell_type": "code",
"execution_count": 11,
"id": "32ffb4a4",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -978,6 +1011,7 @@
},
{
"cell_type": "markdown",
"id": "d25a4fb7",
"metadata": {},
"source": [
"### ENSO Metrics Collections\n",
Expand All @@ -995,6 +1029,7 @@
{
"cell_type": "code",
"execution_count": 12,
"id": "931a02c5",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1179,6 +1214,7 @@
},
{
"cell_type": "markdown",
"id": "da0956e3",
"metadata": {},
"source": [
"All of the results (netCDF and JSON) are located in the output directory, which uses the metrics collection name."
Expand All @@ -1187,6 +1223,7 @@
{
"cell_type": "code",
"execution_count": 13,
"id": "d297d2e5",
"metadata": {},
"outputs": [
{
Expand All @@ -1209,6 +1246,7 @@
},
{
"cell_type": "markdown",
"id": "2cd7ff92",
"metadata": {},
"source": [
"Finally, this example runs the remaining metrics collection ENSO_proc:"
Expand All @@ -1217,6 +1255,7 @@
{
"cell_type": "code",
"execution_count": 14,
"id": "4ec6cdde",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1582,7 +1621,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.6"
"version": "3.8.10"
}
},
"nbformat": 4,
Expand Down

0 comments on commit caaaed6

Please sign in to comment.