Fast, GPU-ready atmospheric radiative transfer in Julia: the RTE solver with RRTMGP correlated-k gas optics.
68
stars
780
commits
Julia
primary language
Sep 12, 2026
updated
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.
using Pkg
Pkg.add("RRTMGP")
The standalone entry points provide a quick start. A gray (single-band) atmosphere uses analytic formulas:
using RRTMGP
out = RRTMGP.solve_gray(Float64; nlay = 60, ncol = 1)
out.net_flux # 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_flux_up[end, 1] # outgoing longwave radiation at the top [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
This snippet is schematic; How to drive RRTMGP from a host model shows the full construction, step by step.
update_fluxes! is allocation-free and
type-stable, asserted in CI with @allocated and JET.Float32 and Float64 throughout; measured
Float32↔Float64 flux differences are a few 10⁻⁴ W/m² in the longwave
and a few 10⁻² W/m² in the shortwave, enforced by ratcheting CI
thresholds.RRTMGP.jl is organized in three layers:
solve_lw! / solve_sw! kernels acting on explicit
state (AtmosphericState, optics, sources, boundary conditions, flux
workspaces). See the Functional core page.RRTMGPSolver bundles the configuration, state, and
workspaces; hosts exchange data through documented
getters and drive it
with update_fluxes!.solve_gray(FT), standard_atmosphere(FT),
and solve(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.
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.
Julia
100.0%
Fast, GPU-ready atmospheric radiative transfer in Julia: the RTE solver with RRTMGP correlated-k gas optics.
68
stars
780
commits
Julia
primary language
Sep 12, 2026
updated
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.
using Pkg
Pkg.add("RRTMGP")
The standalone entry points provide a quick start. A gray (single-band) atmosphere uses analytic formulas:
using RRTMGP
out = RRTMGP.solve_gray(Float64; nlay = 60, ncol = 1)
out.net_flux # 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_flux_up[end, 1] # outgoing longwave radiation at the top [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
This snippet is schematic; How to drive RRTMGP from a host model shows the full construction, step by step.
update_fluxes! is allocation-free and
type-stable, asserted in CI with @allocated and JET.Float32 and Float64 throughout; measured
Float32↔Float64 flux differences are a few 10⁻⁴ W/m² in the longwave
and a few 10⁻² W/m² in the shortwave, enforced by ratcheting CI
thresholds.RRTMGP.jl is organized in three layers:
solve_lw! / solve_sw! kernels acting on explicit
state (AtmosphericState, optics, sources, boundary conditions, flux
workspaces). See the Functional core page.RRTMGPSolver bundles the configuration, state, and
workspaces; hosts exchange data through documented
getters and drive it
with update_fluxes!.solve_gray(FT), standard_atmosphere(FT),
and solve(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.
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.
Julia
100.0%