https://github.com/climlab/climlab-rrtmg

A stand-along Python wrapper for the RRTMG radiation modules

https://github.com/climlab/climlab-rrtmg

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 3 committers (33.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.2%) to scientific vocabulary

Keywords from Contributors

archival projection profiles interactive climate-models generic sequences ecosystem-modeling gridding autograding
Last synced: 10 months ago · JSON representation

Repository

A stand-along Python wrapper for the RRTMG radiation modules

Basic Info
  • Host: GitHub
  • Owner: climlab
  • License: mit
  • Language: Fortran
  • Default Branch: main
  • Homepage:
  • Size: 1.9 MB
Statistics
  • Stars: 8
  • Watchers: 1
  • Forks: 5
  • Open Issues: 9
  • Releases: 4
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License

README.md

climlab-rrtmg

Build and test

Brian Rose, University at Albany

About

This is a stand-alone Python wrapper for the RRTMG radiation modules.

The primary use-case is to drive the RRTMG radiation processes in climlab, but it can be used as a stand-alone radiation model if you are familiar with the RRTMG Fortran interface. This is a lightweight wrapper that emulates the Fortran interface as closely as possible.

Currently we are wrapping RRTMGLW v4.85 and RRTMGSW v4.0. The Fortran source code is included in this repository. The latest versions 5.0 of the RRTMG source code are available on GitHub here

This wrapper includes the following modifications:

  • RRTMGLW is modified to allow reporting of OLR components in spectral bands, as illustrated using climlab here. This modification is strictly diagnostic does not change any other behavior of RRTMGLW.
  • RRTMG_SW is modified to allow gridpoint-specific values of the input parameter adjes which is the adjustment to total solar irradiance.

The parameter adjes is used within RRTMGSW to account for time-of-year adjustments to Earth-Sun distance. Latest versions of climlab compute non-uniform values of `irradiancefactorto compensate for [different diurnal averages of the solar zenith angle](https://climlab.readthedocs.io/en/latest/api/climlab.radiation.insolation.html). climlab'sirradiance_factoris mapped toadjes` when this RRTMG driver is called from climlab.

Installation

Pre-built binaries for many platforms are available from conda-forge.

To install in the current environment: conda install climlab-rrtmg --channel conda-forge or create a self-contained environment: conda create --name my_env python=3.13 climlab-rrtmg --channel conda-forge conda activate my_env

See below for instructions on how to build from source.

Example usage

You can import the modules into a Python session with from climlab_rrtmg import rrtmg_lw, rrtmg_sw

The main RRTMG drivers are exposed through rrtmg_lw.climlab_rrtmg_lw() and rrtmg_sw.climlab_rrtmg_sw()

Please see the directory climlab_rrtmg/tests/ directory in this repository for working examples that set up all the necessary input arrays and call the drivers.

Building from source

Here are instructions to create a build environment (including Fortran compiler) with conda and build using f2py.

To build: conda env create --file ./ci/requirements.yml conda activate rrtmg_build_env python -m pip install . --no-deps -vv

To run tests, do this from any directory other than the climlab-rrtmg repo: pytest -v --pyargs climlab_rrtmg

Version history

  • Version 0.4.1 (late Feburary 2025) is a bug fix, now properly exposing some constants defined in the Fortran code to the Python wrapper.
  • Version 0.4 (released February 2025) is a major refactor of the build system so this package can run on Python 3.12 and above. The build now uses meson.
  • Version 0.3 (released January 2025) includes the modification for grid-variable adjes described above. It is designed to work with climlab v0.9 and higher.
  • Version 0.2 is the first public release (April 2022). The Python wrapper code has been extracted from climlab v0.7.13.

Owner

  • Name: climlab
  • Login: climlab
  • Kind: organization

Home of climlab software and related user content

GitHub Events

Total
  • Create event: 4
  • Release event: 3
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 19
  • Push event: 5
  • Pull request event: 15
Last Year
  • Create event: 4
  • Release event: 3
  • Issues event: 2
  • Watch event: 1
  • Issue comment event: 19
  • Push event: 5
  • Pull request event: 15

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 67
  • Total Committers: 3
  • Avg Commits per committer: 22.333
  • Development Distribution Score (DDS): 0.06
Past Year
  • Commits: 22
  • Committers: 2
  • Avg Commits per committer: 11.0
  • Development Distribution Score (DDS): 0.091
Top Committers
Name Email Commits
Brian Rose b****e@a****u 63
dorrih-stardust d****l@s****m 2
dependabot[bot] 4****] 2
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 11 months ago

All Time
  • Total issues: 12
  • Total pull requests: 29
  • Average time to close issues: 1 day
  • Average time to close pull requests: 2 months
  • Total issue authors: 4
  • Total pull request authors: 3
  • Average comments per issue: 2.5
  • Average comments per pull request: 1.21
  • Merged pull requests: 18
  • Bot issues: 0
  • Bot pull requests: 3
Past Year
  • Issues: 2
  • Pull requests: 15
  • Average time to close issues: about 2 hours
  • Average time to close pull requests: 1 day
  • Issue authors: 2
  • Pull request authors: 3
  • Average comments per issue: 2.0
  • Average comments per pull request: 1.33
  • Merged pull requests: 10
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • brian-rose (9)
  • lizhuo1108 (2)
  • brandonduran (1)
Pull Request Authors
  • brian-rose (27)
  • dependabot[bot] (3)
  • dorrih-stardust (2)
Top Labels
Issue Labels
documentation (1)
Pull Request Labels
dependencies (3) github_actions (1)

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 1
  • Total dependent repositories: 1
  • Total versions: 1
conda-forge.org: climlab-rrtmg

climlab-rrtmg makes the RRTMG_LW and RRTMG_SW radiation codes callable from Python by wrapping using f2py. This is a lightweight wrapper that emulates the Fortran interface as closely as possible. The primary use case is to drive the RRTMG radiation processes in climlab, but it can be used as a standalone driver if you are familiar with the RRTMG Fortran interface.

  • Versions: 1
  • Dependent Packages: 1
  • Dependent Repositories: 1
Rankings
Dependent repos count: 24.4%
Dependent packages count: 29.0%
Average: 44.5%
Stargazers count: 62.2%
Forks count: 62.4%
Last synced: 11 months ago

Dependencies

setup.py pypi
  • numpy *
  • scipy *
  • xarray *
.github/workflows/build-and-test.yml actions
  • actions/checkout v4 composite
  • conda-incubator/setup-miniconda v3 composite
climlab_rrtmg/rrtmg_lw/setup.py pypi
climlab_rrtmg/rrtmg_sw/setup.py pypi
climlab_rrtmg/setup.py pypi
climlab_rrtmg/tests/setup.py pypi