Skip to main content

JAX-RRTMGP: JAX-based RRTMGP Radiative Transfer

JAX-RRTMGP is a JAX-based implementation of the RRTMGP (Rapid Radiative Transfer Model for General circulation models - Parallel) radiative transfer scheme. This package provides fast, differentiable radiative transfer calculations for atmospheric modeling applications.

RRTMGP is a correlated k-distribution model for computing optical depths, source functions, and fluxes for longwave and shortwave radiation in planetary atmospheres. This JAX implementation enables automatic differentiation and efficient execution on GPUs and TPUs.

Features

  • JAX-native implementation: Full compatibility with JAX transformations (jit, grad, vmap, pmap)
  • GPU/TPU acceleration: Efficient execution on modern accelerators
  • Automatic differentiation: Enable gradient-based optimization and sensitivity analysis [IN PROGRESS]
  • Longwave and shortwave radiation: Complete radiative transfer calculations
  • Gas and cloud optics: Support for molecular absorption and cloud scattering/absorption
  • RRTMGP data files included: Pre-computed optical property lookup tables
  • Comprehensive testing: Extensive test suite with reference data

Installation

It is recommended to install in a virtual environment.

git clone https://github.com/climate-analytics-lab/jax-rrtmgp.git
python3 -m pip install -e jax-rrtmgp

Basic Usage

import jax
import jax.numpy as jnp
from rrtmgp import rrtmgp

# Set up atmospheric state
temperature = jnp.array([...])  # Temperature profile [K]
pressure = jnp.array([...])     # Pressure profile [Pa] 
vmr_h2o = jnp.array([...])      # Water vapor volume mixing ratio

# Initialize RRTMGP
config = rrtmgp.get_default_config()
rrtmgp_state = rrtmgp.initialize(config, pressure, temperature, vmr_h2o)

# Compute radiative fluxes
fluxes_lw = rrtmgp.compute_longwave_fluxes(rrtmgp_state, ...)
fluxes_sw = rrtmgp.compute_shortwave_fluxes(rrtmgp_state, ...)

Package Structure

  • rrtmgp: Main RRTMGP interface
  • rrtmgp.optics: Gas and cloud optical property calculations
  • rrtmgp.rte: Radiative transfer equation solvers
  • rrtmgp.optics.rrtmgp_data: Pre-computed lookup tables

Dependencies

  • JAX: Automatic differentiation and JIT compilation
  • NumPy: Numerical computing
  • NetCDF4: Reading RRTMGP data files

Data cache

The netCDF data files are copied out of the package into a local cache before they are read. The cache is /tmp/netcdf/data by default; set the environment variable RRTMGP_NETCDF_CACHE_DIR before importing rrtmgp to put it elsewhere (for example on a host where /tmp/netcdf belongs to another user).

Testing

Run the test suite with:

pytest rrtmgp/

Or run individual test modules:

python rrtmgp/optics/gas_optics_test.py
python rrtmgp/rte/two_stream_test.py

License

Licensed under the Apache License, Version 2.0. This implementation is based on the JAX port of the original RRTMGP Fortran code by Eli Mlawer and Robert Pincus, originally included in swirl-jatmos.

Citation

If you use this software, please cite:

  1. The original RRTMGP paper: Pincus, R., Mlawer, E. J., and Delamere, J. S.: Balancing accuracy, efficiency, and flexibility in radiation calculations for dynamical models, J. Adv. Model. Earth Syst., 11, 3074-3089, 2019.

  2. This JAX implementation: [Add citation when published]

Metadata

Release files for jax-rrtmgp 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jax-rrtmgp 0.6.0
File Size Uploaded Provenance Actions
jax_rrtmgp-0.6.0.tar.gz 57.9 MB With provenance Details for jax_rrtmgp-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jax-rrtmgp 0.6.0
File Interpreter ABI Platform Actions
jax_rrtmgp-0.6.0-py3-none-any.whl Python 3 none any Details for jax_rrtmgp-0.6.0-py3-none-any.whl

Total release size: 116.0 MB

Release files / jax_rrtmgp-0.6.0.tar.gz

Download URL jax_rrtmgp-0.6.0.tar.gz
Size 57.9 MB
Tags Source
SHA-256 checksum
How to use checksums
80839c5591149ab1d5dfe2628ca0eb1e09964b924c6536024c631aa35e4468a4
BLAKE2b-256 checksum
How to use checksums
b09418cb5d1f6aaeeb233e6c8168322917492518b18db8303352feed8f06f40f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Release files / jax_rrtmgp-0.6.0-py3-none-any.whl

Download URL jax_rrtmgp-0.6.0-py3-none-any.whl
Size 58.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
4070ac65c208fdf04a2ec470cb7200aef5cfe39f2aba8b0359445f25f17a5280
BLAKE2b-256 checksum
How to use checksums
5a8e341e5b98f74255ad3200f4211f0f7773b049f8c3b301182091c023a0e4e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

Security for jax-rrtmgp 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jax_rrtmgp-0.6.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page