Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

initial implementation of notebook PODs #674

Merged
merged 11 commits into from
Aug 27, 2024
210 changes: 0 additions & 210 deletions diagnostics/example_notebook/Test_Notebook.ipynb

This file was deleted.

53 changes: 53 additions & 0 deletions diagnostics/example_notebook/doc/example_notebook.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
Multi-Case Example Diagnostic Documentation
===========================================

Last update: Apr 2024

This POD illustrates how multiple cases (experiments) can be analyzed together. The
muliple cases are specified to the MDTF Framework where they are initialized and
preprocessed independently.

.. note::
This POD assumes familiarity with the single-case example diagnostic

Version & Contact info
----------------------

- Version/revision information: version 1.1 (Oct 2022)
- Model Development Task Force Framework Team

Open source copyright agreement
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The MDTF framework is distributed under the LGPLv3 license (see LICENSE.txt).
Unless you've distributed your script elsewhere, you don't need to change this.

Functionality
-------------
The framework generates yaml file called *case_info.yml* with environment variables
for the file paths and variable information for each case. The **example_multicase** POD reads the yaml file
information into a dictionary, and loops through the dictionary to read near-surface air temperature (TAS) data
for each case. The POD time averages the data and calculates the anomaly relative to the global mean.
The anomalies are zonally-averaged and the results from all cases are shown on a single plot.

Required programming language and libraries
-------------------------------------------

* Python >= 3.12
* xarray
* numpy
* matplotlib
* yaml
* sys

Required model output variables
-------------------------------

* tas - Surface (2-m) air temperature (CF: air_temperature)

References
----------

1. E. D. Maloney et al. (2019): Process-Oriented Evaluation of Climate and
Weather Forecasting Models. *BAMS*, **100** (9), 1665–1686,
`doi:10.1175/BAMS-D-18-0042.1 <https://doi.org/10.1175/BAMS-D-18-0042.1>`__.
31 changes: 31 additions & 0 deletions diagnostics/example_notebook/example_notebook.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<title>MDTF example-multicase diagnostic</title>
<img src="../mdtf_diag_banner.png">
<h3>Multi-Case Example Diagnostic: zonal-average near-surface temperature anomaly</h3>
<p>
This POD illustrates how multiple cases (experiments) can be analyzed together.
The MDTF-diagnostics framework initializes and processes each case, writes the environment variables for the cases
to a yaml file (case_info.yml), and exports an ESM Intake catalog with information about the post-processed
data for each ease to the working directory (WORK_DIR). The example_multicase POD driver script reads
environment information from case_info.yml into a dictionary that it references to read data from the
post-processed files in the data catalog.
</p>
<p>
The example_multicase POD reads near-surface air temperature (TAS) from netcdf output files for multiple cases.
The POD time averages the TAS data and calculates the anomaly relative to the global mean.
The anomalies are zonally-averaged and the results from all cases are shown on a single plot.
</p>
<TABLE>
<TR>
<TH align=left style="color:navy;">Time averages
<TH align=left>Model Results
<TR>
<TH align=left>Zonal-mean near-surface temperature anomalies (K)
</TABLE>
<!--
If the POD generates one figure per case, use the following format in your python script file paths:
<TH align=center><A href=model/example_model_plot_{{CASENAME}}.png>{{CASENAME}}</A>
The framework output manager will automatically append a link to each file
-->
<TH align=center><A href=model/example_multicase_plot.png>plot</A>
<!-- update the name of the template to [your_pod_name]_ipynb.html -->
<TH align=center><A href=example_notebook_ipynb.html>notebook</A>
Loading
Loading