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

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]

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jax_rrtmgp-0.3.0.tar.gz (57.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jax_rrtmgp-0.3.0-py3-none-any.whl (57.2 MB view details)

Uploaded Python 3

File details

Details for the file jax_rrtmgp-0.3.0.tar.gz.

File metadata

  • Download URL: jax_rrtmgp-0.3.0.tar.gz
  • Upload date:
  • Size: 57.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jax_rrtmgp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 126b4cb266133e97cdbf5fd7299ce80ecfe2d0c270df9e4503177217556f722f
MD5 80498d1dbfa45cc206b6d8ec2b00d6a8
BLAKE2b-256 ee2140b1d6feea897a7ccd24d88a9127b0121cfa1ff968b54d001df29e4adadd

See more details on using hashes here.

Provenance

The following attestation bundles were made for jax_rrtmgp-0.3.0.tar.gz:

Publisher: release.yaml on climate-analytics-lab/jax-rrtmgp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jax_rrtmgp-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: jax_rrtmgp-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 57.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for jax_rrtmgp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8ee9e96391ac2938ac16dfb623fcdfe8837feef42f4cb6f697e5929232bdadcf
MD5 c9f19d412f499daf15de861b51767d6d
BLAKE2b-256 018284626d9ec47b6c20efc73a0aad544def4327e2e76c55c32f3b2788a616ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for jax_rrtmgp-0.3.0-py3-none-any.whl:

Publisher: release.yaml on climate-analytics-lab/jax-rrtmgp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

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