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.jsonicon_master.namelist.jsonNAMELIST_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--helpto see the available backends.
Optional options
--output-path: override the output path from the configuration file.--log-level: logging level. Possible values arenotset(default),debug,info,warning,error,critical.--print-distributed-debug-msg: print debug logging messages from all MPI ranks (only effective when--log-level debugis set).--enable-output/--no-enable-output: write prognostic and diagnostic fields to output. Defaults to--no-enable-output. Disabled automatically in MPI runs.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file icon4py_standalone_driver-0.3.0.tar.gz.
File metadata
- Download URL: icon4py_standalone_driver-0.3.0.tar.gz
- Upload date:
- Size: 30.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
debc63fd07b7adef362e956bc0acdb188fde15cb139ad2a889e71c2462f21b18
|
|
| MD5 |
883874ec102836c373cd12db27f690fc
|
|
| BLAKE2b-256 |
fcfc21977c7aab41011304b329fa68fbc37bb900c1c7bbcd51e0e212d4817061
|
Provenance
The following attestation bundles were made for icon4py_standalone_driver-0.3.0.tar.gz:
Publisher:
pypi-deploy.yml on C2SM/icon4py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
icon4py_standalone_driver-0.3.0.tar.gz -
Subject digest:
debc63fd07b7adef362e956bc0acdb188fde15cb139ad2a889e71c2462f21b18 - Sigstore transparency entry: 2216793398
- Sigstore integration time:
-
Permalink:
C2SM/icon4py@07104a1be87806f8888adafe1099aa806e860d56 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/C2SM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@07104a1be87806f8888adafe1099aa806e860d56 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file icon4py_standalone_driver-0.3.0-py3-none-any.whl.
File metadata
- Download URL: icon4py_standalone_driver-0.3.0-py3-none-any.whl
- Upload date:
- Size: 33.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34cba8113f67846822dbce7e21308223e560dda7795670bc275efc76a0b0820f
|
|
| MD5 |
f5fc70ba76f3a8336b2669667839b158
|
|
| BLAKE2b-256 |
3dc8056d73d2f88a932ebc34bf5b56f08b5af85a0521e9e5b7e003f658b4c5a3
|
Provenance
The following attestation bundles were made for icon4py_standalone_driver-0.3.0-py3-none-any.whl:
Publisher:
pypi-deploy.yml on C2SM/icon4py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
icon4py_standalone_driver-0.3.0-py3-none-any.whl -
Subject digest:
34cba8113f67846822dbce7e21308223e560dda7795670bc275efc76a0b0820f - Sigstore transparency entry: 2216793784
- Sigstore integration time:
-
Permalink:
C2SM/icon4py@07104a1be87806f8888adafe1099aa806e860d56 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/C2SM
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-deploy.yml@07104a1be87806f8888adafe1099aa806e860d56 -
Trigger Event:
workflow_dispatch
-
Statement type: