Skip to main content

climt

PyPI Continuous Integration Continuous Integration Coverage Documentation Status Zenodo DOI ./docs/climt_logo.jpg

climt is a Toolkit for building Earth system models in Python. climt stands for Climate Modelling and Diagnostics Toolkit – it is meant both for creating models and for generating diagnostics (radiative fluxes for an atmospheric column, for example). However, since it might eventually include model components for purposes other than climate modelling (local area models, large-eddy simulation), we prefer to keep the abbreviation un-expanded!

climt hopes to enable researchers to easily perform online analysis and make modifications to existing models by increasing the ease with which models can be understood and modified. It also enables educators to write accessible models that serve as an entry point for students into Earth system modeling, while also containing state-of-the-art components.

Initially climt contains only components for the atmosphere, and does not yet include a coupler. But there are plans to extend climt to a fully coupled Earth system model in the future. The toolkit is also written in such a way that it could enable the development of non-climate models (e.g. weather prediction, large-eddy simulation). To do so requires only that the prognostic and diagnostic schemes are wrapped into the correct Python-accessible interface.

climt builds on sympl, which provides the base classes and array and constants handling functionality. Thanks to sympl and Pint, climt is also a fully units aware model. It is useful to know how sympl works to use climt better. Read more about sympl at https://sympl.readthedocs.io.

Installation

Note - The GFS dynamical core has been made into a seperate package called gfs_dynamical_core for ease of maintenance. If you need the dynamical core, please install this package from source or directly using pip. Doing this will automatically install climt as well.

pip install gfs_dynamical_core

climt can be installed directly from the python package index using pip.

pip install climt

should work on most systems. From version 0.9.2 onwards, this command will install binary wheels, eliminating the requirement of a compiler on your system.

Detailed instructions for Mac and Linux systems are available in the documentation.

Features

  • climt is fully units-aware!

  • Uses the xarray DataArray abstraction to build self describing model arrays.

  • Provides different levels of abstraction towards building a climate model.

  • Like sympl, climt consciously uses descriptive names in the user API to ensure model scripts are self-documenting.

  • Allows for quick prototyping of earth system model components.

  • Provides a clean and convenient interface to add new components.

Citing climt

If you use climt in your research, please cite the following paper documenting sympl and climt

https://www.geosci-model-dev.net/11/3781/2018/

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

Unreleased

v.0.30.0

  • Behaviour changeBucketHydrology surface fluxes were missing their air-density factors and are now dimensionally correct. The bulk formulae are built from one evaporative mass flux E = beta * rho * c_D * U * (q_s - q_a), with rho the density at the lowest model level from the ideal gas law. Consequences:

    • surface_upward_sensible_heat_flux gains rho * c_p and is about 1200x larger (it was ~0.05 W m^-2 where tens of W m^-2 are physical).

    • surface_upward_latent_heat_flux gains rho and is about 1.2x larger.

    • evaporation_rate, declared m s^-1, is now the liquid-water-equivalent depth rate E / rho_water and is about 830x smaller. Previously it returned metres per day rather than millimetres per day, draining the default 0.15 m bucket in roughly 90 minutes.

    Soil-moisture and surface-temperature evolution therefore change for any run with non-zero wind. air_pressure ([mid_levels, *], Pa) is a new required input. The cached regression outputs are unaffected because their default state has zero wind, which zeroed both fluxes regardless; tests/test_bucket_fluxes.py now covers the flux magnitudes directly.

  • climt now publishes a pure-Python wheel (py3-none-any) to PyPI alongside the compiled platform wheels. It carries no Fortran/Cython extensions, so the components that need them raise a clear error on use (climt.has_fortran_extensions() reports availability), but the rest of the package — including the CORK correlated-k radiation scheme — works anywhere Python runs, including in the browser under Pyodide. pip continues to prefer the compiled wheel wherever one is published for your platform.

  • Windows binaries are no longer built, tested or published. The Windows CI job and the Windows release job (which uploaded a separate mingw-built wheel to PyPI) have both been removed. Windows users now install the pure-Python wheel described above: it needs no compiler, but the Fortran-backed components raise on use — check with climt.has_fortran_extensions(). Building from source on Windows may still work but is unsupported; WSL is the recommended route for the compiled components. Linux (x86_64) and macOS (Apple silicon) compiled wheels are unaffected.

  • New land-surface physics: BucketHydrology gains an optional two-layer (deep + shallow) mode via num_layers=2, adding deep_soil_moisture_content / deep_soil_temperature stores and runoff_rate diagnostics. The num_layers=1 default is unchanged (bit-for-bit). A stray hardcoded soil-moisture clamp that ignored the configured soil_moisture_max was also fixed.

  • New component SecondBEST: a modular, intermediate-complexity BEST land-surface model built as a thin Stepper orchestrator over five swappable process objects (SoilProperties, SurfaceAlbedo, SurfaceLayer, SurfaceFluxes, SubsurfaceTransport), each with a Best* default. Adds a soil vertical grid, soil-profile state quantities, and registers the von_karman_constant. SecondBEST also emits stability-consistent screen-level diagnostics on land columns (air_temperature_at_2m, specific_humidity_at_2m, eastward_wind_at_10m, northward_wind_at_10m), interpolated between the surface and the lowest model level using the surface layer’s own stability profile.

  • New components for ocean/ice surface physics: LandMask, SeaIce, LandIce and DataOcean, plus a slab-ocean q-flux (prescribed ocean_heat_transport_convergence) and optional Ekman heat-transport convergence in SlabSurface (include_ekman).

  • SlabSurface: when include_ekman=True, the ocean_heat_transport_convergence diagnostic now reports the TOTAL ocean heat-transport convergence actually applied to sea cells (prescribed q-flux + Ekman), not just the prescribed input. The Ekman-only breakdown is still available separately as ekman_heat_transport_convergence. With the default include_ekman=False, Ekman is zero and this diagnostic is unchanged from prior releases.

  • Deprecated: IceSheet is deprecated in favor of the new SeaIce (owns area_type == "sea_ice") and LandIce (owns area_type in ("land", "land_ice")) components. IceSheet is now a thin dispatching shim over SeaIce/LandIce kept only for backward compatibility, and emits a DeprecationWarning on construction. Its numerical output is not bit-for-bit identical to the old monolith, even with default arguments, because SeaIce/LandIce carry deliberate defect fixes:

    • The basal boundary condition changed from a hardcoded freezing Dirichlet condition to a prescribed ocean-heat-flux Flux (Neumann) condition (heat_flux_into_sea_water_due_to_sea_ice).

    • Sea-ice thickness is now clamped to be non-negative.

    • Surface albedo is now configurable rather than hardcoded.

    • The surface_downward_heat_flux_in_sea_ice diagnostic is now produced only by the internal SeaIce instance, so it reads as the registered default of 0.0 on land/land_ice columns (previously computed uniformly across sea_ice, land_ice and land columns by the old monolith).

    • Columns with area_type == "sea" (owned by neither SeaIce nor LandIce) now pass surface_temperature straight through from the input instead of taking either sub-component’s internally derived proxy value.

    Existing users of IceSheet should migrate to SeaIce and LandIce directly; see their docstrings for further detail on each fix.

v.0.17.0

  • Removed dycore to move it to independent package

v.0.16.15

  • Move to Github Actions tentatively finished!

v.0.16.11

  • New component BucketHydrology that implements Manabe first generation land model

  • BucketHydrology calculates the sensible and latent heat flux within the component

  • Conservation test for the component also added

  • Moving CI to Github Actions

v.0.16.8

  • Fix timeout for all MAC builds

v.0.16.6

  • Prevent MAC OS builds from timing out

v.0.16.5

  • Fix formatting errors which prevent pypi deployment

v.0.16.4

  • Fix MCICA for the shortwave component of RRTMG

  • Revise random number generation for MCICA

  • Improvement of the user interface to control MCICA

v.0.16.3

  • update numpy requirement to avoid binary incompatibility error

  • Fix error in documentation

v.0.16.2

  • Fix wheel build on Mac

v.0.16.1

  • Fixed issue with Mac build

  • Few changes in the dry convection component. Significantly improves the performance.

  • Changed logo!

  • Fixed failing docs build

v0.16.0

  • Added some documentation for using RRTMG with McICA

  • CI Testing for Mac and py37 added.

  • Refactored initialisation code

  • Enable the McICA version of RRTMG Longwave for consistency with the Shortwave component.

  • Fix bugs in IceSheet

  • Add tests to verify conservation of quantities

  • Fix bugs in initialisation

  • Fix energy conservation in surface flux scheme

  • Enable the McICA version of RRTMG Shortwave, so that partial cloud fractions can be used.

  • Add GMD example scripts to repository.

  • Fix docs to reflect API changes after refactor.

  • Fix wrong initialisation to use sigma values instead of pressure values of optical depth for GrayLongwaveRadiation

Breaking Changes

  • The flux outputs of GrayLongwaveRadiation have been renamed to eliminate on_interface_levels to keep consistency with other components.

  • All arrays are now 3/2d by default based on their expected dimensions.

  • horizontal dimensions are now lon, lat, but inputs used by components remain the same (latitude, longitude).

v.0.14.8

Many of the changes in this version come from changes in Sympl 0.4.0. We recommend reading those changes in the Sympl documentation.

  • Updated component APIs to work with Sympl 0.4.0

  • Many components which previously required horizontal dimensions now use wildcard matches for column dimensions.

  • Switched many print statements to logging calls.

  • Fixed bugs in some components

Breaking Changes

  • get_constant and set_constant have been removed, use the ones in Sympl.

  • Emanuel convection scheme can no longer be set to perform dry adiabatic adjustment to the boundary layer. This has been implemented in a separate component.

  • ClimtPrognostic, ClimtImplicitPrognostic, ClimtDiagnostic, ClimtImplicit have been removed. Use the base types in Sympl.

  • State initialization has been entirely re-worked. get_default_state now takes in an optional grid state instead of options to do with the state grid. A function get_grid is provided which can create a grid state, or one can be created manually. A grid state is a state containing air pressure and sigma on mid and interface levels, as well as surface pressure.

  • Replaced references to “thermal_capacity” with references to “heat_capacity” in component quantity names.

v.0.14.7

  • Fix issue with pip v10 and pandas 0.22 conflicts

v.0.14.3

  • Fix release issue because of pip API change

v.0.14.1

  • Fix appveyor fail due to pip changes

v.0.14.0

  • Fixed broken version numbers

v.0.12.0

  • new release to fix version numbers and create zenodo ID

v.0.9.4

  • Added attributes to inputs/outputs/ etc., to work with ScalingWrapper Added tests as well.

  • Added tests for constants functions

  • Fixed requirements to ensure this version of climt installs the correct versions of sympl and numpy.

v.0.9.3

  • Released because of a labelling issue. See 0.9.2 for details.

v.0.9.2

  • Updated documentation

  • Cleaned up examples

  • Added (*)_properties as a property to all components

  • The gas constant for dry air in the Emanuel scheme is now renamed _Rdair

  • RRTMG LW and SW are now OpenMP parallel

  • Added Instellation component to calculate zenith angle

  • Added tests to increase coverage

  • New constants handling functionality added

  • Travis builds now use stages

  • Appveyor CI up and running

  • Pre-installation of cython and numpy no longer necessary for source builds

  • Added snow-ice component

  • Ozone profiles do not need to be specified externally

  • Now also tested on Python 3.6

Breaking Changes

  • API for constants setting changed to set_constant_from_dict and add_constants_from_dict

  • GfsDynamicalCore renamed to GFSDynamicalCore for consistency

  • get_prognostic_version method of ClimtImplicit renamed to prognostic_version, and no longer accepts timestep as an argument. The current timestep should be set in ClimtImplicit.current_time_step during each iteration.

  • RRTMGShortwave now uses sympl’s solar constant by default instead of from fortran.

v.0.9.1

  • Held-Suarez and moist GCM with grey radiation work!

  • Added DCMIP initial conditions, test 4 tried out.

  • Dynamical core integrated now.

  • BIG change in the build system. Tests pass on Mac as well

  • Arrays can now have arbitrary dtype (to use qualitative, string, quantities)

  • Added Emanuel Convection, surface energy balance model and ice sheet energy balance

  • 2D coordinates are now supported for horizontal coordinates

  • Replaced create_output_arrays() with a more general get_state_dict_for() and get_numpy_arrays_from_state() combination.

  • State arrays now have coordinates

  • Updated documentation

  • RTD finally working, phew!

  • Added RRTMG Longwave, Simple Physics

  • Added helper functions to reduce boilerplate code in components

Breaking Changes

Latest

  • method to obtain piecewise constant prognostic has been renamed to piecewise_constant_version

  • Ozone profile has been modified

  • Heating rate for RRTMG top-of-atmosphere is no longer manually set to zero

  • Components no longer accept constants during initialisation. All constant handling is done internally.

v.0.9

  • SlabSurface no longer uses depth_slab_surface as input

  • changed order of outputs of GfsDynamicalCore and SimplePhysics to conform to TimeStepper order of diagnostics, new_state

  • get_default_state now accepts mid_levels and interface_levels instead of z to specify vertical coordinates.

  • mass_to_volume_mixing_ratio now uses numpy arrays instead of DataArrays.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

climt-0.30.0-py3-none-any.whl (8.3 MB view details)

Uploaded Python 3

climt-0.30.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

climt-0.30.0-cp312-cp312-macosx_15_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.12macOS 15.0+ ARM64

climt-0.30.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

climt-0.30.0-cp311-cp311-macosx_15_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.11macOS 15.0+ ARM64

climt-0.30.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (13.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

climt-0.30.0-cp310-cp310-macosx_15_0_arm64.whl (13.3 MB view details)

Uploaded CPython 3.10macOS 15.0+ ARM64

File details

Details for the file climt-0.30.0-py3-none-any.whl.

File metadata

  • Download URL: climt-0.30.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for climt-0.30.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0247b7c83d8cde8eb500f852b4bf91b3b7b8216cd865633e963f4cae4b0d4fd
MD5 efeb0492256c4c3f0bc0ddec6b0e08c5
BLAKE2b-256 feb5bc923a58ea994cd809f95e237523cdcc6f466a6dbf15f26c1ec64b20f7f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-py3-none-any.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3a8306e9b76a6efce20804c82f8bf564fb05c47262cb78908e5a079015f760e1
MD5 62e052c246087ea698aef46ae33e00ef
BLAKE2b-256 97ab766c7dc260a0d523dcfa271d7cbe1a9411dc8925c644278befb1b4fd8cab

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp312-cp312-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp312-cp312-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 945f90e645253d9a1cd448154ca164096431960f9c6cdd7e937f7787243f8f17
MD5 0d70a837c87598d38e14fb33a76465dc
BLAKE2b-256 24756c0b325f8d22c2ae79edd9ca0d8781172e354a083e6bd9cc110f871cb91e

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp312-cp312-macosx_15_0_arm64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ff0b72da836b9a3b88e847c919a1f7008d941eff6fd870a1594fd5bf906a0cdf
MD5 0978ba4c9b584d659ef7588496b44089
BLAKE2b-256 38d771e48e84a385f58061537a1721175201bb48c1d3e918a9f58e7319e1b006

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp311-cp311-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp311-cp311-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 bd4a5e73c214127dc26b36999ca9fd9ca615bd384d8f91e92e3f09f885ffb169
MD5 525c8ab377f907e7e5657f27328aa788
BLAKE2b-256 6dce000d9fbbed3d904b7b11c6beb9a0789e008269471fd54e42c30e4f7beaa5

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp311-cp311-macosx_15_0_arm64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a35f7aacf9a60ab6c0ea71c0aedf2fd307af206e13acbe37f1be26f8f1b983a1
MD5 cd1d044fe4570487a7071d0d990a71f2
BLAKE2b-256 ec18702ac9e23031b231b19c40ce9c9f8e2974f867984556f3b1d64055e616e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file climt-0.30.0-cp310-cp310-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for climt-0.30.0-cp310-cp310-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 ebe31470598c4ab7c6d798cdc0d98d1d33acd61789ab2aa48c609eed793a07cd
MD5 cdc1e82f6795219c7f2b5160eb09c5e4
BLAKE2b-256 b38e99f4ab0a1ecc85a770284c5d855b9c8139b6325b6d678b75bdfaad36c8cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for climt-0.30.0-cp310-cp310-macosx_15_0_arm64.whl:

Publisher: release_climt.yml on CliMT/climt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page