{
"cells": [
{
"cell_type": "markdown",
"id": "9d00daa0-b7f1-4a33-93ef-e9201d659a2a",
"metadata": {
"tags": []
},
"source": [
"
\n",
"\n",
"# ICON Training - Hands-on Session
Exercise 5: Programming ICON - Running ICON\n",
"\n",
"In this notebook, we will set up and submit an ICON job on Levante based on the setup from the previous [Exercise 4: Running the ICON-LAM Setup](../../exercise_lam/icon_exercise_lam.ipynb).\n",
"The output namelist will be amended by the new variable added to the code in [Exercise 5: Programming ICON](../icon_exercise_programming.ipynb)."
]
},
{
"cell_type": "markdown",
"id": "96936d85-b598-4dd1-afae-12b0973f28f9",
"metadata": {},
"source": [
"## General preparations (from the previous exercise)"
]
},
{
"cell_type": "markdown",
"id": "36e5039f-7eb1-4ccc-9012-c01b5a1beb27",
"metadata": {},
"source": [
" Base directory for ICON sources and binary:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fa169378-1a13-475c-8910-10572ce752e7",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"export SCRATCHDIR=/scratch/${USER::1}/$USER\n",
"export ICONDIR=$SCRATCHDIR/icon"
]
},
{
"cell_type": "markdown",
"id": "3c52a96c-fea9-4e2c-85f7-a8791dce1be8",
"metadata": {},
"source": [
"Absolute path to directory with plenty of space:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "3ba2037f-c1e6-45b7-b225-617ba8b28172",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"export EXPDIR=$SCRATCHDIR/exercise_programming\n",
"if [ ! -d $EXPDIR ]; then\n",
" mkdir -p $EXPDIR\n",
"fi"
]
},
{
"cell_type": "markdown",
"id": "95466b36-4272-4a1d-93fb-df1fdbe65e91",
"metadata": {},
"source": [
"We start by preparing all the necessary data in the output directory. Note that the following block copies already prepared namelists [icon_master.namelist](../prepared/icon_master.namelist), [NAMELIST_ICON](../prepared/NAMELIST_ICON) and a [sbatch script](../prepared/icon-lam.sbatch) into the output directory."
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "caf61e99-2c73-4596-a676-b733f666b707",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"export SCRIPTDIR=$HOME/icon-training-scripts/exercise_programming\n",
"cp $SCRIPTDIR/prepared/icon_master.namelist $EXPDIR/\n",
"cp $SCRIPTDIR/prepared/NAMELIST_ICON $EXPDIR/\n",
"cp $SCRIPTDIR/prepared/icon-lam.sbatch $EXPDIR/"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b84a6165-0b4b-4802-bacc-8a179aaf58ca",
"metadata": {},
"outputs": [],
"source": [
"# directory with input grids and external data:\n",
"export GRIDDIR=/pool/data/ICON/ICON_training/exercise_lam/grids\n",
"# directory with initial data (takes reference data which is identical to the output of Ex. 4):\n",
"export DATADIR=/pool/data/ICON/ICON_training/exercise_lam/data_lam\n",
"\n",
"cd ${EXPDIR}\n",
"\n",
"# Link data needed for radiation\n",
"ln -sf ${ICONDIR}/externals/ecrad/data ecrad_data\n",
"\n",
"# grid files: link to output directory\n",
"ln -sf ${GRIDDIR}/*.nc .\n",
"# data files\n",
"ln -sf ${DATADIR}/* .\n",
"\n",
"# dictionaries for the mapping: DWD GRIB2 names <-> ICON internal names\n",
"ln -sf ${ICONDIR}/run/ana_varnames_map_file.txt .\n",
"ln -sf ${GRIDDIR}/../exercise_lam/map_file.latbc .\n",
"\n",
"# For output: Dictionary for the mapping: names specified in the output nml <-> ICON internal names\n",
"ln -sf ${ICONDIR}/run/dict.output.dwd dict.output.dwd"
]
},
{
"cell_type": "markdown",
"id": "69a7f48b-14c3-4fca-8689-f1ad595ef253",
"metadata": {
"tags": []
},
"source": [
"## Adding a new output namelist"
]
},
{
"cell_type": "markdown",
"id": "de95dea0-18a3-4507-a960-7889ef5b16c2",
"metadata": {
"tags": []
},
"source": [
"
\n",
" ml_varlist = 'process_id'\n",
"
\n",
"\n",
"