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

ICON Training - Hands-on Session

\n", "\n", "# Exercise 2: Global Real Data Run\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", "\n", "In this particular exercise you will learn how to \n", "\n", "- **start a global ICON forecast** from DWD analysis data\n", "- **activate a nest** over Europe\n", "- **configure** the ICON **model output namelist**\n", " - example: creating boundary data for driving a limited area ICON\n", "- make use of **the ICON LOG output**\n", "\n", "**Note:** This script is not suited for operational use, it is part of the step-by-step tutorial.\n", "Furthermore, we will omit some of ICON's less important input and output channels here, e.g. the restart files. 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": "9d9fa159-e728-40be-b9ed-f828f3765023", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "## Input Data\n", "\n", "---\n", "\n", "
\n", "\"alt_text\"/\n", "
Necessary input data for a global ICON-NWP run
\n", "
\n", "\n", "**Global ICON-NWP** runs require a number of input data, in particular \n", "\n", "\n", "This data is already available in the directory `/pool/data/ICON/ICON_training/exercise_realdata`.\n", "\n", "On default, ICON expects the input data to be located in the experiment directory (termed `$EXPDIR` in the run scripts).\n", "The run script creates symbolic links in the experiment directory, which point to the input files.\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "b70fbc41-4327-484f-b62e-cbe311ba990d", "metadata": { "tags": [] }, "source": [ "## Setup\n", "\n", "---\n", "\n", "
\n", "\"alt_text\"/\n", "
Two-way nested domain over Europe with 20 km resolution (R2B07)
\n", "
\n", "\n", "We prepare a **global forecast with 40 km horizontal grid spacing and a 20 km nest over Europe**. More details are given in the table below. \n", "\n", "| Configuration | global | nest |\n", "| :--- | :--- | :--- |\n", "| mesh size | 40 km (R2B6) | 20 km (R2B7) |\n", "| model top height | 75 km | 23 km |\n", "| no. of levels | 90 | 60 |\n", "| no. of cells (per level) | 327680 | 9376 |\n", "| time step | 360 s | 180 s |\n", "| duration | 48h | (see exercise)|\n", "\n", "---" ] }, { "cell_type": "markdown", "id": "22042878-b327-4efe-b93b-d1554b367491", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", " Exercise (Setting up the environment I): \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": {}, "outputs": [], "source": [ "# base directory for ICON sources and binary:\n", "ICONDIR=/pool/data/ICON/ICON_training/icon/\n", "\n", "# directory with input grids and external data:\n", "GRIDDIR=/pool/data/ICON/ICON_training/exercise_realdata/grids\n", "# directory with initial data:\n", "DATADIR=/pool/data/ICON/ICON_training/exercise_realdata/data/ini\n", "\n", "# absolute path to directory with plenty of space:\n", "SCRATCHDIR=/scratch/${USER::1}/$USER\n", "EXPDIR=$SCRATCHDIR/exercise_realdata\n", "\n", "# absolute path to files needed for radiation\n", "RADDIR=${ICONDIR}/externals/ecrad/data\n", "\n", "# path to prepared namelists\n", "NMLDIR=$HOME/icon-training-scripts/exercise_realdata/nml" ] }, { "cell_type": "markdown", "id": "13ef52f9-d7b3-4f9c-b1f0-893fc95d8699", "metadata": {}, "source": [ "
\n", " Exercise (Setting up the environment II): \n", "
\n", " Execute the cell below, in order to copy/link input data to the experiment directory $EXPDIR: grids, external parameters, initial conditions.
\n", "The directory for the experiment will be created, if not already there.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "299d3e82-1310-4109-a692-0cdcf8351fc8", "metadata": {}, "outputs": [], "source": [ "if [ ! -d $EXPDIR ]; then\n", " mkdir -p $EXPDIR\n", "fi\n", "cd ${EXPDIR}\n", "\n", "# grid files: link to output directory\n", "ln -sf ${GRIDDIR}/iconR*.nc .\n", "# external parameter files: link to output directory\n", "ln -sf ${GRIDDIR}/extpar*.nc .\n", "# analysis files: link to output directory\n", "ln -sf ${DATADIR}/*.grb .\n", "\n", "# Dictionary for the mapping: DWD GRIB2 names <-> ICON internal names\n", "ln -sf ${ICONDIR}/run/ana_varnames_map_file.txt map_file.ana\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": "36c5cffb-3875-41d6-a862-ec5301d44792", "metadata": {}, "source": [ "
\n", " Exercise (Sanity check): \n", "
\n", " Check the content of the experiment directory $EXPDIR by using, for example, the ls linux command.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "1374050b-d0ae-4e5a-8781-66d1615a3593", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "b9d58131-71ef-45b7-971d-e38432c4107c", "metadata": {}, "source": [ "
\n", "Solution\n", " \n", "```\n", "lrwxrwxrwx 1 m300173 mh0287 55 Jul 7 14:52 dict.output.dwd -> /pool/data/ICON/ICON_training/icon//run/dict.output.dwd\n", "lrwxrwxrwx 1 m300173 mh0287 79 Jul 7 14:52 dwdANA_R2B06_DOM01.grb -> /pool/data/ICON/ICON_training/exercise_realdata/data/ini/dwdANA_R2B06_DOM01.grb\n", "lrwxrwxrwx 1 m300173 mh0287 79 Jul 7 14:52 dwdANA_R2B07_DOM02.grb -> /pool/data/ICON/ICON_training/exercise_realdata/data/ini/dwdANA_R2B07_DOM02.grb\n", "lrwxrwxrwx 1 m300173 mh0287 69 Jul 7 14:52 extpar_DOM01.nc -> /pool/data/ICON/ICON_training/exercise_realdata/grids/extpar_DOM01.nc\n", "lrwxrwxrwx 1 m300173 mh0287 69 Jul 7 14:52 extpar_DOM02.nc -> /pool/data/ICON/ICON_training/exercise_realdata/grids/extpar_DOM02.nc\n", "lrwxrwxrwx 1 m300173 mh0287 72 Jul 7 14:52 iconR2B05_DOM00.nc -> /pool/data/ICON/ICON_training/exercise_realdata/grids/iconR2B05_DOM00.nc\n", "lrwxrwxrwx 1 m300173 mh0287 72 Jul 7 14:52 iconR2B06_DOM01.nc -> /pool/data/ICON/ICON_training/exercise_realdata/grids/iconR2B06_DOM01.nc\n", "lrwxrwxrwx 1 m300173 mh0287 72 Jul 7 14:52 iconR2B07_DOM02.nc -> /pool/data/ICON/ICON_training/exercise_realdata/grids/iconR2B07_DOM02.nc\n", "lrwxrwxrwx 1 m300173 mh0287 65 Jul 7 14:52 map_file.ana -> /pool/data/ICON/ICON_training/icon//run/ana_varnames_map_file.txt\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "2a32b2e3-85a0-4d4e-8da5-38979fdde6fb", "metadata": {}, "source": [ "###" ] }, { "cell_type": "markdown", "id": "0687c95c-da14-4a66-9f78-43954af0dfc9", "metadata": {}, "source": [ "## Prepare the ICON run (namelists etc.)" ] }, { "cell_type": "markdown", "id": "a58fd4da-0cc0-407c-a7c1-6eabfadd5af8", "metadata": {}, "source": [ "### Create the **ICON master namelist**\n", "\n", "The start date is\n", "> 2021-07-13T00:00:00 \n", "> i.e. July 13, 2021.\n", "\n", "The forecast time is \n", "> 48 hours\n", "> \n", "
\n", " Exercise (master namelist):
\n", " Fill in the missing namelist parameters ini_datetime_string and end_datetime_string. See Section 5.1.1 of the \n", " ICON tutorial \"Basic Settings for Running Real Data Runs\" for details . \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "b5c36aac-3a3e-47f5-bcba-1f1e836f0f88", "metadata": {}, "outputs": [], "source": [ "cat > 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,...)\n", " model_name = \"ATM\" ! character string for naming this component.\n", " model_namelist_filename = \"NAMELIST_NWP\" ! 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 = \"??????????????\" ! initial date and time of the simulation\n", " end_datetime_string = \"??????????????\" ! end date and time of the simulation\n", " ! example date: 2001-01-01T01:00:00Z\n", " dt_restart = 1000000.\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "6787a4cc-6739-4bd5-b078-a59d16776671", "metadata": {}, "source": [ "
\n", "Solution\n", " \n", "```\n", "&time_nml\n", "ini_datetime_string = \"2021-07-13T00:00:00Z\" ! initial date and time of the simulation\n", "end_datetime_string = \"2021-07-15T00:00:00Z\" ! end date and time of the simulation\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "915adecb-73cb-4dc0-9998-251cac1d1232", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "9ac84728-8633-45ea-a905-06957c8cbbe3", "metadata": {}, "source": [ "### Create the **ICON model namelists**\n", "\n", "In the following we will build up the ICON namelist `NAMELIST_NWP` step by step. To do so, we use the UNIX `cat` command in order to collect individual namelists into a single file (named `NAMELIST_NWP`). \n", "\n", "- for a complete list of Namelist parameters see [Namelist_overview.pdf](../Namelist_overview.pdf)\n", "\n", "**Please make sure that you execute each of the following cells only once!**\n", "\n", "Due to the command `cat >> NAMELIST_NWP << EOF` (note the double `>>`), the namelist groups such as `parallel_nml` below will be concatenated each time you execute the cell." ] }, { "cell_type": "markdown", "id": "67924c3e-d5fb-402f-90f5-9d268407699d", "metadata": {}, "source": [ "
\n", " Exercise (Basic settings): \n", " \n", " Exercise (Activating a nest over Europe): \n", " \n", " Hint: A prerequisit for calculating radiation on a reduced grid is the namelist setting lredgrid_phys=.TRUE.,.TRUE., which has already been prepared for you.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "4fc49a53-2d2b-409c-ae87-e044f0030920", "metadata": {}, "outputs": [], "source": [ "cat > NAMELIST_NWP << EOF\n", "\n", "! run_nml: general switches ---------------------------------------------------\n", "&run_nml\n", " ltestcase = ????????????? ! idealized testcase runs\n", " num_lev = ????????????? ! number of full levels (atm.) for each domain\n", " lvert_nest = .TRUE. ! vertical nesting\n", " dtime = 360. ! timestep in seconds\n", " ldynamics = ????????????? ! compute adiabatic dynamic tendencies\n", " ltransport = ????????????? ! compute large-scale tracer transport\n", " ntracer = 5 ! number of advected tracers\n", " iforcing = ????????????? ! forcing of dynamics and transport by parameterized processes\n", " ! 2: AES physics package\n", " ! 3: NWP physics package\n", " msg_level = 13 ! controls how much printout is written during runtime\n", " ltimer = .FALSE. ! timer for monitoring the runtime of specific routines\n", " timers_level = 1 ! performance timer granularity\n", " output = \"nml\" ! main switch for enabling/disabling components of the model output\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 = ?????????? ! grid filename for the radiation model\n", " lredgrid_phys = .TRUE.,.TRUE. ! .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", " start_time = 0., 0. ! Time when a nested domain starts to be active [s]\n", " end_time = 0., 86400. ! Time when a nested domain terminates [s]\n", " nexlevs_rrg_vnest = 14 ! numer of extra model layers for radiation\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "a3f3b6b2-eb86-4e93-81e9-1c9d963c7bef", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "```\n", "&run_nml\n", " ltestcase = .FALSE. ! idealized testcase runs\n", " num_lev = 90,60 ! number of full levels (atm.) for each domain\n", " ldynamics = .TRUE. ! compute adiabatic dynamic tendencies\n", " ltransport = .TRUE. ! compute large-scale tracer transport\n", " iforcing = 3 ! forcing of dynamics and transport by parameterized processes\n", "\n", "&grid_nml\n", " dynamics_grid_filename = 'iconR2B06_DOM01.nc','iconR2B07_DOM02.nc' ! array of the grid filenames for the dycore\n", " radiation_grid_filename = 'iconR2B05_DOM00.nc' ! grid filename for the radiation model\n", "```\n", "\n", "
\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "9a9f8f26-b358-487c-9740-f0f299efd9e0", "metadata": {}, "source": [ "
\n", " Exercise (Asynchronous output): \n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "583b5a32-5293-4f8d-9dac-964b1472a474", "metadata": {}, "outputs": [], "source": [ "cat >> 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 = ????????????? ! 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", " num_dist_array_replicas = 10 ! distributed arrays: no. of replications\n", " use_omp_input = .TRUE. ! allows task parallelism for reading atmospheric input data\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "803ce010-9343-4547-9f40-e59e1361fc8e", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "```\n", "¶llel_nml\n", "num_io_procs = 2 ! number of I/O processors\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "0694df8f-80f2-4275-aac9-3ed6fae36a66", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "1645aee4-0247-4c8d-a656-f9547930cef0", "metadata": {}, "source": [ "
\n", " Exercise (External parameter settings):\n", " \n", " Hint: You will find the external parameter files in your current working directory $EXPDIR.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "b1f3319b-8367-448e-a447-cca46b8784f7", "metadata": {}, "outputs": [], "source": [ "cat >> NAMELIST_NWP << EOF\n", "\n", "! extpar_nml: external data --------------------------------------------------\n", "&extpar_nml\n", " itopo = ????????????? ! topography (0:analytical)\n", " itype_lwemiss = 2 ! requires updated extpar data\n", " itype_vegetation_cycle = 1 ! specifics for annual cycle of LAI\n", " extpar_filename = ????????????? ! filename of external parameter input file\n", " n_iter_smooth_topo = 1,1 ! iterations of topography smoother\n", " hgtdiff_max_smooth_topo = 750.,750. ! see Namelist doc\n", " pp_sso = 1 ! type of postprocessing for SSO standard deviation\n", " read_nc_via_cdi = .TRUE. ! TRUE/FALSE: read NetCDF input data using CDI or parallel NetCDF library\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "0266ef0b-d096-4548-9cb6-aa75f890640a", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "```\n", "&extpar_nml\n", "itopo = 1 ! topography (0:analytical)\n", "extpar_filename = 'extpar_DOM.nc' ! filename of external parameter input file\n", "```\n", " \n", "
" ] }, { "cell_type": "markdown", "id": "45721638-3c69-413a-86dd-4a61a6c63a6c", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "9f7d847f-c3d6-4166-904b-9e12d76cb6dd", "metadata": {}, "source": [ "
\n", " Exercise (Model initialization): \n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "fab41560-0230-48a2-9b92-375dbb4c0b45", "metadata": {}, "outputs": [], "source": [ "cat >> NAMELIST_NWP << EOF\n", "\n", "! initicon_nml: specify read-in of initial state ------------------------------\n", "&initicon_nml\n", " init_mode = ????????????? ! start from initialized DWD analysis\n", " dwdfg_filename = ????????????? ! initialized analysis data\n", " ltile_coldstart = ????????????? ! coldstart for surface tiles\n", " lp2cintp_sfcana = .TRUE. ! interpolate surface analysis from global domain onto nest\n", " ana_varnames_map_file = 'map_file.ana' ! dictionary mapping internal names onto GRIB2 shortNames\n", "/\n", "! lnd_nml: land scheme switches -----------------------------------------------\n", "&lnd_nml\n", " ntiles = ????????????? ! number of land tiles\n", " nlev_snow = 3 ! number of snow layers\n", " lmulti_snow = .FALSE. ! .TRUE. for use of multi-layer snow model\n", " idiag_snowfrac = 20 ! type of snow-fraction diagnosis\n", " lsnowtile = .TRUE. ! .TRUE.=consider snow-covered and snow-free separately\n", " itype_canopy = 2 ! Type of canopy parameterization\n", " itype_root = 2 ! root density distribution\n", " itype_trvg = 3 ! BATS scheme with add. prog. var. for integrated plant transpiration since sunrise\n", " itype_evsl = 4 ! type of bare soil evaporation\n", " itype_heatcond = 3 ! type of soil heat conductivity\n", " itype_lndtbl = 4 ! table for associating surface parameters\n", " itype_snowevap = 3 ! Snow evap. in vegetated areas with add. variables for snow age and max. snow height\n", " cwimax_ml = 5.e-4 ! scaling parameter for maximum interception parameterization\n", " c_soil = 1.25 ! surface area density of the (evaporative) soil surface\n", " c_soil_urb = 0.5 ! surface area density of the (evaporative) soil surface, urban areas\n", " lseaice = .TRUE. ! .TRUE. for use of sea-ice model\n", " llake = .TRUE. ! .TRUE. for use of lake model\n", " lprog_albsi = .TRUE. ! sea-ice albedo is computed prognostically\n", " sstice_mode = 2 ! SST is updated by climatological increments on a daily basis\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "c7ee2e0a-9f68-49d0-9852-4a2fd0d084ff", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "```\n", "&initicon_nml\n", "init_mode = 7 ! start from initialized DWD analysis\n", "dwdfg_filename ='./dwdANA_RB_DOM.grb' ! initialized analysis data\n", "ltile_coldstart = .TRUE. ! coldstart for surface tiles\n", "\n", "&lnd_nml\n", "ntiles = 3 ! number of tiles\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "6787da5d-7df0-4465-af1c-c0fbdfeef27c", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "be3a3e1f-6228-45ee-9890-e96101479a7b", "metadata": {}, "source": [ "
\n", " Exercise (Namelist finalization):
\n", " Add additional namelist groups from the file $NMLDIR/NAMELIST_NWP_base, by executing the following cell. \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "b2f42b08-7f1d-4e2f-80de-82f8bf5a7bfe", "metadata": {}, "outputs": [], "source": [ "cat $NMLDIR/NAMELIST_NWP_base >> NAMELIST_NWP" ] }, { "cell_type": "markdown", "id": "be5ce697-7f69-4468-b2f4-56f9d5285bb5", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "e4b8429b-c76f-4760-9f38-342c562e3c74", "metadata": {}, "source": [ "The initial conditions file (i.e. here the initialized analysis) is provided via the namelist parameter `dwdfg_filename` `(initicon_nml)`, see Section 5.1.4 \"Starting from Initialized DWD Analysis\", of the tutorial.\n", "\n", "As an exercise you have been asked to set the file name, using the keyword nomenclature.\n", "\n", "In the following small exercise, we will try to understand how these keywords work.\n", "\n", "
\n", " Exercise (Keywords):
\n", " Which of the following filenames would be accepted by the ICON model, given the following keyword nomenclature
\n", " dwdfg_filename = './dwdANA_R<nroot>B<jlev>_DOM<idom>.grb'?\n", "
    \n", "
  1. dwdANA_R3B06.grb
  2. \n", "
  3. dwdANA_R2B6_DOM01.grb
  4. \n", "
  5. dwdANA_R9B02_DOM02.grb
  6. \n", "
  7. dwdana_R2B06_DOM01.grb
  8. \n", "
\n", " Hint: See Section 5.1.2, \"Starting from Uninitialized DWD Analysis\" of the tutorial for keyword definitions.\n", "
" ] }, { "cell_type": "raw", "id": "c54dae3e-b60a-4cf3-a3d1-2b8b535bcea2", "metadata": {}, "source": [ "your answer:" ] }, { "cell_type": "markdown", "id": "6a693a49-0730-4a10-bc9d-00b2da72a82f", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "- [ ] `dwdANA_R3B06.grb`: no, \"DOM...\" missing\n", "- [ ] `dwdANA_R2B6_DOM01.grb`: no, only single digit\n", "- [x] `dwdANA_R9B02_DOM02.grb`: yes\n", "- [ ] `dwdana_R2B06_DOM01.grb`: no on case-sensitive Linux file system\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "770efa58-0301-479e-9f51-682ab394f2b0", "metadata": {}, "source": [ "### " ] }, { "cell_type": "markdown", "id": "2bfdb526-2c02-476f-8469-7bb8822ef62d", "metadata": {}, "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", "
\n", " Exercise (One-way versus two-way nesting):
\n", " Open a terminal and navigate to the experiment directory EXPDIR, where you will find the full model namelist NAMELIST_NWP.
\n", " Have a look at the namelist group grid_nml, to find out about the following nesting details.
\n", "
    \n", "
  • Is the domain over Europe one-way nested or two-way nested (i.e. is the feedback to the global domain turned on or off)?
  • \n", "
  • When does the nested domain get activated and deactivated? Please write down the dates.
  • \n", "
\n", " Hint: See Section 5.2, \"Starting or Terminating Nested Domains at Runtime\" for additional help.\n", "
\n", "
\n", "
\n", " \"alt_text\"/\n", "
\n", " Parent-child feedback\n", "
\n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "f68cf9d3-d0b4-4e34-845f-70317c135dcf", "metadata": {}, "source": [ "Answer: One-way versus two-way nesting" ] }, { "cell_type": "raw", "id": "0e20bb6e-ef35-4389-a0d2-f3ea9fb15683", "metadata": {}, "source": [ "your answer:" ] }, { "cell_type": "markdown", "id": "73b9eafc-2b33-4b93-ab9d-665377571392", "metadata": {}, "source": [ "Answer: Nested domain start and end times" ] }, { "cell_type": "raw", "id": "c8ea3348-24ae-429c-a87c-057361a0c2fb", "metadata": {}, "source": [ "your answer:" ] }, { "cell_type": "markdown", "id": "a166a9e8-4570-4410-a9c1-a87511031584", "metadata": {}, "source": [ "
\n", "Solution\n", "\n", "The domain over Europe is two-way nested. (Incremental) feedback to the global domain is turned on.\n", "\n", "```\n", "&grid_nml\n", " lfeedback = .TRUE. ! specifies if feedback to parent grid is performed\n", "```\n", "
\n", "\n", "The nested domain starts at 2021-07-13T00:00:00 (model start) and terminates after one day at 2021-07-14T00:00:00.\n", "\n", "```\n", "&grid_nml\n", " start_time = 0., 0. ! Time when a nested domain starts to be active [s]\n", " end_time = 0., 86400. ! Time when a nested domain terminates [s]\n", "```\n", "
" ] }, { "cell_type": "markdown", "id": "73a5c81b-1044-4319-b834-bf7228da35e3", "metadata": { "jp-MarkdownHeadingCollapsed": true, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "7957078a-c500-49d7-81b6-6e3442286287", "metadata": {}, "source": [ "## Running the model and inspecting the output\n", "\n", "Execute the following cell, in order to **create the ICON batch job file** (job will **not** be submitted to the HPC cluster)" ] }, { "cell_type": "code", "execution_count": null, "id": "439502b8-f569-4da2-bb30-32552e68083a", "metadata": { "tags": [] }, "outputs": [], "source": [ "cat > $EXPDIR/icon.sbatch << 'EOF'\n", "#!/bin/bash\n", "#SBATCH --job-name=testjob\n", "#SBATCH --partition=compute\n", "#SBATCH --nodes=6\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:20: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", "ulimit -c 0 # limit core file size\n", "ulimit -l unlimited\n", "\n", "export SLURM_DIST_PLANESIZE=\"32\"\n", "export OMPI_MCA_btl=\"self\"\n", "export OMPI_MCA_coll=\"^ml,hcoll\"\n", "export OMPI_MCA_io=\"romio321\"\n", "export OMPI_MCA_osc=\"ucx\"\n", "export OMPI_MCA_pml=\"ucx\"\n", "export UCX_HANDLE_ERRORS=\"bt\"\n", "export UCX_TLS=\"shm,dc_mlx5,dc_x,self\"\n", "export UCX_UNIFIED_MODE=\"y\"\n", "export MALLOC_TRIM_THRESHOLD_=\"-1\"\n", "export OMPI_MCA_pml_ucx_opal_mem_hooks=1\n", "\n", "module load eccodes\n", "\n", "export ECCODES_DEFINITION_PATH=/pool/data/ICON/ICON_training/eccodes/definitions.edzw-2.27.0-1:$ECCODES_DEFINITION_PATH\n", "export OMP_NUM_THREADS=1\n", "\n", "# path to model binary, including the executable:\n", "MODEL=$ICONDIR/build/bin/icon\n", "\n", "srun -l --cpu_bind=verbose --hint=nomultithread --distribution=block:cyclic $MODEL\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "2a638355-8ea0-4861-a8a7-2de259aed27b", "metadata": {}, "source": [ "### Running the ICON model" ] }, { "cell_type": "markdown", "id": "09268228-2574-45b5-bb97-e355bb10e1ed", "metadata": {}, "source": [ "Submit the job to the HPC cluster, using the Slurm command `sbatch`." ] }, { "cell_type": "code", "execution_count": null, "id": "4703ede8-e217-4854-bb89-531be7b987c0", "metadata": { "tags": [] }, "outputs": [], "source": [ "export ICONDIR=$ICONDIR\n", "cd $EXPDIR && sbatch --account=$SLURM_JOB_ACCOUNT icon.sbatch" ] }, { "cell_type": "markdown", "id": "d9e26f76-b288-4b92-9eb5-f1f3db601eb0", "metadata": {}, "source": [ "### Checking the job status" ] }, { "cell_type": "markdown", "id": "0bbc3a9a-7dfa-4a09-99a8-6aa34ed10f37", "metadata": {}, "source": [ "Check the job status via `squeue`." ] }, { "cell_type": "code", "execution_count": null, "id": "04c6ba13-7f7f-4a71-80b2-69e9ad122d8b", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "e6dad879-eff4-4eb7-87db-268d5235b3a2", "metadata": {}, "source": [ "### Inspecting the Model Output\n", "\n", "After the job has finished, inspect the model output. Take a look at the output files in $EXPDIR." ] }, { "cell_type": "markdown", "id": "6475864c-3555-4e25-a84f-40396cdc0f31", "metadata": {}, "source": [ "
\n", " Exercise (Horizontal output grid):\n", "
\n", " One of the files contains output on the native ICON grid, the other one contains the output on a regular lat/lon grid.
\n", " How can you identify which file is which (apart from the obvious file names that we have chosen)? Use cdo sinfov to identify the relevant metadata.\n", "

\n", " Hint: You might have to load the environment modules cdo\n", " \n", "
" ] }, { "cell_type": "markdown", "id": "7f710870-e076-43ce-9141-d86d177b1112", "metadata": {}, "source": [ "Answer: native" ] }, { "cell_type": "code", "execution_count": null, "id": "93037753-2d3f-40f1-9844-30b6d0a81aeb", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "9500a63c-a438-48ea-9db5-9e8473208a54", "metadata": {}, "source": [ "Answer: lat/lon" ] }, { "cell_type": "code", "execution_count": null, "id": "d72339c6-ffd2-46d4-b909-5b433a8a442c", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "096d17c3-b6f7-4b30-9bd0-7af6d40b0465", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "Solution\n", "\n", "Answer: native \n", "output on native grid : NWP\\_DOM01\\_ML\\_0001.nc (grid coordinates = 'unstructured')\n", "\n", "Answer: lat/lon \n", "output on lat/lon grid: NWP\\_lonlat\\_DOM01\\_ML\\_0001.nc (grid coordinates = 'lonlat')\n", "\n", "```\n", "cd $EXPDIR\n", "module load cdo\n", "\n", "set +o xtrace\n", "cdo sinfov NWP_DOM01_ML_0001.nc | grep -B0 -A1 \"Grid coordinates\"\n", "cdo sinfov NWP_lonlat_DOM01_ML_0001.nc | grep -B0 -A1 \"Grid coordinates\"\n", "```\n", "
" ] }, { "cell_type": "markdown", "id": "c54a54ec-5952-4bab-a5d8-827dbfbc13e1", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "07a19c25-f35e-469d-88ea-dc22297479f2", "metadata": {}, "source": [ "
\n", " Exercise (Vertical output grid):
\n", " For the output on regular lat/lon grid, use cdo sinfov to identify the type of atmospheric vertical output grid.\n", " \n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "aad06cf2-ea59-4e1e-bfee-052f73da964a", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "699c5540-f3d8-4801-ae2f-ad0537be64ec", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "Solution\n", " \n", "SAMPLE SOLUTION: Type of atm. vertical output grid : ML = \"model levels\" (CDO depicts `generalized_height`)\n", "\n", "```\n", "cd $EXPDIR\n", "module load cdo\n", "cdo sinfov NWP_lonlat_DOM01_ML_0001.nc | grep \"Vertical coordinates\" -B0 -A1\n", "```\n", "
" ] }, { "cell_type": "markdown", "id": "d0940afd-edeb-4a35-96ba-a74e3d541b00", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "76612a8c-7084-488d-b5bf-a101b03f9b2a", "metadata": {}, "source": [ "
\n", " Exercise (Visualization):
\n", " Visualize the 2m temperature, integrated water vapor, gusts at 10m, and total precipitation using the script icon_exercise_realdata_plot01.ipynb.
\n", " If you like, you can look into other fields and timesteps as well, or make use of ncview for visualizing the interpolated lat-lon output.\n", "
" ] }, { "cell_type": "markdown", "id": "4d58bba0-c325-4625-b429-9286453f7087", "metadata": {}, "source": [ "###" ] }, { "cell_type": "markdown", "id": "a27bb745-cfeb-49d3-a07d-e06c03e767cc", "metadata": { "tags": [] }, "source": [ "## Time-stepping" ] }, { "cell_type": "markdown", "id": "f391aa59-acfc-4a06-b820-f88d9194b1e7", "metadata": {}, "source": [ "\n", " \n", " \n", " \n", " \n", "
\n", "

\n", " This exercise focuses on aspects of the ICON time-stepping scheme, explained in Section 3.7.1, \"ICON Time-Stepping\".\n", "

\n", "
\n", "
\n", " \"alt_text\"/\n", "
\n", " ICON internal time stepping\n", "
\n", "
\n", "
\n" ] }, { "cell_type": "markdown", "id": "17d0b52f-67b5-4c8f-babe-6c9c3461d0d8", "metadata": {}, "source": [ "
\n", " Exercise (Time-stepping):\n", "
\n", " Compute the dynamics time step Δτ from the specification of the physics time step Δt (dtime) and the number of dynamics substeps ndyn_substeps (nonhydrostatic_nml).\n", "

\n", " Hint: Have a look at the model Namelist $EXPDIR/NAMELIST_NWP\n", "
\n" ] }, { "cell_type": "code", "execution_count": null, "id": "3c6f24b3-5e37-43d8-b876-5c2221ee9997", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "1582acee-d601-4bb3-bdc4-22cfb2fc7d9b", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "Solution\n", " \n", "Answer: 360s/5 = 72s\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "38397500-2153-4f1a-9006-439fa06f635c", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "d46e3aad-c510-49e2-92f6-d62a4cc0407d", "metadata": {}, "source": [ "The timestep is proportional to the effective mesh size $\\overline{\\Delta x}$ of the horizontal ICON grid. " ] }, { "cell_type": "markdown", "id": "4e9a8b4b-2c38-41b5-8776-1276fbea86ea", "metadata": {}, "source": [ "
\n", " Exercise: \n", " Now take a look at Equation (3.52) on page 91 of the Tutorial handbook and calculate an estimate for the maximum dynamics time step Δτmax which is allowed for the horizontal grid spacing at hand.
\n", " Compare this to the time step used: Did we make a reasonable choice?\n", "
" ] }, { "cell_type": "markdown", "id": "c77b9bdf-d9ef-4e50-97a4-c4074bca817f", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "Solution\n", " \n", "Answer: \n", "The effective mesh size of a global grid can be estimated as

\n", "$\n", "\\overline{\\Delta x} \\approx 5050/(n\\,2^k) \\quad [\\mathrm{km}]\\,.\n", "$\n", "\n", "**Example Python code**\n", "```\n", "python3 - << EOF\n", "n = 2 # grid_root\n", "k = 6 # grid_level\n", "\n", "mesh_size = 5050/(n * 2**k) # [km]\n", "print(f\"mesh size: {mesh_size} [km]\")\n", "\n", "delta_tau_max = 1.8 * mesh_size\n", "print(f\"delta tau_max: {delta_tau_max} [s]\");\n", "EOF\n", "```\n", "
\n", "\n", "**Result**
\n", "$\\Delta \\tau_{max} = 1.8 \\cdot 10^{-3} \\cdot 39453.125 ~[s] \\approx 71 ~[s] $\n", "\n", "

" ] }, { "cell_type": "markdown", "id": "12e29514-4906-43cf-a382-ea4b4551a112", "metadata": { "editable": true, "jp-MarkdownHeadingCollapsed": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "228705e8-36fc-4da4-8043-0cd9bb39597f", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "## Optional: Appending your own output namelist\n", "\n", "
\n", " Exercise (Output namelists for LAM initialization and forcing):
\n", " We will add an additional output namelist, in order to learn about its most important options.
\n", " As an example, we will write a particular set of output fields, which is suitable for driving a limited area run (so called forcing or boundary data).
\n", " Fill in the missing parameters below:
\n", " Forcing data should be written\n", " \n", " Hint: See Section 7.1 (\"Settings for the Model Output\") of the ICON tutorial for additional details regarding output namelists.\n", "
" ] }, { "cell_type": "code", "execution_count": null, "id": "a9fa43e0-8ad1-4620-b686-e1df9086e92e", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "outputs": [], "source": [ "cat >> NAMELIST_NWP << EOF\n", "\n", "!----------------------------------------------------------------------------\n", "! output_nml: writing boundary data for LAM ;----\n", "!----------------------------------------------------------------------------\n", "&output_nml\n", " filetype = ????????????? ! output format: GRIB2 or NETCDFv2\n", " dom = ????????????? ! write output only for EU-nest\n", " output_bounds = ????????????? ! output: start, end, increment in s\n", " steps_per_file = ????????????? ! number of output steps in one output file\n", " remap = ????????????? ! (no)remap to regular lat/lon grid (0 or 1)\n", " output_grid = .FALSE. ! flag whether grid information is added to output.\n", " output_filename = ????????????? ! file name base\n", " filename_format = '__' ! full file format\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " !\n", " ml_varlist = ????????????? ! output fields on model levels\n", "/\n", "\n", "EOF" ] }, { "cell_type": "markdown", "id": "5da02368-7c5e-4ccd-86f6-811a56c466b4", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [ "hide-input" ] }, "source": [ "
\n", "Solution\n", "\n", "```\n", "cat >> NAMELIST_NWP << EOF\n", "\n", "!----------------------------------------------------------------------------\n", "! output_nml: LAM exercise; writing boundary data for LAM ;----\n", "!----------------------------------------------------------------------------\n", "&output_nml\n", " filetype = 2 ! output format: GRIB2 or NETCDFv2\n", " dom = 2 ! write output only for EU-nest\n", " output_bounds = 0., 86400., 7200. ! output: start, end, increment in s\n", " steps_per_file = 1 ! number of output steps in one output file\n", " remap = 0 ! (no)remap to regular lat/lon grid (0 or 1)\n", " output_grid = .FALSE. ! flag whether grid information is added to output.\n", " output_filename = './lam_forcing/forcing' ! file name base\n", " filename_format = '__' ! full file format\n", " mode = 1 ! 1: forecast mode (relative t-axis), 2: climate mode (absolute t-axis)\n", " !\n", " ml_varlist = 'U','V','W','PRES','TEMP','QV','QC','QI','QR','QS','HHL' ! output fields on model levels\n", "/\n", "\n", "EOF\n", "```\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "212253ea-1821-4b92-84b8-370d2f08378b", "metadata": {}, "source": [ "###" ] }, { "cell_type": "markdown", "id": "7635dc8b-8a91-4f6c-9216-366046705f70", "metadata": {}, "source": [ "Then, create the additional output directory:" ] }, { "cell_type": "code", "execution_count": null, "id": "93f9fba4-84de-4279-bd19-ddbccbd6d4a6", "metadata": {}, "outputs": [], "source": [ "mkdir -p $EXPDIR/lam_forcing" ] }, { "cell_type": "markdown", "id": "5909360e-be1b-408a-8f80-031468675252", "metadata": {}, "source": [ "Submit the batch job." ] }, { "cell_type": "code", "execution_count": null, "id": "4a842219-9fa0-48a0-96c8-ffd12d5bba40", "metadata": {}, "outputs": [], "source": [ "export ICONDIR=$ICONDIR\n", "cd $EXPDIR && sbatch --account=$SLURM_JOB_ACCOUNT icon.sbatch" ] }, { "cell_type": "markdown", "id": "0da27192-9037-4b92-b50f-36f74ea110d2", "metadata": {}, "source": [ "Check the job status via `squeue`." ] }, { "cell_type": "code", "execution_count": null, "id": "05d8c480-4247-4817-b5ee-fb8366cedd6e", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "markdown", "id": "5abd5aa0-defa-49e6-8184-ebdc700a4348", "metadata": {}, "source": [ "###" ] }, { "cell_type": "markdown", "id": "ab5641ce-66c5-4fe3-b662-e0d4fbb85251", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "Check the correctness of your output files. You should find **13 forcing data files** in your output directory `lam_forcing`.\n", "\n", "
\n", " Exercise (Check output files):
\n", " In your Linux terminal, export the following environment variable\n", "

\n", " export ECCODES_DEFINITION_PATH=/pool/data/ICON/ICON_training/eccodes/definitions.edzw-2.27.0-1:$ECCODES_DEFINITION_PATH\n", "

\n", " and apply the following command to the last forcing data file:\n", "

\n", " cdo sinfov data-file.grb > data-file.sinfov\n", "

\n", " Compare with the reference output below to see whether your output namelist is correct.\n", "
\n", "\n", "\n", "```\n", " File format : GRIB2\n", " -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name\n", " 1 : DWD unknown v instant 60 1 9376 1 P16 : U \n", " 2 : DWD unknown v instant 60 1 9376 1 P16 : V \n", " 3 : DWD unknown v instant 61 2 9376 1 P16 : W \n", " 4 : DWD unknown v instant 60 1 9376 1 P16 : P \n", " 5 : DWD unknown v instant 60 1 9376 1 P16 : T \n", " 6 : DWD unknown v instant 60 1 9376 1 P16 : QV \n", " 7 : DWD unknown v instant 60 1 9376 1 P16 : QC \n", " 8 : DWD unknown v instant 60 1 9376 1 P16 : QI \n", " 9 : DWD unknown v instant 60 1 9376 1 P16 : QR \n", " 10 : DWD unknown v instant 60 1 9376 1 P16 : QS \n", " 11 : DWD unknown v instant 61 3 9376 1 P16 : HHL \n", " Grid coordinates :\n", " 1 : unstructured : points=9376\n", " grid : number=101 position=1\n", " uuid : 7f1e5eb3-fc61-a692-b99f-830dab7e2440\n", " Vertical coordinates :\n", " 1 : generalized_height : levels=60\n", " height : 1 to 60 by 1 \n", " bounds : 1-2 to 60-61 by 1 \n", " zaxis : number=0\n", " uuid : baebf431-dfd5-542e-cb76-8394de703140\n", " 2 : generalized_height : levels=61\n", " height : 1 to 61 by 1 \n", " zaxis : number=0\n", " uuid : baebf431-dfd5-542e-cb76-8394de703140\n", " 3 : generalized_height : levels=61\n", " height : 1 to 61 by 1 \n", " bounds : 1-0 to 61-0 by 1 \n", " zaxis : number=0\n", " uuid : baebf431-dfd5-542e-cb76-8394de703140\n", " typeOfSecondFixedSurface : 101\n", " Time coordinate :\n", " time : 1 step\n", " RefTime = 2021-07-13 00:00:00 Units = minutes Calendar = proleptic_gregorian\n", " YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss\n", " 2021-07-14 00:00:00\n", "```" ] }, { "cell_type": "markdown", "id": "73720810-7a3c-43b3-8422-5cb3a092a9f6", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "###" ] }, { "cell_type": "markdown", "id": "5df00d64-f799-4ea7-93fd-e99a41f115fc", "metadata": {}, "source": [ "## Excursion: The ICON LOG output" ] }, { "cell_type": "markdown", "id": "fdbfbbce-d0db-4047-9de0-3ad26db0a453", "metadata": {}, "source": [ "
\n", "\"alt_text\"/\n", "
The ICON LOG file
\n", "
\n", "\n", "During model integration, ICON writes various information to the `stderr` output stream (which serves as an unbuffered substitute for `stdout`). This information is collected by the batch queuing system in a text file often referred to as 'the ICON log file'. \n", "The name of the log file is defined in the ICON batch script header (see `#SBATCH --output`). In our exercises it is named `slurm.XXX.out`, and \n", "stored in the output directory `$EXPDIR`.\n", "\n", "The amount of information that is printed and stored in the LOG file depends on the verbosity level, which is set in the ICON namelist \n", "(see the parameter `msg_level` in the namelist `run_nml`).\n", "\n", "The **log file contains** various information, such as \n", "- **information about the model setup**\n", " - like control output of various subroutines and functions\n", " - the chosen input fields and grids \n", " - output dates\n", " - ...\n", "- **domain specific information** for each integration time step\n", " - date and time of each time step\n", " - global max/min of the normal horizontal and vertical velocity (`vn` and `w`)\n", " - domain average of the surface pressure tendency $\\frac{\\mathrm{d}p_s}{\\mathrm{d}t}$\n", " - trigger dates of physical parameterizations" ] }, { "cell_type": "markdown", "id": "35c145b3-fed2-4b17-ae8c-f22ec32aff87", "metadata": {}, "source": [ "
\n", " Exercise (The ICON log output): \n", "
    \n", "
  • In your Linux terminal, navigate to your experiment directory $EXPDIR and open an existing ICON log file.
  • \n", "
  • Try to identify the above mentioned domain specific information for an arbitrary integration time step.
  • \n", "
  • Do you have an idea why there are multiple messages of the form MAXABS VN, W in domain ... for each time step?\n", "
\n", "
" ] }, { "cell_type": "markdown", "id": "d5f8b94c-8c1c-43c3-abc7-c0a140060183", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "Solution\n", " \n", "Answer:\n", "\n", "Each line of the form `MAXABS VN, W in domain ...` corresponds to a single integration step of the *dynamical core*. Remember that ICON performs a substepping of the dynamical core with respect to the physics, which means that the dynamical core is called multiple (usually 5) times per physics time step.\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "911642aa-033a-461b-b5d4-b95ea8eec130", "metadata": {}, "source": [ "###" ] }, { "cell_type": "markdown", "id": "2f5a4b72-97c5-4445-8203-9544631eb53e", "metadata": {}, "source": [ "### The surface pressure tendency\n", "\n", "The **domain averaged surface pressure tendendency** output\n", "\n", "$|\\large \\frac{\\mathrm{d}p_s}{\\mathrm{d}t}| = \\frac{1}{A}\\sum_{i}\\left(\\sum_{k}|-g\\nabla_{h}\\cdot(\\rho v_{h})\\,\\Delta z_{k}|\\right)\\Delta a_{i} \\,,\\quad \\text{in Pa/s}$\n", "\n", "\n", "in your log file can be seen as a measure of the gravity wave activity in your simulation. The tendency includes contributions from 'meteorological' inertia-gravity waves, but also spurious/artificial waves that emerge e.g. from imbalances in the initial conditions. The surface pressure tendency is larger the more gravity waves are present in the forecast. Therefore, it can be used to monitor the noise level of your simulation. See also Section 2.2.1 of the ICON tutorial for more details. " ] }, { "cell_type": "markdown", "id": "0c952703-d305-44ef-a883-35e2088e9075", "metadata": {}, "source": [ "
\n", " Exercise (Monitoring the noise level of your simulation):

\n", " In order to visualize the domain averaged surface pressure tendency as a function of time, apply the script scripts/plot_dpsdt_training.ipynb to a log file of your choice.
\n", "Describe what you see.\n", "

" ] }, { "cell_type": "raw", "id": "b921da8b-30fd-4376-8c37-cb9eb8ae4806", "metadata": {}, "source": [ "your answer" ] }, { "cell_type": "markdown", "id": "70c11193-8446-47d5-b0d6-835decd590df", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### Solution" ] }, { "cell_type": "markdown", "id": "c6868eb3-a5c6-43d7-87b6-53919e3d4b99", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "
\n", "\n", "Answer:\n", "\n", "
\n", "\"alt_text\"/\n", "
Surface pressure tendency
\n", "
\n", "\n", "- The plot exhibits a high, but rapidly decaying noise level during the first couple of minutes of the model run. The initial noise emerges from spurious imbalances in the initial conditions.\n", "\n", "
" ] }, { "cell_type": "markdown", "id": "4d70f082-bc9b-4b13-ab62-b480fe18a2ec", "metadata": { "editable": true, "slideshow": { "slide_type": "" }, "tags": [] }, "source": [ "### " ] }, { "cell_type": "markdown", "id": "92a6c3df-6f0e-4953-bdee-1282eecfc849", "metadata": { "tags": [] }, "source": [ "---" ] }, { "cell_type": "markdown", "id": "cb126281-ee81-48c5-88c2-09e40d2a858d", "metadata": {}, "source": [ "

Congratulations! You have successfully completed Exercise 2.

" ] }, { "cell_type": "markdown", "id": "3e3437d7-533d-4d03-a6c8-a8d6a87f6bb4", "metadata": {}, "source": [ "---" ] }, { "cell_type": "markdown", "id": "5ead2f4c-a2f9-4cbe-9598-38e371b21448", "metadata": {}, "source": [ "## Further Reading and Resources\n", "\n", "- ICON Tutorial, Ch. 5: 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", "- Parallelization was not covered in this tutorial exercise. For details, however, there is an optional exercise, see the Jupyter notebook
icon_exercise_parallelization.ipynb
" ] }, { "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 }