Diagnostics#


These activities have been tested and updated by Jesse Nusbaumer and Alice DuVivier


Once the CESM model has been run and the output data has been transfered to the short term archive directory the real job of understanding how the simulation ran and what it means from a scientific perspective begins.

By this point you have run a number of simulations and have looked at model output using ncview. In this lab you will go beyond ncview by using Python plotting and analysis methods in Jupyterhub to produce additional diagnostic results. There is also a complete CESM diagnostics system currently under active development called CUPiD that you will get to try out as well, although please note that it is still in its very early stages. Finally, please note that there are many other CESM analysis tools and projects available as well, but not all will be covered here.

To start running the Jupyter Notebooks provided for this tutorial, follow the steps below.

Step 1. Download CESM Tutorial notebooks with Git Clone#

We will use the main branch of the tutorial materials for use in this tutorial.

First we will change into the home directory and then we will use the git clone command to download the CESM Tutorial diagnostics notebooks.

Change the current directory to the home directory:
cd 

Download the cesm code to your code workspace directory as CESM-Tutorial:

git clone https://github.com/NCAR/CESM-Tutorial.git CESM-Tutorial

Step 2. Login to JupyterHub#

Go to the JupyterHub website (https://jupyterhub.hpc.ucar.edu/) and click on the “Production” button.

JupyterHub

This will take you to a page where you enter your username and password. Enter your username as you would for Derecho, but your password will be the following:

Derecho password,Duo Pin

Where “Duo Pin” is the six numbers you can find in your Duo app under the “UCAR” Account listing. Please note that the comma ( , ) must also be there separating the password from the Duo Pin.

JupyterHub Login

JupyterHub Login

After you do this and click “Sign In” you will be taken to a Server landing page where you will need to start your sever on Jupyterhub.

JupyterHub Server

Select the “Casper PBS Batch” option in the drop down menu.

JupyterHub Casper PBS

After selecting “Casper PBS Batch” you need to make other choices to select the right resources. You should use the queue and project account keys specified below. You may also want to request 03:00:00 for your Wall Time so that your server is active for the entire hands-on activity session. Do not change any other selection for this tutorial. If you are doing further analysis of model experiments you may need to change these settings and can find more information in the CISL Documentation about JupyterHub.

For this tutorial you should use the Queue `tutorial` and Project Account `UESM0013`.

JupyterHub Selections

You may have to wait a moment or two for your server to start up.

JupyterHub Casper PBS

Your JupyterHub session is now active and ready to run.

Step 3. Open a Diagnostics Notebook#

When your JupyterHub session opens you should be in your home directory on the NCAR HPC. In Step 1 you cloned the “CESM-Tutorial” repository, which has the notebooks you will run in this activity.

JupyterHub Main Page

To get to the Diagnostics notebooks, double click the following sequence of folders:

  1. CESM-Tutorial

  2. notebooks

  3. diagnostics

  4. Click on the folder for the model component that you are interested in running (e.g. cam)

  5. Click on the basics.ipynb notebook (see arrow on left, below)

The final path in your browser url line for the following example should be: $USER/CESM-Tutorial/notebooks/diagnostics/cam/basics.ipynb

JupyterHub Open Notebook

Step 4. Check Your Notebook Kernel#

Check your kernel (see arrow in upper right corner, above). It should be either NPL 2023a or NPL 2023b. You should use the specified kernel for any diagnostics you do during the tutorial as it is a default environment available on NCAR HPC and the notebooks here have been tested so that they work with that particular kernel for the analysis environment. We have set the default kernels and specifiy what they should be in each component notebook. However, if you need to change it click on the kernel button and select the correct kernel.

Step 5. Run Jupyter Notebook Cells#

To run a Jupyter cell

  • Type your command into the cell

  • To execute the command:

    • Press shift+return

    OR
    - Select the cell then click the 'play' button at the top of the window (see red arrow, above)

All figures will be rendered in the Jupyter Notebook, so there is no need to open any other window for this portion of the lab activities.