CCPP and SCM Online Tutorial | Download and Build > Option 1 Using a pre-configured platform

Option 1. Using a computational platform with the required software stack

The SCM can build on most modern UNIX-based operating systems, including both MacOS and Linux. It has a few prerequisite libraries and software, including a Fortran compiler compatible with the FORTRAN-08 standard, Python version 3.8 or later, CMake version 3.14 or later, and a few external libraries which may need to be installed:

  • NetCDF-c/NetCDF-FORTRAN
  • NCEP libraries BACIO, SP, and W3EMC
  • Python modules f90nml and netcdf4

This tutorial will assume that you already have these prerequisites installed. Machines that already have the prerequisite software include:

  • NCAR Derecho
  • NOAA Hera, Jet
  • MSU Orion, Hercules

For more details on software prerequisites, including instructions for building on a custom platform, see the SCM Users Guide.

Obtaining the code

The source code for the CCPP and SCM is provided through GitHub.com. This tutorial accompanies the v7.0.0 release tag, which contains the tested and supported version for general use. 

Clone the the v7 release code using

cd $SCM_WORK
git clone --recursive -b release/public-v7 https://github.com/NCAR/ccpp-scm

The recursive option in this command clones the release/public-v7 branch of the NCAR authoritative SCM repository (ccpp-scm) and all submodules/sub-repositories (ccpp-physics, ccpp-framework, and CMakeModules). 

Setting up the environment in a preconfigured platform

If using a preconfigured platform, it may be necessary to run on a compute node.

On Hera:

salloc -q debug -t 0:30:00 --nodes=1 -A your_account_name

On Derecho:

export PBS_ACCOUNT_DERECHO=your_account_number
qinteractive
Note: If running on a compute node, you may need to re-define the $SCM_WORK environment variable.

Computational platforms that meet the system requirements and have the prerequisite software prebuilt and installed in a central location are referred to as preconfigured platforms. Examples of preconfigured platforms are the Hera NOAA high-performance computing machine and the NCAR Derecho system (using the Intel and GNU compilers). The SCM repository contains modulefiles for all pre-configured platforms that can be loaded to set up the environment as needed. These modules set up the needed environment variables, particularly $PATH, so that the SCM will build correctly.

To load the needed module, ensure you are in the top-level ccpp-scm directory, and run the following commands:

cd $SCM_WORK/ccpp-scm
module purge
module use scm/etc/modules/
module load [machine]_[compiler]

The last command will depend on which machine you are on and what compiler you are using. For example on the NCAR Derecho machine for GNU compilers:

module load derecho_gnu

Setting up the environment in a non-preconfigured platform

If you are not using a preconfigured platform, you need to install spack-stack yourself following the instructions found in Section 4.2.4 of the CCPP SCM User and Technical Guide v7-0-0

After performing the installation and setting environment variables bacio_ROOT, sp_ROOT, and w3nco_ROOT to the location where spack-stack is installed, continue following the instructions in this tutorial.

Staging additional datasets

You need to download the lookup tables (large binaries, 324 MB) for the Thompson microphysics package, the GOCART climatological aerosols, and other datasets.  The aerosol data is very large (~12 GB) and is needed when the first digit of the aerosol flag (iaer) in the physics namelist is =1, e.g. GFS_v17_p8_ugwpv1 and HRRR_gf suites.

cd $SCM_WORK/ccpp-scm
./contrib/get_all_static_data.sh
./contrib/get_thompson_tables.sh
./contrib/get_aerosol_climo.sh

Building the code

Following the commands below, you will run cmake to query system parameters, execute the CCPP pre-build script to match the physics variables (between what the host model – SCM – can provide and what is needed by physics schemes in the CCPP), and build the physics caps needed to use them. Subsequently, you will run make to build the SCM executable.

cd $SCM_WORK/ccpp-scm/scm
mkdir -p bin && cd bin
cmake ../src
make -j4

A successful build will produce the executable file $SCM_WORK/ccpp-scm/scm/bin/scm