Skip to main content

CNit logo CNit

CI PyPI version Documentation PyPI Downloads

CNit (Carbon-Nitrogen Interactions in Terrestrial ecosystems) is a process-based terrestrial biogeochemistry model of coupled carbon and nitrogen cycles. It is the land component of MAGICC (Model for the Assessment of Greenhouse Gas Induced Climate Change), designed to represent terrestrial carbon–nitrogen feedbacks efficiently in integrated assessment and climate projection studies.

Features

  • Three carbon pools (plant, litter, and soil) and four nitrogen pools (plant, litter, soil, and mineral).
  • Bidirectional carbon–nitrogen coupling: nitrogen availability limits carbon uptake, while carbon uptake drives nitrogen demand and can stimulate biological fixation.
  • Effects of atmospheric CO₂, temperature, nitrogen availability, and land use on ecosystem fluxes.
  • Separate deforestation, afforestation, post-deforestation regrowth, and afforestation decay fluxes for land-use and carbon dioxide removal scenarios.
  • Annual timesteps in the default examples, with support for evenly spaced subannual timesteps. Allocation fractions apply within each model timestep; supplied calibration files are based on an annual timescale.

Installation

Install CNit from PyPI:

pip install cnit

Quick Start

This example runs CNit with simple annual input series. See the Quickstart Guide for installation options, a notebook version, and further explanation.

import numpy as np
from cnit import CNitModel, CNitModelConfig, Q

# Create a model with default parameters.
model = CNitModel.from_config(CNitModelConfig())

# Set up annual time coordinates and input series.
time_axis = Q(np.arange(1850, 2101), "yr")
n_steps = len(time_axis)
dT_s = Q(np.linspace(0, 2, n_steps), "K")
CO2_s = Q(np.linspace(280, 560, n_steps), "ppm")

# Land-use emissions are zero for this simple example.
CemsLUnet_s = Q(np.zeros(n_steps), "GtC/yr")
CemsLUgrs_s = Q(np.zeros(n_steps), "GtC/yr")
NemsLUnet_s = Q(np.zeros(n_steps), "GtN/yr")
NemsLUgrs_s = Q(np.zeros(n_steps), "GtN/yr")
NemsLUmin_s = Q(np.zeros(n_steps), "GtN/yr")

# Nitrogen deposition and fertilizer inputs.
NflxAD_s = Q(np.linspace(0.05, 0.15, n_steps), "GtN/yr")
NflxFT_s = Q(np.linspace(0, 0.1, n_steps), "GtN/yr")

res = model.run(
    time_axis=time_axis,
    dT_s=dT_s,
    CO2_s=CO2_s,
    CemsLUnet_s=CemsLUnet_s,
    CemsLUgrs_s=CemsLUgrs_s,
    NflxAD_s=NflxAD_s,
    NflxFT_s=NflxFT_s,
    NemsLUnet_s=NemsLUnet_s,
    NemsLUgrs_s=NemsLUgrs_s,
    NemsLUmin_s=NemsLUmin_s,
)

print(f"Final plant carbon: {res['CplsP'].data[-1]} {res['CplsP'].units}")
print(f"Final plant nitrogen: {res['NplsP'].data[-1]} {res['NplsP'].units}")
print(f"Final NPP: {res['CflxNPP'].data[-1]} {res['CflxNPP'].units}")

Documentation

The CNit documentation covers the model overview, quickstart, detailed physics and configuration APIs, CMIP6 ESM and TRENDY DGVM emulation workflows, and calibration data and results.

References

If you use CNit in research, please cite the relevant publication(s):

Model description and calibration

  • [CNit v1.0] Tang, G., Nicholls, Z., Norton, A., Zaehle, S., and Meinshausen, M.: Synthesizing global carbon–nitrogen coupling effects – the MAGICC coupled carbon–nitrogen cycle model v1.0, Geosci. Model Dev., 18, 2193–2230, doi:10.5194/gmd-18-2193-2025, 2025.
  • [CNit v2.0] Tang, G., Zaehle, S., Nicholls, Z., Norton, A., Ziehn, T., and Meinshausen, M.: Understanding the drivers of carbon–nitrogen cycle variability in CMIP6 ESMs with MAGICC CNit v2.0: model and calibration updates, J. Adv. Model. Earth Syst., 18, e2025MS005270, doi:10.1029/2025MS005270, 2026.
  • [CNit v2.1] Tang, G., Norton, A., Gasser, T., Nicholls, Z. R. J., Ziehn, T., Abrahão, G. M., and Meinshausen, M. A.: Reassessing the terrestrial carbon sink reveals stronger CO₂ fertilization, elevated climate sensitivity, and intensifying nitrogen limitation, ESS Open Archive, preprint, doi:10.22541/essoar.15006117/v2, 2026.
  • [CMIP6 data] Tang, G., Nicholls, Z., Jones, C., Gasser, T., Norton, A., Ziehn, T., Romero-Prieto, A., and Meinshausen, M.: Investigating carbon and nitrogen conservation in reported CMIP6 Earth system model data, Geosci. Model Dev., 18, 2111–2136, doi:10.5194/gmd-18-2111-2025, 2025.

Climate and carbon-cycle application

  • [MAGICC-CNit SSP projections] Tang, G., Nicholls, Z., Norton, A., Gasser, T., Ziehn, T., Zaehle, S., and Meinshausen, M.: Nitrogen limitation amplifies future warming by weakening terrestrial carbon cycle feedbacks and sink capacity, Commun. Earth Environ., 7, 760, doi:10.1038/s43247-026-03736-0, 2026.

See References for the complete bibliography.

Development

See Contributing for development setup and checks. The Changelog lists release history.

Authors and Contributors

Author, developer, and maintainer: Gang Tang

Contributors:

CNit is the carbon cycle component of MAGICC. See the MAGICC repository for the climate model.

License

CNit is distributed under the BSD 3-Clause License. See LICENSE.

Metadata

Release files for cnit 2.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 cnit 2.4.0
File Size Uploaded Provenance Actions
cnit-2.4.0.tar.gz 94.7 kB Without provenance Details for cnit-2.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cnit 2.4.0
File Interpreter ABI Platform Actions
cnit-2.4.0-py3-none-any.whl Python 3 none any Details for cnit-2.4.0-py3-none-any.whl

Total release size: 180.1 kB

Release files / cnit-2.4.0.tar.gz

Download URL cnit-2.4.0.tar.gz
Size 94.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32c3c17f891e0fdfc31fe58ccb4bda022d5f23d09049f7a96bd00e64256b0a26
BLAKE2b-256 checksum
How to use checksums
93f46abbad2e0e6aaf4013a80c919aa06116fe27f29561fa52aca641e219379a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.15

Release files / cnit-2.4.0-py3-none-any.whl

Download URL cnit-2.4.0-py3-none-any.whl
Size 85.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f74a85fddd6ce8dab1a4ff2bd8bd5e697eaad15e157de279237727f97edbf95f
BLAKE2b-256 checksum
How to use checksums
bb9c6a51eac9369ba5c8f28cb268ea03b3f81181a9515b962a25947ddac56cbd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.15

Security for cnit 2.4.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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