pyrcel
An implementation of a simple, adiabatic cloud parcel model for use in aerosol-cloud interaction studies.
https://github.com/darothen/pyrcel
Category: Atmosphere
Sub Category: Atmospheric Chemistry and Aerosol
Keywords from Contributors
optimize archiving transforms measur generic observation compose conversion projection animals
Last synced: about 8 hours ago
JSON representation
Repository metadata
A 0D, adiabatic cloud parcel model for studying aerosol activation.
- Host: GitHub
- URL: https://github.com/darothen/pyrcel
- Owner: darothen
- License: bsd-3-clause
- Created: 2013-09-18T15:53:10.000Z (about 13 years ago)
- Default Branch: master
- Last Pushed: 2026-10-30T20:17:01.000Z (16 days ago)
- Last Synced: 2026-11-15T16:31:56.455Z (about 8 hours ago)
- Language: Python
- Homepage:
- Size: 8.21 MB
- Stars: 32
- Watchers: 3
- Forks: 32
- Open Issues: 25
- Releases: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
README.md
pyrcel: cloud parcel model
pyrcel is a simple, adiabatic cloud parcel model for use in
aerosol-cloud interaction studies. Rothenberg and Wang (2016) discuss the model in detail and its improvements over Nenes et al (2001):
- Implementation of κ-Köhler theory for condensation physics (Petters and Kreidenweis, 2007)
- Extension of model to handle arbitrary sectional representations of aerosol populations, based on user-controlled empirical or parameterized size distributions
- JAX/diffrax-based numerical core — differentiable, batchable, GPU-ready, with no Fortran/SUNDIALS dependency
Detailed documentation is available, including a scientific description, installation details, and a basic example.
[!WARNING]
Version 2.0 NoticeThis is pyrcel v2.0, a major new release with more features, greater flexibility, and a JAX-based differentiable kernel. However, there are several breaking changes compared to version 1.3.x.
Please review the migration guide to update your code.
If you wish to continue using the legacy (v1.3.x) model, you can install it from PyPI by pinning the version:
pip install "pyrcel<2"
Quick Start
The easiest way to run pyrcel from source is with uv:
$ git clone https://github.com/darothen/pyrcel.git && cd pyrcel
$ uv run python examples/basic_run.py
uv will automatically create an isolated environment and install all dependencies.
The first call compiles JAX kernels; subsequent calls are fast.
Usage
import pyrcel as pm
sulfate = pm.AerosolSpecies(
"sulfate", pm.Lognorm(mu=0.05, sigma=2.0, N=1000.0), kappa=0.54, bins=50
)
model = pm.ParcelModel([sulfate], V=1.0, T0=283.0, S0=-0.02, P0=85000.0, console=True)
output = model.run(t_end=300.0, output_dt=10.0, terminate=True, live=True)
print(f"S_max = {output.summary['S_max']*100:.3f} %")
print(f"N_act = {output.Nd:.3e} m⁻³")
Key capabilities:
- Autodiff — exact gradients of
S_maxw.r.t. updraft speed, initial conditions,
accommodation coefficient, and aerosol properties viajax.grad. - Batching / GPU —
jax.vmapruns ensembles of parcels in one compiled call;
passdevice="gpu"toParcelModelfor CUDA acceleration. - Time-varying updraft — pass a
pyrcel.InterpolatedUpdraft(ts=..., vs=...)asV. - Flexible output —
output.to_pandas(),.to_xarray(),.to_netcdf(),.to_parquet().
The differentiable core (pyrcel.integrator, pyrcel.equilibrate) is usable directly
for jit/grad/vmap; ParcelModel is the interactive convenience layer (console
output, progress meter, post-solve summary table).
Installation
From PyPI (recommended):
$ pip install pyrcel
JAX (CPU) is included by default. No extras needed for standard use.
From source:
$ git clone https://github.com/darothen/pyrcel.git && cd pyrcel
$ uv sync
$ uv run python examples/basic_run.py
GPU support (CUDA 12):
$ pip install "pyrcel[gpu]"
Requirements
- Python >= 3.11
- JAX >= 0.4.38
- diffrax >= 0.6.2
- equinox >= 0.11.10
- optimistix >= 0.0.7
- NumPy, SciPy, pandas, polars, xarray
Development
Clone the repo and install with dev dependencies:
$ git clone https://github.com/darothen/pyrcel.git && cd pyrcel
$ uv sync --extra test
$ prek install # installs the git pre-commit hook (requires prek: https://prek.j178.dev)
Run the fast test suite:
$ uv run pytest tests/ -m "not slow"
Lint and format are handled automatically by prek on commit, or run manually:
$ prek run --all-files
Please fork this repository if you intend to develop the model further so that the
code's provenance can be maintained.
License / Usage
All scientific code should be licensed. This code is released under the New BSD (3-clause) license.
If you use this for any scientific work resulting in a publication, please cite our
original publication detailing the model:
@article {
author = "Daniel Rothenberg and Chien Wang",
title = "Metamodeling of Droplet Activation for Global Climate Models",
journal = "Journal of the Atmospheric Sciences",
year = "2016",
publisher = "American Meteorological Society",
address = "Boston MA, USA",
volume = "73",
number = "3",
doi = "10.1175/JAS-D-15-0223.1",
pages= "1255 - 1272",
url = "https://journals.ametsoc.org/view/journals/atsc/73/3/jas-d-15-0223.1.xml"
}
Additionally, please consider citing the bespoke DOI for the
specific release version of pyrcel
that you used during your research (or the base version you modified). This
allows us to track adoption and use of specific model versions over time.
Owner metadata
- Name: Daniel Rothenberg
- Login: darothen
- Email: daniel@danielrothenberg.com
- Kind: user
- Description: Weather/Climate Scientist | Pythonista | Co-founder @brightbandtech > Formerly Tech Lead @ Waymo > ex-Chief Scientist @Tomorrow.io > MIT EAPS/IDSS/CGCS
- Website: http://www.danielrothenberg.com
- Location: Erie, CO
- Twitter: danrothenberg
- Company: @Brightbandtech
- Icon url: https://avatars.githubusercontent.com/u/4992424?u=cb7b2ccc173e5dcd13c724a96e84185bd87e761f&v=4
- Repositories: 79
- Last ynced at: 2026-11-09T13:32:46.697Z
- Profile URL: https://github.com/darothen
GitHub Events
Total
- Create event: 15
- Delete event: 11
- Fork event: 4
- Issue comment event: 4
- Issues event: 2
- Pull request event: 7
- Pull request review event: 3
- Push event: 55
- Release event: 1
- Watch event: 4
Last Year
- Create event: 13
- Delete event: 11
- Fork event: 1
- Issue comment event: 2
- Pull request event: 6
- Pull request review event: 1
- Push event: 48
- Watch event: 1
Committers metadata
Last synced: 1 day ago
Total Commits: 446
Total Committers: 6
Avg Commits per committer: 74.333
Development Distribution Score (DDS): 0.197
Commits in past year: 47
Committers in past year: 3
Avg Commits per committer in past year: 15.667
Development Distribution Score (DDS) in past year: 0.043
| Name | Commits | |
|---|---|---|
| Daniel Rothenberg | d****n@m****u | 358 |
| Daniel Rothenberg | d****l@d****m | 82 |
| Marco Wurth | m****h@k****u | 2 |
| dependabot[bot] | 4****] | 2 |
| Milos Lompar | l****m@m****u | 1 |
| Alicja | a****a@c****l | 1 |
Committer domains:
- com-4t.pl: 1
- mail.ru: 1
- kit.edu: 1
- danielrothenberg.com: 1
- mit.edu: 1
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 43
Total pull requests: 42
Average time to close issues: 10 months
Average time to close pull requests: 2 months
Total issue authors: 5
Total pull request authors: 8
Average comments per issue: 0.79
Average comments per pull request: 0.5
Merged pull request: 15
Bot issues: 0
Bot pull requests: 10
Past year issues: 30
Past year pull requests: 29
Past year average time to close issues: 2 days
Past year average time to close pull requests: 10 days
Past year issue authors: 1
Past year pull request authors: 5
Past year average comments per issue: 0.63
Past year average comments per pull request: 0.38
Past year merged pull request: 9
Past year bot issues: 0
Past year bot pull requests: 7
Top Issue Authors
- darothen (39)
- Tianning-Zhao (1)
- feifeiya8 (1)
- marcowurth (1)
- slayoo (1)
Top Pull Request Authors
- darothen (14)
- GlazerMann (11)
- dependabot[bot] (10)
- marcowurth (3)
- SecondGlanceFromAlice (1)
- wx4stg (1)
- lompar (1)
- yutipurohit (1)
Top Issue Labels
- v2 (24)
- infrastructure (8)
- feature (7)
- refactor (5)
- model feature (4)
- documentation (4)
- science (3)
- testing (1)
Top Pull Request Labels
- dependencies (10)
- python:uv (7)
Package metadata
- Total packages: 2
-
Total downloads:
- pypi: 1,611 last-month
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 19
- Total maintainers: 1
proxy.golang.org: github.com/darothen/pyrcel
- Homepage:
- Documentation: https://pkg.go.dev/github.com/darothen/pyrcel#section-documentation
- Licenses: bsd-3-clause
- Latest release: v2.0.0+incompatible (published 5 months ago)
- Last Synced: 2026-11-14T16:03:32.965Z (1 day ago)
- Versions: 14
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.401%
- Average: 5.583%
- Dependent repos count: 5.764%
pypi.org: pyrcel
pyrcel: 0D adiabatic cloud parcel model
- Homepage:
- Documentation: https://pyrcel.readthedocs.io/en/latest/
- Licenses: BSD-3-Clause
- Latest release: 2.0.0 (published 5 months ago)
- Last Synced: 2026-11-14T16:04:42.583Z (1 day ago)
- Versions: 5
- Dependent Packages: 1
- Dependent Repositories: 1
- Downloads: 1,611 Last month
-
Rankings:
- Forks count: 8.719%
- Dependent packages count: 10.126%
- Stargazers count: 13.962%
- Average: 17.253%
- Dependent repos count: 21.545%
- Downloads: 31.913%
- Maintainers (1)
Dependencies
- Assimulo ==3.0
- numba ==0.45.1
- numpy ==1.17.0
- pandas ==0.25.1
- scipy ==1.3.1
- xarray ==0.12.3
- numba *
- numpy *
- pandas *
- pyyaml *
- scipy *
- setuptools *
- setuptools-scm *
- xarray *
- actions/checkout v4 composite
- astral-sh/setup-uv v5 composite
- babel 2.18.0
- backrefs 7.0
- certifi 2026.6.17
- cftime 1.6.5
- charset-normalizer 3.4.7
- click 8.4.2
- colorama 0.4.6
- contourpy 1.3.3
- cycler 0.12.1
- diffrax 0.7.2
- equinox 0.13.8
- execnet 2.1.2
- fonttools 4.63.0
- ghp-import 2.1.0
- griffelib 2.1.0
- hypothesis 6.155.2
- idna 3.18
- iniconfig 2.3.0
- jax 0.10.1
- jax-cuda12-pjrt 0.10.1
- jax-cuda12-plugin 0.10.1
- jaxlib 0.10.1
- jaxtyping 0.3.11
- jinja2 3.1.6
- kiwisolver 1.5.0
- lineax 0.1.1
- markdown 3.10.2
- markupsafe 3.0.3
- matplotlib 3.11.0
- mergedeep 1.3.4
- mkdocs 1.6.1
- mkdocs-autorefs 1.4.4
- mkdocs-get-deps 0.2.2
- mkdocs-material 9.7.6
- mkdocs-material-extensions 1.3.1
- mkdocstrings 1.0.4
- mkdocstrings-python 2.0.5
- ml-dtypes 0.5.4
- netcdf4 1.7.4
- numpy 2.4.6
- nvidia-cublas-cu12 12.9.2.10
- nvidia-cuda-cccl-cu12 12.9.27
- nvidia-cuda-cupti-cu12 12.9.79
- nvidia-cuda-nvcc-cu12 12.9.86
- nvidia-cuda-nvrtc-cu12 12.9.86
- nvidia-cuda-runtime-cu12 12.9.79
- nvidia-cudnn-cu12 9.23.2.1
- nvidia-cufft-cu12 11.4.1.4
- nvidia-cusolver-cu12 11.7.5.82
- nvidia-cusparse-cu12 12.5.10.65
- nvidia-nccl-cu12 2.30.7
- nvidia-nvjitlink-cu12 12.9.86
- nvidia-nvshmem-cu12 3.7.0
- opt-einsum 3.4.0
- optimistix 0.1.0
- packaging 26.2
- paginate 0.5.7
- pandas 3.0.3
- pathspec 1.1.1
- pillow 12.3.0
- platformdirs 4.10.0
- pluggy 1.6.0
- polars 1.41.2
- polars-runtime-32 1.41.2
- pygments 2.20.0
- pymdown-extensions 11.0
- pyparsing 3.3.2
- pyrcel *
- pyrefly 1.1.1
- pytest 9.1.0
- pytest-xdist 3.8.0
- python-dateutil 2.9.0.post0
- pyyaml 6.0.3
- pyyaml-env-tag 1.1
- requests 2.34.2
- ruff 0.15.19
- scipy 1.17.1
- setuptools 82.0.1
- six 1.17.0
- sortedcontainers 2.4.0
- typing-extensions 4.15.0
- tzdata 2026.2
- urllib3 2.7.0
- wadler-lindig 0.1.7
- watchdog 6.0.0
- xarray 2026.4.0
- actions/checkout v4 composite
- actions/download-artifact v4 composite
- actions/upload-artifact v4 composite
- astral-sh/setup-uv v5 composite
- pypa/gh-action-pypi-publish release/v1 composite
Score: 13.2212815858925
