Compile and Run¶
Access¶
The ICON repository is hosted on the C2SM GitHub organisation. If you do not have access, please follow the instructions under How to get Access.
If you do not already have an SSH key set up for GitHub, but would like to do so, follow the instructions .
Since 2024, ICON is open-source and comes with semi-annual releases, which can be accessed via this public repository .
If you are an ICON developer, you should have access to the DKRZ GitLab, where the original ICON repository is hosted. All developments related to GPU go
into the icon-nwp
repository .
Configure and compile¶
Below you find instructions on how to compile different flavors of ICON on C2SM-supported machines.
Clone the ICON repository:
git clone -b release-2025.04 --recurse-submodules git@github.com:C2SM/icon.git
git clone -b release-2025.04-public --recurse-submodules https://gitlab.dkrz.de/icon/icon-model.git
git clone --recurse-submodules git@gitlab.dkrz.de:icon/icon-nwp.git
Säntis¶
Last update: 2025-05-22
Säntis is regularly maintained by CSCS. In addition, the uenvs are updated irregularly. Therefore, some of the information provided here may be out of date. Please use the C2SM support forum in case of questions regarding building ICON on Säntis.
Run the following after navigating into the ICON root folder (replace gpu
by cpu
if applicable):
UENV_VERSION=$(cat config/cscs/SANTIS_ENV_TAG)
uenv run ${UENV_VERSION} -- ./config/cscs/santis.gpu.nvhpc
Note
If you have never used a uenv on Säntis, you need to create a uenv repo first:
uenv repo create
In case you are using the uenv version for the first time, you need to pull the image first:
uenv image pull $UENV_VERSION
Building out-of-source¶
Out-of-source builds are useful if you want to have two or more compiled versions of ICON in the same repository. To achieve that, you simply need to create separate folders in the ICON root folder and run the configure wrapper from there.
For example, if you want to compile ICON both for cpu
and gpu
, create those directories:
mkdir nvhpc_cpu
mkdir nvhpc_gpu
Then, navigate into the corresponding folder and compile with:
UENV_VERSION=$(cat config/cscs/SANTIS_ENV_TAG)
cd nvhpc_cpu
uenv run ${UENV_VERSION} -- ./../config/cscs/santis.cpu.nvhpc
UENV_VERSION=$(cat config/cscs/SANTIS_ENV_TAG)
cd nvhpc_gpu
uenv run ${UENV_VERSION} -- ./../config/cscs/santis.gpu.nvhpc
Euler¶
Navigate into the ICON root folder.
Now, set up your spack instance:
# Setup spack
SPACK_TAG=$(cat "config/ethz/SPACK_TAG_EULER")
git clone --depth 1 --recurse-submodules --shallow-submodules -b ${SPACK_TAG} https://github.com/C2SM/spack-c2sm.git
. spack-c2sm/setup-env.sh
Euler Support recommends to compile code on compute nodes. There,
we can take advantage of multi-core compiling.
However, we need to load the module eth_proxy
, which enables connecting from a compute node
to an external service, e.g. GitHub or GitLab.
module load eth_proxy
Now, activate the spack environment and build ICON:
# Build ICON
# For out-of-source builds: navigate into the build folder and
# adapt the path to the Spack environment in the following
spack env activate -d config/ethz/spack/${SPACK_TAG}/euler_cpu_gcc
srun -N 1 -n 12 --mem-per-cpu=1G spack install -j 12
Run test case¶
In the run folder, you find many prepared test cases, which you can convert into run scripts. To generate the runscript of one of the experiment files, e.g. c2sm_clm_r13b03_seaice, you can use the make_runscripts
function.
./make_runscripts c2sm_clm_r13b03_seaice
To run the created runscript, navigate to the run subdirectory and submit the runscript.
UENV_VERSION=$(cat config/cscs/SANTIS_ENV_TAG)
cd run && sbatch --uenv ${UENV_VERSION} ./exp.c2sm_clm_r13b03_seaice.run
cd run && sbatch ./exp.c2sm_clm_r13b03_seaice.run
cd run && sbatch ./exp.c2sm_clm_r13b03_seaice.run
You may need to adjust the account in the runscript to match your permissions. Alternatively, you can include --account=<my_account_id>
in the sbatch
command.
Input data¶
There are two types in input data sets available for ICON:
- General input data for use cases / production runs
- Testing input data for CI
Input data pools¶
/capstor/store/cscs/userlab/cws01/pool/data/ICON
/scratch/mch/jenkins/icon/pool/data/ICON
/cluster/work/climate/icon_input
Testing input data pool¶
The input data for standard ICON tests are stored in a Git-lfs repository .
/capstor/store/cscs/userlab/d126/testing-input-data
/scratch/mch/icontest/testing-input-data
/cluster/work/climate/icon_testing_input