Building CCPP-SCM

Overview

Teaching: 0 min
Exercises: 0 min
Questions
  • How do I setup the SCM?

Objectives

You have now downloaded all the model components. Let’s take a look: From your /home/username/classes/clim670/ccpp-scm-6.0 directory, see what is there.

$ ls

Organization of the CCPP-SCM Directory

Using existing libraries

The Python environment must provide the f90nml module for the SCM scripts to function. Users can test if f90nml is installed using this command in the shell:

$ python -c "import f90nml"

If f90nml is installed, this command will succeed silently, otherwise an ImportError: No module named f90nml will be printed to screen. To install the f90nml (v0.19) Python module, use:

$ module load anaconda3
$ pip install --user f90nml ==0.19

Platform-specific scripts are provided to load modules and set the user environment for preconfigured platforms. These scripts load compiler modules (Fortran 2008-compliant), the NetCDF module, Python environment, etc. and set compiler and environment variables.

$ cd /home/username/classes/clim670/ccpp-scm-6.0/scm/etc/
$ ls 

Hopper is not one of the preconfigured platforms. To get the corresponding file for Hopper:

$ cp /home/cstan/classes/clim670/ccpp-scm/scm/etc/Hopper_setup* . 

Let’s take a look: From your /home/username/classes/clim670/ccpp-scm-6.0/scm/etc/ directory, see what is there.

$ ls

Now you have two new files that will configure the building environmeent for Hopper. One can be used for the t/csh shell and the other for the bash shell. From the top-level code directory (ccpp-scm-6.0), source the bash script for Hopper:

$ cd ../../
$ source scm/etc/Hopper_setup_gnu.sh

Ignore the warnings.

The first step in compiling the CCPP and SCM is to properly setup your user environment as described in sections above. The second step is to download the lookup tables and other large datasets (large binaries, <1 GB) needed by the physics schemes and place them in the correct directory. I have downloaded these files and you will create symbolic links:

$ cd /home/username/classes/clim670/ccpp-scm-6.0/scm/data/
$ ln -fs /home/cstan/classes/clim670/ccpp-scm/scm/data/comparison_data/
$ ln -fs /home/cstan/classes/clim670/ccpp-scm/scm/data/physics_input_data/
$ ln -fs /home/cstan/classes/clim670/ccpp-scm/scm/data/processed_case_input/
$ ln -fs /home/cstan/classes/clim670/ccpp-scm/scm/data/raw_case_input/

Above were the one-time setup setps, now we move on to the steps you will do everytime to setup a new model experiment and run it.

  1. From the top level code-directory (ccpp-scm-6.0), change directory to the top-level SCM directory:
$ cd scm
  1. Make a build directory and change into it
$ mkdir bin
$ cd bin
  1. Invoke cmake on the source code
$ cmake ../src 

This will take a while.

What happened when we ran cmake?

We are now ready to compile. This step will create the executable.

$ make 

What happened when we ran make?

Now what?

If your compilation has completed, then you are ready to run the case.

Key Points