Skip to main content

pratmo

pratmo rewrites the original Fortran 77 model in Rust and exposes it through a command-line runner and a typed Python/NumPy interface. The project aims to preserve the original model structure while making the code easier to test, inspect, and embed. It also adds an experimental inorganic iodine mechanism that is not present in PRATMO v6.0.

Implementation tests and selected numerical comparisons with the compiled Fortran program are included, but these are software consistency checks—not scientific validation of the Rust rewrite, its inputs, or its predictions.

Features

  • Rust model core with structured CTM steady-state and full DIURN-cycle APIs.
  • Python package named pratmo, with typed configuration objects and NumPy arrays for profiles, grids, coordinates, time series, and diagnostics.
  • 40 implicit gas-phase species and 19 long-lived species or chemical families.
  • Experimental inorganic iodine chemistry, including ten iodine species, iodine photolysis, higher iodine oxides, and heterogeneous recycling.
  • Standard atmospheres, custom atmospheric profiles, configurable aerosol and sea-salt surface areas, and observation-constrained NO2 workflows.
  • Compatibility paths for the original fixed-format inputs and legacy CLI outputs, plus opt-in tooling for numerical comparisons with Fortran.
  • Runnable CTM, DIURN, iodine, custom-atmosphere, and OMPS batch examples.

The iodine mechanism's assumptions and known omissions are documented in Iodine chemistry.

Python quickstart

The published distribution and import name are both pratmo. To install a released wheel:

python -m pip install "pratmo[plot]"

For development, build the extension into the project environment:

uv sync --dev
uv run maturin develop --release

Run a CTM altitude profile with runnable, validated defaults:

from pratmo import Model
from pratmo.plotting import plot_profile

model = Model()
output = model.ctm(latitude=60.0, day="2026-03-16")

print(output.altitude_km)
print(output.species_profile("o3"))       # cm^-3
print(output.long_lived_profile("noy"))  # dimensionless mixing ratio
plot_profile(output, ["o3", "no2", "oh"]).show()

Atmosphere accepts pressure, temperature, altitude, ozone, and aerosol profiles with explicit units. Helpers such as ppmv(5), ppbv(300), pressure(values, "Pa"), and number_density(values, "m-3") keep conversions visible. Suspicious values emit PratmoWarning; inconsistent profiles raise ValueError before integration.

The lower-level PratmoModel, CtmConfig, and DiurnConfig API remains available. The package also exposes IMPLICIT_SPECIES_NAMES, LONG_LIVED_NAMES, and JVALUE_NAMES for discovery. See the rendered Python guide and examples for CTM, DIURN, custom-atmosphere, and observation-constrained workflows.

Rust and CLI

cargo build --workspace
cargo run -p pratmo-cli -- --input-dir fortran

pratmo-core provides the structured Rust API. pratmo-cli preserves the original file-based workflow and writes Fortran-compatible output files into the selected input directory.

Development verification

These checks test software behavior and selected Fortran agreement. Passing them does not mean that the model is scientifically validated.

Run the normal development checks with:

cargo fmt --all -- --check
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspace
cargo test --workspace --all-features
uv run pytest
uv run sphinx-build -W --keep-going -b html docs docs/_build/html

GitHub Actions runs these Rust checks, the Python tests, a strict documentation build, and the complete cross-platform wheel build on every push and pull request. Built distributions are retained as workflow artifacts. The publish job runs only for release tags matching v* and uses PyPI Trusted Publishing. The extension uses PyO3's Python 3.9 stable ABI, so each platform build produces one cp39-abi3 wheel compatible with Python 3.9 and newer.

The clean-room compiled-Fortran differential is available separately:

scripts/fortran_differential.sh

The detailed numerical comparisons, parity policy, and unsupported legacy modes are tracked in STATUS.md and FORTRAN_PARITY.md. Release procedures and archived implementation notes are separated under developer documentation.

Current boundaries

  • DERIVS sensitivity mode and PZSTD conversion are rejected explicitly.
  • The original multi-case Fortran driver loop is not implemented.
  • Full CTM climatology-grid coverage remains broader than the comparison fixture.
  • The iodine extension has mechanism-level tests but no Fortran reference and has not been scientifically validated.

License

pratmo is available under the MIT License.

Metadata

Release files for pratmo 0.4.0

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

Source distribution (sdist)

Source distribution for pratmo 0.4.0
File Size Uploaded
pratmo-0.4.0.tar.gz 646.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pratmo 0.4.0
File
pratmo-0.4.0-cp39-abi3-win_arm64.whl CPython 3.9 abi3 Windows ARM64 Details
pratmo-0.4.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
pratmo-0.4.0-cp39-abi3-win32.whl CPython 3.9 abi3 Windows x86-32 Details
pratmo-0.4.0-cp39-abi3-musllinux_1_2_x86_64.whl CPython 3.9 abi3 Linux musl 1.2+ x86-64 Details
pratmo-0.4.0-cp39-abi3-musllinux_1_2_i686.whl CPython 3.9 abi3 Linux musl 1.2+ x86-32 Details
pratmo-0.4.0-cp39-abi3-musllinux_1_2_armv7l.whl CPython 3.9 abi3 Linux musl 1.2+ ARMv7l Details
pratmo-0.4.0-cp39-abi3-musllinux_1_2_aarch64.whl CPython 3.9 abi3 Linux musl 1.2+ ARM64 Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.9 abi3 Linux glibc 2.17+ IBM System/390x Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.9 abi3 Linux glibc 2.17+ PowerPC 64-le Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-32 Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl CPython 3.9 abi3 Linux glibc 2.17+ ARMv7l Details
pratmo-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
pratmo-0.4.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
pratmo-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 17.3 MB

Release files / pratmo-0.4.0.tar.gz

Download URL pratmo-0.4.0.tar.gz
Size 646.6 kB
Tags Source
SHA-256 checksum
How to use checksums
061e00f8a7f3ccb3af765d57ebfef02efa57192b8cf14c421775024ea6dc850a
BLAKE2b-256 checksum
How to use checksums
b65595880c16cdc54a89ceb08968e44290d6cf534399ede7d9a36ac2dfc904b8
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-win_arm64.whl

Download URL pratmo-0.4.0-cp39-abi3-win_arm64.whl
Size 875.8 kB
Tags CPython 3.9 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
7214efe943ed2a3899eb1eb51412e88962727567644419c83f3629482bdb50ab
BLAKE2b-256 checksum
How to use checksums
c00574586f809ab74f493daf192d03246c1310fbacb93531cdd034fcb70ff7df
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-win_amd64.whl

Download URL pratmo-0.4.0-cp39-abi3-win_amd64.whl
Size 892.6 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
02c62616817b0267fd2306576581e6463d070561e98a2ee5697e5c512200f6a1
BLAKE2b-256 checksum
How to use checksums
8071f156ac2130af7e7a880c28566fc7aa67c07a76dfade321065d22fb26fbab
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-win32.whl

Download URL pratmo-0.4.0-cp39-abi3-win32.whl
Size 853.0 kB
Tags CPython 3.9 Windows x86-32 abi3
SHA-256 checksum
How to use checksums
0776effab0318521f9bd3835dbfdea0c46ea0636aeaeb48ab4e624dca1df8afb
BLAKE2b-256 checksum
How to use checksums
b133be2eed19d9ee3b29c27487639e941fddb94673d1bdd01f52af3fea2f70b4
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-musllinux_1_2_x86_64.whl

Download URL pratmo-0.4.0-cp39-abi3-musllinux_1_2_x86_64.whl
Size 1.3 MB
Tags CPython 3.9 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
852a06c00fb8ed1b908a8169f7deb0134b179cf8302dbeff94d5eff30c0eeaa6
BLAKE2b-256 checksum
How to use checksums
53fdbaa8e1b74c668ed7ea76abc58b18c623c211e2e0ca18816246f9c7b8e703
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-musllinux_1_2_i686.whl

Download URL pratmo-0.4.0-cp39-abi3-musllinux_1_2_i686.whl
Size 1.3 MB
Tags CPython 3.9 Linux musl 1.2+ x86-32 abi3
SHA-256 checksum
How to use checksums
663683dc5cec7f2de7a1c77b6bd2ad38002e1222ad2c656a99c7f46dbe188cee
BLAKE2b-256 checksum
How to use checksums
9827708053de7e9a3194ae51fdbb37bd54855f6da64f7fbbbf934a006ad282f2
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-musllinux_1_2_armv7l.whl

Download URL pratmo-0.4.0-cp39-abi3-musllinux_1_2_armv7l.whl
Size 1.4 MB
Tags CPython 3.9 Linux musl 1.2+ ARMv7l abi3
SHA-256 checksum
How to use checksums
d9daa7cb9555a043c60425d4761958751b8783dfc0ad60b2081ce47708959991
BLAKE2b-256 checksum
How to use checksums
9f593f7609f48f70b03efe3c6e1d9813f0b465bd99377389ea755e6257190fd4
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-musllinux_1_2_aarch64.whl

Download URL pratmo-0.4.0-cp39-abi3-musllinux_1_2_aarch64.whl
Size 1.3 MB
Tags CPython 3.9 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
99a22e115dc25b7dbcb295808ef26a5c67f092f644f062a09b011c97083b107a
BLAKE2b-256 checksum
How to use checksums
781a4eab48c1ea72c181d5a4757446e1917f29bf753414a111e6af6a789ac533
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
fadde27bf4ccc2712422d0f717b1a2ef7727c9c6a84f7165382b92ca262b7ba3
BLAKE2b-256 checksum
How to use checksums
a21e17a9891c6b03590981a27a35076c0a00be45014387df62efd7746555a906
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
b578b94ef814da3a3a3a1afd11f1511b7a4c93b4f7ad7cb991fc5feffe915bbf
BLAKE2b-256 checksum
How to use checksums
97ede00deaf25b5a962537d9d208fd8a34f30e799e9e96f7b50455970916feb9
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 1.3 MB
Tags CPython 3.9 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
2d09d9c778ebfe9f567edaeade2bfdc3fdfc19ae4b39196e8da26ce8c7396d0f
BLAKE2b-256 checksum
How to use checksums
63bd9faf0e7ce937092b2b6bc1fa2a44cd99471121ac3e5d2faf068b8465990c
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_i686.manylinux2014_i686.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-32 abi3
SHA-256 checksum
How to use checksums
4d73b339e01d6f2695588be585aa9111709f0d11b061491086ac1ff0331d9dc5
BLAKE2b-256 checksum
How to use checksums
dc7db15258b04b747e15853d427aca091bd13d022db8bbfd32fa6adb98587a55
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARMv7l abi3
SHA-256 checksum
How to use checksums
211d2bb1d1e84d3fde7f3c45399e17f8008c0d7c0d601b7644487d0dd9af6722
BLAKE2b-256 checksum
How to use checksums
096e6533551708a772dedf3d21422ee34fce00e97a6c190e1b592ff2a83f18ba
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL pratmo-0.4.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
415f31f1c4df98a3ed7d46217218707144e75a4fcb3b5931ba78c119d47af70f
BLAKE2b-256 checksum
How to use checksums
f998ebdc55751c4f822faab940602d32236992800b152f72999c8ba66b502f0b
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL pratmo-0.4.0-cp39-abi3-macosx_11_0_arm64.whl
Size 1.0 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
afb81b88e3df614041a3b7e4d5e9359d958fba402cf20e6d87877a29b7babe2b
BLAKE2b-256 checksum
How to use checksums
273a07acf6aa45e3cf947f03da47aa95f13e3c0266bd43b6ddea72746a01d604
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 Sep 29, 2026.

Transparency log

Release files / pratmo-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl

Download URL pratmo-0.4.0-cp39-abi3-macosx_10_12_x86_64.whl
Size 1.0 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
ce28c787ed8ef9f55309fb51d450b49ce0614ebecbb483aa475dd7417763fb11
BLAKE2b-256 checksum
How to use checksums
08a9e644e6ca7344d9730d393f27df7eac28740153d43065be87b43438a68457
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 Sep 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.4.0 This release

16 release files

0.1.0

16 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