Download CESM#

In this tutorial, you will download the CESM source code from GitHub into your own CESM workspace on Derecho. This code base will be used throughout the tutorial exercises.

We will use the CESM3 tutorial tag: `cesm3.0_Tutorial2026`

Note: At the time of the tutorial, the final CESM3 release has not yet been completed. Therefore, we will use a preliminary tutorial tag (cesm3.0_Tutorial2026) that contains the CESM3 code base and configuration needed for the exercises. The exact tag used in the tutorial may differ from the final CESM3 release.

Downloading the CESM code is an important first step, since all subsequent exercises will use this code workspace. If you encounter any problems during this process, please ask for help.

Step 1: Create CESM Code Directory#

First, create a location in the glade file system where you will store your CESM source code.

Throughout this tutorial, $USER is a placeholder for your NCAR HPC username.

Exercise: Create a directory to store your code
cd /glade/u/home/$USER
mkdir code

Step 2. Clone the CESM Repository#

First, we will change into the code workspace location then we will use the git clone command to download the CESM code.

Exercise: Clone the CESM Repository
  • Change the current directory to the code workspace directory:

    cd /glade/u/home/$USER/code

  • Download the CESM code to your code workspace directory as my_cesm_code:

    git clone https://github.com/ESCOMP/CESM.git my_cesm_code
    cd my_cesm_code
    git checkout cesm3.0_Tutorial2026

The directory name my_cesm_code is only an example. You may choose any directory name you prefer. Outside of this tutorial, many users choose names that identify the CESM version they are working with (for example, cesm3.0, or cesm3.0_Tutorial2026).

  • Verify the Tutorial Tag

You can verify that you are using the correct version by running:

    git describe --tags --exact-match

which should return:

    cesm3.0_Tutorial2026
Click here for example output
  ccs_config up to date.
                 fms up to date.
Recursively checking out submodules of fms
               share up to date.
                cice up to date.
Recursively checking out submodules of cice
                 mom up to date.
Recursively checking out submodules of mom
                cism up to date.
Recursively checking out submodules of cism
               cdeps up to date.
Recursively checking out submodules of cdeps
                 rtm up to date.
                 ww3 up to date.
Recursively checking out submodules of ww3
              mosart up to date.
               cmeps up to date.
          mpi-serial up to date.
         tools/CUPiD up to date.
Recursively checking out submodules of tools/CUPiD
          parallelio up to date.
           mizuroute up to date.
Recursively checking out submodules of mizuroute
               tuv-x up to date.
                 clm up to date.
Recursively checking out submodules of clm
                cime up to date.
Recursively checking out submodules of cime
                 cam up to date.
Recursively checking out submodules of cam
Sparse checkout cam-sima fxsparse ../.sima_phys_utils_sparse_checkout
Successfully checked out             cam-sima at sima0_07_000
Sparse checkout mpas fxsparse ../.mpas_sparse_checkout
Successfully checked out                 mpas at v8.2.1
Sparse checkout cosp2 fxsparse ../.cosp_sparse_checkout
Successfully checked out                cosp2 at v2.1.9
Sparse checkout clubb fxsparse ../.clubb_sparse_checkout
Successfully checked out                clubb at clubb_4ncar_20260109_ddf5110
Sparse checkout ext_co2_cooling fxsparse ../.ext_co2_cooling_sparse_checkout
Successfully checked out      ext_co2_cooling at v1.1
Recursively checking out submodules of src
Recursively checking out submodules of MOM6
              pysect up to date.
Recursively checking out submodules of fates
Recursively checking out submodules of atmos_phys
Recursively checking out submodules of fv3
Recursively checking out submodules of geoschem
Recursively checking out submodules of hemco
Recursively checking out submodules of HEMCO

Versions#

CESM Versions

One of the first decisions when starting a modeling project is choosing which version of CESM to use. Factors to consider include:

  • Scientific and technical support for the version. As a rule of the thumb, release tags are the most supported version of CESM.

  • Availability of model features required for your research.

  • Consistency with community experiments or previous studies.

  • Compatibility with analysis tools and workflows.

For example, if you plan to compare your simulations with a community project, you should generally use the same CESM version as that project.

More information can be found on the CESM Models website.

To see available CESM release tags, use:

git tag --list 'release-cesm*'
Click here for example output
release-cesm2.0.0
release-cesm2.0.1
release-cesm2.1.0
release-cesm2.1.1
release-cesm2.1.2
release-cesm2.1.3
release-cesm2.1.4
release-cesm2.1.5
release-cesm2.2.0
release-cesm2.2.1
release-cesm2.2.2

Note CESM3 has not yet been officially released at the time of this tutorial. As a result, you will only see CESM2 release tags when listing official releases. The tutorial tag cesm3.0_Tutorial2026 is a pre-release CESM3 tag created specifically for this tutorial and therefore does not appear in the list of official CESM releases.

Step 3. Download Component Models with git-fleximod#

The CESM repository itself does not contain all component model source code. Individual model components are maintained in separate repositories and must be downloaded after cloning CESM.

CESM3 uses git-fleximod to manage external repositories.

From your CESM source directory, run:

    cd /glade/u/home/$USER/code/my_cesm_code 
    ./bin/git-fleximod update

Depending on your system configuration, you may be prompted to accept a security certificate. If prompted, accept the certificate permanently. If no prompt appears, that is perfectly normal. During this step, git-fleximod will download the required CESM component models and supporting repositories.

Click here for example output
where `$USER` will be replaced by your user name
./bin/git-fleximod update
          ccs_config up to date.
                 fms up to date.
Recursively checking out submodules of fms
               share up to date.
                cice up to date.
Recursively checking out submodules of cice
                 mom up to date.
Recursively checking out submodules of mom
                cism up to date.
Recursively checking out submodules of cism
               cdeps up to date.
Recursively checking out submodules of cdeps
                 rtm up to date.
                 ww3 up to date.
Recursively checking out submodules of ww3
              mosart up to date.
               cmeps up to date.
          mpi-serial up to date.
         tools/CUPiD up to date.
Recursively checking out submodules of tools/CUPiD
          parallelio up to date.
           mizuroute up to date.
Recursively checking out submodules of mizuroute
               tuv-x up to date.
                 clm up to date.
Recursively checking out submodules of clm
                cime up to date.
Recursively checking out submodules of cime
                 cam up to date.
Recursively checking out submodules of cam
Sparse checkout cam-sima fxsparse ../.sima_phys_utils_sparse_checkout
Successfully checked out             cam-sima at sima0_07_000
Sparse checkout mpas fxsparse ../.mpas_sparse_checkout
Successfully checked out                 mpas at v8.2.1
Sparse checkout cosp2 fxsparse ../.cosp_sparse_checkout
Successfully checked out                cosp2 at v2.1.9
Sparse checkout clubb fxsparse ../.clubb_sparse_checkout
Successfully checked out                clubb at clubb_4ncar_20260109_ddf5110
Sparse checkout ext_co2_cooling fxsparse ../.ext_co2_cooling_sparse_checkout
Successfully checked out      ext_co2_cooling at v1.1
Recursively checking out submodules of src
Recursively checking out submodules of MOM6
              pysect up to date.
Recursively checking out submodules of fates
Recursively checking out submodules of atmos_phys
Recursively checking out submodules of fv3
Recursively checking out submodules of geoschem
Recursively checking out submodules of hemco
Recursively checking out submodules of HEMCO

The directory text /glade/u/home/$USER/code/my_cesm_code is your CESM source workspace ($SRCROOT), which will be used throughout the tutorial.

  • The directory text /glade/u/home/$USER/code/my_cesm_code is your CESM source workspace ($SRCROOT), which will be used throughout the tutorial. as described in the workspaces section.

Congratulations, you have now downloaded the CESM code component of your workspace!!

Evaluate your understanding

You downloaded the CESM code with the instructions above. In which directory is the CESM code? How do you navigate to that directory?

Click here for the solution
If you download CESM with the instructions above, the CESM code is located in:
/glade/u/home/$USER/code/my_cesm_code

To navigate to that directory, use the UNIX command cd:

cd /glade/u/home/$USER/code/my_cesm_code

If you are not familiar with UNIX commands, please review the UNIX chapter of this documentation.