Skip to main content

Standalone driver for ICON4Py

main.py contains a simple Python program to run the experimental ICON4Py port.

The driver reads its configuration from a configuration directory, initializes the grid and model state, and runs the time integration. Which granules are active (diffusion, solve_nonhydro, tracer advection, microphysics) is determined by the provided configuration rather than being hardcoded.

It supports both single-node and distributed (MPI) runs. IO output is currently single-node only and is therefore disabled for MPI runs.

Installation

See the general instructions in the README.md in the base folder of the repository.

Usage

# set environment variables (optional but convenient)
export ICON4PY_ROOT=<path to the icon4py clone>
export GRID_FOLDER=<path to the folder holding grids>
export CONFIG_FOLDER=<path to the configuration directory>

# command line arguments
icon4py-standalone-driver \
    --grid-file-path $GRID_FOLDER/icon_grid_0013_R02B04_R.nc \
    --config-file-path $CONFIG_FOLDER \
    --icon4py-backend gtfn_cpu \
    --output-path $ICON4PY_ROOT/output_path \
    --enable-output

Configuration directory

The driver expects a configuration directory containing the following JSON files:

  • NAMELIST_ICON_output_atm.json
  • icon_master.namelist.json
  • NAMELIST_expname.json

These are generated from the corresponding Fortran namelists and describe the experiment, the atmosphere setup, and the input parameters.

To generate these from an experiment run with Fortran ICON you can use the f90nml Python package to generate the JSON files from the original NAMELIST files of the Fortran ICON simulation. Once the Fortran ICON simulation has finished, there is a folder generated in <ICON_ROOT>/<BUILD_TYPE>/experiments/<EXPERIMENT_NAME> that includes the necessary NAMELIST files to configure the ICON4Py standalone_driver. Using the following instruction you can export the necessary files to their JSON equivalent format:

mkdir CONFIG_DIR
f90nml -g config_nml <ICON_ROOT>/<BUILD_TYPE>/experiments/<EXPERIMENT_NAME>/NAMELIST_ICON_output_atm CONFIG_DIR/NAMELIST_ICON_output_atm.json
f90nml -g config_nml <ICON_ROOT>/<BUILD_TYPE>/experiments/<EXPERIMENT_NAME>/icon_master.namelist CONFIG_DIR/icon_master.namelist.json
f90nml -g config_nml <ICON_ROOT>/<BUILD_TYPE>/experiments/<EXPERIMENT_NAME>/NAMELIST_<EXPERIMENT_NAME> CONFIG_DIR/NAMELIST_expname.json

Once the above is done you can provide the CONFIG_DIR to the --config-file-path of the icon4py-standalone-driver to configure the simulation the same way as the ICON Fortran one.

Of course you can write the necessary configuration files manually or start by some template files and edit them yourself.

Required options

  • --grid-file-path: path to the ICON grid file.
  • --config-file-path: path to the directory containing the configuration JSON files.
  • --icon4py-backend: GT4Py backend for running the driver. Run with --help to see the available backends.

Optional options

  • --output-path: override the output path from the configuration file.
  • --log-level: logging level. Possible values are notset (default), debug, info, warning, error, critical.
  • --print-distributed-debug-msg: print debug logging messages from all MPI ranks (only effective when --log-level debug is set).
  • --enable-output/--no-enable-output: write prognostic and diagnostic fields to output. Defaults to --no-enable-output. Disabled automatically in MPI runs.

Metadata

Release files for icon4py-standalone-driver 0.3.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 icon4py-standalone-driver 0.3.0
File Size Uploaded
icon4py_standalone_driver-0.3.0.tar.gz 30.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for icon4py-standalone-driver 0.3.0
File Interpreter ABI Platform
icon4py_standalone_driver-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 64.1 kB

Release files / icon4py_standalone_driver-0.3.0.tar.gz

Download URL icon4py_standalone_driver-0.3.0.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
debc63fd07b7adef362e956bc0acdb188fde15cb139ad2a889e71c2462f21b18
BLAKE2b-256 checksum
How to use checksums
fcfc21977c7aab41011304b329fa68fbc37bb900c1c7bbcd51e0e212d4817061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Release files / icon4py_standalone_driver-0.3.0-py3-none-any.whl

Download URL icon4py_standalone_driver-0.3.0-py3-none-any.whl
Size 33.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34cba8113f67846822dbce7e21308223e560dda7795670bc275efc76a0b0820f
BLAKE2b-256 checksum
How to use checksums
3dc8056d73d2f88a932ebc34bf5b56f08b5af85a0521e9e5b7e003f658b4c5a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.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 Jul 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

0.2.0

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