Download CESM#

Having explored the CESM Github pages we are going to return to the Cheyenne terminal window to download the Tutorial branch tag code into your own personal CESM workspace. Follow the three steps, below, to setup your CESM workspace.

Downloading and setting up the Tutorial branch tag is an important step as this will be the code workspace we will be using throughout the rest of the Tutorial. If you have problems here please ask for help.

Step 1. Download CESM Code with Git Clone#

We will use the CESM release version `release-cesm2.1.4` for use in this tutorial.

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

Change the current directory to the code workspace directory:
cd /glade/work/$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 release-cesm2.1.4

Note that while we named the downloaded code my_cesm_code, you can name it anything you want and for future downloads outside this tutorial it can be helpful to label the code for the release you are using for your experiments.

Click here for example output
Note: switching to 'release-cesm2.1.4'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 4003996 Fix release number

Versions#

One thing you will need to determine is what version of the CESM code you should use. Some things to consider when making that decision include:

  • What versions of the code are supported scientifically or technically?

  • Things you may want to consider are what sort of model features do you need and what versions of the model are these available in?

  • If you want to compare your sensitivity experiment against a community experiment (e.g. CESM2-LE) then you should use the same version of the code.

More information can be found on the CESM Models website.

If you want to check which other release versions are available, you can use the command:

git tag --list 'release-cesm2*'    
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.2.0
release-cesm2.2.1

Step 2. Download the Component Models with checkout_externals#

The CESM code downloaded with the branch tag does not include all of the code and support for the component models. These are developed and maintained in other Github repositories. To include all of the component models into your code workspace you need to download them as an additional step. The checkout_externals tool is located in manage_externals directory in the my_cesm_code code directory.

Exercise: Run the `checkout_externals` command to download all the component models:
./manage_externals/checkout_externals

*Note: If you get a message about accepting a certificate permanently or temporarily, accept the certificate permanently. If you do not get this message, do not worry, you are still on track!
Click here for example output
where `$USER` will be replaced by your user name
Processing externals description file : Externals.cfg (/glade/work/$USER/code/my_cesm_code)
Checking local status of required & optional components: cam, cice, cime, cism, clm, mosart, pop, rtm, ww3, 
Checking out externals: cime, cam, Processing externals description file : Externals_CAM.cfg (/glade/work/$USER/code/my_cesm_code/components/cam)
Checking out externals: chem_proc, carma, clubb, cosp2, 
cice, cism, Processing externals description file : Externals_CISM.cfg (/glade/work/$USER/code/my_cesm_code/components/cism)
Checking out externals: source_cism, 
clm, Processing externals description file : Externals_CLM.cfg (/glade/work/$USER/code/my_cesm_code/components/clm)
Checking out externals: fates, ptclm, 
mosart, pop, Processing externals description file : Externals_POP.cfg (/glade/work/$USER/code/my_cesm_code/components/pop)
Checking out externals: cvmix, marbl, 
rtm, ww3, 
  • The path /glade/work/$USER/code/my_cesm_code is your workspace SRCROOT, 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/work/$USER/code/my_cesm_code

To navigate to that directory, use the command:

cd /glade/work/$USER/code/my_cesm_code