Skip to main content

ICON Grid Generator

Tests Docs PyPI Python License

Pure Python generation of ICON-style triangular grids.

Global ICON grid resolutions

ICON Grid Generator creates spherical ICON R<n>B<k> grids, planar triangular grids, limited-area extracts, and ICON-style NetCDF files without depending on ICON model runtimes or stencil frameworks.

Quick Start

from grid_generator import generate_grid

grid = generate_grid("R2B4")
print(grid.name)
print(grid.dims)
grid.to_netcdf("icon_grid_R02B04.nc")
R02B04
{'cell': 20480, 'vertex': 10242, 'edge': 30720}

Global grids are optimized by default. Pass optimize_global=False only when raw bisection geometry is required for diagnostics or comparisons.

What You Can Generate

  • Global spherical ICON grids from standard R<n>B<k> names.
  • Planar triangular torus, channel, parallelogram, stretched, and ragged grids.
  • Limited-area grids extracted from generated global parents.
  • Region-based cuts of existing spherical or planar grids.
  • ICON-style NetCDF files and complete in-memory xarray datasets.
  • Geometry, topology, metric, refinement, diagnostic, and visualization data.

Installation

Python 3.10 or newer is required. Install acceleration plus the common NetCDF and xarray support from PyPI with:

python -m pip install "icon-grid-generator[accelerate,netcdf,xarray]"

The base package still depends only on NumPy and can instead be installed with python -m pip install icon-grid-generator. That path is correct and deterministic, but its NumPy fallback is not practical for high-resolution global grids. Install the accelerate extra to enable the measured Numba path; accelerator="auto" selects it automatically for sufficiently large work.

Performance

Optimized global grids were measured on an exclusive dual-socket AMD EPYC 7713 node with 128 physical cores (256 hardware threads) and about 446 GiB of scheduler-visible memory. Python 3.11, NumPy 2.4.6, Numba 0.66, and 128 Numba threads were used. Times are single runs and storage is uncompressed ICON-style NetCDF; shared-filesystem write time varies with load.

Grid Cells Generation Peak RSS Retained arrays NetCDF storage
R2B8 5,242,880 56.5 s 4.35 GiB 3.01 GiB 4.09 GiB
R2B9 20,971,520 2.02 min 16.57 GiB 12.03 GiB 16.37 GiB
R2B10 83,886,080 6.13 min 64.85 GiB 48.13 GiB ~65.5 GiB
R2B11 335,544,320 37.10 min 255.87 GiB 192.50 GiB 261.88 GiB

The R2B11 file was written and validated in another 8.52 minutes, for a 45.83-minute end-to-end run. Install accelerate, set max_cells=None, and leave accelerator="auto" or select "numba" explicitly for this scaling regime. See Performance and Scaling for methodology, caveats, and the main remaining bottlenecks.

Documentation

The complete documentation is published at ofuhrer.github.io/icon-grid-generator:

Development

See CONTRIBUTING.md for setup and contribution guidance. Run the complete local check with:

python -m pip install -e ".[accelerate,test,docs,netcdf,xarray]"
make check
make perf-check

Citation

If you use ICON Grid Generator in published work, cite it using CITATION.cff.

License

ICON Grid Generator is distributed under the BSD 3-Clause License.

Download files

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

Source Distribution

icon_grid_generator-0.5.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

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

icon_grid_generator-0.5.0-py3-none-any.whl (74.8 kB view details)

Uploaded Python 3

File details

Details for the file icon_grid_generator-0.5.0.tar.gz.

File metadata

  • Download URL: icon_grid_generator-0.5.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for icon_grid_generator-0.5.0.tar.gz
Algorithm Hash digest
SHA256 32c7e205e7372ac88bfa72f04f16818b3ffae4917a76adfa306f91a3f51bba41
MD5 927f1cee880bb87c9d338b95512cfdfe
BLAKE2b-256 56caa1d1c8e3069050aecc210f38ceeedc19f190a978747c62a24ddddb043e22

See more details on using hashes here.

Provenance

The following attestation bundles were made for icon_grid_generator-0.5.0.tar.gz:

Publisher: release.yml on ofuhrer/icon-grid-generator

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

File details

Details for the file icon_grid_generator-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for icon_grid_generator-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f11b2a0cfdf6c8b8075fe92dff61c09b64f4a6b19b90b8c814c6b8e3494dff68
MD5 6b30c2295491f65b1e5ff8c94deb68b7
BLAKE2b-256 fa51ab87ecd29c3bf1ffeadeae9fad5603966cb172ba70ce3588812d8f689e67

See more details on using hashes here.

Provenance

The following attestation bundles were made for icon_grid_generator-0.5.0-py3-none-any.whl:

Publisher: release.yml on ofuhrer/icon-grid-generator

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

Release history Release notifications | RSS feed

0.9.0

2 files

0.8.1

2 files

0.8.0

2 files

0.7.0

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

This release

0.5.0 This release

2 files

0.4.1

2 files

0.4.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 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