{ "cells": [ { "cell_type": "markdown", "id": "4f4804ec-bfb1-46e5-bb90-41d39702b319", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "\n", "

ICON Training - Hands-on Session

\n", "\n", "# Exercise 1: Running Idealized Test Cases\n", "\n", "---\n", "\n", "The course exercises revisit the topics of the individual tutorial chapters and range from easy tests to the setup of complex forecast simulations.\n", "In this particular exercise you will learn how to set up **idealized runs in ICON with and without nested domains**. \n", "\n", "It covers the following topics:\n", "\n", "- setting up an idealized test case\n", "- downloading predefined ICON grids from the ICON download server\n", "- running ICON with one or more nested domains\n", "- working with the ICON namelist\n", "- writing output to disk\n", "\n", "\n", "**Note:** This script is not suited for operational use, it is part of the step-by-step tutorial. This exercise focuses on command-line tools and the rudimentary visualization with Python scripts. Professional post-processing and viz tools are beyond the scope of this tutorial.\n", "\n", " \n", "---" ] }, { "cell_type": "markdown", "id": "cc639b28-9259-419c-984f-f94e4f03cf94", "metadata": { "editable": true, "jp-MarkdownHeadingCollapsed": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Necessary input data\n", "\n", "ICON provides a set of predefined test cases of varying complexity and focus, ranging from\n", "pure dynamical core and transport test cases to “moist” cases, including microphysics and\n", "potentially other parameterizations. \\\n", "If you are interested in more details, please see Chapter 4 of the ICON tutorial (see the link at the bottom of the page).\n", "\n", "Most of these tests require only a very limited set of input data, which makes them comparatively easy to set up and run. \n", "A graphical overview of the necessary input data is given in the figure below.\n", "\n", "---\n", "
\n", "\"alt_text\"/\n", "
Necessary input data for idealized tests
\n", "
\n", "\n", "#### Required\n", "* **horizontal grid file(s):** coordinates and topological index relations between cells, edges and vertices\n", "\n", "#### Not required\n", "* **vertical grid file**: it is constructed during the initialization phase of ICON \n", "* **initial condition file**: initial conditions are computed by the ICON model itself on the basis of analytical functions.\n", "* **external parameter file**: topography is specified by an analytical function\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "f87c9c74-1647-4a53-a50f-127444bf6286", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Jablonowski-Williamson (JW) baroclinic wave test case\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "c3daa04b-2bf1-4712-8eb5-23b0236db920", "metadata": {}, "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", "

\n", " The global JW test has become a standard test case for assessing the \n", " quality of atmospheric dynamical cores.

\n", " The test considers the formation of a baroclinic wave in a geostrophically \n", " and hydrostatically balanced zonally symmetric basic state with a strong Equator-to-pole \n", " temperature contrast. Waves are triggered by a small perturbation in the initial wind field imposed at \n", " 20°E, 40°N.\n", "

\n", "
\n", "
\n", " \"alt_text\"/\n", "
\n", " Surface Pressure and 850hPa Temperature at day 9 for the Jablonowski-Williamson test case\n", "
\n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "59f86242-221e-45b5-b175-8029361ba799", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "---\n", "\n", "**We will set up the JW baroclinic wave test in ICON**, first without nested domains: " ] }, { "cell_type": "markdown", "id": "197b2a60-7459-4e92-8d9a-f680551af671", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", " Exercise: \n", "
\n", " Execute the following cell in order to set some environment variables that will be used during this exercise\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "eccee5ab-ad5e-4d5e-ba1d-ef516e52d65a", "metadata": { "tags": [] }, "outputs": [], "source": [ "# base directory for ICON sources and binary:\n", "export ICONDIR=/pool/data/ICON/ICON_training/icon/\n", "\n", "# directory with input grids:\n", "export GRIDDIR=$HOME/icon-training-scripts/exercise_idealized/input/\n", "\n", "# absolute path to directory with plenty of space:\n", "export SCRATCHDIR=/scratch/${USER::1}/$USER\n", "export EXPDIR=$SCRATCHDIR/exercise_idealized/exp_JW_R02B04\n", "\n", "# visualization settings\n", "export SCRIPTDIR=$HOME/icon-training-scripts/exercise_idealized/plot_scripts" ] }, { "cell_type": "markdown", "id": "e2a82937-0f36-41fb-be52-430db4f84ea8", "metadata": {}, "source": [ "In the above settings we used the `scratch` partition of the file system, with a quota of 15 TiB (see `/sw/bin/lfsquota.sh -u $USER`)." ] }, { "cell_type": "markdown", "id": "899c7f99-0f48-441e-9b0c-4b45e26cbddb", "metadata": { "tags": [] }, "source": [ "## Retrieve the horizontal grids" ] }, { "cell_type": "markdown", "id": "c92168ba-ce14-4731-b267-f78a5ab05bf6", "metadata": {}, "source": [ "
\n", " Exercise (Retrieving the grid files):\n", "
\n", " Predefined horizontal grid files are available from the ICON download server.\n", "
\n", " In order to retrieve the required grids ...\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "d9d35d9d-649a-4b99-8f0e-fd0f38f0c1cb", "metadata": { "tags": [] }, "outputs": [], "source": [ "cd $GRIDDIR\n", "wget ..." ] }, { "cell_type": "markdown", "id": "f7cd52f0-065b-4018-90f5-8d96e4dcf929", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "```\n", "cd $GRIDDIR\n", "wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/icon_grid_0054_R02B04_G.nc\n", "wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/icon_grid_0055_R02B05_N.nc\n", "wget http://icon-downloads.mpimet.mpg.de/grids/public/edzw/icon_grid_0056_R02B05_N.nc\n", "```\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "b9dcb6e4-552d-4c87-85f6-17a0f0aa14a6", "metadata": {}, "source": [ "
\n", " Exercise (Placing the grid files in the right folder):\n", "
\n", " It is good practice to place all input data in the so called experiment directory ${EXPDIR}, where also the output will be written to.
\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "85f74b5c-4f99-4c85-b20d-eacf7c45c66a", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "cd $HOME/icon-training-scripts/exercise_idealized\n", "if [ ! -d $EXPDIR ]; then\n", " mkdir -p $EXPDIR\n", "fi\n", "cd ${EXPDIR}\n", "echo ${EXPDIR}\n", "\n", "# grid files: link to output directory\n", "ln -sf ${GRIDDIR}/?????? .\n" ] }, { "cell_type": "markdown", "id": "9338ec0c-5c2e-4b1d-b821-9a49d5a466f3", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "```\n", "if [ ! -d $EXPDIR ]; then\n", " mkdir -p $EXPDIR\n", "fi\n", "cd ${EXPDIR}\n", "echo ${EXPDIR}\n", "\n", "# grid files: link to output directory\n", "ln -sf ${GRIDDIR}/icon_grid_00*.nc .\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "e3bb8f44-6c97-47d8-a2d6-71a6a2856600", "metadata": { "tags": [] }, "source": [ "## ICON namelists and job script" ] }, { "cell_type": "markdown", "id": "f4af3403-fced-4f79-be81-11a7d021ee8a", "metadata": {}, "source": [ "---\n", "\n", "
\n", "\"alt_text\"/\n", "
The ICON job script, the ICON namelist files, and their dependencies
\n", "
\n", "\n", "ICON uses **Fortran namelists** in order to control or modify the model behavior. \n", "\n", "Two namelist files have to be provided: \n", "\n", "1. **the master namelist file** (icon_master.namelist) \\\n", " contains basic settings such as the model name, or the experiment startdate and enddate\n", "2. **the model namelist file** (in this exercise named NAMELIST_NWP) \\\n", " contains model-specific settings, e.g. for the dynamical core, physics parameterizations and output\n", "\n", "In the master namelist file (**icon_master.namelist**) the name of the model namelist file (here **NAMELIST_NWP**) must be specified via the parameter `model_namelist_filename`. The content of the master namelist file is read by ICON at model start. Note that the name of the master namelist file (**icon_master.namelist**) is hardcoded in the model code and must not be changed.\n", "\n", "For a complete list of namelist parameters see [Namelist_overview.pdf](../Namelist_overview.pdf)
\n", "Default values are set for all namelist parameters, so that you only have to specify values that differ from the default.\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "6b166b5e-8bfa-47b4-932d-56d8fb6007dd", "metadata": { "tags": [] }, "source": [ "### Prepare the ICON Namelists" ] }, { "cell_type": "markdown", "id": "58d10f68-17b6-4fba-a79b-809f7d265278", "metadata": {}, "source": [ "
\n", "\"alt_text\"/\n", "
\n", "
\n", "\n", "
\n", " Exercise (Create the ICON master namelist):\n", "
\n", " \n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "f804488c-7f15-4cae-94b3-ca24b87a275f", "metadata": {}, "outputs": [], "source": [ "cat > $EXPDIR/icon_master.namelist << EOF\n", "\n", "! master_nml: ----------------------------------------------------------------\n", "&master_nml\n", " lrestart = .FALSE. ! .TRUE.=current experiment is resumed\n", "/\n", "\n", "! master_model_nml: repeated for each model ----------------------------------\n", "&master_model_nml\n", " model_type = 1 ! identifies which component to run (atmosphere,ocean,wave,...)\n", " model_name = \"ATMO\" ! character string for naming this component.\n", " model_namelist_filename = ?????????? ! file name containing the model namelists\n", " model_min_rank = 1 ! start MPI rank for this model\n", " model_max_rank = 65536 ! end MPI rank for this model\n", " model_inc_rank = 1 ! stride of MPI ranks\n", "/\n", "\n", "! time_nml: specification of date and time------------------------------------\n", "&time_nml\n", " ini_datetime_string = \"2012-06-01T00:00:00\" ! initial date and time of the simulation\n", " end_datetime_string = \"2012-06-13T00:00:00\" ! end date and time of the simulation\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "9c5f04e2-9592-4e85-be47-a927a653bdf3", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "
\n",
    "! master_model_nml: repeated for each model ----------------------------------\n",
    "&master_model_nml\n",
    " model_type                  =                          1         ! identifies which component to run (atmosphere,ocean,...)\n",
    " model_name                  =                      \"ATMO\"        ! character string for naming this component.\n",
    " model_namelist_filename     =              \"NAMELIST_NWP\"        ! file name containing the model namelists\n",
    "
\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "de8b95ae-4ea4-4fa9-8e34-83247362ff79", "metadata": {}, "source": [ "
\n", "\"alt_text\"/\n", "
\n", "
\n", "\n", "
\n", " Exercise (Create the ICON model namelist): \n", " \n", "See Section 4.1 and Table 4.1 of the ICON Tutorial for additional help on the namelist parameters.
\n", "Hint: The name of the global grid file contains the suffix 'G'.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "ae9f3abc-006f-4eb1-ae4a-5d6d93c45d98", "metadata": {}, "outputs": [], "source": [ "cat > $EXPDIR/NAMELIST_NWP << EOF\n", "\n", "! parallel_nml: MPI parallelization -------------------------------------------\n", "¶llel_nml\n", " nproma = 32 ! loop chunk length\n", " p_test_run = .FALSE. ! .TRUE. means verification run for MPI parallelization\n", " num_io_procs = 1 ! number of I/O processors\n", " num_restart_procs = 0 ! number of restart processors\n", " iorder_sendrecv = 3 ! sequence of MPI send/receive calls\n", " proc0_shift = 0 ! serves for offloading I/O to the vector hosts of the NEC Aurora\n", " use_omp_input = .TRUE. ! allows task parallelism for reading atmospheric input data\n", "/\n", "\n", "! run_nml: general switches ---------------------------------------------------\n", "&run_nml\n", " ltestcase = ?????????? ! idealized testcase runs\n", " num_lev = 40 ! number of full levels (atm.) for each domain\n", " lvert_nest = .FALSE. ! vertical nesting\n", " dtime = 1440. ! timestep in seconds\n", " ldynamics = ?????????? ! compute adiabatic dynamic tendencies\n", " ltransport = .FALSE. ! main switch for large-scale tracer transport\n", " ntracer = 0 ! number of advected tracers\n", " iforcing = ?????????? ! pure dynamics (no physics forcing)\n", " msg_level = 10 ! controls how much printout is written during runtime\n", " ltimer = .FALSE. ! timer for monitoring the runtime of specific routines\n", " output = \"nml\" ! main switch for enabling/disabling components of the model output\n", "/\n", "\n", "! diffusion_nml: horizontal (numerical) diffusion ----------------------------\n", "&diffusion_nml\n", " lhdiff_vn = .TRUE. ! diffusion on the horizontal wind field\n", " lhdiff_temp = .TRUE. ! diffusion on the temperature field\n", " lhdiff_w = .TRUE. ! diffusion on the vertical wind field\n", " hdiff_order = 5 ! order of nabla operator for diffusion\n", " itype_vn_diffu = 2 ! reconstruction method used for Smagorinsky diffusion\n", " itype_t_diffu = 2 ! discretization of temperature diffusion\n", " hdiff_efdt_ratio = 20.0 ! ratio of e-folding time to time step \n", " hdiff_smag_fac = 0.02 ! scaling factor for Smagorinsky diffusion\n", "/\n", "\n", "! dynamics_nml: dynamical core -----------------------------------------------\n", "&dynamics_nml\n", " iequations = 3 ! type of equations and prognostic variables\n", " divavg_cntrwgt = 0.50 ! weight of central cell for divergence averaging\n", " lcoriolis = .TRUE. ! Coriolis force\n", "/\n", "\n", "! extpar_nml: external data --------------------------------------------------\n", "&extpar_nml\n", " extpar_filename = \"\" ! filename of external parameter input file\n", " itopo = ?????????? ! topography (0:analytical)\n", " n_iter_smooth_topo = 0 ! iterations of topography smoother\n", "/\n", "\n", "! grid_nml: horizontal grid --------------------------------------------------\n", "&grid_nml\n", " dynamics_grid_filename = ?????????? ! array of the grid filenames for the dycore\n", " radiation_grid_filename = \"\" ! array of the grid filenames for the radiation model\n", " lredgrid_phys = .FALSE. ! .true.=radiation is calculated on a reduced grid\n", " lfeedback = .TRUE. ! specifies if feedback to parent grid is performed\n", " ifeedback_type = 2 ! feedback type (incremental/relaxation-based)\n", "/\n", "\n", "! sleve_nml: vertical level specification -------------------------------------\n", "&sleve_nml\n", " min_lay_thckn = 20. ! layer thickness of lowermost layer\n", " top_height = 35000. ! height of model top\n", " flat_height = 16000. ! height above which the coordinate surfaces are flat\n", " stretch_fac = 0.9 ! stretching factor to vary distribution of model levels\n", "/\n", "\n", "! io_nml: general switches for model I/O -------------------------------------\n", "&io_nml\n", " dt_diag = 21600.0 ! diagnostic integral output interval\n", " dt_checkpoint = 5760000.0 ! time interval for writing restart files.\n", "/\n", "\n", "! nh_testcase_nml: idealized testcase specification --------------------------\n", "&nh_testcase_nml\n", " nh_test_name = ?????????? ! testcase selection\n", " jw_up = 1.0 ! amplitude of u-perturbation [m/s]\n", "/\n", "\n", "! nonhydrostatic_nml: nonhydrostatic model -----------------------------------\n", "&nonhydrostatic_nml\n", " iadv_rhotheta = 2 ! advection method for rho and rhotheta\n", " ivctype = 2 ! type of vertical coordinate\n", " exner_expol = 0.5 ! temporal extrapolation of Exner function\n", " vwind_offctr = 0.2 ! off-centering in vertical wind solver\n", " damp_height = 25000. ! height at which Rayleigh damping of vertical wind starts\n", " rayleigh_coeff = 0.025 ! Rayleigh damping coefficient\n", " divdamp_fac = 0.0016 ! scaling factor for divergence damping\n", " divdamp_order = 4 ! order of divergence damping\n", " igradp_method = 3 ! discretization of horizontal pressure gradient\n", " l_zdiffu_t = .TRUE. ! specifies computation of Smagorinsky temperature diffusion\n", " thslp_zdiffu = 0.02 ! slope threshold (temperature diffusion)\n", " thhgtd_zdiffu = 125.0 ! threshold of height difference (temperature diffusion)\n", "/\n", "\n", "! nwp_phy_nml: switches for the physics schemes ------------------------------\n", "&nwp_phy_nml\n", " inwp_gscp = 0 ! cloud microphysics and precipitation\n", " inwp_convection = 0 ! convection\n", " inwp_radiation = 0 ! radiation\n", " inwp_cldcover = 0 ! cloud cover scheme for radiation\n", " inwp_turb = 0 ! vertical diffusion and transfer\n", " inwp_satad = 0 ! saturation adjustment\n", " inwp_sso = 0 ! subgrid scale orographic drag\n", " inwp_gwd = 0 ! non-orographic gravity wave drag\n", " inwp_surface = 0 ! surface scheme\n", "/\n", "\n", "! gridref_nml: switches for grid refinement -----------------------------------\n", "&gridref_nml\n", " denom_diffu_v = 150. ! denominator for lateral boundary diffusion of velocity\n", " fbk_relax_timescale = 43200. ! relaxation time scale for feedback\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! model level output on native (triangular) grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 43200. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp1_JW' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " !\n", " ml_varlist = 'u', 'v', 'w', 'temp', 'pres','topography_c', 'pres_sfc', 'vor', 'div'\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! pressure level output on native grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 43200. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp1_JW' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " remap = 0 ! no remapping (native grid)\n", " !\n", " pl_varlist = 'temp', 'vor', 'div'\n", " p_levels = 50000.,70000.,85000.,92500. ! pressure levels in Pa\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! model level output on regular lat/lon grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 86400. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp1_JW_lonlat' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " remap = 1 ! remap to regular lat/lon grid\n", " reg_lat_def = -90.,1.0,90. ! start, increment, end latitude in degrees \n", " reg_lon_def = 0.,1.0,359.0 ! start, increment, end longitude in degrees\n", " !\n", " ml_varlist = 'u', 'v', 'w', 'temp', 'pres','topography_c', 'pres_sfc', 'vor', 'div'\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "6600d344-2bf0-489a-bedf-3933cbbaed0b", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input", "hide-cell" ] }, "source": [ "
\n", "Solution\n", "
\n",
    "&run_nml\n",
    "ltestcase                   =                       .TRUE.       ! idealized testcase runs\n",
    "ldynamics                   =                       .TRUE.       ! compute adiabatic dynamic tendencies\n",
    "iforcing                    =                          0         ! pure dynamics (no physics forcing)\n",
    "\n",
    "\n",
    "&extpar_nml\n",
    "itopo                       =                          0         ! topography (0:analytical)\n",
    "\n",
    "\n",
    "&grid_nml\n",
    " dynamics_grid_filename      =    'icon_grid_0054_R02B04_G.nc'   ! array of the grid filenames for the dycore\n",
    "\n",
    "\n",
    "&nh_testcase_nml\n",
    "nh_test_name                =                        'jabw'      ! testcase selection\n",
    "
\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "31133736-21e7-4688-bb28-5ced7faac277", "metadata": {}, "source": [ "### Prepare the ICON batch job" ] }, { "cell_type": "markdown", "id": "9e6cba5b-38d6-4321-bca6-c8a704a13c57", "metadata": {}, "source": [ "
\n", "\"alt_text\"/\n", "
\n", "
\n", "\n", "
\n", " Exercise (Create the ICON batch job):\n", "
\n", " The model code has already been compiled for you, with the ICON model binary being available under $ICONDIR/build.
\n", " The process of building the ICON model will be described in Exercise icon_exercise_programming.ipynb\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "df46de68-cebd-4f5f-9b80-b70efed714e7", "metadata": { "tags": [] }, "outputs": [], "source": [ "cat > $EXPDIR/icon.sbatch << 'EOF'\n", "#!/bin/bash\n", "#SBATCH --job-name=JW_test\n", "#SBATCH --partition=compute\n", "#SBATCH --nodes=1\n", "#SBATCH --ntasks-per-node=128\n", "#SBATCH --output=slurm.%j.out\n", "#SBATCH --exclusive\n", "#SBATCH --mem-per-cpu=960\n", "#SBATCH --time=00:10:00\n", "\n", "### ENV ###\n", "env\n", "set -xe\n", "\n", "unset SLURM_EXPORT_ENV \n", "unset SLURM_MEM_PER_NODE\n", "unset SBATCH_EXPORT\n", "\n", "\n", "# limit stacksize ... adjust to your programs need\n", "# and core file size\n", "ulimit -c 0\n", "ulimit -l unlimited\n", "\n", "export OMP_NUM_THREADS=1\n", "\n", "# OpenMPI environment settings\n", "export OMPI_MCA_osc=\"ucx\"\n", "export OMPI_MCA_pml=\"ucx\"\n", "export OMPI_MCA_btl=\"self\"\n", "export UCX_HANDLE_ERRORS=\"bt\"\n", "export OMPI_MCA_pml_ucx_opal_mem_hooks=1\n", "export OMPI_MCA_io=\"romio321\" # basic optimisation of I/O\n", "export UCX_TLS=\"shm,rc_mlx5,rc_x,self\" # for jobs using LESS than 150 nodes\n", "export UCX_UNIFIED_MODE=\"y\" # JUST for homogeneous jobs on CPUs, do not use for GPU nodes\n", "\n", "\n", "# path to model binary, including the executable:\n", "MODEL=??????????\n", "\n", "srun -l --cpu_bind=verbose --hint=nomultithread --distribution=block:cyclic $MODEL\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "801982d3-4a2d-4fcf-9954-fdfda46bcd79", "metadata": {}, "source": [ "**Note:** This run script - and likewise the run scripts from the following exercises - contains a whole series of platform-specific settings for parallel execution (e.g. `export OMPI_MCA_osc`). These are documented for the advanced user under https://docs.dkrz.de/doc/levante/running-jobs/runtime-settings.html#mpi-runtime-settings." ] }, { "cell_type": "markdown", "id": "1c4740cb-20f7-4f79-bf0c-36d5d1971fa3", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "
\n",
    "# path to model binary, including the executable:\n",
    "MODEL=$ICONDIR/build/bin/icon\n",
    "
\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "034dcc5d-e011-470e-a4a5-7ae135009cec", "metadata": {}, "source": [ "All files which are required to run the Jablonowski-Williamson test case have now been generated and stored in `$EXPDIR`.\\\n", "**Please list the content** of `$EXPDIR`, and remind yourself about the purpose of the individual files." ] }, { "cell_type": "code", "execution_count": null, "id": "340140b4-06e6-4bf8-98eb-99dd80b92128", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "68966380-0afa-4937-a610-d67b54618660", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "
\n",
    "icon_grid_0056_R02B05_N.nc  icon_grid_0055_R02B05_N.nc  icon_grid_0054_R02B04_G.nc  icon_master.namelist  NAMELIST_NWP  icon.sbatch\n",
    "
\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "0b5c289f-63e9-423c-b224-11688e25a9ab", "metadata": {}, "source": [ "## Running the ICON model" ] }, { "cell_type": "markdown", "id": "0a7dcdfb-8e83-478d-b92b-38984eacc3a0", "metadata": {}, "source": [ "
\n", " Exercise: \n", " Submit the job script icon.sbatch to the HPC cluster, using the Slurm command sbatch.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "2e00855c-719b-4c25-b581-3422d009ed1a", "metadata": {}, "outputs": [], "source": [ "cd $EXPDIR && sbatch --account=$SLURM_JOB_ACCOUNT icon.sbatch" ] }, { "cell_type": "markdown", "id": "31c37911-9464-4fc4-bdeb-4f6e5c609999", "metadata": {}, "source": [ "### Checking the job status" ] }, { "cell_type": "markdown", "id": "81e917cd-86cd-433e-9826-1ac465bff952", "metadata": {}, "source": [ "
\n", " Exercise: \n", " Check the job status using the Slurm command squeue.
\n", "
\n", " Hint: In order to list only jobs belonging to your user ID, you can make use of the option -u $USER\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "7ca6d577-d1d3-4551-ac93-7199ace14049", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "5e6bcd86-8eec-4d74-b04a-0076957dc745", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "`squeue -u $USER`\n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "3758dd93-79c3-405f-a4ae-cbe4f2be284d", "metadata": {}, "source": [ "### Inspecting the output" ] }, { "cell_type": "markdown", "id": "bfe3302d-9324-4558-99f7-8c4a1fa92a3d", "metadata": {}, "source": [ "Open a terminal by clicking the following button and go to the output directory `$EXPDIR`. You will find three NetCDF output files with \n", "\n", "**(a)** model level output on the native (triangular) grid \\\n", "**(b)** pressure level output on the native grid \\\n", "**(c)** model level output interpolated onto a regular lat-lon grid." ] }, { "cell_type": "markdown", "id": "a984e978-bb9e-4c9a-a10f-41292985c96d", "metadata": {}, "source": [ "
\n", " Exercise (Inspecting the output):\n", "
\n", " Have a closer look at the output files and their internal structure to find out which one is which. We suggest to use the tools cdo and ncdump as described in Section 10.1 of the tutorial.\n", " \n", "Hint: You might have to load the environment modules cdo and netcdf-c.\n", "
" ] }, { "cell_type": "raw", "id": "b4f2f158-c770-478e-9505-a3974b0d35f6", "metadata": {}, "source": [ "Your Answer:" ] }, { "cell_type": "markdown", "id": "dacd4952-49ce-4a9d-a22b-6240293fc680", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "**grid metainformation**: 'height', 'plev', 'lon', 'lat' (ncdump) or 'grid coordinates'/'vertical coordinates' (CDO)\n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "d0dbfb04-9d49-45fd-b336-38ecca6939bb", "metadata": {}, "source": [ "
\n", " Exercise: \n", " What output interval (in hours) has been used for model level output on the triangular grid?\n", "
" ] }, { "cell_type": "raw", "id": "e6c1a0e7-ec76-4bdc-ac3d-0fe49271fcfa", "metadata": {}, "source": [ "Your Answer:" ] }, { "cell_type": "markdown", "id": "f6b9bc11-1f20-42c3-a8d0-4014b2d48353", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "**output interval**: 12h (but 24h for lat-lon output) solution: cdo sinfov \n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "a30d1c78-a80d-4bbf-8a18-187c7bd68ec4", "metadata": {}, "source": [ "
\n", " Exercise (Visualization):\n", "
\n", " In order to visualize your results after 9 simulated days, execute the Python script JW_day9_pres_vort_temp_NH_and_SH.py in the following cell.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "7b0bd0d7-6d9c-4ba4-983e-f7a19c7120c3", "metadata": {}, "outputs": [], "source": [ "pip install matplotlib cartopy xarray netCDF4 'numpy<2'\n", "\n", "cd $EXPDIR\n", "PREFIX=\"exp1\" python3 $SCRIPTDIR/JW_day9_pres_vort_temp_NH_and_SH.py" ] }, { "cell_type": "markdown", "id": "3f927133-ebba-4ba8-ba59-e849f739391a", "metadata": {}, "source": [ "
\n", " Click here to show your result.
\n", " You may compare with the reference result given below. The left (right) column shows results for the northern (southern) hemisphere of the earth. Please note that we use different contour intervals for the northern and southern hemisphere.\n", "
" ] }, { "cell_type": "markdown", "id": "a09f3020-fd36-47bc-af37-9ebba602fc22", "metadata": {}, "source": [ "
\n", "
\n", "\"alt_text\"/\n", "
\n", "
R2B4 surface pressure, 850hPa vorticity and 850hPa temperature at day 9 for NH (left) and SH (right)
\n", "
" ] }, { "cell_type": "markdown", "id": "0043c2b1-308c-4d19-941e-e249a9b8f5e9", "metadata": {}, "source": [ "
\n", " Exercise (Inspecting results for the southern hemisphere):\n", "
\n", " The actual baroclinic wave delevops on the northern hemisphere.\n", " \n", "
\n" ] }, { "cell_type": "raw", "id": "f0d0cfa5-6336-4304-af76-24c9e81b405a", "metadata": {}, "source": [ "Your answer:" ] }, { "cell_type": "markdown", "id": "ba98e25f-c45f-424a-9161-ba726c9bc91d", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "Answer: \n", "\n", "A deviation from the zonally symmetric flow (wavenumber 5 disturbance) becomes apparent after approx. day 5. \n", "The disturbance maximum does not occur in the proximity of the pentagon points ($lat\\approx 27\\deg$), but in the region of largest baroclinicity ($lat\\approx 60\\deg$). This deviation from the zonally symmetric flow is not a direct consequence of the existence of the pentagon points but a consequence of the overall grid irregularity (area, angle, etc.) and its periodicity.\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "5e017c56-840b-4259-8fe5-5b1703cf069e", "metadata": {}, "source": [ "## Grid Nesting\n", "\n", "The JW test is well suited to learn about ICON’s nesting capability.\n", "We will repeat the previous exercise with one or more additional nested domains. As we will see, activating nested domains reqires only a few namelist changes." ] }, { "cell_type": "markdown", "id": "d5a0f887-b95b-41f7-83a7-887dc8384763", "metadata": {}, "source": [ "The grid files of the nested domains have already been downloaded by you at the beginning of this exercise (grids no. 55 and 56). \\\n", "The geographic location of these nests is depicted in the figure below. \\\n", "Please verify that the grid files are stored in the subdirectory `$GRIDDIR` and linked (or copied) to the experiment directory `$EXPDIR`." ] }, { "cell_type": "markdown", "id": "7338d5ab-ddeb-43aa-b5e3-14e6faba0795", "metadata": {}, "source": [ "
\n", "
\n", " \"alt_text\"/\n", "
Geographic location of the R2B5 nests
For your guidance, the R2B4 results at day 9 are shown in the background
\n", "
\n", "
\n", "\n", "
\n", " Exercise (Activate one or more nested domains):\n", "
\n", " Fill in the missing namelist parameters below and execute the cell. In particular, \n", " \n", " See Section 4.2.3 of the ICON tutorial for additional help.
\n", " The same output fields as for the global domain will be generated for the regional domain(s). We will be using the new file prefix exp2, in order to avoid overwriting your previous results\n", "
" ] }, { "cell_type": "markdown", "id": "b6dfd66b-4fc4-476d-8795-885891ee082b", "metadata": { "tags": [] }, "source": [ "### Prepare the ICON Namelist" ] }, { "cell_type": "code", "execution_count": null, "id": "23552659-06d6-4bee-af2d-b546c25905ae", "metadata": {}, "outputs": [], "source": [ "cat > $EXPDIR/NAMELIST_NWP << EOF\n", "\n", "! parallel_nml: MPI parallelization -------------------------------------------\n", "¶llel_nml\n", " nproma = 32 ! loop chunk length\n", " p_test_run = .FALSE. ! .TRUE. means verification run for MPI parallelization\n", " num_io_procs = 1 ! number of I/O processors\n", " num_restart_procs = 0 ! number of restart processors\n", " iorder_sendrecv = 3 ! sequence of MPI send/receive calls\n", " proc0_shift = 0 ! serves for offloading I/O to the vector hosts of the NEC Aurora\n", " use_omp_input = .TRUE. ! allows task parallelism for reading atmospheric input data\n", "/\n", "\n", "! run_nml: general switches ---------------------------------------------------\n", "&run_nml\n", " ltestcase = .TRUE. ! idealized testcase runs\n", " num_lev = 40,?????????? ! number of full levels (atm.) for each domain\n", " lvert_nest = .FALSE. ! vertical nesting\n", " dtime = 1440. ! timestep in seconds\n", " ldynamics = .TRUE. ! compute adiabatic dynamic tendencies\n", " ltransport = .FALSE. ! main switch for large-scale tracer transport\n", " ntracer = 0 ! number of advected tracers\n", " iforcing = 0 ! pure dynamics (no physics forcing)\n", " msg_level = 10 ! controls how much printout is written during runtime\n", " ltimer = .FALSE. ! timer for monitoring the runtime of specific routines\n", " output = \"nml\" ! main switch for enabling/disabling components of the model output\n", "/\n", "\n", "! diffusion_nml: horizontal (numerical) diffusion ----------------------------\n", "&diffusion_nml\n", " lhdiff_vn = .TRUE. ! diffusion on the horizontal wind field\n", " lhdiff_temp = .TRUE. ! diffusion on the temperature field\n", " lhdiff_w = .TRUE. ! diffusion on the vertical wind field\n", " hdiff_order = 5 ! order of nabla operator for diffusion\n", " itype_vn_diffu = 2 ! reconstruction method used for Smagorinsky diffusion\n", " itype_t_diffu = 2 ! discretization of temperature diffusion\n", " hdiff_efdt_ratio = 20.0 ! ratio of e-folding time to time step \n", " hdiff_smag_fac = 0.02 ! scaling factor for Smagorinsky diffusion\n", "/\n", "\n", "! dynamics_nml: dynamical core -----------------------------------------------\n", "&dynamics_nml\n", " iequations = 3 ! type of equations and prognostic variables\n", " divavg_cntrwgt = 0.50 ! weight of central cell for divergence averaging\n", " lcoriolis = .TRUE. ! Coriolis force\n", "/\n", "\n", "! extpar_nml: external data --------------------------------------------------\n", "&extpar_nml\n", " extpar_filename = \"\" ! filename of external parameter input file\n", " itopo = 0 ! topography (0:analytical)\n", " n_iter_smooth_topo = 0 ! iterations of topography smoother\n", "/\n", "\n", "! grid_nml: horizontal grid --------------------------------------------------\n", "&grid_nml\n", " dynamics_grid_filename = ?????????? ! array of the grid filenames for the dycore\n", " radiation_grid_filename = \"\" ! array of the grid filenames for the radiation model\n", " lredgrid_phys = .FALSE. ! .true.=radiation is calculated on a reduced grid\n", " lfeedback = .TRUE. ! specifies if feedback to parent grid is performed\n", " ifeedback_type = 2 ! feedback type (incremental/relaxation-based)\n", " dynamics_parent_grid_id = 0,1,1 ! explicit setting of grid hierarchy (needed due to code bug)\n", "/\n", "\n", "! sleve_nml: vertical level specification -------------------------------------\n", "&sleve_nml\n", " min_lay_thckn = 20. ! layer thickness of lowermost layer\n", " top_height = 35000. ! height of model top\n", " flat_height = 16000. ! height above which the coordinate surfaces are flat\n", " stretch_fac = 0.9 ! stretching factor to vary distribution of model levels\n", "/\n", "\n", "! io_nml: general switches for model I/O -------------------------------------\n", "&io_nml\n", " dt_diag = 21600.0 ! diagnostic integral output interval\n", " dt_checkpoint = 5760000.0 ! time interval for writing restart files.\n", "/\n", "\n", "! nh_testcase_nml: idealized testcase specification --------------------------\n", "&nh_testcase_nml\n", " nh_test_name = \"jabw\" ! testcase selection\n", " jw_up = 1.0 ! amplitude of u-perturbation [m/s]\n", "/\n", "\n", "! nonhydrostatic_nml: nonhydrostatic model -----------------------------------\n", "&nonhydrostatic_nml\n", " iadv_rhotheta = 2 ! advection method for rho and rhotheta\n", " ivctype = 2 ! type of vertical coordinate\n", " exner_expol = 0.5 ! temporal extrapolation of Exner function\n", " vwind_offctr = 0.2 ! off-centering in vertical wind solver\n", " damp_height = 25000. ! height at which Rayleigh damping of vertical wind starts\n", " rayleigh_coeff = 0.025 ! Rayleigh damping coefficient\n", " divdamp_fac = 0.0016 ! scaling factor for divergence damping\n", " divdamp_order = 4 ! order of divergence damping\n", " igradp_method = 3 ! discretization of horizontal pressure gradient\n", " l_zdiffu_t = .TRUE. ! specifies computation of Smagorinsky temperature diffusion\n", " thslp_zdiffu = 0.02 ! slope threshold (temperature diffusion)\n", " thhgtd_zdiffu = 125.0 ! threshold of height difference (temperature diffusion)\n", "/\n", "\n", "! nwp_phy_nml: switches for the physics schemes ------------------------------\n", "&nwp_phy_nml\n", " inwp_gscp = 0 ! cloud microphysics and precipitation\n", " inwp_convection = 0 ! convection\n", " inwp_radiation = 0 ! radiation\n", " inwp_cldcover = 0 ! cloud cover scheme for radiation\n", " inwp_turb = 0 ! vertical diffusion and transfer\n", " inwp_satad = 0 ! saturation adjustment\n", " inwp_sso = 0 ! subgrid scale orographic drag\n", " inwp_gwd = 0 ! non-orographic gravity wave drag\n", " inwp_surface = 0 ! surface scheme\n", "/\n", "\n", "! gridref_nml: switches for grid refinement -----------------------------------\n", "&gridref_nml\n", " denom_diffu_v = 150. ! denominator for lateral boundary diffusion of velocity\n", " fbk_relax_timescale = 43200. ! relaxation time scale for feedback\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! model level output on native (triangular) grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 43200. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp2_JW' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " !\n", " ml_varlist = 'u', 'v', 'w', 'temp', 'pres','topography_c', 'pres_sfc', 'vor', 'div'\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! pressure level output on native grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 43200. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp2_JW' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " remap = 0 ! no remapping (native grid)\n", " !\n", " pl_varlist = 'temp', 'vor', 'div'\n", " p_levels = 50000.,70000.,85000.,92500. ! pressure levels in Pa\n", "/\n", "\n", "! output_nml: specifies an output stream --------------------------------------\n", "! model level output on regular lat/lon grid\n", "&output_nml\n", " filetype = 4 ! output format: 2=GRIB2, 4=NETCDFv2\n", " dom = -1 ! write all domains\n", " output_bounds = 0., 10000000., 43200. ! output: start, end, increment\n", " steps_per_file = 30 ! number of output steps in one output file\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " include_last = .TRUE. ! flag whether to include the last time step\n", " output_filename = 'exp2_JW_lonlat' ! file name base\n", " output_grid = .TRUE. ! flag whether grid information is added to output.\n", " remap = 1 ! remap to regular lat/lon grid\n", " reg_lat_def = -90.,1.0,90. ! start, increment, end latitude in degrees \n", " reg_lon_def = 0.,1.0,359.0 ! start, increment, end longitude in degrees\n", " !\n", " ml_varlist = 'u', 'v', 'w', 'temp', 'pres','topography_c', 'pres_sfc', 'vor', 'div'\n", "/\n", "EOF" ] }, { "cell_type": "markdown", "id": "02ab0f9d-1637-437a-ba95-c674363b1457", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "
\n",
    "&grid_nml\n",
    "dynamics_grid_filename = 'icon_grid_0054_R02B04_G.nc','icon_grid_0055_R02B05_N.nc','icon_grid_0056_R02B05_N.nc'\n",
    "\n",
    "&run_nml\n",
    "num_lev                =  40,40,40        ! number of full levels (atm.) for each domain\n",
    "
\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "b8a1ec9d-72d1-4404-9ea0-f083ef9a4bdc", "metadata": {}, "source": [ "### Running the ICON model" ] }, { "cell_type": "markdown", "id": "b1ccde58-e037-43b1-8309-1c95d874fd22", "metadata": {}, "source": [ "Submit the job to the HPC cluster, using the Slurm command `sbatch`." ] }, { "cell_type": "code", "execution_count": null, "id": "3433b2ae-b681-4067-80c8-7568f9863ef5", "metadata": {}, "outputs": [], "source": [ "cd $EXPDIR && sbatch --account=$SLURM_JOB_ACCOUNT icon.sbatch" ] }, { "cell_type": "markdown", "id": "44cdbe0e-c87a-4dab-bec6-c1764769ef68", "metadata": {}, "source": [ "Check the job status using the Slurm command `squeue`" ] }, { "cell_type": "code", "execution_count": null, "id": "084ab7ca-d9e4-4885-9c4a-f91f57d24cc7", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "e130a336-6296-47dd-ab9d-dba66afa73d0", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "1b953b21-ed82-476f-8fa6-430e96bb7b2d", "metadata": { "tags": [] }, "source": [ "### Inspecting the output" ] }, { "cell_type": "markdown", "id": "6d4f06f0-1c6b-4fc9-9d4d-318cd0754bcf", "metadata": {}, "source": [ "
\n", " Exercise (Inspecting the output):\n", "
\n", " After the job has finished, execute the Python scripts JW_day9_pres_vort_temp_NH_and_SH.py and JW_day9_pres_and_vort_merge_2nests.py in the cell below, in order to visualize the results of your nested run.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "e3d19385-627c-48c6-b043-a535970073f9", "metadata": {}, "outputs": [], "source": [ "# set filename prefix\n", "export PREFIX=\"exp2\"\n", "cd $EXPDIR\n", "python3 $SCRIPTDIR/JW_day9_pres_vort_temp_NH_and_SH.py\n", "python3 $SCRIPTDIR/JW_day9_pres_and_vort_merge_2nests.py" ] }, { "cell_type": "markdown", "id": "449da3fe-4cb3-4443-8cf5-c62c298fb14f", "metadata": {}, "source": [ "
\n", " Exercise: \n", " Have a look at the results\n", " \n", "
\n", "\n", "If you want to verify that your global domain results are correct, you can compare with the global domain reference solution [here](./pic/exp2_JW_R2B4N5_day9_pres_vort_temp_reference_global.png)." ] }, { "cell_type": "raw", "id": "aa6b7460-e8d0-4720-bd10-ee708f710041", "metadata": {}, "source": [ "Your answer:" ] }, { "cell_type": "markdown", "id": "5fb7526e-71b5-44fb-9786-29adf5a6870e", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "Answer: \n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "61b303d4-8876-4f11-b416-09c5ad09f26c", "metadata": {}, "source": [ "## Parent-child relationships" ] }, { "cell_type": "markdown", "id": "5aba8b5f-7c21-437d-b390-058e3eb97a39", "metadata": {}, "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", "

\n", " The figure to the right depicts an alternative configuration using three domains, \n", " in which the two nested domains are consecutively nested into each other (multi-level nesting).\n", "

\n", " Obviously the parent-child relation of these domains differs from the previous configuration. \n", " Nevertheless, the correct settings for dynamics_grid_filename are identical to those used in the previous nested run.\n", "

\n", "

\n", " How does ICON know about the actual parent-child relationship of the grids in use?\n", "

\n", "
\n", "
\n", " \"alt_text\"/\n", "
\n", " Multi-level nesting example\n", "
\n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "1150d07d-a0e3-41ea-ae27-c0aaef762267", "metadata": {}, "source": [ "
\n", " Exercise (Determining the parent-child relationships of nested domains):\n", "
\n", " See Section 3.9, page 121 of the tutorial for an explanation and\n", " \n", "
" ] }, { "cell_type": "raw", "id": "8f455fa5-078e-4801-8027-0eb8faa2b99d", "metadata": {}, "source": [ "Your Answer:" ] }, { "cell_type": "markdown", "id": "57beff9b-f3d9-4920-aefb-288f65116e17", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "Answer: The parent-child information is inferred from NetCDF attributes stored in the grid files. These attributes are\n", "- `uuidOfHGrid`: unique identifier of the current grid\n", "- `uuidOfParHGrid`: unique identifier of the current grids' parent grid.\n", "\n", "```\n", "module load netcdf-c\n", "ncdump -h $EXPDIR/icon_grid_0055_R02B05_N.nc | grep \"uuidOf\"\n", "```\n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "82a12b80-1759-478d-8951-42b3b8cadcab", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "---" ] }, { "cell_type": "markdown", "id": "f65dd927-4aa2-4349-9e96-313b1c3277f9", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "

Congratulations! You have successfully completed Exercise 1.

" ] }, { "cell_type": "markdown", "id": "146116f1-a899-4a7c-8662-c5e42a3e1423", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "---" ] }, { "cell_type": "markdown", "id": "67ec8744-8de1-4143-b166-f57526c91be3", "metadata": {}, "source": [ "## Further Reading and Resources\n", "\n", "- ICON Tutorial, Ch. 4: https://www.dwd.de/DE/leistungen/nwv_icon_tutorial/nwv_icon_tutorial.html\n", "
A new draft version of the ICON Tutorial is available here: https://icon-training-2025-scripts-rendering-cc74a6.gitlab-pages.dkrz.de/index.html. It is currently being finalized and will be published soon.\n", "- Tracer transport was not covered in this tutorial exercise. For details, however, there is an optional exercise, see the Jupyter notebook
icon_exercise_idealized_transport.ipynb
\n" ] }, { "cell_type": "markdown", "id": "cee681f0-8568-4254-b946-7e96a7c88d6d", "metadata": {}, "source": [ "---\n", "\n", "*Author info: Deutscher Wetterdienst (DWD) 2025 :: icon@dwd.de. For a full list of contributors, see CONTRIBUTING in the root directory. License info: see LICENSE file.*" ] } ], "metadata": { "kernelspec": { "display_name": "Bash", "language": "bash", "name": "bash" }, "language_info": { "codemirror_mode": "shell", "file_extension": ".sh", "mimetype": "text/x-sh", "name": "bash" } }, "nbformat": 4, "nbformat_minor": 5 }