Skip to main content

MAM4-JAX

A JAX port of the MAM4 (Modal Aerosol Module, 4-mode) aerosol-microphysics box model, validated against the E3SM Fortran reference.

The goal is a modern, readable, reproducible implementation of MAM4's microphysical processes — calcsize, water uptake, gas–aerosol exchange, nucleation, coagulation, and rename — written in JAX with float64 precision and verified element-wise against the Fortran reference to a relative error of 1e-6.

Status: scaffolding. The Fortran reference has been imported; the JAX package is not yet started. See CLAUDE.md for working rules and architecture notes that govern the port.

Repository layout

Hosts implementing CAM6 SOA can pass AmicphysParams(soa_uptake_mask=[True, True, False, True], soa_equilibrium_molecular_weight=250.0) to run_step or amicphys: accumulation/Aitken exchange and primary-carbon coating remain enabled, while coarse SOA uptake is excluded. None retains the MAM4-MOM reference configuration. The mask is per call and does not change sulfate uptake or shared species tables. The equilibrium molecular weight sets CAM6's 1.02 µg/m³ saturation concentration at 298 K; None preserves the MOM 150-g/mol default. Source inventories must still use their host tracer units, independently of this equilibrium convention. See ADR-021 in docs/KEY_DECISIONS.md.

mam4-jax/
├── CLAUDE.md                 # Working rules, architecture, validation workflow
├── README.md                 # (this file)
└── mam4-original-src-code/   # Vendored Fortran reference — read-only

The JAX package, test harness, validation data, and design docs (ARCHITECTURE.md, PROGRESS.md, PLANS.md, KEY_DECISIONS.md, DEFERRED.md, FEATURES.md) will land as the port progresses.

Fortran reference: provenance

The contents of mam4-original-src-code/ are a frozen snapshot vendored into this repository. They are not a submodule and will not auto-update from upstream.

Field Value
Snapshot taken 2025-12-10
Immediate source https://github.com/reflective-org/MAM4_box_model
Commit 4150e2d582a8fa6debca5009d22ec000496bd405
Upstream project https://github.com/kaizhangpnl/MAM_box_model (Kai Zhang et al., PNNL)

If you need to inspect the Fortran reference's history, diff against later upstream versions, or reproduce the snapshot, clone the source above at the pinned commit.

The vendored snapshot is read-only within this repo — do not modify the files under mam4-original-src-code/. To update the snapshot, replace the directory wholesale from a fresh upstream checkout and record the new commit/date in this table within the same PR.

References

  • Liu, X. et al. (2012). Toward a minimal representation of aerosols in climate models: description and evaluation in the Community Atmosphere Model CAM5. Geosci. Model Dev., 5, 709–739. https://doi.org/10.5194/gmd-5-709-2012
  • Liu, X. et al. (2016). Description and evaluation of a new four-mode version of the Modal Aerosol Module (MAM4) within version 5.3 of the Community Atmosphere Model. Geosci. Model Dev., 9, 505–522. https://doi.org/10.5194/gmd-9-505-2016

License

This project is released under the GPL v3 License - see the LICENSE file for details.

Metadata

Release files for mam4-jax 0.5.1

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

Source distribution (sdist)

Source distribution for mam4-jax 0.5.1
File Size Uploaded
mam4_jax-0.5.1.tar.gz 182.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mam4-jax 0.5.1
File Interpreter ABI Platform
mam4_jax-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 316.1 kB

Release files / mam4_jax-0.5.1.tar.gz

Download URL mam4_jax-0.5.1.tar.gz
Size 182.5 kB
Tags Source
SHA-256 checksum
How to use checksums
de9ec4ef6e1aca75a1acf2ae7b1426270b4315aa54354f99f1edad35fd595e07
BLAKE2b-256 checksum
How to use checksums
fcb2865dafb12b0eb7eb4363e064a6291cb71cb999a06844d69cefa583ba8c80
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Release files / mam4_jax-0.5.1-py3-none-any.whl

Download URL mam4_jax-0.5.1-py3-none-any.whl
Size 133.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fc6cefb0137262081a481d8c804d566da9856ad22c3f31433d834f0450d49c71
BLAKE2b-256 checksum
How to use checksums
d8ad4a3bb53b52adc4494dd47789ce738135ac0a3a81980db513adbb2d2205b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.4.0

2 release files

0.3.2

2 release 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