JAX-based implementation of RRTMGP radiative transfer for atmospheric modeling.
Project description
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 interfacerrtmgp.optics: Gas and cloud optical property calculationsrrtmgp.rte: Radiative transfer equation solversrrtmgp.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:
-
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.
-
This JAX implementation: [Add citation when published]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jax_rrtmgp-0.1.0.tar.gz.
File metadata
- Download URL: jax_rrtmgp-0.1.0.tar.gz
- Upload date:
- Size: 57.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99c694ce9232fc4a288f268e6232040d7072bbaa61e4a8ebc5d974e19c7b2cfe
|
|
| MD5 |
4d1862b4d1e849f956adae3713ac3d62
|
|
| BLAKE2b-256 |
453c31c31e4aa89460c5f67eb0b016b8683daf33d4a4ef33a6dfdc7396d4c3e9
|
Provenance
The following attestation bundles were made for jax_rrtmgp-0.1.0.tar.gz:
Publisher:
release.yaml on climate-analytics-lab/jax-rrtmgp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_rrtmgp-0.1.0.tar.gz -
Subject digest:
99c694ce9232fc4a288f268e6232040d7072bbaa61e4a8ebc5d974e19c7b2cfe - Sigstore transparency entry: 1758642996
- Sigstore integration time:
-
Permalink:
climate-analytics-lab/jax-rrtmgp@764031ad5df9fe3d19242d1be49419a3b8128e3f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/climate-analytics-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@764031ad5df9fe3d19242d1be49419a3b8128e3f -
Trigger Event:
release
-
Statement type:
File details
Details for the file jax_rrtmgp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jax_rrtmgp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 57.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
777963197ab0e8995da0000da5fdec442629623af8b0feb0fd38d2ac388dcc7c
|
|
| MD5 |
c9208b6af2d32e853bc43203af4ca715
|
|
| BLAKE2b-256 |
7105111b1abbeff8960eef8875dba73abf0376250403bd20aa472e3f038209ef
|
Provenance
The following attestation bundles were made for jax_rrtmgp-0.1.0-py3-none-any.whl:
Publisher:
release.yaml on climate-analytics-lab/jax-rrtmgp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jax_rrtmgp-0.1.0-py3-none-any.whl -
Subject digest:
777963197ab0e8995da0000da5fdec442629623af8b0feb0fd38d2ac388dcc7c - Sigstore transparency entry: 1758643026
- Sigstore integration time:
-
Permalink:
climate-analytics-lab/jax-rrtmgp@764031ad5df9fe3d19242d1be49419a3b8128e3f -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/climate-analytics-lab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@764031ad5df9fe3d19242d1be49419a3b8128e3f -
Trigger Event:
release
-
Statement type: