wrf-install
v1.0.1
Published
Claude Code skill: complete WRF+WPS compilation and installation from source
Maintainers
Readme
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-installOr via Claude Code plugin manager:
claude plugins install wrf-installQuick Start
- Download the 9 required source packages (see Download Packages below)
- Place them in a single directory
- In Claude Code, type:
/wrf-install - When prompted, provide the path to your package directory
- The Skill auto-detects if you're installing locally or on a remote server
- 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
Option A: One-Click Script (Recommended)
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
| # | File | Size | Download | |---|------|------|----------| | 1 | WRFV4.7.1.tar.gz | 55MB | GitHub | | 2 | WPS-4.6.0.tar.gz | 5MB | GitHub | | 3 | netcdf-c-4.7.2.tar.gz | 6MB | Unidata | | 4 | netcdf-fortran-4.5.2.tar.gz | 2MB | Unidata | | 5 | mpich-3.0.4.tar.gz | 12MB | MPICH | | 6 | zlib-1.2.11.tar.gz | 0.6MB | zlib | | 7 | libpng-1.2.50.tar.gz | 0.8MB | SourceForge | | 8 | jasper-1.900.1.tar.gz | 1.5MB | UVic | | 9 | geog_low_res_mandatory.tar.gz | 500MB | UCAR |
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.gzAfter 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/pathSystem 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.shOutput 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 logsWhat'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
| Problem | Likely Cause | Fix |
|---------|-------------|-----|
| geogrid.exe says "geog_data_path must be specified" | namelist.wps missing or incorrect | Set geog_data_path in &geogrid to your GEOG directory |
| real.exe runs but no wrfinput_d01 produced | LD_LIBRARY_PATH not set in SSH session | export LD_LIBRARY_PATH=$WRF_INSTALL_DIR/LIBRARIES/netcdf/lib:$LD_LIBRARY_PATH |
| Your versions of Fortran and NETCDF are not consistent | System netCDF found before custom build | Rebuild netCDF-C + netCDF-Fortran, ensure custom bin/ is first in PATH |
| NoahMP submodule files not populating WRF directories | ./clean -a destroyed git symlinks | Re-run Phase 2.5 of the Skill |
| fatal error: netcdf.h during compile | NETCDF env var not set | export NETCDF=$WRF_INSTALL_DIR/LIBRARIES/netcdf |
| mpirun not found | MPICH not in PATH | export PATH=$WRF_INSTALL_DIR/LIBRARIES/mpich/bin:$PATH |
| Compilation takes too long | -j 2 too conservative | Increase make -j 4 or -j 8 if you have more cores |
Version Compatibility
| Component | Version | Min OS | |-----------|---------|--------| | WRF | 4.7.1 | Ubuntu 20.04+ | | WPS | 4.6.0 | Ubuntu 20.04+ | | netCDF-C | 4.7.2 | — | | netCDF-Fortran | 4.5.2 | — | | MPICH | 3.0.4 | — | | gcc/gfortran | 9.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.
