Download CESM#

You are going to download the CESM code from github into your own personal CESM workspace. Follow the three steps, below, to setup your CESM Code workspace.

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

Downloading the CESM code 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: Create CESM Code Directory#

Create a workspace location where you can put your CESM code on the derecho glade file system. In all exercises in this tutorial $USER is a placeholder and you should use your NCAR HPC login name when completing the exercise.

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

Step 2. Download CESM Code with Git Clone#

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/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 release-cesm2.1.5

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.5'.

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 7a6c5b0 Update for cesm2.1.5-rc.01

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.1.5
release-cesm2.2.0
release-cesm2.2.1
release-cesm2.2.2

Step 3. Download the Component Models with checkout_externals#

The CESM code downloaded with the branch tain the previous step 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:
cd /glade/u/home/$USER/code/my_cesm_code
./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/u/home/$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/u/home/$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/u/home/$USER/code/my_cesm_code/components/cism)
Checking out externals: source_cism, 
clm, Processing externals description file : Externals_CLM.cfg (/glade/u/home/$USER/code/my_cesm_code/components/clm)
Checking out externals: fates, ptclm, 
mosart, pop, Processing externals description file : Externals_POP.cfg (/glade/u/home/$USER/code/my_cesm_code/components/pop)
Checking out externals: cvmix, marbl, 
rtm, ww3, 
  • The path /glade/u/home/$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/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.