Usage¶
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.
Once you have access, clone the repository from GitHub using the SSH protocol:
git clone --recurse-submodules git@github.com:C2SM/icon.git
Configure and compile¶
Piz Daint¶
Spack is used to build ICON. Please follow the steps below to set up Spack and build ICON.
1. Set up a Spack instance
To set up a Spack instance , ensure that you clone the repository using the Spack tag provided in the ICON repository at config/cscs/SPACK_TAG_C2SM and load it into your command line.
2. Build ICON
Refer to the official spack-c2sm documentation for installing ICON using Spack .
After the fist compilation, you need to create a setting
file:
SPACK_TAG=$(cat "config/cscs/SPACK_TAG_C2SM")
ENV_NAME=daint_gpu_nvhpc # modify if necessary
module load daint-gpu CDO
rm -f setting
./config/cscs/create_sh_env $SPACK_TAG $ENV_NAME
Euler¶
Spack is used to build ICON. Please follow the steps below to set up Spack and build ICON.
1. Set up a Spack instance
To set up a Spack instance , ensure that you clone the repository using the Spack tag provided in the ICON repository at config/ethz/SPACK_TAG_EULER and load it into your command line.
2. Build ICON
Activate the Spack environment for Euler:
SPACK_TAG=$(cat "config/ethz/SPACK_TAG_EULER")
spack env activate -d config/ethz/spack/$SPACK_TAG/euler_cpu_gcc
Euler Support recommends to compile code on compute-nodes. Unfortunately internet-access on Euler compute-nodes is restricted . Therefore a two-step install needs to be performed:
# fetch and install cosmo-eccodes-definitions on login-node
spack install cosmo-eccodes-definitions
# compile ICON on compute-nodes
srun -N 1 -c 12 --mem-per-cpu=20G spack install -v -j 12
Todi¶
Under construction - last update: 2024-09-20
Information on this section is not yet complete nor final. It will be updated following the progress of the Alps system deployment at CSCS and C2SM's adaptation to this new system. Please use the C2SM support forum in case of questions regarding building ICON on Alps.
On Todi, Spack is also used to build ICON. However, these is no suitable spack.yaml
file present for the Spack environment. Therefore, create a spack.yaml
file and use the software stack upstream provided by the user environment.
1. Create a spack.yaml
file
From your ICON root folder:
spack:
specs:
- cosmo-eccodes-definitions@2.25.0.2
- icon @develop %nvhpc +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace +acm-license gpu=openacc+cuda +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma +pgi-inlib +cuda-graphs
view: true
concretizer:
unify: when_possible
develop:
icon:
path: ../../../../..
spec: icon @develop %nvhpc +grib2 +eccodes-definitions +ecrad ~emvorado +art +dace +acm-license gpu=openacc+cuda +mpi-gpu +realloc-buf ~aes ~jsbach ~ocean ~coupling ~rte-rrtmgp ~loop-exchange ~async-io-rma +pgi-inlib +cuda-graphs
2. Build ICON
# Load ICON user-environment
uenv start --view=spack icon-wcp/v1:rc4
# Setup spack
SPACK_TAG='v0.21.1.3'
git clone --depth 1 --recurse-submodules --shallow-submodules -b ${SPACK_TAG} https://github.com/C2SM/spack-c2sm.git
. spack-c2sm/setup-env.sh /user-environment
# Build ICON
cd /path/to/icon
spack env activate -d config/cscs/spack/${SPACK_TAG}/todi_gpu_nvhpc
spack install
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. mch_ch_lowres, you can use the make_runscripts
function.
./make_runscripts mch_ch_lowres
To run the created runscript, navigate to the run subdirectory and submit the runscript.
cd run && sbatch ./exp.mch_ch_lowres.run
--account <my_account_id>
in the sbatch
command.
Input data¶
ICON input data are stored at the following locations:
- Piz Daint (CSCS):
/users/icontest/pool/data/ICON
- Euler:
/cluster/work/climate/icon_input