NWP | AI model output as input (IC/LBC) of WRF/MPAS
Introduction
As the field of Numerical Weather Prediction (NWP) rapidly evolves, the integration of AI-driven forecasting models like ECMWF's Pangu-Weather offers incredible speed and efficiency. This post documents a technical workflow where I used the Pangu-Weather model to generate a 10-day forecast and encountered a critical issue when attempting to initialize the Weather Research and Forecasting (WRF) model: the absence of crucial soil temperature and soil moisture variables in the Pangu-Weather GRIB output.
This article outlines the steps taken, the problem encountered, and the solution involving the use of auxiliary data from the ECMWF's operational Integrated Forecasting System (IFS).
Literature review
AI-Driven WRF (2025)
- Xu, H., Zhao, Y., Dajun, Z., Duan, Y., & Xu, X. (2025). Exploring the typhoon intensity forecasting through integrating AI weather forecasting with regional numerical weather model. npj Climate and Atmospheric Science, 8(1), 38.
- we propose an attractive approach by initiating regional Weather Research and Forecasting (WRF) model with Pangu-weather, a state-of-the-art AI weather forecasting system (AI-Driven WRF), whose forecasting power can be further augmented by the implementation of dynamic vortex initialization.

The NWP Workflow: AI Model to WRF Input
The process involves several standard steps in an NWP setup, with the AI model replacing the initial global model forecast:
1. AI Forecast Generation (ECMWF Pangu-Weather)
I utilized the ECMWF implementation of the Pangu-Weather AI model to produce a 10-day forecast.
- Model Used:
ai-models(specifically utilizing thepangu_weather_6.onnxandpangu_weather_24.onnxmodels for 6-hourly and 24-hourly steps). - Time Interval: A full 10-day forecast with output at 6-hour intervals.
Output File: A single large GRIB file named
panguweather.grib.
Key takeaway: The Pangu-Weather model is trained primarily to forecast atmospheric variables like geopotential, wind components, temperature, and specific humidity. It does not natively output the necessary land surface variables (soil temperature and soil moisture) required for the WRF model's
ungribandmetgridsteps.
2. Preparing GRIB Files for WRF
The single 10-day GRIB file needed to be processed for the WRF Preprocessing System (WPS).
Step 2a: Splitting the GRIB file The monolithic
panguweather.gribfile, containing all timesteps, was split into individual GRIB2 files, one for each 6-hour forecast time. This is often necessary for robust processing by the WPS utilities.Method 1: Using CDO (Climate Data Operators)
CDO is the simplest command-line solution and is often pre-installed or easily available in scientific computing environments.
CDO Command:
splitselThe
splitsel,1operator is designed to split a file into one output file per timestep (or more accurately, one file per selection/record). Since IFS GRIB files often have multiple fields (parameters, levels) per timestep, this command works by splitting based on the internal record count.
1
2
3
4# Syntax: cdo -splitsel,N <input_file> <output_prefix>
# N=1 means split after every single record/timestep.
cdo -splitsel,1 input_ifs.grib2 output_timestep_- Output Files: This will generate files named sequentially, like
output_timestep_000001.grib2,output_timestep_000002.grib2, etc.
Step 2b: The
ungribStep Theungrib.exeutility reads the meteorological data from the GRIB files and extracts/interpolates them onto a model-ready intermediate file format (e.g.,AI:YYYY-MM-DD_HH).- Action: Ran
ungrib.exeon the individual Pangu-Weather GRIB files. - Result:
ungribprocessed the atmospheric variables successfully.
- Action: Ran
Step 2c: The
metgridStep Themetgrid.exeutility takes the intermediate files and horizontally interpolates the data onto the user-defined WRF grid domains.- Action: Ran
metgrid.exe. - Result: Successful, but the resulting
met_em.*files were deficient.
- Action: Ran
1 | |
The Critical Problem: Missing Soil Variables
Upon inspecting the met_em.* files generated by metgrid, a crucial issue was identified (often logged as an error or warning during metgrid, or discovered later during the real step):
The met_em files contained only atmospheric variables (geopotential height, temperature, wind, pressure, specific humidity, ...) but were completely missing land surface variables, specifically:
- Soil Temperature (ST000010, etc.)
- Soil Moisture (SM000010, etc.)

The WRF model requires these variables to correctly initialize the land surface physics (Land Surface Model, LSM) and maintain a realistic energy and water balance at the lower boundary. Initializing WRF without them will lead to incorrect surface fluxes, potentially causing model "blow-up" or severe biases in near-surface forecasts.
The Solution: Auxiliary Data Sourcing
The fix requires obtaining the missing soil variables from a reliable source and merging them into the initialization data.
Strategy: Using ECMWF-IFS Operational Data
Since Pangu-Weather is a re-forecast product based on ECMWF training data (ERA5), the logical step is to use the ECMWF's Integrated Forecasting System (IFS) operational analysis or short-range forecast for the same initialization time.
The solution steps are:
- Download Auxiliary Data: Obtain the required soil variables (Soil Temperature and Volumetric Soil Water/Moisture) from the ECMWF's high-resolution operational model (HRES) or reanalysis (ERA5) for the forecast start time.
- Variables: Typically required at four soil levels.
- Separate GRIB Processing: Process this auxiliary IFS GRIB file separately through
ungribandmetgrid.- The IFS data will be processed by WPS to create a set of
met_em.*files containing only the soil variables.
- The IFS data will be processed by WPS to create a set of
- Data Merging (Copy/Overwrite): Use a utility to copy/merge the soil variables from the IFS-derived
met_em.*files into the Pangu-Weather derivedmet_em.*files.
Conceptual Code Snippet (Using NetCDF tools like NCO):
- Generate
met_em_pangu.*(Pangu-Weather, missing soil)- Generate
met_em_ifs_soil.*(IFS, only soil variables)- Merge:
1
2# Example using NCO/NetCDF command to copy variable 'TSLB' (Soil Temp)
ncks -A met_em_ifs_soil.d01.2025-12-11_00:00:00 met_em_pangu.d01.2025-12-11_00:00:00 -v TSLB- Verification: Verify the final, merged
met_em.*files contain all necessary atmospheric (from Pangu) and land surface (from IFS) fields.