Difference between revisions of "UKCA Chemistry and Aerosol Tutorial 9"

From UKCA
 
(8 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
==What you will learn in this Tutorial==
 
==What you will learn in this Tutorial==
   
In this tutorial you will learn how the two UKCA dry deposition schemes are implemented. You will then make changes to allow one of your new tracers to be dry-deposited.
+
In this tutorial you will learn about the UKCA diagnostics package and the different diagnostics that you can output using it. You will also learn how to add new diagnostics from the new reactions and deposition that you have added.
   
==Task 9.1: adding new dry deposition values==
+
==Task 9.1: Output new diagnostics==
   
<span style="color:green">'''TASK 9.1:''' You should now add in the dry deposition of '''ALICE'''. This species deposits in a similar way to '''CO'''. The values for '''depvel_defs_strattrop''' are:</span>
+
<span style="color:green">'''TASK 9.1:''' Output diagnostics of the reaction <math>\textrm{ALICE} + \textrm{OH} \longrightarrow \textrm{BOB} + \textrm{SEC\_ORG}</math> to STASH code '''34461''', the dry deposition of '''ALICE''' to STASH code '''34462''', and the wet deposition of '''BOB''' to '''34463'''. They should be outputted as a daily mean to the '''pa/UPA''' stream.</span>
 
{| border="1"
 
! Surface Type || Summer (day) || Summer (night) || Summer (24h ave) || Winter (day) || Winter (night) || Winter (24h ave)
 
|-
 
| '''Water''' || 0.00 || 0.00 || 0.00 || 0.00 || 0.00 || 0.00
 
|-
 
| '''Forest''' || 0.03 || 0.03 || 0.03 || 0.03 || 0.03 || 0.03
 
|-
 
| '''Grass''' || 0.03 || 0.03 || 0.03 || 0.03 || 0.03 || 0.03
 
|-
 
| '''Desert''' || 0.03 || 0.03 || 0.03 || 0.03 || 0.03 || 0.03
 
|-
 
| '''Ice''' || 0.00 || 0.00 || 0.00 || 0.00 || 0.00 || 0.00
 
|}
 
 
<span style="color:green">i.e. the same as for CO.</span>
 
   
 
{| class="collapsible collapsed wikitable"
 
{| class="collapsible collapsed wikitable"
 
|-
 
|-
! Hint
+
! Hint
  +
|-
  +
| Remember to use the correct sampling frequency.
 
|-
 
|-
| You will need to make changes for both dry deposition schemes. The changes to '''ukca_surfddr.F90''' can be made very easily by adding '''ALICE''' to the '''CO''' block in the <tt>CASE</tt> statement.
 
 
|}
 
|}
  +
  +
'''Note:''' If you were unable to successfully complete [[UKCA Chemistry and Aerosol Tutorial 8#Task 8.1: Add wet deposition of a species|Task 8.1]] , then please take a copy of the '''i''' job from the Tutorial experiment (''Tutorial: solution to Task 8.1 - add new wet deposition'') and work from there, as this will allow you to only make the changes required for this task. Please also make a new branch and merge-in branch '''fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns/src''' at revision number '''14713''' to allow you to proceed.
   
  +
==Adding New UKCA Diagnostics==
'''Note:''' If you were unable to successfully complete [[UKCA Chemistry and Aerosol Tutorial 8#Task 8.1: Add a bimolecular reaction|Task 8.1]], then please take a copy of the '''h''' job from the Tutorial experiment (''Tutorial: solution to Task 8.1 - add a new bimolecular reaction'') and work from there, as this will allow you to only make the changes required for this task.
 
   
  +
If you are using one of the chemistry schemes that uses ASAD (e.g. ''CheT/TropIsop'', ''CheS/Strat'', ''CheST/StratTrop'') then you can make use of the ASAD Reaction Flux Diagnostics module (held in '''asad_chem_flux_diags.F90'''). These allow you to straight-forwardly output new reaction and deposition fluxes.
==Adding Dry Deposition==
 
   
  +
To output new diagnostics you will first need to define them in the '''asad_flux_dat.F90''' module, and then create new STASHmaster file specifications for them.
UKCA uses two different dry-deposition schemes:
 
   
  +
During this tutorial you will be tasked with outputting the reaction and deposition fluxes that you have added in to your branch.
* A simple 2D parameterisation described by Giannakopoulos (1999)[1], Ganzeveld and Lelieveld (1995)[2], and Sander and Crutzen (1996)[3].
 
* A more detailed interactive parameterisation, based on the Wesely scheme (Wesely, 1989; Sanderson 2007)[4,5]
 
   
  +
==Flux Definitions in asad_flux_dat.F90==
The default scheme is the 2D scheme. To choose the interactive dry deposition scheme in the UMUI, go to '''Model Selection &rarr; Atmosphere &rarr; Model Configuration &rarr; UKCA Chemistry and Aerosols &rarr; COUPL''' and select '''UKCA interactive dry deposition scheme'''.
 
   
  +
Within the '''asad_flux_dat.F90''' module the diagnostics are defined in blocks with the format
'''Note:''' If you are using the interactive scheme and wish to add new values to it, you will also need to add values to the 2D scheme as well. As the 2D scheme is the default, it must always have values set.
 
   
  +
asad_flux_defn(<span style="color:blue">'Diagnostic type'</span>,<span style="color:red">STASH code</span>,<span style="color:blue">'Diagnostic specification'</span>,<span style="color:brown">Mask</span>,Reaction number,<span style="color:magenta">Number of species</span>, &
During this tutorial you will be tasked with adding the dry deposition of one of your new tracers.
 
  +
(/'<span style="color:purple">Species</span>/<span style="color:green">Reactant 1</span>','<span style="color:green">Reactant 2</span>'/), &
  +
(/'<span style="color:green">Product 1</span>','<span style="color:green">Product 2</span>','<span style="color:green">Product 3</span>','<span style="color:green">Product 4</span>'/)), &
   
  +
Which have the following meaning:
'''References'''
 
# Giannakopoulos, C., M. P. Chipperfield, K. S. Law, and J. A. Pyle (1999), Validation and intercomparison of wet and dry deposition schemes using 210Pb in a global three-dimensional off-line chemical transport model, J. Geophys. Res., 104(D19), 23761–23784, doi:10.1029/1999JD900392.
 
# Ganzeveld, L., and J. Lelieveld (1995), Dry deposition parameterization in a chemistry general circulation model and its influence on the distribution of reactive trace gases, J. Geophys. Res., 100(D10), 20999–21012, doi:10.1029/95JD02266.
 
# Sander, R., and P. J. Crutzen (1996), Model study indicating halogen activation and ozone destruction in polluted air masses transported to the sea, J. Geophys. Res., 101(D4), 9121–9138, doi:10.1029/95JD03793.
 
# M.L. Wesely, Parameterization of surface resistances to gaseous dry deposition in regional-scale numerical models, Atmospheric Environment (1967), Volume 23, Issue 6, 1989, Pages 1293-1304, ISSN 0004-6981, http://dx.doi.org/10.1016/0004-6981(89)90153-4.
 
# Sanderson, M. G., Collins, W. J., Hemming, D. L. and Betts, R. A. (2007), Stomatal conductance changes due to increasing carbon dioxide levels: Projected impact on surface ozone levels. Tellus B, 59: 404–411. doi: 10.1111/j.1600-0889.2007.00277.x
 
   
  +
===Diagnostic Type===
==Chemistry Scheme Specification==
 
   
  +
This is a '''three character string''' which defines what type of diagnostic is being requested. This can take the values
The default is to use the 2D scheme, although it is advisable to use the interactive scheme. Within the UKCA code, whether a species is dry deposited or not is controlled in the '''ukca_chem_<span style="color:blue">scheme</span>.F90''' file. In the '''chch_defs_<span style="color:blue">scheme</span>''' array there are lines like
 
   
  +
* '''RXN''' to output the flux through a reaction (in moles/gridcell/s)
chch_t( 10,'HONO2 ', 1,'TR ',' ', <span style="color:red">'''1'''</span>, 1, 0), & ! 10 DD: 7,WD: 4,
 
  +
* '''DEP''' to output the deposition flux of a species (in moles/gridcell/s)
chch_t( 11,'H2O2 ', 1,'TR ',' ', <span style="color:red">'''1'''</span>, 1, 0), & ! 11 DD: 8,WD: 5,
 
  +
* '''EMS''' to output the emission flux into a species (in moles/gridcell/s)
  +
* '''NET''' to output the net chemical tendency of a species (in moles/gridcell/s)
  +
* '''STE''' to output the net dynamical tendency of a species (in moles/gridcell/s)
  +
* '''MAS''' to output the mass of the atmosphere (in kg/gridcell)
  +
* '''PSC''' to output polar stratospheric cloud diagnostics (1 when the gridcell contains a PSC, 0 otherwise - monthly mean field will be a fraction in range 0 &rarr; 1)
  +
* '''TPM''' to output the tropospheric mask (1 for troposphere, 0 otherwise - monthly mean field will be a fraction in range 0 &rarr; 1)
  +
* '''OUT''' to output a tracer in mmr. Only really useful if the field is masked to give the tropospheric concentration only (see the discussion of the '''Mask''' option)
  +
* '''RTE''' to output the rate of a reaction (in gridcell/s)
   
  +
===STASH Code===
Where the <span style="color:red">'''1'''</span> in the 6th column turns on dry deposition of that species (being 0 otherwise). You will need to change the 0 to a '''1''' for the species that you wish to now dry deposit.
 
   
  +
This is a '''5 digit integer''' defining the STASH code that the diagnostic will be outputted to (e.g. 34301). Currently this must be in '''section 34'''.
==2D Dry Deposition Scheme==
 
   
  +
===Diagnostic Specification===
The deposition velocities for the 2D scheme are defined in the '''depvel_defs_<span style="color:blue">scheme</span>''' array, which is held in the '''ukca_chem_<span style="color:blue">scheme</span>.F90''' module. This is a large array made up of size (6,5) blocks. These blocks mean
 
   
  +
This is a '''one character string''' which is needed to further define what diagnostic is required. If it isn't needed then it should just be set to '''X''' or left blank.
{| border="1"
 
  +
| Summer (day) velocity over water || Summer (night) velocity over water || Summer (24h ave.) velocity over water || Winter (day) velocity over water || Winter (night) velocity over water || Winter (24h ave.) velocity over water
 
  +
* ''RXN''
|-
 
  +
** '''B''' to output the flux through a bimolecular reaction
| Summer (day) velocity over forest || Summer (night) velocity over forest || Summer (24h ave.) velocity over forest || Winter (day) velocity over forest || Winter (night) velocity over forest || Winter (24h ave.) velocity over forest
 
  +
** '''T''' to output the flux through a termolecular reaction
|-
 
  +
** '''H''' to output the flux through a heterogeneous reaction
| Summer (day) velocity over grass || Summer (night) velocity over grass || Summer (24h ave.) velocity over grass || Winter (day) velocity over grass || Winter (night) velocity over grass || Winter (24h ave.) velocity over grass
 
  +
** '''J''' to output the flux through a photolysis reaction
|-
 
  +
* ''DEP''
| Summer (day) velocity over desert || Summer (night) velocity over desert || Summer (24h ave.) velocity over desert || Winter (day) velocity over desert || Winter (night) velocity over desert || Winter (24h ave.) velocity over desert
 
  +
** '''D''' to output the dry deposition flux
|-
 
  +
** '''W''' to output the wet deposition flux
| Summer (day) velocity over ice || Summer (night) velocity over ice || Summer (24h ave.) velocity over ice || Winter (day) velocity over ice || Winter (night) velocity over ice || Winter (24h ave.) velocity over ice
 
  +
* ''EMS''
|}
 
  +
** '''S''' to output a surface emission (2D)
  +
** '''A''' to output aircraft emissions (3D)
  +
** '''L''' to output lightning emissions (3D)
  +
** '''V''' to output volcanic SO2 emissions (3D)
  +
** '''T''' to output SO2 emissions (3D)
  +
* ''PSC''
  +
** '''1''' to output the fraction of Type 1 PSCs
  +
** '''2''' to output the fraction of Type 2 PSCs
  +
* ''RTE''
  +
** '''B''' to output the rate of a bimolecular reaction
  +
** '''T''' to output the rate of a termolecular reaction
  +
** '''H''' to output the rate of a heterogeneous reaction
  +
** '''J''' to output the rate of a photolysis reaction
  +
  +
===Mask===
  +
  +
This is a '''logical''' which defines whether only the tropospheric values of the diagnostic are outputted ('''.TRUE.''') or not ('''.FALSE.'''). It is calculated every timestep.
  +
  +
For the ''STE'' diagnostic this is required if you wish to output the diagnosed stratosphere-troposphere exchange of a species. For the ''OUT'' diagnostic this can be used to output only the tropospheric concentration of a tracer. This is also used in the calculation of the of the ''TPM'' diagnostic.
  +
  +
===Reaction number===
  +
  +
This is an '''integer''', and should only be used in the special case of there being two (or more) reactions with the exactly the same reactants and products, but with different rate coefficients. In this case the first reaction in the list would be given number '''1''' and the second '''2''' etc. If this is not needed then it should be set to '''0''' (which will be usual for most reactions).
  +
  +
===Number of Species===
  +
  +
This is an '''integer''', and should give the total number of species, so this will be '''1''' for diagnostics such as ''DEP'', ''STE'', ''NET'' etc., which only consider a single species, and the '''total number of reactants and products''' for diagnostics ''RXN'' and ''RTE''.
  +
  +
===Species===
  +
  +
This is a '''10-character string''' giving the exact name of the species that the diagnostic should be considered for (including capitalisation). This is only used for the ''DEP'', ''EMS'', ''NET'', ''STE'', and ''OUT''. For the ''RXN'' and ''RTE'' diagnostics the full list of reactants and products should be given (see below). For the ''MAS'', ''PSC'', and ''TPM'' diagnostics this isn't needed and could either be set to '''XXX''' or left blank. If it is needed the other reactant/product slots should be left blank.
  +
  +
===Reactants and Products===
  +
  +
These are '''10-character strings''', and should be as the reaction is defined in the '''ukca_chem_<span style="color:blue">scheme</span>.F90''' modules.
  +
  +
===Addition of Diagnostics===
  +
  +
If you define more than one diagnostic to be output to the same STASH code, then the diagnostic routines will sum these diagnostics together. This can be useful (e.g., if you wanted to output the sum of all NO+RO2 reactions to one STASH item), but can be problematic if you accidentally output two fields to the same STASH code, as this will give strange results!
  +
  +
===Changes to asad_flux_dat.F90===
  +
  +
After you have defined your new diagnostics at the top of this module, you will need to make sure that they have been added correctly to the '''asad_chemical_fluxes''' array, which is defined in the '''ASAD_LOAD_DEFAULT_FLUXES''' subroutine held in the '''asad_flux_dat.F90'''.
  +
  +
==STASHmaster file==
  +
  +
While the diagnostics are defined in '''asad_flux_dat.F90''' they are turned on by requesting the item through STASH. To do this you will need to make a new STASHmaster file for diagnostics that you have defined yourself. The easiest option is to copy an existing diagnostic specification from the ''STASHmaster_A'' file, which is located at
  +
  +
/work/n02/n02/hum/vn8.4/ctldata/STASHmaster/STASHmaster_A
  +
  +
on ARCHER, and at
  +
  +
/projects/um1/vn8.4/ctldata/STASHmaster/STASHmaster_A
  +
  +
on MONSooN.
  +
  +
===2D Diagnostic Fields===
  +
  +
If you are outputting a 2D field such as a surface emission or a dry deposition field (e.g. you are using the old 2D dry deposition scheme) then the fact that this is a 2D surface field is defined in the STASHmaster entry, which looks like this e.g.
  +
  +
#
  +
1| 1 | 34 | <span style="color:red">321</span> |<span style="color:red">Ox BUDGET: O3 DRY DEPOSITION (2D)</span> |
  +
2| 0 | 0 | 1 | 1 | 5 | -1 | -1 | 0 | 0 | 0 | 0 |
  +
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
  +
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
  +
5| 0 | 1871 | 1 | 129 | 0 | 0 | 0 | 0 | 0 |
  +
#
  +
  +
However, you can always output a surface diagnostic using a STASHmaster file that defines a 3D field, it is just that only the surface values will be non-zero (if the full field is output).
  +
  +
You will need to edit the two elements in <span style="color:red">red</span> to match your new diagnostic.
  +
  +
===3D Diagnostic Fields===
  +
  +
A 3D diagnostic field has slightly different values for some of the elements of the STASHmaster definition. These can been seen by comparing the specification above with the one below
  +
  +
#
  +
1| 1 | 34 | <span style="color:red">321</span> |<span style="color:red">Ox BUDGET: O3 DRY DEPOSITION (3D)</span> |
  +
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
  +
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
  +
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
  +
5| 0 | 1871 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
  +
#
   
  +
You will need to edit the two elements in <span style="color:red">red</span> to match your new diagnostic.
and are in cm/s. The ''desert'' category is not used, and only the ''day'' and ''night'' values are considered in the calculation of the dry-deposition velocities. Examples of these values are
 
   
  +
===STASHmaster file format===
! 1 O3 (Ganzeveld & Lelieveld (1995) note 1 (modified to same as Guang)
 
0.05, 0.05, 0.05, 0.05, 0.05, 0.05, & ! 1.1
 
0.85, 0.30, 0.65, 0.65, 0.25, 0.45, & ! 1.2
 
0.65, 0.25, 0.45, 0.65, 0.25, 0.45, & ! 1.3
 
0.18, 0.18, 0.18, 0.18, 0.18, 0.18, & ! 1.4
 
0.05, 0.05, 0.05, 0.05, 0.05, 0.05, & ! 1.5
 
! 2 NO (inferred from NO2 - see Giannakopoulos (1998))
 
0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & ! 2.1
 
0.14, 0.01, 0.07, 0.01, 0.01, 0.01, & ! 2.2
 
0.10, 0.01, 0.06, 0.01, 0.01, 0.01, & ! 2.3
 
0.01, 0.01, 0.01, 0.01, 0.01, 0.01, & ! 2.4
 
0.00, 0.00, 0.00, 0.00, 0.00, 0.00, & ! 2.5
 
   
  +
As well as defining the STASH items in your new user STASHmaster file, you will also need to include the correct preamble and an end of file specifier. These are
'''Note:''' When adding new deposition values you should be careful. UKCA assumes that the order of this array is the same as the order of the species in the '''chch_defs_<span style="color:blue">scheme</span>''' array. If you are adding values for a species in the middle of the list then you will need to make sure that you slot it in to the appropriate place in the existing '''depvel_defs_<span style="color:blue">scheme</span>''' array (and change the size of this array accordingly).
 
   
  +
Preamble:
This scheme is controlled in '''ukca_ddeprt.F90'''. The deposition only occurs in the bottom (i.e. 'surface') layer.
 
   
  +
H1| SUBMODEL_NUMBER=1
==Interactive Dry Deposition Scheme==
 
  +
H2| SUBMODEL_NAME=ATMOS
  +
H3| UM_VERSION=8.4
  +
#
  +
#|Model |Sectn | Item |Name |
  +
#|Space |Point | Time | Grid |LevelT|LevelF|LevelL|PseudT|PseudF|PseudL|LevCom|
  +
#| Option Codes | Version Mask | Halo |
  +
#|DataT |DumpP | PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PCA |
  +
#|Rotate| PPF | USER | LBVC | BLEV | TLEV |RBLEVV| CFLL | CFFF |
  +
#
   
  +
which is also helpful in describing what the elements in the STASH specification are.
Adding in new species to the interactive scheme is slightly more involved than for the 2D scheme. This scheme is controlled from the '''ukca_ddepctl.F90''' routine which is called from ''ukca_chemistry_ctl.F90''.
 
The two routines '''ukca_aerod.F90''' and '''ukca_surfddr.F90''' contain species specific information, and it is these routines that need to be altered to add in values for a new species. Further details on this scheme can be found in the {{pdf|Umdp84_vn82.pdf|UKCA documentation paper for UM version 8.2}}.
 
   
  +
End of file specifier:
When using this scheme, dry deposition occurs throughout the boundary layer, rather than just in the lowest model (i.e. surface) layer.
 
   
  +
#
===Changes to ukca_aerod.F90===
 
  +
1| -1 | -1 | -1 |END OF FILE MARK |
  +
2| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
  +
3| 000000000000000000000000000000 | 00000000000000000000 | 0 |
  +
4| 0 | 0 | -99 -99 -99 -99 -30 -99 -99 -99 -99 -99 |
  +
5| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
  +
#
   
  +
===UMUI Changes===
This routine calculates the aerodynamic and quasi-laminar surface resistances. The species dependant information that is needed is the diffusion coefficient, '''d0''' (in units of <math>m^{2}s^{-1}</math>). By default this is set to -1 if the species is not deposited. If it is deposited, and there are no values for this coefficient in the literature, it is suggested that <math>d_{0,\textrm{species}}</math> is calculated as
 
   
  +
After you have made your STASHmaster file with the required diagnostics, you should add it to the UMUI in '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; User-STASHmaster files. Diags, Progs & Ancils'''. You will also need to give it an initial value in '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; Initialisation of User Prognostics''' (you can just set it to '''zero''', i.e. '''3''' in the '''Option''' column). After you have done this you can select the diagnostic in the '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; STASH. Specification of Diagnostics requirements''' panel.
<math>
 
d_{0,\textrm{species}} = d_{0,H_{2}O} \ \sqrt[]{M_{H_{2}O}/M_{\textrm{species}}}
 
</math>
 
   
  +
==Time Validity==
Where <math>M_{H_{2}O}</math> is the relative molecular mass of H2O, and <math>M_{\textrm{species}}</math> is the relative molecular mass of the species being deposited, and <math>d_{0,H_{2}O}</math> is the diffusion coefficient for H2O (2.08E-5 <math>m^{2}s^{-1}</math>).
 
   
  +
When outputting UKCA reaction and deposition fluxes, you need to consider what time-points these diagnostics are valid at. Tracer fields are valid at all timesteps, but for reaction fluxes this is not the case. For all the chemistry schemes which use ASAD/Newton-Raphson (''CheT/TropIsop'', ''CheS/Strat'', and ''CheST/StratTrop''), the UKCA chemical timestep is every hour.
You should add in an appropriate value for the new species that you are depositing in the '''CASE''' statement in this routine. Examples of how this is already done are
 
   
  +
This means that when you output this diagnostic through STASH you need to change the ''sampling frequency''. To do this, go to the STASH panel in the UMUI ('''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; STASH. Specification of Diagnostic requirements''') and '''copy''' the '''time profile''' you would like to use for the diagnostic to a new profile (giving it a similar, but slightly different name) and then change the '''sampling frequency''' to be
CASE ('O3 ','NO2 ','O3S ','NO3 ')
 
d0(j) = 1.4e-5
 
CASE ('HONO ')
 
d0(j) = d_h2o * SQRT(m_h2o / m_hono)
 
   
  +
* '''Frequency (every)''' to be '''3'''
'''Note:''' If you have not yet defined a '''M_<span style="color:blue">species</span>''' value for your new species, you will need to do this in '''ukca_constants.F90'''.
 
  +
* '''Offset''' to be '''2'''
   
  +
This will then sample the diagnostic on the UKCA timesteps. If you don't sample the diagnostic using this sampling frequency, then the output may be incorrect.
===Changes to ukca_surfddr.F90===
 
   
  +
The following diagnostics are valid on '''all timesteps''':
The Wesely scheme considers 9 different surface types:
 
   
  +
* ''MAS''
# Broadleaved trees
 
  +
* ''OUT''
# Needleleaf trees
 
  +
* ''TPM''
# C3 Grass
 
  +
* ''STE''
# C4 Grass
 
  +
* ''EMS''
# Shrub
 
# Urban
 
# Water
 
# Bare Soil
 
# Ice
 
   
  +
The following diagnostics are only valid on '''chemical timesteps''':
'''ukca_surfddr.F90''' sets the surface resistance (in <math>sm^{-1}</math>) for each of the species dry-deposited ('''rsurf''')). If a species is not deposited onto a particular type of surface (but is deposited onto other types) then its resistance on this type can be set to a very large value ('''r_null'''). Often many species are assigned the same values. You will need to add in appropriate values for your species into the '''CASE''' statement within this routine.
 
   
  +
* ''RXN''
Examples of how this is already done are
 
  +
* ''DEP''
  +
* ''RTE''
  +
* ''PSC''
   
  +
===Why should I use these numbers?===
CASE ('NO2 ','NO3 ')
 
rsurf(:,n)=(/225.,225.,400.,400.,600.,1200.,2600.,1200., &
 
3500. /)
 
CASE ('CO ')
 
rsurf(:,n)=(/3700.,7300.,4550.,1960.,4550.0,r_null,r_null, &
 
4550.0,r_null /) ! Shrub+bare soil set to C3 grass (guess)
 
   
  +
The standard N96L85 GA4.0 job has a timestep of 20-minutes (72 timesteps per day). This means that 1-hour is 3 timesteps, and the first timestep of a day is the 1st. An off-set of 2 will then mean outputting on the hour.
==Increase the value of JPDD==
 
   
  +
'''Note:''' If you are using a job with a different timestep you will need to change this sampling, as by default UKCA will still run with a 1-hour timestep.
When you added a new chemical reaction you needed to increment a counter which gave the number of reactions, when adding new dry deposition of a species you will need to increase the size of the '''JPDD''' counter. This is done with a hand-edit, the value of '''JPDD''' being set in the '''CNTLATM''' file in your <tt>$HOME/umui_jobs/<span style="color:blue">jobid</span></tt> directory.
 
   
==Solution to Task 9.1: adding new dry deposition values==
+
==Solution to Task 9.1: Output new diagnostics==
   
Please see [[Solution to UKCA & UMUI Tutorial 7 Task 7.1 |this page]] for a solution to [[#Task 9.1: adding new dry deposition values|Task 9.1]].
+
Please see [[Solution to UKCA Chemistry and Aerosol Tutorial 9 Task 9.1 |this page]] for a solution to [[#Task 9.1: Output new diagnostics|Task 9.1]].
   
 
----
 
----

Latest revision as of 15:29, 15 December 2015

Back to UKCA Chemistry and Aerosol Tutorials

What you will learn in this Tutorial

In this tutorial you will learn about the UKCA diagnostics package and the different diagnostics that you can output using it. You will also learn how to add new diagnostics from the new reactions and deposition that you have added.

Task 9.1: Output new diagnostics

TASK 9.1: Output diagnostics of the reaction to STASH code 34461, the dry deposition of ALICE to STASH code 34462, and the wet deposition of BOB to 34463. They should be outputted as a daily mean to the pa/UPA stream.

Note: If you were unable to successfully complete Task 8.1 , then please take a copy of the i job from the Tutorial experiment (Tutorial: solution to Task 8.1 - add new wet deposition) and work from there, as this will allow you to only make the changes required for this task. Please also make a new branch and merge-in branch fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns/src at revision number 14713 to allow you to proceed.

Adding New UKCA Diagnostics

If you are using one of the chemistry schemes that uses ASAD (e.g. CheT/TropIsop, CheS/Strat, CheST/StratTrop) then you can make use of the ASAD Reaction Flux Diagnostics module (held in asad_chem_flux_diags.F90). These allow you to straight-forwardly output new reaction and deposition fluxes.

To output new diagnostics you will first need to define them in the asad_flux_dat.F90 module, and then create new STASHmaster file specifications for them.

During this tutorial you will be tasked with outputting the reaction and deposition fluxes that you have added in to your branch.

Flux Definitions in asad_flux_dat.F90

Within the asad_flux_dat.F90 module the diagnostics are defined in blocks with the format

      asad_flux_defn('Diagnostic type',STASH code,'Diagnostic specification',Mask,Reaction number,Number of species, &
      (/'Species/Reactant 1','Reactant 2'/),                                                                         &
      (/'Product 1','Product 2','Product 3','Product 4'/)),                                                          &

Which have the following meaning:

Diagnostic Type

This is a three character string which defines what type of diagnostic is being requested. This can take the values

  • RXN to output the flux through a reaction (in moles/gridcell/s)
  • DEP to output the deposition flux of a species (in moles/gridcell/s)
  • EMS to output the emission flux into a species (in moles/gridcell/s)
  • NET to output the net chemical tendency of a species (in moles/gridcell/s)
  • STE to output the net dynamical tendency of a species (in moles/gridcell/s)
  • MAS to output the mass of the atmosphere (in kg/gridcell)
  • PSC to output polar stratospheric cloud diagnostics (1 when the gridcell contains a PSC, 0 otherwise - monthly mean field will be a fraction in range 0 → 1)
  • TPM to output the tropospheric mask (1 for troposphere, 0 otherwise - monthly mean field will be a fraction in range 0 → 1)
  • OUT to output a tracer in mmr. Only really useful if the field is masked to give the tropospheric concentration only (see the discussion of the Mask option)
  • RTE to output the rate of a reaction (in gridcell/s)

STASH Code

This is a 5 digit integer defining the STASH code that the diagnostic will be outputted to (e.g. 34301). Currently this must be in section 34.

Diagnostic Specification

This is a one character string which is needed to further define what diagnostic is required. If it isn't needed then it should just be set to X or left blank.

  • RXN
    • B to output the flux through a bimolecular reaction
    • T to output the flux through a termolecular reaction
    • H to output the flux through a heterogeneous reaction
    • J to output the flux through a photolysis reaction
  • DEP
    • D to output the dry deposition flux
    • W to output the wet deposition flux
  • EMS
    • S to output a surface emission (2D)
    • A to output aircraft emissions (3D)
    • L to output lightning emissions (3D)
    • V to output volcanic SO2 emissions (3D)
    • T to output SO2 emissions (3D)
  • PSC
    • 1 to output the fraction of Type 1 PSCs
    • 2 to output the fraction of Type 2 PSCs
  • RTE
    • B to output the rate of a bimolecular reaction
    • T to output the rate of a termolecular reaction
    • H to output the rate of a heterogeneous reaction
    • J to output the rate of a photolysis reaction

Mask

This is a logical which defines whether only the tropospheric values of the diagnostic are outputted (.TRUE.) or not (.FALSE.). It is calculated every timestep.

For the STE diagnostic this is required if you wish to output the diagnosed stratosphere-troposphere exchange of a species. For the OUT diagnostic this can be used to output only the tropospheric concentration of a tracer. This is also used in the calculation of the of the TPM diagnostic.

Reaction number

This is an integer, and should only be used in the special case of there being two (or more) reactions with the exactly the same reactants and products, but with different rate coefficients. In this case the first reaction in the list would be given number 1 and the second 2 etc. If this is not needed then it should be set to 0 (which will be usual for most reactions).

Number of Species

This is an integer, and should give the total number of species, so this will be 1 for diagnostics such as DEP, STE, NET etc., which only consider a single species, and the total number of reactants and products for diagnostics RXN and RTE.

Species

This is a 10-character string giving the exact name of the species that the diagnostic should be considered for (including capitalisation). This is only used for the DEP, EMS, NET, STE, and OUT. For the RXN and RTE diagnostics the full list of reactants and products should be given (see below). For the MAS, PSC, and TPM diagnostics this isn't needed and could either be set to XXX or left blank. If it is needed the other reactant/product slots should be left blank.

Reactants and Products

These are 10-character strings, and should be as the reaction is defined in the ukca_chem_scheme.F90 modules.

Addition of Diagnostics

If you define more than one diagnostic to be output to the same STASH code, then the diagnostic routines will sum these diagnostics together. This can be useful (e.g., if you wanted to output the sum of all NO+RO2 reactions to one STASH item), but can be problematic if you accidentally output two fields to the same STASH code, as this will give strange results!

Changes to asad_flux_dat.F90

After you have defined your new diagnostics at the top of this module, you will need to make sure that they have been added correctly to the asad_chemical_fluxes array, which is defined in the ASAD_LOAD_DEFAULT_FLUXES subroutine held in the asad_flux_dat.F90.

STASHmaster file

While the diagnostics are defined in asad_flux_dat.F90 they are turned on by requesting the item through STASH. To do this you will need to make a new STASHmaster file for diagnostics that you have defined yourself. The easiest option is to copy an existing diagnostic specification from the STASHmaster_A file, which is located at

/work/n02/n02/hum/vn8.4/ctldata/STASHmaster/STASHmaster_A

on ARCHER, and at

/projects/um1/vn8.4/ctldata/STASHmaster/STASHmaster_A

on MONSooN.

2D Diagnostic Fields

If you are outputting a 2D field such as a surface emission or a dry deposition field (e.g. you are using the old 2D dry deposition scheme) then the fact that this is a 2D surface field is defined in the STASHmaster entry, which looks like this e.g.

#
1|    1 |   34 |  321 |Ox BUDGET: O3 DRY DEPOSITION (2D)   |
2|    0 |    0 |    1 |    1 |    5 |   -1 |   -1 |    0 |    0 |    0 |    0 |
3| 000000000000000000000000000000 | 00000000000000000001 |    3 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 | 1871 |    1 |  129 |    0 |    0 |    0 |    0 |    0 |
#

However, you can always output a surface diagnostic using a STASHmaster file that defines a 3D field, it is just that only the surface values will be non-zero (if the full field is output).

You will need to edit the two elements in red to match your new diagnostic.

3D Diagnostic Fields

A 3D diagnostic field has slightly different values for some of the elements of the STASHmaster definition. These can been seen by comparing the specification above with the one below

#
1|    1 |   34 |  321 |Ox BUDGET: O3 DRY DEPOSITION (3D)   |
2|    0 |    0 |    1 |    1 |    2 |   10 |   11 |    0 |    0 |    0 |    0 |
3| 000000000000000000000000000000 | 00000000000000000001 |    3 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 | 1871 |    0 |   65 |    0 |    0 |    0 |    0 |    0 |
#

You will need to edit the two elements in red to match your new diagnostic.

STASHmaster file format

As well as defining the STASH items in your new user STASHmaster file, you will also need to include the correct preamble and an end of file specifier. These are

Preamble:

H1| SUBMODEL_NUMBER=1
H2| SUBMODEL_NAME=ATMOS
H3| UM_VERSION=8.4
#
#|Model |Sectn | Item |Name                                |
#|Space |Point | Time | Grid |LevelT|LevelF|LevelL|PseudT|PseudF|PseudL|LevCom|
#| Option Codes                   | Version Mask         | Halo |
#|DataT |DumpP | PC1  PC2  PC3  PC4  PC5  PC6  PC7  PC8  PC9  PCA |
#|Rotate| PPF  | USER | LBVC | BLEV | TLEV |RBLEVV| CFLL | CFFF |
#

which is also helpful in describing what the elements in the STASH specification are.

End of file specifier:

#
1|   -1 |   -1 |   -1 |END OF FILE MARK                    |
2|    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |
3| 000000000000000000000000000000 | 00000000000000000000 |    0 |
4|    0 |    0 | -99  -99  -99  -99  -30  -99  -99  -99  -99  -99 |
5|    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |    0 |
#

UMUI Changes

After you have made your STASHmaster file with the required diagnostics, you should add it to the UMUI in Model Selection → Atmosphere → STASH → User-STASHmaster files. Diags, Progs & Ancils. You will also need to give it an initial value in Model Selection → Atmosphere → STASH → Initialisation of User Prognostics (you can just set it to zero, i.e. 3 in the Option column). After you have done this you can select the diagnostic in the Model Selection → Atmosphere → STASH → STASH. Specification of Diagnostics requirements panel.

Time Validity

When outputting UKCA reaction and deposition fluxes, you need to consider what time-points these diagnostics are valid at. Tracer fields are valid at all timesteps, but for reaction fluxes this is not the case. For all the chemistry schemes which use ASAD/Newton-Raphson (CheT/TropIsop, CheS/Strat, and CheST/StratTrop), the UKCA chemical timestep is every hour.

This means that when you output this diagnostic through STASH you need to change the sampling frequency. To do this, go to the STASH panel in the UMUI (Model Selection → Atmosphere → STASH → STASH. Specification of Diagnostic requirements) and copy the time profile you would like to use for the diagnostic to a new profile (giving it a similar, but slightly different name) and then change the sampling frequency to be

  • Frequency (every) to be 3
  • Offset to be 2

This will then sample the diagnostic on the UKCA timesteps. If you don't sample the diagnostic using this sampling frequency, then the output may be incorrect.

The following diagnostics are valid on all timesteps:

  • MAS
  • OUT
  • TPM
  • STE
  • EMS

The following diagnostics are only valid on chemical timesteps:

  • RXN
  • DEP
  • RTE
  • PSC

Why should I use these numbers?

The standard N96L85 GA4.0 job has a timestep of 20-minutes (72 timesteps per day). This means that 1-hour is 3 timesteps, and the first timestep of a day is the 1st. An off-set of 2 will then mean outputting on the hour.

Note: If you are using a job with a different timestep you will need to change this sampling, as by default UKCA will still run with a 1-hour timestep.

Solution to Task 9.1: Output new diagnostics

Please see this page for a solution to Task 9.1.


Written by Luke Abraham 2014