Hwm93
NASA Horizontal Wind Model HWM93 in Python and Matlab
Install / Use
/learn @space-physics/Hwm93README
HWM93 in Python
NASA Horizontal Wind Model HWM93 in Python ≥ 3.6

Works with many Fortran compilers, including:
- Gfortran ≥ 5
- Intel
ifort - PGI
pgf90 - Nvidia
flang
Install
A Fortran compiler such as gfortran is needed.
We use f2py (part of numpy) to seamlessly use Fortran libraries from Python.
If you don't have a Fortran compiler, here is how to install Gfortran:
-
Linux:
apt install gfortran -
Mac:
brew install gcc -
pip install -e .
test by
pytest -sv
Windows
If you get ImportError on Windows for the Fortran module, try from the hwm93 directory:
del *.pyd
python setup.py build_ext --inplace --compiler=mingw32
Usage
HWM93 can be used from the command line or as an imported Python module in other programs. Matlab also can use HWM93.
Command line
python RunHWM93.py -h
Write data to NetCDF (HDF5) with -o option.
import module
import hwm93
from datetime import datetime
winds = hwm93.run(t=datetime(2017,11,12,8), altkm=150.,
glat=65., glon=-148., f107a=150, f107=150, ap=4)
winds is an xarray.Dataset
<xarray.Dataset>
Dimensions: (alt_km: 1)
Coordinates:
* alt_km (alt_km) float64 150.0
Data variables:
meridional (alt_km) float64 4.827
zonal (alt_km) float64 -20.5
Attributes:
time: 2017-11-12T08:00:00
glat: 65.0
glon: -148.0
If you want just a single variable, say
print(winds.zonal.values)
Matlab
You can import this Python module from Matlab as in hwm93.m.
Notes
[Optional] Fortran-only use
Most users don't need this.
meson build
meson test -C build
or
f2py -c src/hwm93_sub.f -m hwm93 only: gws5 :
Reference
Original A. E. Hedin Fortran 77 HWM93 code
Related Skills
node-connect
337.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
claude-opus-4-5-migration
83.2kMigrate prompts and code from Claude Sonnet 4.0, Sonnet 4.5, or Opus 4.1 to Opus 4.5
frontend-design
83.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
model-usage
337.4kUse CodexBar CLI local cost usage to summarize per-model usage for Codex or Claude, including the current (most recent) model or a full model breakdown. Trigger when asked for model-level usage/cost data from codexbar, or when you need a scriptable per-model summary from codexbar cost JSON.
