Skip to content

Commit 1b81234

Browse files
committed
Updating LULC NCAR HPC documentation
1 parent c37d334 commit 1b81234

1 file changed

Lines changed: 106 additions & 61 deletions

File tree

docs/Users_Guide/lulcncarhpc.rst

Lines changed: 106 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -9,116 +9,161 @@ Running I-WRF on NCAR HPCs with Land Use/Land Cover Change Data
99
Overview
1010
========
1111

12-
Update section with an overview of the following instructions.
12+
The following instructions can be used to run METplus verification for the Land Use/Land Cover Change (LULC) use case of the I-WRF weather simulation framework from the National Center for Atmospheric Research (NCAR) on NCAR High Performance Computing (HPC) platforms. The steps below configure and execute the METplus verification framework using containerized applications with Apptainer (formerly Singularity) to analyze I-WRF LULC simulation output.
13+
14+
The LULC use case examines how changes in land surface characteristics impact weather patterns and atmospheric dynamics through idealized modeling scenarios. METplus provides statistical analysis and evaluation tools to quantify these meteorological impacts, making this verification workflow valuable for studies in urban meteorology, land-atmosphere interactions, and climate change impact assessment.
15+
16+
NCAR HPC systems provide the computational resources needed for efficient METplus processing of large I-WRF datasets. This exercise uses containerized METplus applications, which simplifies the setup work needed to run the verification and ensures consistency across different HPC environments.
17+
18+
It is recommended that you follow the instructions in each section in the order presented to avoid encountering issues during the process. This guide assumes that I-WRF LULC simulations have already been completed and focuses specifically on the METplus verification workflow.
19+
1320

1421
Prepare to Use NCAR HPCs
1522
========================
1623

17-
Update section with instructions on how to set up the system to run i-wrf.
24+
To get started with running METplus verification on NCAR HPC systems, you will need access to one of the supported platforms (Derecho, Casper, or other NCAR computing resources). If you do not already have access, you will need to request an account through the NCAR Computing and Information Systems Laboratory (CISL).
25+
26+
NCAR HPC access is typically provided to researchers affiliated with NCAR, university collaborators, or those with approved allocations. If you need to request access:
1827

19-
Examples include:
28+
* Visit the NCAR CISL user registration page to create an account
29+
* Provide information about your research project and institutional affiliation
30+
* Wait for account approval, which typically takes 1-2 business days
31+
* Once approved, you can log in to the HPC systems using SSH
2032

21-
* Gaining access to the system
22-
* Creating instances
23-
* Managing instances.
33+
Most NCAR HPC systems use a batch job scheduling system for computational work. While this exercise can be run interactively for demonstration purposes, production runs should be submitted through the job scheduler. Refer to the NCAR HPC documentation for specific guidance on your target system.
34+
Once you have access to an NCAR HPC system, you can log in using SSH from your local machine or through NCAR's web-based interfaces where available.
2435

2536
Preparing the Environment
2637
=========================
2738

28-
Load the apptainer module::
39+
With your NCAR HPC account active and you logged in to the system, you can now set up the environment and create the necessary directories to run METplus verification. You will only need to perform these steps once per system, as the directory structure and configuration will remain available for future use.
40+
41+
The following sections instruct you to issue numerous Linux commands in your shell. The commands in each section can be copied and pasted into your shell terminal.
42+
43+
Load Required Modules
44+
---------------------
45+
46+
NCAR HPC systems use environment modules to manage software. Load the Apptainer module which provides the containerization software needed to run METplus::
2947

3048
module load apptainer
3149

32-
Create a working directory in the scratch area::
50+
Define Environment Variables
51+
----------------------------
3352

34-
IWRF_WORK_DIR=${SCRATCH}/iwrf_work
53+
We will be using environment variables throughout this exercise to ensure consistent file paths and resource names. Copy and paste the definitions below into your shell before proceeding::
3554

36-
Create a directory to store the METplus output::
55+
IWRF_WORK_DIR=${SCRATCH}/iwrf_work
56+
LOCAL_OUTPUT_DIR=${IWRF_WORK_DIR}/metplus_out
57+
export APPTAINER_TMPDIR=${TMPDIR}
3758

38-
LOCAL_OUTPUT_DIR=${IWRF_WORK_DIR}/metplus_out
39-
mkdir -p ${LOCAL_OUTPUT_DIR}
59+
Any time you open a new shell session on the HPC system, you will need to reload the apptainer module and redefine these variables before executing the commands that follow.
4060

41-
Create a directory to store temporary Apptainer files
42-
($TMPDIR is set automatically for all users on NCAR HPC machines)::
61+
Create Working Directories
62+
--------------------------
4363

44-
export APPTAINER_TMPDIR=${TMPDIR}
45-
mkdir -p ${APPTAINER_TMPDIR}
64+
The METplus verification process requires specific directory structures to organize input data, configuration files, and output results. Create the main working directory in your scratch space::
4665

47-
Clone the I-WRF GitHub repository to get the configuration files::
66+
mkdir -p ${IWRF_WORK_DIR}
4867

49-
git clone https://github.com/NCAR/i-wrf ${IWRF_WORK_DIR}/i-wrf
68+
Create a directory to store the METplus verification output::
5069

51-
Install Docker and Pull Docker Objects
52-
======================================
70+
mkdir -p ${LOCAL_OUTPUT_DIR}
5371

54-
Update section with instructions on how to install Docker and pull docker images needed.
72+
Create a directory for temporary Apptainer files. The $TMPDIR variable is automatically set on NCAR HPC systems to an appropriate temporary storage location::
5573

56-
Download Data for WRF
57-
=====================
74+
mkdir -p ${APPTAINER_TMPDIR}
5875

59-
Update section with instructions on how to download the data needed to run WRF.
76+
Download Configuration Files
77+
----------------------------
6078

61-
Run WRF
62-
=======
79+
METplus requires configuration files to direct its verification behavior. These are available in the I-WRF GitHub repository. Clone the repository to access the LULC use case configuration::
6380

64-
Update section with instructions on how to run WRF.
81+
git clone https://github.com/NCAR/i-wrf ${IWRF_WORK_DIR}/i-wrf
6582

66-
Run METplus
67-
===========
83+
This creates a local copy of all I-WRF configuration files, including the METplus settings needed for the LULC verification workflow.
84+
85+
Pull Apptainer Objects
86+
======================
6887

69-
Pull the METplus and input data containers from DockerHub. ::
88+
As mentioned above, the METplus software is provided as a containerized image that will run using Apptainer on your NCAR HPC system. Apptainer (formerly Singularity) is the preferred containerization technology on HPC systems, as it provides secure container execution without requiring root privileges. Unlike cloud environments that use Docker directly, NCAR HPC systems use Apptainer to run containerized applications.
89+
90+
The METplus image contains all the necessary software and dependencies to perform verification of I-WRF LULC simulation output. You can "pull" (download) the METplus image from the container registry to your HPC system's storage.
91+
92+
Get the METplus and Data Container Images
93+
-----------------------------------------
94+
95+
You must pull the METplus software container and the input data containers that contain the observational and WRF simulation data for the LULC use case::
7096

7197
apptainer pull ${IWRF_WORK_DIR}/iwrf-metplus.sif docker://ncar/iwrf-metplus:latest
7298
apptainer pull ${IWRF_WORK_DIR}/data-lulc-input-obs.sif docker://ncar/iwrf-data:lulc-input-obs-d03.apptainer
7399
apptainer pull ${IWRF_WORK_DIR}/data-lulc-input-wrf.sif docker://ncar/iwrf-data:lulc-input-wrf-d03.apptainer
74100

75-
Set environment variables to bind directories to the container
76-
77-
* Input data directories for WRF and radar observation input data
78-
* WRF:
79-
* Local: From data-lulc-input-wrf.sif
80-
* Container: /data/input/wrf
81-
* OBS:
82-
* Local: From data-lulc-input-obs.sif
83-
* Container: /data/input/obs
84-
* Config directory containing METplus use case configuration file
85-
* Local: ${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/METplus
86-
* Container: /config
87-
* Plot script directory containing METplotpy configuration files
88-
* Local: ${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/Visualization
89-
* Container: /plot_scripts
90-
* Output directory to write output
91-
* Local: ${IWRF_WORK_DIR}/metplus_out
92-
* Container: /data/output
93-
* Apptainer temp directory
94-
* Local: ${APPTAINER_TMPDIR}
95-
* Container: ${APPTAINER_TMPDIR}
96-
97-
::
98-
99-
LOCAL_METPLUS_CONFIG_DIR=${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/METplus
100-
LOCAL_PLOT_SCRIPT_DIR=${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/Visualization
101+
These commands download three container images: the METplus software, the observational data, and the WRF simulation data. The process may take several minutes depending on your network connection.
102+
103+
Run METplus
104+
===========
105+
106+
After the container images have been downloaded, you can run the METplus verification to compare the I-WRF LULC simulation results against observational data and generate statistical verification results and visualization plots. This process involves configuring the data bindings and executing the verification workflow for two meteorological variables.
107+
108+
Configure Container Data Bindings
109+
---------------------------------
110+
111+
METplus requires access to input data, configuration files, and output directories. Apptainer uses bind mounts to make local directories and container images available inside the running container. Set up the environment variables that define these data bindings.
112+
113+
First, define the local directory paths for configuration and visualization scripts::
114+
115+
LOCAL_METPLUS_CONFIG_DIR=${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/METplus
116+
LOCAL_PLOT_SCRIPT_DIR=${IWRF_WORK_DIR}/i-wrf/use_cases/Land_Use_Land_Cover/Visualization
117+
118+
Next, configure the Apptainer bind mounts. This environment variable tells Apptainer how to map local directories and container images to paths inside the running container::
101119

102120
export APPTAINER_BIND="${IWRF_WORK_DIR}/data-lulc-input-obs.sif:/data/input/obs:image-src=/,${LOCAL_METPLUS_CONFIG_DIR}:/config,${IWRF_WORK_DIR}/data-lulc-input-wrf.sif:/data/input/wrf:image-src=/,${LOCAL_OUTPUT_DIR}:/data/output,${LOCAL_PLOT_SCRIPT_DIR}:/plot_scripts,${APPTAINER_TMPDIR}:${APPTAINER_TMPDIR}"
103121

104-
Execute the run_metplus.py command inside the container to run the use case
122+
This configuration provides the container with access to:
123+
124+
* Observational data from the ``data-lulc-input-obs.sif`` container image at ``/data/input/obs``
125+
* WRF simulation data from the ``data-lulc-input-wrf.sif`` container image at ``/data/input/wrf``
126+
* METplus configuration files from the I-WRF repository at ``/config``
127+
* Visualization script files for generating plots at ``/plot_scripts``
128+
* Output directory for writing verification results at ``/data/output``
129+
* Temporary directory for Apptainer operations
105130

106-
* Accumulated Precipitation::
131+
Execute METplus Verification
132+
----------------------------
133+
134+
The LULC use case includes verification for two meteorological variables: accumulated precipitation and radar reflectivity. Each verification is run separately using its own METplus configuration file.
135+
136+
Run the accumulated precipitation verification::
107137

108138
apptainer exec ${IWRF_WORK_DIR}/iwrf-metplus.sif /metplus/METplus/ush/run_metplus.py /config/GridStat_apcp_lulc.conf
109139

110-
* Reflectivity::
140+
This process compares simulated precipitation accumulation against observational data and generates statistical metrics. Progress information is displayed while the verification is performed.
141+
142+
Run the reflectivity verification::
111143

112144
apptainer exec ${IWRF_WORK_DIR}/iwrf-metplus.sif /metplus/METplus/ush/run_metplus.py /config/GridStat_refc_lulc.conf
113145

114-
Check that the output data was created locally::
146+
This process evaluates the model's ability to simulate radar reflectivity patterns compared to observed radar data.
147+
148+
Both verification processes use GridStat, which computes grid-to-grid verification statistics. The tools generate comprehensive statistical output including bias, correlation, and skill scores that quantify the model's performance.
149+
150+
Verify Output Generation
151+
------------------------
152+
153+
After both METplus runs complete successfully, you can verify that the output files were created properly.
154+
155+
Check that the GridStat verification output was generated::
115156

116157
ls ${LOCAL_OUTPUT_DIR}/grid_stat/* -1
117158

118-
Check that the METplotpy plots were created locally::
159+
This should show directories containing statistical output files in text format that can be viewed and analyzed.
160+
161+
Check that the METplotpy visualization plots were created locally::
119162

120163
ls ${LOCAL_OUTPUT_DIR}/met_plot/*/*.png -1
121164

165+
This should display a list of PNG image files containing plots and graphics that visualize the verification results. These plots provide graphical representations of the statistical comparisons between the I-WRF LULC simulations and observational data.
166+
122167
Visualize the Results
123168
=====================
124169

0 commit comments

Comments
 (0)