Installing CUPID - ESCOMP/CTSM GitHub Wiki

1) Installing CUPiD

This page follows the CUPiD Installation Documentation, with some tweaks specific to the NCAR super computer.

1) Checkout CTSM with CUPiD

Open a terminal window and log on to casper. This tutorial assumes you're using a bash shell, which is the default shell on most Linux and Unix computers. You can check your shell by running echo $SHELL, and if it isn't /bin/bash you can switch by simply running the command bash (if you are intentionally using a different shell, we'll assume you know how translate bash commands like export to your shell of choice).

Make a sandbox to play in

cd /glade/work/$USER
mkdir ctsm_cupid_2026
cd ctsm_cupid_2026

Clone the CUPiD branch of CTSM

git clone --origin escomp -b branch_tags/CUPiD.n01_ctsm5.4.017 https://github.com/ESCOMP/CTSM.git
cd CTSM

Checkout submodules

./bin/git-fleximod update

You will see something like this:

                 rtm up to date.
              mosart up to date.
                cism up to date.
Recursively checking out submodules of cism
          ccs_config up to date.
          mpi-serial up to date.
               share up to date.
               cdeps up to date.
Recursively checking out submodules of cdeps
               cmeps up to date.
               cupid updated to 6b12f0b093e2f9f0d91061960975270b63cfad5a
Recursively checking out submodules of cupid
           mizuRoute up to date.
Recursively checking out submodules of mizuRoute
          parallelio up to date.
               fates up to date.
Recursively checking out submodules of fates
                cime up to date.
Recursively checking out submodules of cime

2) Install CUPiD Environments

CUPiD is available from the NCAR organization on github.com. And comes with the version of CTSM that you checked out above (in the tools/CUPiD subdirectory). It requires conda to manage a few different python environments. The NCAR system administrators provide conda through a module, which you can access by running

module load conda

[NOTE]: If this fails you likely need to run this command to get the module command enabled . $LMOD_ROOT/lmod/init/bash

The rest of this tutorial will refer to the location with CUPiD in the CTSM checkout as ${CUPID_ROOT}. To be able to copy and paste blocks of commands directly, we need to add the variable to your environment. We'll create the environment variable CUPID_ROOT with the following command:

cd tools/CUPiD
export CUPID_ROOT=`pwd -P`

Note: This environment variable only exists in this specific terminal. It will need to exported again if you open a separate terminal, unless you modify your start files (see the NCAR documentation for this process for more information).

Checkpoint #1

At this point you should have:

  1. Logged on to casper
  2. Cloned CTSM (and checkout out all the externals)
  3. Navigated the directory tree so your current working directory is the tools/CUPiD subdirectory of your CTSM checkout.

2.2) Install two conda environments for CUPiD

CUPiD needs a python environment with specific packages installed to run the CUPiD tools, while the diagnostic notebooks provided with CUPiD need a different set of packages.

To run CUPiD itself we use the (cupid-infrastructure) environment, then CUPiD runs the diagnostics notebooks with (cupid-analysis). We will use mamba to install these environments and the --yes option to avoid mamba waiting for approval before continuing with the install:

Install (cupid-infrastructure) and (cupid-analysis)

cd ${CUPID_ROOT}
mamba env create -f environments/cupid-infrastructure.yml --yes && \
mamba env create -f environments/cupid-analysis.yml --yes

BE PATIENT Managing these python environments is kind of slow and may take 10-15 minutes. The last line printed to the screen will say something about doing a pip install on some of the external packages we'll use (e.g. ILAMB). This also takes a bit of time. Your command line will return after it's finished. While this is running, we will continue on to the next page and learn more about CUPiD.

Notes:

  • In the command above you're executing two separate commands separated by &&; the second command (installing (cupid-analysis)) will only run if the first command (installing (cupid-infrastructure) finishes successfully).
  • The \ is a line continuation operator - without it, the command would be on a single line and very long.
  • If you remove the --yes flag, mamba will ask you to confirm the installation after it determines what packages will be installed.

While these environments get installed, we'll talk a little bit about how CUPiD is structured.



Next to the CUPiD overview page