The RRTMGP.jl package is a Julia implementation of the radiative transfer
solver RTE (Radiative Transfer for Energetics) and the RRTMGP (RRTM for General
circulation model applications—Parallel) correlated-k gas optics
(Pincus et al., 2019), based on the
reference Fortran implementation
rte-rrtmgp. It computes
longwave and shortwave radiative fluxes and heating rates for clear, cloudy,
and aerosol-laden atmospheres, and is the radiation scheme of the
CliMA Earth System Model.
| Documentation | |
| Version | |
| License | |
| Tests | |
| Code Coverage | |
| Downloads |
using Pkg
Pkg.add("RRTMGP")The standalone front door provides a quick start. A gray (single-band) atmosphere uses analytic formulas:
using RRTMGP
out = RRTMGP.solve_gray(Float64; nlay = 60, ncol = 1)
out.net # net flux at each level [W/m²]
out.heating_rate # radiative heating rate at each layer [K/s]For the full correlated-k gas optics, build an idealized clear-sky profile
and solve it (the lookup tables are downloaded automatically; loading
NCDatasets activates them):
using RRTMGP, NCDatasets
profile = RRTMGP.standard_atmosphere(Float64; kind = :tropical)
out = RRTMGP.solve(profile)
out.lw_up[end, 1] # outgoing longwave radiation at the top of the atmosphere [W/m²]
out.heating_rate # radiative heating rate at each layer [K/s]Climate models construct an RRTMGPSolver once, write their state through the
getter contract, and call
update_fluxes!(solver) every radiation step:
solver = RRTMGP.RRTMGPSolver(grid_params, method, params, bcs_lw, bcs_sw, as)
RRTMGP.update_fluxes!(solver) # allocation-free, in place
F = RRTMGP.net_flux(solver) # (nlev, ncol) view into solver memory- Full RRTMGP gas optics: longwave and shortwave correlated-k lookup tables, clouds (with McICA sampling of partial cloudiness), and MERRA aerosols, validated against the Fortran rte-rrtmgp reference fluxes.
- Gray radiation: analytic single-band optics for idealized-climate and teaching use.
- Two-stream and no-scattering solvers for both bands, with optional per-band (spectrally resolved) flux output.
- CPU and GPU: the same code runs single-threaded, multi-threaded, and on CUDA GPUs via ClimaComms.
- Zero-allocation driver:
update_fluxes!is allocation-free and type-stable (asserted in CI with@allocatedand JET), allowing it to run fast within a climate simulation. - Dual precision:
Float32andFloat64throughout, with high accuracy (~ 1e-3 W/m²) atFloat32and an accuracy-ratchet test pinning theFloat32↔Float64flux differences.
RRTMGP.jl is organized in three layers:
- Functional core:
solve_lw!/solve_sw!kernels acting on explicit state (AtmosphericState, optics, sources, boundary conditions, flux workspaces). See the Functional core page. - Solver aggregate:
RRTMGPSolverbundles the configuration, state, and workspaces; hosts exchange data through documented getters and drive it withupdate_fluxes!. - Standalone front door:
solve_gray(FT),standard_atmosphere(FT), andsolve(profile)for classroom use, single-column experiments, and quick starts.
Readers coming from the Fortran implementation can use the Fortran and paper concordance to map names between the two code bases and the underlying papers.
- Documentation home: overview and page index.
- Functional core: the solver kernels, with runnable gray and clear-sky examples.
- Getter contract: the host data-exchange interface.
- API reference: types and functions.
RRTMGP.jl provides radiative fluxes and heating rates for the CliMA ecosystem, including:
For questions, check the documentation or open an issue on GitHub.
Contributors should follow the shared CliMA engineering standards in
docs/dev-guides/, which cover architecture, performance,
code quality, documentation, and workflows. These are vendored from
CliMA/DeveloperGuides. The repo's
AGENTS.md is a starting point for AI agents with repo-specific
guidance.
- Robert Pincus for his invaluable help.
- Robert Pincus, Eli Mlawer, and Jennifer Delamere, the developers of RTE+RRTMGP and its reference Fortran implementation, on which this code is based.