3. Build the Medium-Range Weather (MRW) Application
The Unified Forecast System (UFS) Medium-Range Weather (MRW) Application is an umbrella repository consisting of a number of different components housed in external repositories. Once the MRW App is configured and built, users can generate predictions of atmospheric behavior out to about two weeks.
This chapter walks users through how to build and run the “out-of-the-box” case for the MRW App. However, the steps are relevant to any MRW Application experiment and can be modified to suit users’ goals. The “out-of-the-box” MRW App case builds a weather forecast for _____DATES_____. The forecast uses the ___________ domain, the Global Forecast System (GFS) version 16 physics suite (FV3_GFS_v16 CCPP), and FV3-based GFS raw external model data for initialization.
Attention
All UFS applications support four platform levels. The steps described in this chapter will work most smoothly on preconfigured (Level 1) systems. On Level 1 systems, all of the required libraries for building community releases of UFS models and applications are available in a central location. This guide can serve as a starting point for running the MRW App on other systems, too, but users may need to perform additional troubleshooting.
The steps required for building the MRW App are as follows:
3.1. Install spack-stack
Attention
Skip the spack-stack installation if working on a Level 1 system (e.g., Cheyenne, Hera, Orion, NOAA Cloud); spack-stack is already installed there.
Definition: spack-stack is a repository that provides a Spack-based method for building the software stack required to run numerical weather prediction (NWP) tools such as the MRW App and other UFS applications. spack-stack uses the Spack package manager along with custom Spack configuration files and Python scripts to simplify installation of the libraries required to run various applications.
3.1.1. Background
The UFS Weather Model draws on over 50 code libraries to run its applications, including the MRW Application. These libraries range from libraries developed in-house at NOAA (e.g., NCEPLIBS, FMS) to libraries developed by NOAA’s partners (e.g., PIO, ESMF) to truly third party libraries (e.g., NETCDF). Individual installation of these libraries is not practical, so the spack-stack was developed as a central installation system to ensure that the infrastructure environment across multiple platforms is as similar as possible. Installation of the spack-stack is required to run the MRW App.
3.1.2. Instructions
Users working on systems that fall under Support Levels 2-4 will need to install spack-stack the first time they try to build applications (such as the MRW App) that depend on it. Users can either build the spack-stack on their local system or use the centrally maintained stacks on each HPC platform if they are working on a Level 1 system. For a detailed description of installation options, see :ref:`Installing spack-stack <InstallBuildSpackStack>`.
After completing installation, continue to the next section.
3.2. Download the UFS MRW Application Code
The MRW Application source code is publicly available on GitHub. To download the MRW App, clone the master branch of the repository:
git clone -b master https://github.com/ufs-community/ufs-mrweather-app.git
The cloned repository contains the configuration files and sub-directories shown in Table 3.1 below.
File/Directory Name |
Description |
|---|---|
Externals.cfg |
Includes tags pointing to the correct version of the external GitHub repositories/branches used in the MRW App. |
LICENSE.md |
CC0 license information |
README.md |
Getting Started Guide |
build_global-workflow.sh |
Script to build the global workflow for the MRW App. |
describe_version |
Script for describing the CESM version and any local modifications |
docs |
Contains release notes, documentation, and User’s Guide |
manage_externals |
Utility for checking out external repositories |
plotting_scripts |
Scripts and instructions for plotting the results of a forecast in order to visually check the results for 2-m temperature, hourly precipitation, cloud cover, and 10-m wind at a user inputted time range. |
3.3. Check Out External Components
The MRW App relies on the global workflow and its components, detailed in Section 5 of this User’s Guide. Each component has its own repository. Users must run the checkout_externals script to collect the individual components of the MRW App from their respective git repositories. The checkout_externals script uses the configuration file Externals.cfg in the top level directory of the MRW App to clone the correct tags (code versions) of the external repositories listed in Section 1.4.1 into the appropriate directories under the global-workflow and src directories.
Run the executable that pulls in MRW App components from external repositories:
Checkout the global workflow:
cd ufs-mrweather-app
./manage_externals/checkout_externals
Determine whether checkout of externals was successful using:
./manage_externals/checkout_externals -S
3.4. Set Up the Environment and Build the Executables
The MRW App requires certain directories to hold experiment input and output. For
Set-up (uncoupled, free-forecast mode w/ cold-start initial conditions)
Build UFS model and global-workflow components
sh build_global-workflow.sh [-c]
Note
Only use the -c option to compile for coupled UFS; requires different physics packages and APP argument when running setup_expt.py in step 5.