top of page

Part-4 | Preprocessing Input Data using WPS and Running the WRF Model

  • Writer: Subhadip Datta
    Subhadip Datta
  • Feb 11
  • 2 min read

In this part of the blog series, we will walk through the preprocessing steps and execution of the Weather Research and Forecasting (WRF) Model using NCEP GDAS Final Analysis (ds083.3) data for the period 2025-02-01 00:00 to 2025-02-10 06:00.

We assume that WPS (WRF Preprocessing System) and WRF Model are already installed and properly configured.


I covered namelist.wps and namelist.input file configurations in separate blogs to keep this post focused on execution. Follow those blogs before go though those steps.


 


Step 1: Running WPS

Navigate to the WPS directory:

cd ~/WPS

Step 1.1: Running Geogrid

Execute the geogrid.exe program to generate geographical data:

./geogrid.exe

⚠️ If an error occurs, check the namelist.wps file and ensure that the domain configurations are correctly set.

Step 1.2: Linking GRIB Files

Link the input GRIB2 data files from the NCEP GDAS-FNL dataset:

./link_grib.csh ../INPUT_DATA/fnl_2025*.grib2

Set up the Variable Table (Vtable) for GDAS-FNL:

ln -sf ungrib/Variable_Tables/Vtable.GFS Vtable

Step 1.3: Running Ungrib

Execute the ungrib.exe program to extract meteorological fields from GRIB2 files:

./ungrib.exe

⚠️ If an error occurs, verify that the correct Vtable has been linked and that the input GRIB2 files exist in the specified directory.

Step 1.4: Running Metgrid

Run metgrid.exe to interpolate meteorological data onto the WRF model grids:

./metgrid.exe

⚠️ If an error occurs, ensure that namelist.wps is correctly configured and the previous steps completed successfully.

Step 2: Running the WRF Model

Navigate to the WRF run directory:

cd ../WRF/run

Step 2.1: Linking Meteorological Data

Link the preprocessed meteorological files (met_em.d0*.nc) to the WRF run directory:

ln -sf ../../MGRID_OUT/met_em* .

Step 2.2: Running the Real Program

Execute the real.exe program to generate initial and boundary conditions:

mpirun -np 4 ./real.exe

After execution, check the rsl.error.0000 file to ensure success:

tail rsl.error.0000

⚠️ If errors appear, check the namelist.input file and confirm that the time periods and domains match the WPS configuration.

Step 2.3: Running the WRF Model

Run wrf.exe for numerical weather prediction:

mpirun -np 8 ./wrf.exe

⚠️ If the process is killed, there might be a memory allocation issue. Consider reducing the number of processors or increasing memory allocation in WSL.

Step 3: Configuring WSL for Memory and CPU Allocation

If using WSL (Windows Subsystem for Linux), ensure the .wslconfig file is optimized for your system. Edit or create the file at:

C:/Users/<your_username>/.wslconfig

Add the following settings based on your system's configuration:

[wsl2]
memory=25GB
processors=10
swap=150GB

🔄 Restart WSL and rerun WRF:

cd WRF/run
mpirun -np 8 ./wrf.exe
tail rsl.error.0000

 

Final Thoughts

By following these steps, you have successfully preprocessed input data and executed the WRF Model. If errors persist, check:

  • namelist.wps (for domain and data issues in WPS)

  • namelist.input (for incorrect physics, time settings, or boundary conditions in WRF)

  • WSL memory settings (if running on Windows)

Stay tuned for upcoming blogs covering detailed configurations of namelist.wps and namelist.input to fine-tune your WRF simulations.

Recent Posts

See All

Comments


©2024 by Subhadip Datta. Powered and secured by Wix

bottom of page