Lifetime Tracer Simulation: Difference between revisions

From icon-art guide
Jump to navigation Jump to search
No edit summary
(fixed math display)
 
(4 intermediate revisions by 2 users not shown)
Line 6: Line 6:
* the structure of lifetime tracers in xml-files
* the structure of lifetime tracers in xml-files
* editing output variables
* editing output variables
No emission data will be included in this simulation.


== Configuration case ==
== Configuration case ==
Line 11: Line 12:


The simulation is modeling the 01 October 2012 and is initialized with data from the ECMWF Integrated Forecast System (IFS) and includes boundary conditions and chemical lifetimes from the WMO Ozone assessment 2010. The boundary conditions and the chemical lifetimes are recalculated in a sort of rate at which the substances are depleted from the atmosphere with help of the implicit solution of the balance equation:
The simulation is modeling the 01 October 2012 and is initialized with data from the ECMWF Integrated Forecast System (IFS) and includes boundary conditions and chemical lifetimes from the WMO Ozone assessment 2010. The boundary conditions and the chemical lifetimes are recalculated in a sort of rate at which the substances are depleted from the atmosphere with help of the implicit solution of the balance equation:
<math>\frac{\partial(\bar{\rho)\hat{\Psi_{l}}/{\partial t} = -\nabla\cdot (\hat{v}\bar{\rho}\hat{\Psi_{l}})- \nabla\cdot\bar{(\rho v''\Psi_{g,l}''}+P_l-L_l+E_l</math>


<math>
Here <math>\rho</math> is the density of air, <math>\hat{\Psi_{l}}</math> the barycentric-averaged mass mixing ratio, <math>\nabla\cdot (\hat{v}\bar{\rho}\hat{\Psi_{l}})</math> indicates the flux divergence that includes the horizontal and vertical advection of the gaseous compound l and <math>\nabla\cdot\bar{(\rho v''\Psi_{l}'')}</math> indicates the change due to turbulent fluxes. Further <math>P_l</math> describes the production rate due to chemical reactions, <math>L_l</math> the respective loss rate and emissions are noted with <math>E_l</math>. Everything is related to the respective compound l.
\frac{\partial \bar{\rho} \hat{\Psi}_l }{ \partial t} = -\nabla \cdot (\hat{v} \overline{\rho} \hat{\Psi}_{l})- \nabla \cdot (\overline{\rho v'' \Psi_{g,l}'' })+P_l-L_l+E_l
</math>

Here <math>\rho</math> is the density of air, <math>\hat{\Psi_{l}}</math> the barycentric-averaged mass mixing ratio, <math>\nabla\cdot (\hat{v}\bar{\rho}\hat{\Psi_{l}})</math> indicates the flux divergence that includes the horizontal and vertical advection of the gaseous compound l and <math>\nabla\cdot\overline{(\rho v''\Psi_{l}'')}</math> indicates the change due to turbulent fluxes. Further <math>P_l</math> describes the production rate due to chemical reactions, <math>L_l</math> the respective loss rate and emissions are noted with <math>E_l</math>. Everything is related to the respective compound l.


In this example no emission data is used.
In this example no emission data is used.
Line 20: Line 24:
== Setting up the Runscript ==
== Setting up the Runscript ==


Let's start with the runscript that has to be prepared. Please note that the in the following explained parts have to be printed in one runscript-file with the naming designation "xyz.run". Here it is named <code>exp.testsuite.lifetime_tracer_test.run</code> but of course you can call it differently as well.
Let's start with the runscript that has to be prepared. Please note that the in the following explained parts have to be printed in one runscript-file with the naming designation "xyz.run". Here it is named <code>exp.testsuite.lifetime_tracer_test.run</code> but of course you can call it differently as well. The runscript can be stored under the following path in your icon directory: <code>/icon-kit/run</code>


If you've also worked through the example of the [[Simplified Chemistry]], you can use nearly the same runscript. Note that you have to change the paths from Part 1, the timing settings from Part 2, the output variables from Part 3, the emission settings as well as the path of the chemtracer-xml-file in the ART-settings from Part 4 and finally the timing in the job settings from Part 5. Details can be found below.
If you've already walked through the example of the [[Simplified Chemistry]], you can use nearly the same runscript. Note that you have to change the paths from Part 1, the timing settings from Part 2, the output variables from Part 3, the emission settings as well as the path of the chemtracer-xml-file in the ART-settings from Part 4 and finally the timing in the job settings from Part 5. Details can be found below.


Inside of that, first check that all your directories are correct, probably they have to be adjusted. Abbreviations used here are the following:
Inside of that, first check in part 1 that all your paths to your directories are correct, probably they have to be adjusted. Note that "hp8526" is a name of a specific account here, make sure to double check especially these lines. Abbreviations used here are the following:
*CENTER: Your organization
*CENTER: Your organization
*EXPNAME: name of your ICON-Simulation
*EXPNAME: name of your ICON-Simulation
Line 31: Line 35:
*INDIR: Directory where the necessary Input data are stored
*INDIR: Directory where the necessary Input data are stored
*EXP:
*EXP:
*lart: For ICON-ART Simulation that has to be switched to <code>Oheim_simple_icon.run</code>.
*lart: For ICON-ART Simulation that has to be switched to <code>.True.</code>.


<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Part 1: Runscript Directory Settings (Example configuration)
Part 1: Runscript Directory Settings (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
#!/bin/bash
#!/bin/bash
CENTER=IMK
CENTER=IMK
Line 109: Line 113:
#
#
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
</syntaxhighlight>
</pre>
</div>
</div>


Additionally in the next lines of code you set the timing. In this simulation we only simulate one day (01 October 2012). To really catch all day times and so the time dependent solar radiation, the output interval is set to 1 hours to calculate <chem>CHBr3</chem> and <chem>CH2Br2</chem> to every time of the day. Because of the Photolysis dependency of <chem>CHBr3</chem> this is particularly important.
Additionally in the next lines of code you set the timing. In this simulation we only simulate one day (01 October 2012). To calculate <chem>CHBr3</chem> and <chem>CH2Br2</chem> to every time of the day the output interval is set to 1 hour.
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Part 2: Runscript Timing Settings (Example configuration)
Part 2: Runscript Timing Settings (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
! run_nml: general switches ----------
! run_nml: general switches ----------
&amp;# model timing
&amp;# model timing
Line 127: Line 131:
leadtime="P8H"
leadtime="P8H"
checkpoint_interval="P30D"
checkpoint_interval="P30D"
</syntaxhihlight>
</pre>
</div>
</div>


Line 134: Line 138:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Part 3: Runscript ICON-Parameter and -Namelist Settings (Example configuration)
Part 3: Runscript ICON-Parameter and -Namelist Settings (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
# model parameters
# model parameters
model_equations=3 # equation system
model_equations=3 # equation system
Line 389: Line 393:
reg_lat_def = -90.,1,90.
reg_lat_def = -90.,1,90.
/
/
</syntaxhighlight>
</pre>
</div>
</div>
Please note in the last namelist section "output_nml" that you can set all output variables that you need to postprocess your data later. All assigned variables here will be written in the output netCDF-files as well. To learn more about post processing your data, check out a later chapter of this article or the [[Postprocessing]] article.
Please note in the last namelist section "output_nml" that you can set all output variables that you need to postprocess your data later. All assigned variables here will be written in the output netCDF-files as well. To learn more about post processing your data, check out a later chapter of this article or the [[Postprocessing]] article.


Now, we're getting to the ICON-ART settings. To enable chemistry in an ICON-ART Simulation inn general, the switch <code>lart_chem</code> has to be set to <code>.TRUE.</code>. With <code>lart_diag_out</code> output of the diagnostic fields can be enabled. Due to setting <code>lart_chem=.TRUE.</code> either <code>lart_chemtracer</code> or <code>lart_mecca</code> have to be set to <code>.TRUE.</code>. Because we want to perform a simulation with simplified chemistry, we have to switch on <code>lart_chemtracer</code>. If this namelist parameter is set to <code>.TRUE.</code>, also <code>cart_chemtracer_xml</code> has to be fulfilled. Here you enter the path of your xml-file which describes the tracers occurring and their properties in the simulation. How to create this xml-file is explained in the next chapter.
Now, we're getting to the ICON-ART settings. To enable chemistry in an ICON-ART Simulation in general, the switch <code>lart_chem</code> has to be set to <code>.TRUE.</code>. With <code>lart_diag_out</code> output of the diagnostic fields can be enabled. Due to setting <code>lart_chem=.TRUE.</code> either <code>lart_chemtracer</code> or <code>lart_mecca</code> has to be set to <code>.TRUE.</code>. Because we want to perform a simulation with simplified chemistry, we have to switch on <code>lart_chemtracer</code>. If this namelist parameter is set to <code>.TRUE.</code>, also <code>cart_chemtracer_xml</code> has to be fulfilled. Here you enter the path of your xml-file which describes the tracers occurring and their properties in the simulation. How to create this xml-file is explained in the next chapter.
An example configuration for this part is shown in the following:
An example configuration for this part is shown in the following:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Part 4: Runscript ICON-ART Settings (Example configuration)
Part 4: Runscript ICON-ART Settings (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
&art_nml
&art_nml
lart_chem = .TRUE.
lart_chem = .TRUE.
Line 410: Line 414:
/
/
EOF
EOF
</syntaxhighlight>
</pre>
</div>
</div>
Please note that there are also several other namelist parameter you can select from (see [[Namelist]] article) but to perform our case study we're done for the ART setting at this point.
Please note that there are also several other namelist parameter you can select from (see [[Namelist]] article) but to perform our case study we're done for the ART setting at this point.
Line 417: Line 421:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Part 5: Runscript job Settings (Example configuration)
Part 5: Runscript job Settings (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
cp ${ICONFOLDER}/bin/icon ./icon.exe
cp ${ICONFOLDER}/bin/icon ./icon.exe


Line 437: Line 441:
chmod +x job_ICON
chmod +x job_ICON
sbatch job_ICON
sbatch job_ICON
</syntaxhighlight>
</pre>
</div>
</div>


Line 444: Line 448:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Complete example configuration of the runscript
Complete example configuration of the runscript
<pre class="mw-collapsible-content">
<syntaxhighlight lang=bash line class="mw-collapsible-content">
#!/bin/bash
#!/bin/bash
CENTER=IMK
CENTER=IMK
Line 817: Line 821:
chmod +x job_ICON
chmod +x job_ICON
sbatch job_ICON
sbatch job_ICON
</syntaxhighlight>
</pre>
</div>
</div>


Line 827: Line 831:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Standard Chemtracer-xml-file for simulations without emission data
Standard Chemtracer-xml-file for simulations without emission data
<pre class="mw-collapsible-content">
<syntaxhighlight lang=xml line class="mw-collapsible-content">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tracers SYSTEM "tracers.dtd">
<!DOCTYPE tracers SYSTEM "tracers.dtd">
Line 1,138: Line 1,142:
</chemtracer>
</chemtracer>
</tracers>
</tracers>
</syntaxhighlight>
</pre>
</div>
</div>


Line 1,144: Line 1,148:
<div class="toccolours mw-collapsible mw-collapsed">
<div class="toccolours mw-collapsible mw-collapsed">
Chemtracer-xml-file for lifetime tracer simulation (Example configuration)
Chemtracer-xml-file for lifetime tracer simulation (Example configuration)
<pre class="mw-collapsible-content">
<syntaxhighlight lang=xml line class="mw-collapsible-content">
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tracers SYSTEM "tracers.dtd">
<!DOCTYPE tracers SYSTEM "tracers.dtd">
Line 1,174: Line 1,178:
</chemtracer>
</chemtracer>
</tracers>
</tracers>
</syntaxhighlight>
</pre>
</div>
</div>



Latest revision as of 12:45, 26 October 2023

- under construction -

In this example it is shown how to simulate a lifetime driven tracer with simplified chemistry in ICON-ART. This tutorial teaches you...

  • the setup of the runscript
  • the correct setup of the xml-file for such tracers.
  • the structure of lifetime tracers in xml-files
  • editing output variables

No emission data will be included in this simulation.

Configuration case

The depicted case is dealing with biogenic very short-lived species (VSLS) with a very short lifetime, more accurately Bromoform () and Dibromomethane (). Like of most VSLSs the major source of and is the ocean which leads too a large gradient with increasing height in the concentration of these tracers. Bromoform is mainly depleted by photolysis in the Troposphere whereas Dibromomethanes main loss is due to Hydroxylradicals (OH). To assess the ability to simulate the transport of VSLS from the surface to the lower stratosphere, this case study uses an idealized chemical tracer approach.

The simulation is modeling the 01 October 2012 and is initialized with data from the ECMWF Integrated Forecast System (IFS) and includes boundary conditions and chemical lifetimes from the WMO Ozone assessment 2010. The boundary conditions and the chemical lifetimes are recalculated in a sort of rate at which the substances are depleted from the atmosphere with help of the implicit solution of the balance equation:

Here is the density of air, the barycentric-averaged mass mixing ratio, indicates the flux divergence that includes the horizontal and vertical advection of the gaseous compound l and indicates the change due to turbulent fluxes. Further describes the production rate due to chemical reactions, the respective loss rate and emissions are noted with . Everything is related to the respective compound l.

In this example no emission data is used.


Setting up the Runscript

Let's start with the runscript that has to be prepared. Please note that the in the following explained parts have to be printed in one runscript-file with the naming designation "xyz.run". Here it is named exp.testsuite.lifetime_tracer_test.run but of course you can call it differently as well. The runscript can be stored under the following path in your icon directory: /icon-kit/run

If you've already walked through the example of the Simplified Chemistry, you can use nearly the same runscript. Note that you have to change the paths from Part 1, the timing settings from Part 2, the output variables from Part 3, the emission settings as well as the path of the chemtracer-xml-file in the ART-settings from Part 4 and finally the timing in the job settings from Part 5. Details can be found below.

Inside of that, first check in part 1 that all your paths to your directories are correct, probably they have to be adjusted. Note that "hp8526" is a name of a specific account here, make sure to double check especially these lines. Abbreviations used here are the following:

  • CENTER: Your organization
  • EXPNAME: name of your ICON-Simulation
  • OUTDIR: Directory where the simulation output will be stored
  • ARTFOLDER: Directory where the ICON-ART code is stored
  • INDIR: Directory where the necessary Input data are stored
  • EXP:
  • lart: For ICON-ART Simulation that has to be switched to .True..

Part 1: Runscript Directory Settings (Example configuration)

Additionally in the next lines of code you set the timing. In this simulation we only simulate one day (01 October 2012). To calculate and to every time of the day the output interval is set to 1 hour.

Part 2: Runscript Timing Settings (Example configuration)

Please note in the last namelist section "output_nml" that you can set all output variables that you need to postprocess your data later. All assigned variables here will be written in the output netCDF-files as well. To learn more about post processing your data, check out a later chapter of this article or the Postprocessing article.

Now, we're getting to the ICON-ART settings. To enable chemistry in an ICON-ART Simulation in general, the switch lart_chem has to be set to .TRUE.. With lart_diag_out output of the diagnostic fields can be enabled. Due to setting lart_chem=.TRUE. either lart_chemtracer or lart_mecca has to be set to .TRUE.. Because we want to perform a simulation with simplified chemistry, we have to switch on lart_chemtracer. If this namelist parameter is set to .TRUE., also cart_chemtracer_xml has to be fulfilled. Here you enter the path of your xml-file which describes the tracers occurring and their properties in the simulation. How to create this xml-file is explained in the next chapter. An example configuration for this part is shown in the following:

Part 4: Runscript ICON-ART Settings (Example configuration)

Please note that there are also several other namelist parameter you can select from (see Namelist article) but to perform our case study we're done for the ART setting at this point.

Depending on the used HPC-System, some parameter concerning the running job like maximum running time and used nodes can be set. For this case study the following settings can be copied. Note that this is valid for the HoreKa HPC system and that it can differ to other systems.

Part 5: Runscript job Settings (Example configuration)

To conclude and to double check, in the following box the complete runscript is shown once again.

Complete example configuration of the runscript

Setting up the xml-file

An xml-file describes the chemical components of the simulation which means that all trace gases or aerosols and their properties that are relevant for the simulation are listed here. Since we perform a simulation with simplified ICON-ART chemistry of lifetime dependent tracers we need the matching chemtracer-xml-file where only these tracers have to mentioned. Then, the concentrations will be calculated according to their lifetimes with no relation to other tracers. Because of no specific other settings (e.g. emissions), this is the only xml-file needed here.

To prepare the xml-file we can select the matching species from the general previously generated xml-file standard_chemtracer.xml.

Standard Chemtracer-xml-file for simulations without emission data

After identifying the needed chemtracers (in our case (in xml-file: TRCHBr3) and (in xml-file: TRCH2Br2)) we copy the needed code lines into our new xml-file chemtracer_lifetime_chbr3_ch2br2.xml needed for the simulation.

Chemtracer-xml-file for lifetime tracer simulation (Example configuration)

Running the simulation

Double check all filled in paths and namelist - especially the ART-namelists. If every namelist parameter in the runscript is filled in correctly, the runscript has to be saved. Afterwards by typing

./exp.testsuite.lifetime_tracer_test.run

a job can be submitted to the respective HPC-System. Type the terminal command

squeue

to view a list of your submitted and currently running and jobs. By changing in the output directory (which is according to our runscript /hkfs/work/workspace/scratch/hp8526-liftime_tracer_test you can check the slurm file for possible errors and run times after your job has been run through.

In the output directory you can also find all output data for postprocessing in netCDF format.