Difference between revisions of "UKCA & UMUI Tutorial 6"

From UKCA
Line 34: Line 34:
 
' ', 1.80E-12, 0.00, 250.00, 0.000, 0.000, 0.000, 0.000), & ! B159 JPL2011
 
' ', 1.80E-12, 0.00, 250.00, 0.000, 0.000, 0.000, 0.000), & ! B159 JPL2011
   
The first reaction in these examples takes its kinetic data from [http://www.iupac-kinetic.ch.cam.ac.uk/ IUPAC]. Going to this website, this reaction is defined [http://www.iupac-kinetic.ch.cam.ac.uk/datasheets/xhtml/HOx_VOC8_HO_CH2C%28CH3%29CHCH2%28isoprene%29.xhtml_mathml.xml here]. The second reaction above takes its kinetic data from [http://jpldataeval.jpl.nasa.gov/ NASA's Jet Propulsion Laboritory]. The rate for this can be found on page 1-19 of the [http://jpldataeval.jpl.nasa.gov/pdf/JPL%2010-6%20Final%2015June2011.pdf JPL2011 document].
+
The first reaction in these examples takes its kinetic data from [http://www.iupac-kinetic.ch.cam.ac.uk/ IUPAC]. Going to this website, this reaction is defined [http://www.iupac-kinetic.ch.cam.ac.uk/datasheets/xhtml/HOx_VOC8_HO_CH2C%28CH3%29CHCH2%28isoprene%29.xhtml_mathml.xml here]. The second reaction above takes its kinetic data from [http://jpldataeval.jpl.nasa.gov/ NASA's Jet Propulsion Laboritory]. The rate for this can be found on page 1-19 of the [http://jpldataeval.jpl.nasa.gov/pdf/JPL%2010-6%20Final%2015June2011.pdf JPL2011 document]. When adding new reactions you will need to increment the size of the array holding the <tt>ratb_t</tt> type.
   
 
If there is a reaction that is an exception to the general Arrhenius equation then special code needs to be placed in the '''asad_bimol.F90''' routine, which is held in the <tt>UKCA/</tt> directory.
 
If there is a reaction that is an exception to the general Arrhenius equation then special code needs to be placed in the '''asad_bimol.F90''' routine, which is held in the <tt>UKCA/</tt> directory.
Line 45: Line 45:
 
* '''JPNR''' is the total number of reactions
 
* '''JPNR''' is the total number of reactions
   
These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the <code>&RUN_UKCA</code> namelist in '''CNTLATM'''. You will need to make a hand-edit to change these accordingly. The current value can be found by saving and processing the job, and then viewing the ''CNTLATM'' file in the <tt>$HOME/umui_jobs/<span style="color:blue">jobid</span></tt> directory.
+
These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the <code>&RUN_UKCA</code> namelist in '''CNTLATM'''. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the ''CNTLATM'' file in the <tt>$HOME/umui_jobs/<span style="color:blue">jobid</span></tt> directory.
   
 
===Task 6.1: Add a bimolecular reaction===
 
===Task 6.1: Add a bimolecular reaction===
Line 105: Line 105:
   
 
<blockquote>
 
<blockquote>
If <math>f < 1.0</math> then <math>F_{c} = f</math>
+
If <math>f < 1.0</math> then <math>F_{c} = f</math><br/>
else <math>F_{c} = \textrm{exp}\left(-\frac{T}{f}\right)</math>
+
else <math>F_{c} = \textrm{exp}\left(-T/f\right)</math>
 
</blockquote>
 
</blockquote>
  +
  +
as the <math>F_{c}</math> may or may not be highly temperature dependent.
  +
  +
Examples of these reactions are
  +
  +
ratt_t('N2O5 ','m ','NO2 ','NO3 ', 0.3, & ! T023
  +
1.30E-03, -3.50, 11000.00, 9.70E+14, 0.10, 11080.00, 0.000, 0.000), & ! T023 IUPAC 2002
  +
ratt_t('NO ','NO ','NO2 ','NO2 ', 0.0, & ! T024
  +
3.30E-39, 0.00, -530.00, 0.00E+00, 0.00, 0.00, 0.000, 0.000) & ! T024 IUPAC 2001
  +
  +
When adding new reactions you will need to increment the size of the array holding the <tt>ratt_t</tt> type.
  +
  +
===Increase the size of JPTK (and JPNR)===
  +
  +
As with the bimolecular reactions, you will also need to increase the values of two parameters that UKCA needs. These are
  +
  +
* '''JPTK''' is the number of termolecular reactions
  +
* '''JPNR''' is the total number of reactions
  +
  +
These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the <code>&RUN_UKCA</code> namelist in '''CNTLATM'''. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the ''CNTLATM'' file in the <tt>$HOME/umui_jobs/<span style="color:blue">jobid</span></tt> directory.
  +
  +
==Heterogeneous Reactions==
  +
  +
Heterogeneous reactions are those that occur on aerosol surfaces. There is no functional form defined for these reactions, with special code needed to be added for each case.
  +
  +
===Chemistry Defition Routines===
  +
  +
The heterogeneous reactions are defined in the '''ukca_chem_<span style="color:blue">scheme</span>.F90''' routines using the '''rath_t''' Fortran type specification, usually in one array.
  +
To format of this '''rath_t''' type is
  +
  +
rath_t('Reactant 1','Reactant 2','<span style="color:blue">Product 1 </span>','<span style="color:red">Product 2 </span>','<span style="color:green">Product 3 </span>',&
  +
'<span style="color:purple">Product 4 </span>', <span style="color:blue">Fraction of Product 1 produced</span>, <span style="color:red">Fraction of Product 2 produced</span>, <span style="color:green">Fraction of Product 3 produced</span>, <span style="color:purple">Fraction of Product 4 produced</span>), &
  +
  +
i.e. there is no rate information provided. For reactions on PSCs special code has been added to the routines in '''ukca_hetero_mod.F90''', and for other reactions there is code in '''asad_hetero.F90'''. Examples of this type are
  +
  +
rath_t('ClONO2 ','H2O ','HOCl ','HONO2 ',' ', &
  +
' ', 0.000, 0.000, 0.000, 0.000), &
  +
...
  +
rath_t('SO2 ','H2O2 ','NULL0 ',' ',' ', & !HSO3+H2O2(aq)
  +
' ', 0.000, 0.000, 0.000, 0.000), &
  +
  +
===Increase the size of JPHK (and JPNR)===
  +
  +
As with the bimolecular and termolecular reactions, you will also need to increase the values of two parameters that UKCA needs. These are
  +
  +
* '''JPHK''' is the number of heterogeneous reactions
  +
* '''JPNR''' is the total number of reactions
  +
  +
These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the <code>&RUN_UKCA</code> namelist in '''CNTLATM'''. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the ''CNTLATM'' file in the <tt>$HOME/umui_jobs/<span style="color:blue">jobid</span></tt> directory.
   
   

Revision as of 14:56, 21 June 2013

Back to UKCA & UMUI Tutorials

Adding new Chemical Reactions

UKCA currently uses two different methods of defining the chemical reactions solved in the model. The first is a backward Euler solver, and is used for the RAQ and StdTrop chemistry schemes where the solver itself is created by a code-writer. The second makes use of the ASAD chemical integration software package, and is used for the CheT/TropIsop, CheS/Strat, and CheST/StratTrop chemistry schemes. ASAD can use many different solvers, although currently it uses symbolic Newton-Raphson solver. In this tutorial we will only consider the ASAD framework, as this is easily extended by a user.

ASAD considers four different types of chemical reactions: bimolecular reactions, termolecular reactions, heterogeneous reactions, and photolysis reactions.

Biomolecular Reactions

For most bimolecular reactions, it is sufficient to provide the , , and coefficients that are used to compute the rate coefficient from the Arrhenius expression

Chemistry Defition Routines

The bimolecular reactions are defined in the ukca_chem_scheme.F90 routines using the ratb_t Fortran type specification, and are held in arrays. At the end of this routine the ratb_defs_scheme array is created from these, and if that scheme is selected in UKCA these reactions are copied across into the master ratb_defs array.

To format of this ratb_t type is

ratb_t('Reactant 1','Reactant 2','Product 1 ','Product 2 ','Product 3 ',&
'Product 4 ',  ,  ,  , Fraction of Product 1 produced, Fraction of Product 2 produced, Fraction of Product 3 produced, Fraction of Product 4 produced), & 

Where the fraction of a product can be set to 0.000 if this functionality does not need to be used, i.e. the fraction is 1.0.

The specifications of the induvidual reactions are done as, e.g.

ratb_t('OH        ','C5H8      ','ISO2      ','          ','          ',& ! B144 
'          ',  2.70E-11,  0.00,   -390.00, 0.000, 0.000, 0.000, 0.000), & ! B144 IUPAC2009   
...
ratb_t('OH        ','HCl       ','H2O       ','Cl        ','          ',& ! B159 
'          ',  1.80E-12,  0.00,    250.00, 0.000, 0.000, 0.000, 0.000), & ! B159 JPL2011   

The first reaction in these examples takes its kinetic data from IUPAC. Going to this website, this reaction is defined here. The second reaction above takes its kinetic data from NASA's Jet Propulsion Laboritory. The rate for this can be found on page 1-19 of the JPL2011 document. When adding new reactions you will need to increment the size of the array holding the ratb_t type.

If there is a reaction that is an exception to the general Arrhenius equation then special code needs to be placed in the asad_bimol.F90 routine, which is held in the UKCA/ directory.

Increase the size of JPBK (and JPNR)

As well as adding these reactions to the ukca_chem_scheme.F90 routine (and incrementing the size of the arrays in that routine accordingly, you will also need to increase the values of two parameters that UKCA needs. These are

  • JPBK is the number of bimolecular reactions
  • JPNR is the total number of reactions

These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the &RUN_UKCA namelist in CNTLATM. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the CNTLATM file in the $HOME/umui_jobs/jobid directory.

Task 6.1: Add a bimolecular reaction

TASK 6.1: You should now add in the bimolecular reaction of ALICE with OH to form BOB. This reaction is given by:

Parameter Value
2.70E-11
0.00
-390.00

Note: If you were unable to successfully complete Task 5.2, then please take a copy of the f job from the Tutorial experiment (Tutorial: solution to Task 5.2 - adding new chemical emissions into a UKCA tracer) and work from there, as this will allow you to make only the required UKCA changes.

Solution

Termolecular Reactions

As well as defining reactions involving a third body, the termolecular rate definition can also be used to define unimolecular reactions.

The pressure and temperature dependent rate, , of a termolecular reaction is given by

where the low pressure rate constant is given by

and the high pressure rate constant is given by

Chemistry Defition Routines

The termolecular reactions are defined in the ukca_chem_scheme.F90 routines using the ratt_t Fortran type specification, and are held in one arrays (there are not usually enough reactions to require splitting the reactions over several arrays).

To format of this ratt_t type is

ratt_t('Reactant 1','Reactant 2','Product 1 ','Product 2 ', , &
,  ,  , ,  ,  , Fraction of Product 1 produced, Fraction of Product 2 produced), & 

and as in ratb_t, where the fraction of a product can be set to 0.000 if this functionality does not need to be used, i.e. the fraction is 1.0.

The value is used to define the value by

If then
else

as the may or may not be highly temperature dependent.

Examples of these reactions are

ratt_t('N2O5      ','m         ','NO2       ','NO3       ',     0.3,    & ! T023  
  1.30E-03, -3.50, 11000.00,  9.70E+14,  0.10, 11080.00, 0.000, 0.000), & ! T023 IUPAC 2002   
ratt_t('NO        ','NO        ','NO2       ','NO2       ',     0.0,    & ! T024  
  3.30E-39,  0.00,  -530.00,  0.00E+00,  0.00,     0.00, 0.000, 0.000)  & ! T024 IUPAC 2001  

When adding new reactions you will need to increment the size of the array holding the ratt_t type.

Increase the size of JPTK (and JPNR)

As with the bimolecular reactions, you will also need to increase the values of two parameters that UKCA needs. These are

  • JPTK is the number of termolecular reactions
  • JPNR is the total number of reactions

These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the &RUN_UKCA namelist in CNTLATM. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the CNTLATM file in the $HOME/umui_jobs/jobid directory.

Heterogeneous Reactions

Heterogeneous reactions are those that occur on aerosol surfaces. There is no functional form defined for these reactions, with special code needed to be added for each case.

Chemistry Defition Routines

The heterogeneous reactions are defined in the ukca_chem_scheme.F90 routines using the rath_t Fortran type specification, usually in one array. To format of this rath_t type is

rath_t('Reactant 1','Reactant 2','Product 1 ','Product 2 ','Product 3 ',&
'Product 4 ', Fraction of Product 1 produced, Fraction of Product 2 produced, Fraction of Product 3 produced, Fraction of Product 4 produced), & 

i.e. there is no rate information provided. For reactions on PSCs special code has been added to the routines in ukca_hetero_mod.F90, and for other reactions there is code in asad_hetero.F90. Examples of this type are

rath_t('ClONO2    ','H2O       ','HOCl      ','HONO2     ','          ', &
'          ', 0.000, 0.000, 0.000, 0.000), &
...
rath_t('SO2       ','H2O2      ','NULL0     ','          ','          ', & !HSO3+H2O2(aq)
'          ', 0.000, 0.000, 0.000, 0.000),                               &

Increase the size of JPHK (and JPNR)

As with the bimolecular and termolecular reactions, you will also need to increase the values of two parameters that UKCA needs. These are

  • JPHK is the number of heterogeneous reactions
  • JPNR is the total number of reactions

These are set automatically in the UMUI (depending on what scheme is chosen), and are placed in the &RUN_UKCA namelist in CNTLATM. You will need to make a hand-edit to change these accordingly. The current values can be found by saving and processing the job, and then viewing the CNTLATM file in the $HOME/umui_jobs/jobid directory.



Written by Luke Abraham 2013