Claude Code Tools

wrf-install

official

Claude Code skill: complete WRF+WPS compilation and installation from source

Version
1.0.1
Last Updated
2026-05-27
Source
official

wrf-install

A Claude Code Skill for complete WRF+WPS compilation and installation from source.

Aligned with the UCAR Official Compilation Tutorial.

What It Does

Builds a complete WRF (Weather Research and Forecasting) modeling environment from source:

  • Compiles 6 dependency libraries (netCDF-C, netCDF-Fortran, MPICH, zlib, libpng, Jasper)
  • Compiles WRF v4.7.1 (ARW core, dmpar)
  • Compiles WPS v4.6.0 (preprocessing system)
  • Installs GEOG static geography data
  • Verifies each component after installation
  • Skips already-built components on re-run

Install

npx wrf-install

Or via Claude Code plugin manager:

claude plugins install wrf-install

Quick Start

  1. Download the 9 required source packages (see Download Packages below)
  2. Place them in a single directory
  3. In Claude Code, type: /wrf-install
  4. When prompted, provide the path to your package directory
  5. The Skill auto-detects if you’re installing locally or on a remote server
  6. Wait ~2 hours for the full build

Works on both local Linux machines and remote servers. The Skill adapts download and file operations automatically.

Download Packages

Download all 9 packages with a single command:

# From GitHub Release (fastest, most reliable)
export GITHUB_RELEASE_REPO="your-username/wrf-install"
bash scripts/download_packages.sh ~/Downloads/wrf-packages

# Or specify the repo directly:
bash scripts/download_packages.sh ~/Downloads/wrf-packages "your-username/wrf-install"

The script tries GitHub Release first, then falls back to original source URLs. If you haven’t set up a Release, it will download directly from the original sources.

Option B: Manual Download

Download each file individually from the table below and place them all in one directory.

Required Packages

#FileSizeDownload
1WRFV4.7.1.tar.gz55MBGitHub
2WPS-4.6.0.tar.gz5MBGitHub
3netcdf-c-4.7.2.tar.gz6MBUnidata
4netcdf-fortran-4.5.2.tar.gz2MBUnidata
5mpich-3.0.4.tar.gz12MBMPICH
6zlib-1.2.11.tar.gz0.6MBzlib
7libpng-1.2.50.tar.gz0.8MBSourceForge
8jasper-1.900.1.tar.gz1.5MBUVic
9geog_low_res_mandatory.tar.gz500MBUCAR

Setting Up a GitHub Release (for repo owners)

To host these packages on GitHub for faster downloads:

# 1. Download the packages (if you don't have them)
bash scripts/download_packages.sh ~/Downloads/wrf-packages

# 2. Create a Release and upload assets
gh release create v1.0.0 \
    --title "WRF+WPS Source Packages v1.0.0" \
    --notes "Source packages for WRF v4.7.1 + WPS v4.6.0 installation." \
    ~/Downloads/wrf-packages/*.tar.gz

After the Release is created, users can set GITHUB_RELEASE_REPO to download from it.

Installation Directory

Default: $HOME/Build_WRF

To customize, set before invoking:

export WRF_INSTALL_DIR=/your/custom/path

System Requirements

  • Linux (Ubuntu 20.04+ recommended)
  • gcc, gfortran, cpp (install via apt install gcc gfortran cpp)
  • ~50GB free disk space
  • ~2 hours build time

Environment Check

Before starting, run the environment check script:

bash scripts/check_env.sh

Output Structure

After installation:

$WRF_INSTALL_DIR/
├── LIBRARIES/
│   ├── netcdf/       # netCDF-C + netCDF-Fortran
│   ├── mpich/        # MPI
│   └── grib2/        # zlib, libpng, jasper
├── WRF/              # WRF source + compiled binaries
│   ├── main/         # wrf.exe, real.exe, ndown.exe
│   └── test/em_real/ # Run directory
├── WPS/              # WPS source + compiled binaries
│   ├── geogrid.exe
│   ├── ungrib.exe
│   └── metgrid.exe
├── WPS_GEOG/         # Static geography data
│   └── geog/
└── logs/             # Compilation logs

What’s Next

After installation, verify everything works:

# 1. Run the post-install test
bash scripts/test_install.sh

# 2. Test WPS with the example namelist
cd $WRF_INSTALL_DIR/WPS
cp ../wrf-install/examples/namelist.wps.example namelist.wps
# Edit geog_data_path to match your install
./geogrid.exe  # Should print "Successful completion"

# 3. Get ERA5 data and run a real case
# See: https://www2.mmm.ucar.edu/wrf/OnLineTutorial/

Example namelist files are in the examples/ directory.

Troubleshooting

ProblemLikely CauseFix
geogrid.exe says “geog_data_path must be specified”namelist.wps missing or incorrectSet geog_data_path in &geogrid to your GEOG directory
real.exe runs but no wrfinput_d01 producedLD_LIBRARY_PATH not set in SSH sessionexport LD_LIBRARY_PATH=$WRF_INSTALL_DIR/LIBRARIES/netcdf/lib:$LD_LIBRARY_PATH
Your versions of Fortran and NETCDF are not consistentSystem netCDF found before custom buildRebuild netCDF-C + netCDF-Fortran, ensure custom bin/ is first in PATH
NoahMP submodule files not populating WRF directories./clean -a destroyed git symlinksRe-run Phase 2.5 of the Skill
fatal error: netcdf.h during compileNETCDF env var not setexport NETCDF=$WRF_INSTALL_DIR/LIBRARIES/netcdf
mpirun not foundMPICH not in PATHexport PATH=$WRF_INSTALL_DIR/LIBRARIES/mpich/bin:$PATH
Compilation takes too long-j 2 too conservativeIncrease make -j 4 or -j 8 if you have more cores

Version Compatibility

ComponentVersionMin OS
WRF4.7.1Ubuntu 20.04+
WPS4.6.0Ubuntu 20.04+
netCDF-C4.7.2
netCDF-Fortran4.5.2
MPICH3.0.4
gcc/gfortran9.x ~ 13.x

WRF 4.7.1 ↔ WPS 4.6.0 is the tested compatible pair. Newer versions may work but have not been verified.

License

MIT - See LICENSE

Contributing

Issues and pull requests welcome. Please ensure any changes to the Skill maintain alignment with the UCAR official tutorial.