From ce80ac5616cb3440be93f52772d89605340c16c8 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 7 Aug 2024 15:37:09 -0600 Subject: [PATCH 1/2] Add instructions for running nmse_PSL.ipynb Since CUPiD will now run a notebook, I also added instructions for creating the JupyterBook (although we probably need better instructions when it comes to "how can I look at the JupyterBook") --- notebooks/diagnostics/cupid.ipynb | 92 +++++++++++++++++++++++++------ 1 file changed, 74 insertions(+), 18 deletions(-) diff --git a/notebooks/diagnostics/cupid.ipynb b/notebooks/diagnostics/cupid.ipynb index 5012a59c..b3e99693 100644 --- a/notebooks/diagnostics/cupid.ipynb +++ b/notebooks/diagnostics/cupid.ipynb @@ -214,7 +214,7 @@ " #from each component.\n", "\n", " atm:\n", - " vars: ['TREFHT']\n", + " vars: ['PSL']\n", " derive_vars: []\n", " hist_str: 'h0'\n", " start_years: [1]\n", @@ -253,7 +253,29 @@ " end_years: [3]\n", " level: 'lev'\n", "\n", - "#IGNORE EVERYTHING BELOW THIS LINE!\n", + "compute_notebooks:\n", + "\n", + " # This is where all the notebooks you want run and their\n", + " # parameters are specified. Several examples of different\n", + " # types of notebooks are provided.\n", + "\n", + " # The first key (here infrastructure) is the name of the\n", + " # notebook from nb_path_root, minus the .ipynb\n", + "\n", + " infrastructure:\n", + " index:\n", + " parameter_groups:\n", + " none: {}\n", + "\n", + " atm:\n", + " nmse_PSL:\n", + " parameter_groups:\n", + " none:\n", + " validation_path: '/glade/campaign/cesm/development/cross-wg/diagnostic_framework/nmse_validation/fv1.9x2.5'\n", + " start_date: '0001-01-01'\n", + " end_date: '0004-01-01'\n", + " regridded_output: False\n", + "\n", "\n", "########### JUPYTER BOOK CONFIG ###########\n", "\n", @@ -274,21 +296,13 @@ "\n", " # Parts group notebooks into different sections in the Jupyter book\n", " # table of contents, so you can organize different parts of your project.\n", + " # Each chapter is the name of one of the notebooks that you executed\n", + " # in compute_notebooks above, also without .ipynb\n", "\n", - "# - caption: Atmosphere\n", + " - caption: Atmosphere\n", + " chapters:\n", + " - file: atm/nmse_PSL\n", "\n", - " # Each chapter is the name of one of the notebooks that you executed\n", - " # in compute_notebooks above, also without .ipynb\n", - "# chapters:\n", - "# - file: atm/adf_quick_run\n", - "\n", - "# - caption: Land\n", - "# chapters:\n", - "# - file: lnd/land_comparison\n", - "\n", - "# - caption: Sea Ice\n", - "# chapters:\n", - "# - file: ice/seaice\n", "\n", "#####################################\n", "# Keys for Jupyter Book _config.yml #\n", @@ -315,7 +329,7 @@ "id": "27ed4c0c-f6ee-48a2-b264-2a2e58744f82", "metadata": {}, "source": [ - "## Generating time series" + "## Generating time series and Computing NMSE diagnostic" ] }, { @@ -334,7 +348,7 @@ "outputs": [], "source": [ "module load nco #Currently the NetCDF Operators are needed by CUPiD in order to run the time series generator\n", - "cupid-run -ts" + "cupid-run --time-series" ] }, { @@ -384,13 +398,55 @@ "What is different?" ] }, + { + "cell_type": "markdown", + "id": "47b2e3aa", + "metadata": {}, + "source": [ + "## Looking at Diagnostics\n", + "\n", + "Besides creating time series data sets, the `cupid-run` command also ran the `examples/nblibrary/atm/nmse_PSL.ipynb` notebook with parameters set in `config.yml`.\n", + "The notebooks in `examples/nblibrary/atm/` are templates, but the completed notebook is in `examples/key_metrics/computed_notebooks/key_metrics/atm/nmse_PSL.ipynb`.\n", + "You can open this notebook directly via JupyterHub, or CUPiD can use Jupyter Book to create a webpage:" + ] + }, { "cell_type": "code", "execution_count": null, "id": "e1b5db8c-4890-46b3-8b5c-c095e75bcd18", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "cupid-build" + ] + }, + { + "cell_type": "markdown", + "id": "83a7bfc3", + "metadata": {}, + "source": [ + "When this command finishes running, you will have a new directory: `examples/key_metrics/computed_notebooks/key_metrics/_build/html/`.\n", + "The easiest way to view these files is to look at them via JupyterHub, although its HTML parsing is not the best.\n", + "You could also run firefox from derecho or casper" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "f686e7e6", + "metadata": {}, + "outputs": [], + "source": [ + "firefox &" + ] + }, + { + "cell_type": "markdown", + "id": "c3679cad", + "metadata": {}, + "source": [ + "and then point your browser to `examples/key_metrics/computed_notebooks/key_metrics/_build/html/index.html`, or copy the entire `html/` directory to your laptop." + ] } ], "metadata": { From a61ee7423fe4e0cf6a9e798fe144e1ee7ce155c1 Mon Sep 17 00:00:00 2001 From: Michael Levy Date: Wed, 7 Aug 2024 15:41:31 -0600 Subject: [PATCH 2/2] Firefox is only installed on casper Students trying to open the browser on derecho will get a command-not-found error. --- notebooks/diagnostics/cupid.ipynb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebooks/diagnostics/cupid.ipynb b/notebooks/diagnostics/cupid.ipynb index b3e99693..7058a002 100644 --- a/notebooks/diagnostics/cupid.ipynb +++ b/notebooks/diagnostics/cupid.ipynb @@ -427,7 +427,7 @@ "source": [ "When this command finishes running, you will have a new directory: `examples/key_metrics/computed_notebooks/key_metrics/_build/html/`.\n", "The easiest way to view these files is to look at them via JupyterHub, although its HTML parsing is not the best.\n", - "You could also run firefox from derecho or casper" + "You could also run firefox from casper (note that the browser is not installed on derecho!):" ] }, {