Difference between revisions of "UKCA Chemistry and Aerosol vn11.8 Tutorial 9"
(10 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[UKCA Chemistry and Aerosol Tutorials at vn11.8]] |
[[UKCA Chemistry and Aerosol Tutorials at vn11.8]] |
||
+ | |||
+ | {| class="wikitable" border = "1px" |
||
+ | |- |
||
+ | | Difficulty || '''<span style="color:red">HARD</span>''' |
||
+ | |- |
||
+ | | Time to Complete || '''2 or more hours''' |
||
+ | |- |
||
+ | | Video instructions || '''https://youtu.be/6XqYfW2qHKY?t=681''' |
||
+ | |} |
||
+ | |||
+ | '''Remember to run <tt>mosrs-cache-password</tt> in your Rose suite and UM branch terminals.''' |
||
==What you will learn in this Tutorial== |
==What you will learn in this Tutorial== |
||
Line 263: | Line 274: | ||
If you have not done so, you will also need to make sure that you use your new STASHmaster_A file in Rose, as is explained in detail in [[UKCA_Chemistry_and_Aerosol_vn11.8_Tutorial_4#Use_your_new_STASHmaster_file_in_Rose|Tutorial 4]]. |
If you have not done so, you will also need to make sure that you use your new STASHmaster_A file in Rose, as is explained in detail in [[UKCA_Chemistry_and_Aerosol_vn11.8_Tutorial_4#Use_your_new_STASHmaster_file_in_Rose|Tutorial 4]]. |
||
− | After you have made your STASmaster_A file changes, you will need to add these diagnostics into STASH, as per [[ |
+ | After you have made your STASmaster_A file changes, you will need to add these diagnostics into STASH, as per [[UKCA_Chemistry_and_Aerosol_vn11.8_Tutorial_3|Tutorial 3]]. Remember to run the TidyStashTransform macro. As you will have included your branch's STASHmaster_A file using ''@HEAD'', you won't need to make any further changes to Rose, but you will need to make sure that you have committed your UM branch prior to running. Because the file is taken from ''<code>fcm:um.x'''m'''_br</code>'' you will need to make sure that the revision has synced to the PUMA mirror (i.e. by waiting a few minutes). |
==Solution to Task 9.1: Output new diagnostics== |
==Solution to Task 9.1: Output new diagnostics== |
||
<gallery widths=300px heights=300px> |
<gallery widths=300px heights=300px> |
||
− | Image: |
+ | Image:UM11.8_s50i996.png|ALICE + OH → BOB + Sec_Org (s50i996) reaction flux (mol/s) at the surface (20m) |
− | Image: |
+ | Image:UM11.8_s50i997.png|ALICE dry deposition flux (s50i997) (mol/s) at the surface (20m) |
− | Image: |
+ | Image:UM11.8_s50i998.png|BOB wet deposition flux (s50i998) (mol/s) at the surface (20m) |
</gallery> |
</gallery> |
||
Line 278: | Line 289: | ||
For a working Rose suite that has completed this task, please see |
For a working Rose suite that has completed this task, please see |
||
− | * '''vm:''' <code>u-ca024@ |
+ | * '''vm:''' <code>u-ca024@183251</code> |
The specific Rose changes made are: |
The specific Rose changes made are: |
||
− | * '''vm:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/ |
+ | * '''vm:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/183251/c/a/0/2/4/trunk |
'''vm:''' |
'''vm:''' |
||
+ | Index: app/um/rose-app.conf |
||
+ | =================================================================== |
||
+ | --- app/um/rose-app.conf (revision 182959) |
||
+ | +++ app/um/rose-app.conf (revision 183251) |
||
+ | @@ -3793,6 +3793,30 @@ |
||
+ | tim_name='T3HMN' |
||
+ | use_name='UPA' |
||
+ | |||
+ | +[namelist:umstash_streq(50996_26eab91c)] |
||
+ | +dom_name='DALLTH' |
||
+ | +isec=50 |
||
+ | +item=996 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | +[namelist:umstash_streq(50997_e01cc6bc)] |
||
+ | +dom_name='DALLTH' |
||
+ | +isec=50 |
||
+ | +item=997 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | +[namelist:umstash_streq(50998_01fd6a94)] |
||
+ | +dom_name='DALLTH' |
||
+ | +isec=50 |
||
+ | +item=998 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | [namelist:umstash_streq(51001_3e6241a4)] |
||
+ | dom_name='DP27CCM' |
||
+ | isec=51 |
||
+ | @@ -3841,6 +3865,30 @@ |
||
+ | tim_name='T3HMN' |
||
+ | use_name='UPA' |
||
+ | |||
+ | +[namelist:umstash_streq(52996_56c5ed16)] |
||
+ | +dom_name='DP27CCM' |
||
+ | +isec=52 |
||
+ | +item=996 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | +[namelist:umstash_streq(52997_eb3669f6)] |
||
+ | +dom_name='DP27CCM' |
||
+ | +isec=52 |
||
+ | +item=997 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | +[namelist:umstash_streq(52998_c5c157df)] |
||
+ | +dom_name='DP27CCM' |
||
+ | +isec=52 |
||
+ | +item=998 |
||
+ | +package='' |
||
+ | +tim_name='T3HMN' |
||
+ | +use_name='UPA' |
||
+ | + |
||
+ | [namelist:umstash_time(t3hmn_039ecafe)] |
||
+ | !!iedt=0 |
||
+ | iend=-1 |
||
+ | Index: app/fcm_make/rose-app.conf |
||
+ | =================================================================== |
||
+ | --- app/fcm_make/rose-app.conf (revision 182959) |
||
+ | +++ app/fcm_make/rose-app.conf (revision 183251) |
||
+ | @@ -43,4 +43,4 @@ |
||
+ | thread_utils=false |
||
+ | timer_version=3A |
||
+ | um_rev=$BASE_UM_REV |
||
+ | -um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@94120 |
||
+ | +um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@94303 |
||
− | These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/ |
+ | These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task09.1/Task09.1_rose.patch</code>'''. |
The specific UM changes made are: |
The specific UM changes made are: |
||
− | * https://code.metoffice.gov.uk/trac/um/changeset/ |
+ | * https://code.metoffice.gov.uk/trac/um/changeset/94303/main/branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns |
+ | |||
+ | Index: src/atmosphere/UKCA/asad_flux_dat.F90 |
||
+ | =================================================================== |
||
+ | --- src/atmosphere/UKCA/asad_flux_dat.F90 (revision 94120) |
||
+ | +++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision 94303) |
||
+ | @@ -4177,6 +4177,18 @@ |
||
+ | (/' ',' ',' ',' '/)) & |
||
+ | /) |
||
+ | |||
+ | +! Additional diagnostics for UKCA tutorials |
||
+ | +TYPE(asad_flux_defn), PARAMETER, PUBLIC :: ukca_tutorial_fluxes(3) = (/ & |
||
+ | +asad_flux_defn('RXN',50996,'B',.FALSE.,0,4, & |
||
+ | +(/'ALICE ','OH '/), & |
||
+ | +(/'BOB ','Sec_Org ',' ',' '/)), & |
||
+ | +asad_flux_defn('DEP',50997,'D',.FALSE.,0,1, & |
||
+ | +(/'ALICE ',' '/), & |
||
+ | +(/' ',' ',' ',' '/)), & |
||
+ | +asad_flux_defn('DEP',50998,'W',.FALSE.,0,1, & |
||
+ | +(/'BOB ',' '/), & |
||
+ | +(/' ',' ',' ',' '/)) & |
||
+ | +/) |
||
+ | |||
+ | |||
+ | PUBLIC :: asad_load_default_fluxes |
||
+ | @@ -4301,7 +4313,7 @@ |
||
+ | IF (ukca_config%l_ukca_ro2_perm) THEN |
||
+ | !- If RO2-permutation chemistry, need different RO2+RO2 |
||
+ | ! reactions |
||
+ | - n_chemical_fluxes = 338 |
||
+ | + n_chemical_fluxes = 341 |
||
+ | ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) |
||
+ | asad_chemical_fluxes=(/ & |
||
+ | asad_trop_ox_budget_prod, & ! 20 |
||
+ | @@ -4326,10 +4338,11 @@ |
||
+ | asad_o1d_prod, & ! 3 278 |
||
+ | asad_h2o_budget, & ! 38 316 |
||
+ | asad_oxidN_wetdep, & ! 9 325 |
||
+ | - asad_oxidN_drydep & ! 13 338 |
||
+ | + asad_oxidN_drydep, & ! 13 338 |
||
+ | + ukca_tutorial_fluxes & ! 3 341 |
||
+ | /) |
||
+ | ELSE |
||
+ | - n_chemical_fluxes = 331 |
||
+ | + n_chemical_fluxes = 334 |
||
+ | ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) |
||
+ | asad_chemical_fluxes=(/ & |
||
+ | asad_trop_ox_budget_prod, & ! 20 |
||
+ | @@ -4354,7 +4367,8 @@ |
||
+ | asad_o1d_prod, & ! 3 271 |
||
+ | asad_h2o_budget, & ! 38 309 |
||
+ | asad_oxidN_wetdep, & ! 9 318 |
||
+ | - asad_oxidN_drydep & ! 13 331 |
||
+ | + asad_oxidN_drydep, & ! 13 331 |
||
+ | + ukca_tutorial_fluxes & ! 3 334 |
||
+ | /) |
||
+ | END IF |
||
+ | END IF |
||
+ | Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf |
||
+ | =================================================================== |
||
+ | --- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 94120) |
||
+ | +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 94303) |
||
+ | @@ -26284,6 +26284,18 @@ |
||
+ | = |
||
+ | =Available only if NetCDF emission system of UKCA is used |
||
+ | |||
+ | +[stashmaster:code(50996)] |
||
+ | +description=RXN FLX: ALICE+OH->BOB+Sec_Org |
||
+ | +help=Flux through the ALICE+OH->BOB+Sec_Org reaction |
||
+ | + |
||
+ | +[stashmaster:code(50997)] |
||
+ | +description=DRY DEP FLUX: ALICE (3D) |
||
+ | +help=Dry deposition flux of ALICE |
||
+ | + |
||
+ | +[stashmaster:code(50998)] |
||
+ | +description=WET DEP FLUX: BOB (3D) |
||
+ | +help=Wet deposition flux of BOB |
||
+ | + |
||
+ | [stashmaster:code(51001)] |
||
+ | description=O3 MASS MIXING RATIO ON PRESS LEVS |
||
+ | help=Ozone Mass Mixing Ratio in kg/kg(Air) |
||
+ | @@ -29792,6 +29804,21 @@ |
||
+ | =chemistry on pressure levels |
||
+ | =Available for Strat and StratTrop chemistry only |
||
+ | |||
+ | +[stashmaster:code(52996)] |
||
+ | +description=RXN FLX: ALICE+OH->BOB+Sec_Org PLEV |
||
+ | +help=Flux through the ALICE+OH->BOB+Sec_Org reaction |
||
+ | + = on Pressure Levels |
||
+ | + |
||
+ | +[stashmaster:code(52997)] |
||
+ | +description=DRY DEP FLUX: ALICE (3D) PLEVS |
||
+ | +help=Dry deposition flux of ALICE |
||
+ | + = on Pressure Levels |
||
+ | + |
||
+ | +[stashmaster:code(52998)] |
||
+ | +description=WET DEP FLUX: BOB (3D) PLEVS |
||
+ | +help=Wet deposition flux of BOB |
||
+ | + = on Pressure Levels |
||
+ | + |
||
+ | [stashmaster:code(53181)] |
||
+ | description=Temperature Inc: Idealised (K/step) |
||
+ | help=Temperature increment from the idealised section in Kelvin per model |
||
+ | Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A |
||
+ | =================================================================== |
||
+ | --- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 94120) |
||
+ | +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 94303) |
||
+ | @@ -27521,6 +27521,24 @@ |
||
+ | 4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | 5| 0 | 0 | 0 | 129 | 0 | 0 | 0 | 0 | 0 | |
||
+ | # |
||
+ | +1| 1 | 50 | 996 |RXN FLUX: ALICE+OH->BOB+Sec_Org | |
||
+ | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | +1| 1 | 50 | 997 |DRY DEP FLUX: ALICE (3D) | |
||
+ | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | +1| 1 | 50 | 998 |WET DEP FLUX: BOB (3D) | |
||
+ | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | #=============================================================================== |
||
+ | # Section 50 Item 999 reserved. |
||
+ | #=============================================================================== |
||
+ | @@ -30625,6 +30643,24 @@ |
||
+ | # pressure levels not meaningful. Do not use these slots for other diagnostics. |
||
+ | #=============================================================================== |
||
+ | # |
||
+ | +1| 1 | 52 | 996 |RXN FLUX: ALICE+OH->BOB+Sec_Org PLEV| |
||
+ | +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | +1| 1 | 52 | 997 |DRY DEP FLUX: ALICE (3D) PLEVS | |
||
+ | +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | +1| 1 | 52 | 998 |WET DEP FLUX: BOB (3D) PLEVS | |
||
+ | +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | |
||
+ | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | |
||
+ | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | |
||
+ | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | |
||
+ | +# |
||
+ | #=============================================================================== |
||
+ | # Section 52 Item 999 reserved. |
||
+ | #=============================================================================== |
||
− | These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task05.2/Task05.2_code.patch</code>'''. |
||
If you open the '''.pa''' file in Xconv, you should see the following fields: |
If you open the '''.pa''' file in Xconv, you should see the following fields: |
||
− | + | 2 : 96 72 27 1 unspecified: Stash code = 52996 |
|
− | + | 3 : 96 72 27 1 unspecified: Stash code = 52997 |
|
− | + | 4 : 96 72 27 1 unspecified: Stash code = 52998 |
|
+ | |||
+ | 29 : 96 72 38 1 unspecified: Stash code = 50996 |
||
+ | 30 : 96 72 38 1 unspecified: Stash code = 50997 |
||
+ | 31 : 96 72 38 1 unspecified: Stash code = 50998 |
||
+ | |||
+ | These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task09.1/Task09.1_code.patch</code>'''. |
||
+ | |||
+ | Sample output from this task can be found at '''<code>Tutorials/vn11.8/sample_output/Task09.1/atmosa.pa19810901_00</code>'''. |
||
==Checklist== |
==Checklist== |
||
Line 306: | Line 556: | ||
[file:app/um/file/STASHmaster] |
[file:app/um/file/STASHmaster] |
||
source=fcm:um.xm_br/dev/[your MOSRS userid]/vnX.Y_your_branch_name/rose-meta/um-atmos/vn11.8/etc/stash/STASHmaster@HEAD |
source=fcm:um.xm_br/dev/[your MOSRS userid]/vnX.Y_your_branch_name/rose-meta/um-atmos/vn11.8/etc/stash/STASHmaster@HEAD |
||
− | : <span style="font-size:20px">☐</span> |
+ | : <span style="font-size:20px">☐</span> Point the metadata in your suite to the <code>rose-meta/um-atmos/HEAD</code> of your branch's working copy. |
− | : <span style="font-size:20px">☐</span> Point the metadata in your suite to um-atmos/vn11.8. |
||
: <span style="font-size:20px">☐</span> Include your branch in your suite at: fcm_make <math>\rightarrow</math> env <math>\rightarrow</math> Sources. |
: <span style="font-size:20px">☐</span> Include your branch in your suite at: fcm_make <math>\rightarrow</math> env <math>\rightarrow</math> Sources. |
||
: <span style="font-size:20px">☐</span> In <code>asad_flux_dat.F90</code>, make a new array of type <code>asad_flux_defn</code> and populate it with your new diagnostic specification(s), referencing the same item numbers as in your STASHmaster_A file. |
: <span style="font-size:20px">☐</span> In <code>asad_flux_dat.F90</code>, make a new array of type <code>asad_flux_defn</code> and populate it with your new diagnostic specification(s), referencing the same item numbers as in your STASHmaster_A file. |
Latest revision as of 17:12, 28 February 2022
UKCA Chemistry and Aerosol Tutorials at vn11.8
Difficulty | HARD |
Time to Complete | 2 or more hours |
Video instructions | https://youtu.be/6XqYfW2qHKY?t=681 |
Remember to run mosrs-cache-password in your Rose suite and UM branch terminals.
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 50996, the dry deposition of ALICE to STASH code 50997, and the wet deposition of BOB to 50998. They should be outputted as a 3-hour mean to the pa/UPA stream.
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)
- 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)
STASH Code
This is a 5 digit integer defining the STASH code that the diagnostic will be outputted to (e.g. 50001). Currently this must be in section 50.
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
- PSC
- 1 to output the fraction of Type 1 PSCs
- 2 to output the fraction of Type 2 PSCs
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 the RXN diagnostic.
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, NET, STE, and OUT. For the RXN 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_master.F90
module.
Summing 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 in 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
module. You will need to increment the size of this array, given by the n_chemical_fluxes
parameter.
Note that as there are several different chemical mechanism with further-sub options, how asad_chemical_fluxes
is defined is rather complex:
! Pick up correct version of the aerosol chemistry IF (ukca_config%l_ukca_offline .OR. ukca_config%l_ukca_offline_be) THEN n_aero_fluxes = 16 ALLOCATE(asad_aerosol_chem(n_aero_fluxes)) asad_aerosol_chem = asad_aerosol_chem_offline ELSE IF (ukca_config%l_ukca_strattrop) THEN n_aero_fluxes = 16 ALLOCATE(asad_aerosol_chem(n_aero_fluxes)) asad_aerosol_chem = asad_aerosol_chem_strattrop ELSE IF (ukca_config%l_ukca_cristrat) THEN n_aero_fluxes = 24 ALLOCATE(asad_aerosol_chem(n_aero_fluxes)) asad_aerosol_chem = asad_aerosol_chem_cri ELSE n_aero_fluxes = 16 ALLOCATE(asad_aerosol_chem(n_aero_fluxes)) asad_aerosol_chem = asad_aerosol_chem_online END IF ! Use pre-determined reaction list IF (ukca_config%l_ukca_cristrat) THEN IF (ukca_config%l_ukca_chem_aero) THEN n_chemical_fluxes = 756 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & cri_trop_ox_budget_prod01, & ! 57 57 cri_trop_ox_budget_prod02, & ! 41 98 cri_aer_trop_ox_budget_loss01,& ! 34 132 cri_aer_trop_ox_budget_loss02,& ! 72 204 cri_trop_ox_budget_drydep, & ! 26 230 cri_trop_ox_budget_wetdep, & ! 18 248 cri_aer_trop_other_fluxes, & ! 56 304 asad_general_interest, & ! 8 312 cri_aer_trop_co_budget, & ! 47 359 asad_lightning_diags, & ! 5 364 asad_strat_oh_prod, & ! 31 395 asad_strat_oh_loss, & ! 26 421 asad_strat_o3_budget, & ! 20 441 asad_strat_o3_misc, & ! 15 456 asad_aerosol_chem_cri, & ! 27 483 cri_rco2no2_pan_prod, & ! 6 489 cri_ro2ho2_reacn, & ! 47 536 cri_ro2no3_reacn, & ! 54 590 cri_ro2ro2_reacn, & ! 63 653 asad_ch4_oxidn, & ! 6 659 asad_o1d_prod, & ! 3 662 asad_h2o_budget, & ! 38 700 cri_oxidN_wetdep, & ! 19 719 cri_oxidN_drydep & ! 37 756 /) ELSE n_chemical_fluxes = 745 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & cri_trop_ox_budget_prod01, & ! 57 57 cri_trop_ox_budget_prod02, & ! 41 98 cri_trop_ox_budget_loss01, & ! 34 132 cri_trop_ox_budget_loss02, & ! 72 204 cri_trop_ox_budget_drydep, & ! 26 230 cri_trop_ox_budget_wetdep, & ! 18 248 cri_trop_other_fluxes, & ! 56 304 asad_general_interest, & ! 8 312 cri_trop_co_budget, & ! 47 359 asad_lightning_diags, & ! 5 364 asad_strat_oh_prod, & ! 31 395 asad_strat_oh_loss, & ! 26 421 asad_strat_o3_budget, & ! 20 441 asad_strat_o3_misc, & ! 15 456 asad_aerosol_chem, & ! 16 472 cri_rco2no2_pan_prod, & ! 6 478 cri_ro2ho2_reacn, & ! 47 525 cri_ro2no3_reacn, & ! 54 579 cri_ro2ro2_reacn, & ! 63 642 asad_ch4_oxidn, & ! 6 648 asad_o1d_prod, & ! 3 651 asad_h2o_budget, & ! 38 689 cri_oxidN_wetdep, & ! 19 708 cri_oxidN_drydep & ! 37 745 /) END IF ELSE IF (ukca_config%l_ukca_ro2_perm) THEN !- If RO2-permutation chemistry, need different RO2+RO2 ! reactions n_chemical_fluxes = 338 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & asad_trop_ox_budget_prod, & ! 20 asad_trop_ox_budget_loss01, & ! 23 43 asad_trop_ox_budget_loss02, & ! 12 55 asad_trop_ox_budget_drydep, & ! 11 66 asad_trop_ox_budget_wetdep, & ! 7 73 asad_trop_other_fluxes, & ! 16 89 asad_general_interest, & ! 8 97 asad_ro2perm_trop_co_budget,& ! 21 118 asad_lightning_diags, & ! 5 123 asad_strat_oh_prod, & ! 31 154 asad_strat_oh_loss, & ! 26 180 asad_strat_o3_budget, & ! 20 200 asad_strat_o3_misc, & ! 15 215 asad_aerosol_chem, & ! 16 231 asad_rco2no2_pan_prod, & ! 3 234 asad_ro2ho2_reacn, & ! 13 247 asad_ro2no3_reacn, & ! 7 254 asad_ro2perm_ro2ro2_reacn, & ! 15 269 asad_ch4_oxidn, & ! 6 275 asad_o1d_prod, & ! 3 278 asad_h2o_budget, & ! 38 316 asad_oxidN_wetdep, & ! 9 325 asad_oxidN_drydep & ! 13 338 /) ELSE n_chemical_fluxes = 331 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & asad_trop_ox_budget_prod, & ! 20 asad_trop_ox_budget_loss01, & ! 23 43 asad_trop_ox_budget_loss02, & ! 12 55 asad_trop_ox_budget_drydep, & ! 11 66 asad_trop_ox_budget_wetdep, & ! 7 73 asad_trop_other_fluxes, & ! 16 89 asad_general_interest, & ! 8 97 asad_trop_co_budget, & ! 21 118 asad_lightning_diags, & ! 5 123 asad_strat_oh_prod, & ! 31 154 asad_strat_oh_loss, & ! 26 180 asad_strat_o3_budget, & ! 20 200 asad_strat_o3_misc, & ! 15 215 asad_aerosol_chem, & ! 16 231 asad_rco2no2_pan_prod, & ! 3 234 asad_ro2ho2_reacn, & ! 13 247 asad_ro2no3_reacn, & ! 7 254 asad_ro2ro2_reacn, & ! 8 262 asad_ch4_oxidn, & ! 6 268 asad_o1d_prod, & ! 3 271 asad_h2o_budget, & ! 38 309 asad_oxidN_wetdep, & ! 9 318 asad_oxidN_drydep & ! 13 331 /) END IF END IF
The first block of code is required to set asad_aerosol_chem, as the reactions that make up this set of diagnostics vary depending on chemistry scheme used. The second longer block sets asad_chemical_fluxes for either the CRI-Strat or StratTrop routines, and then has sub-options depending on whether RO2-permutation chemistry is being used as this then changes a sub-set of reactions again.
When adding your diagnostics to these blocks of code, take care to ensure that you add them to the correct place, otherwise you may have an error or the diagnostics may show zero output.
Changes to asad_chem_flux_diags.F90
(and other UKCA routines)
You will need to edit asad_chem_flux_diags.F90
module if you want to output a new type of diagnostic. This can be quite involved, but you can look at existing routines to see how things are done. You will also need to add code into the main UKCA routines the pass the data through, e.g.
! 3D flux diagnostics IF (L_asad_use_chem_diags .AND. & ((L_asad_use_flux_rxns .OR. L_asad_use_rxn_rates) .OR. & (L_asad_use_wetdep .OR. L_asad_use_drydep))) & CALL asad_chemical_diagnostics(row_length,rows, & model_levels,dpd_full,dpw_full,prk_full,y_full, & j,i,klevel,volume,ierr)
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 edit the STASHmaster_A file in your branch, as covered in the Adding new chemical tracers tutorial. Here, as you are adding new diagnostics to section 50, the equivalent pressure-level diagnostics need to be made in section 52.
Most UKCA diagnostics are 3D, although some, such as emissions (which are outputted in a different way), are 2D. You should take care with the STASH settings in STASHmaster_A between these types, as there some differences that will need to be considered. Note that any 2D (i.e. surface) diagnostics that you create will not have a pressure-level equivalent.
As previously, you may find it easier to copy an existing diagnostic and edit that, but take care to ensure that the settings used are equivalent, e.g. you should copy a 3D section 50 field and not a 2D one, or one from section 34 etc.
Rose Changes
If you have not done so, you will also need to make sure that you use your new STASHmaster_A file in Rose, as is explained in detail in Tutorial 4.
After you have made your STASmaster_A file changes, you will need to add these diagnostics into STASH, as per Tutorial 3. Remember to run the TidyStashTransform macro. As you will have included your branch's STASHmaster_A file using @HEAD, you won't need to make any further changes to Rose, but you will need to make sure that you have committed your UM branch prior to running. Because the file is taken from fcm:um.xm_br
you will need to make sure that the revision has synced to the PUMA mirror (i.e. by waiting a few minutes).
Solution to Task 9.1: Output new diagnostics
You were given the task
- Output diagnostics of the reaction to STASH code 50996, the dry deposition of ALICE to STASH code 50997, and the wet deposition of BOB to 50998. They should be outputted as a 3-hour mean to the pa/UPA stream.
For a working Rose suite that has completed this task, please see
- vm:
u-ca024@183251
The specific Rose changes made are:
vm:
Index: app/um/rose-app.conf =================================================================== --- app/um/rose-app.conf (revision 182959) +++ app/um/rose-app.conf (revision 183251) @@ -3793,6 +3793,30 @@ tim_name='T3HMN' use_name='UPA' +[namelist:umstash_streq(50996_26eab91c)] +dom_name='DALLTH' +isec=50 +item=996 +package= +tim_name='T3HMN' +use_name='UPA' + +[namelist:umstash_streq(50997_e01cc6bc)] +dom_name='DALLTH' +isec=50 +item=997 +package= +tim_name='T3HMN' +use_name='UPA' + +[namelist:umstash_streq(50998_01fd6a94)] +dom_name='DALLTH' +isec=50 +item=998 +package= +tim_name='T3HMN' +use_name='UPA' + [namelist:umstash_streq(51001_3e6241a4)] dom_name='DP27CCM' isec=51 @@ -3841,6 +3865,30 @@ tim_name='T3HMN' use_name='UPA' +[namelist:umstash_streq(52996_56c5ed16)] +dom_name='DP27CCM' +isec=52 +item=996 +package= +tim_name='T3HMN' +use_name='UPA' + +[namelist:umstash_streq(52997_eb3669f6)] +dom_name='DP27CCM' +isec=52 +item=997 +package= +tim_name='T3HMN' +use_name='UPA' + +[namelist:umstash_streq(52998_c5c157df)] +dom_name='DP27CCM' +isec=52 +item=998 +package= +tim_name='T3HMN' +use_name='UPA' + [namelist:umstash_time(t3hmn_039ecafe)] !!iedt=0 iend=-1 Index: app/fcm_make/rose-app.conf =================================================================== --- app/fcm_make/rose-app.conf (revision 182959) +++ app/fcm_make/rose-app.conf (revision 183251) @@ -43,4 +43,4 @@ thread_utils=false timer_version=3A um_rev=$BASE_UM_REV -um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@94120 +um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@94303
These differences can be found in the file Tutorials/vn11.8/worked_solutions/Task09.1/Task09.1_rose.patch
.
The specific UM changes made are:
Index: src/atmosphere/UKCA/asad_flux_dat.F90 =================================================================== --- src/atmosphere/UKCA/asad_flux_dat.F90 (revision 94120) +++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision 94303) @@ -4177,6 +4177,18 @@ (/' ',' ',' ',' '/)) & /) +! Additional diagnostics for UKCA tutorials +TYPE(asad_flux_defn), PARAMETER, PUBLIC :: ukca_tutorial_fluxes(3) = (/ & +asad_flux_defn('RXN',50996,'B',.FALSE.,0,4, & +(/'ALICE ','OH '/), & +(/'BOB ','Sec_Org ',' ',' '/)), & +asad_flux_defn('DEP',50997,'D',.FALSE.,0,1, & +(/'ALICE ',' '/), & +(/' ',' ',' ',' '/)), & +asad_flux_defn('DEP',50998,'W',.FALSE.,0,1, & +(/'BOB ',' '/), & +(/' ',' ',' ',' '/)) & +/) PUBLIC :: asad_load_default_fluxes @@ -4301,7 +4313,7 @@ IF (ukca_config%l_ukca_ro2_perm) THEN !- If RO2-permutation chemistry, need different RO2+RO2 ! reactions - n_chemical_fluxes = 338 + n_chemical_fluxes = 341 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & asad_trop_ox_budget_prod, & ! 20 @@ -4326,10 +4338,11 @@ asad_o1d_prod, & ! 3 278 asad_h2o_budget, & ! 38 316 asad_oxidN_wetdep, & ! 9 325 - asad_oxidN_drydep & ! 13 338 + asad_oxidN_drydep, & ! 13 338 + ukca_tutorial_fluxes & ! 3 341 /) ELSE - n_chemical_fluxes = 331 + n_chemical_fluxes = 334 ALLOCATE(asad_chemical_fluxes(n_chemical_fluxes)) asad_chemical_fluxes=(/ & asad_trop_ox_budget_prod, & ! 20 @@ -4354,7 +4367,8 @@ asad_o1d_prod, & ! 3 271 asad_h2o_budget, & ! 38 309 asad_oxidN_wetdep, & ! 9 318 - asad_oxidN_drydep & ! 13 331 + asad_oxidN_drydep, & ! 13 331 + ukca_tutorial_fluxes & ! 3 334 /) END IF END IF Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf =================================================================== --- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 94120) +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 94303) @@ -26284,6 +26284,18 @@ = =Available only if NetCDF emission system of UKCA is used +[stashmaster:code(50996)] +description=RXN FLX: ALICE+OH->BOB+Sec_Org +help=Flux through the ALICE+OH->BOB+Sec_Org reaction + +[stashmaster:code(50997)] +description=DRY DEP FLUX: ALICE (3D) +help=Dry deposition flux of ALICE + +[stashmaster:code(50998)] +description=WET DEP FLUX: BOB (3D) +help=Wet deposition flux of BOB + [stashmaster:code(51001)] description=O3 MASS MIXING RATIO ON PRESS LEVS help=Ozone Mass Mixing Ratio in kg/kg(Air) @@ -29792,6 +29804,21 @@ =chemistry on pressure levels =Available for Strat and StratTrop chemistry only +[stashmaster:code(52996)] +description=RXN FLX: ALICE+OH->BOB+Sec_Org PLEV +help=Flux through the ALICE+OH->BOB+Sec_Org reaction + = on Pressure Levels + +[stashmaster:code(52997)] +description=DRY DEP FLUX: ALICE (3D) PLEVS +help=Dry deposition flux of ALICE + = on Pressure Levels + +[stashmaster:code(52998)] +description=WET DEP FLUX: BOB (3D) PLEVS +help=Wet deposition flux of BOB + = on Pressure Levels + [stashmaster:code(53181)] description=Temperature Inc: Idealised (K/step) help=Temperature increment from the idealised section in Kelvin per model Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A =================================================================== --- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 94120) +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 94303) @@ -27521,6 +27521,24 @@ 4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | 5| 0 | 0 | 0 | 129 | 0 | 0 | 0 | 0 | 0 | # +1| 1 | 50 | 996 |RXN FLUX: ALICE+OH->BOB+Sec_Org | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | +# +1| 1 | 50 | 997 |DRY DEP FLUX: ALICE (3D) | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | +# +1| 1 | 50 | 998 |WET DEP FLUX: BOB (3D) | +2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 65 | 0 | 0 | 0 | 0 | 0 | +# #=============================================================================== # Section 50 Item 999 reserved. #=============================================================================== @@ -30625,6 +30643,24 @@ # pressure levels not meaningful. Do not use these slots for other diagnostics. #=============================================================================== # +1| 1 | 52 | 996 |RXN FLUX: ALICE+OH->BOB+Sec_Org PLEV| +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | +# +1| 1 | 52 | 997 |DRY DEP FLUX: ALICE (3D) PLEVS | +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | +# +1| 1 | 52 | 998 |WET DEP FLUX: BOB (3D) PLEVS | +2| 0 | 0 | 17 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 | +3| 000000000000000000000000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 8 | 0 | 0 | 0 | 0 | 0 | +# #=============================================================================== # Section 52 Item 999 reserved. #===============================================================================
If you open the .pa file in Xconv, you should see the following fields:
2 : 96 72 27 1 unspecified: Stash code = 52996 3 : 96 72 27 1 unspecified: Stash code = 52997 4 : 96 72 27 1 unspecified: Stash code = 52998 29 : 96 72 38 1 unspecified: Stash code = 50996 30 : 96 72 38 1 unspecified: Stash code = 50997 31 : 96 72 38 1 unspecified: Stash code = 50998
These differences can be found in the file Tutorials/vn11.8/worked_solutions/Task09.1/Task09.1_code.patch
.
Sample output from this task can be found at Tutorials/vn11.8/sample_output/Task09.1/atmosa.pa19810901_00
.
Checklist
- ☐ Make the required changes to branch's STASHmaster_A file, to add the new diagnostics. Make a note of the STASH items chosen, and also add the pressure-level diagnostics.
- ☐ Add help text for your diagnostics in your branch's STASHmaster-meta.conf file.
- ☐ Using a text editor, open the
app/um/rose-app.conf
file from yourroses/[SUITE-ID]
directory, and add the lineSTASHMASTER=STASHmaster
in the[env]
block, then save and close the file. - ☐ Using a text editor, open the
rose-suite.conf
file from yourroses/[SUITE-ID]
directory, and add the following lines to the top of the file, before saving and closing it:
[file:app/um/file/STASHmaster] source=fcm:um.xm_br/dev/[your MOSRS userid]/vnX.Y_your_branch_name/rose-meta/um-atmos/vn11.8/etc/stash/STASHmaster@HEAD
- ☐ Point the metadata in your suite to the
rose-meta/um-atmos/HEAD
of your branch's working copy. - ☐ Include your branch in your suite at: fcm_make env Sources.
- ☐ In
asad_flux_dat.F90
, make a new array of typeasad_flux_defn
and populate it with your new diagnostic specification(s), referencing the same item numbers as in your STASHmaster_A file. - ☐ Append this new array at the end of
asad_chemical_fluxes
, and incrementn_chemical_fluxes
by the number of new diagnostics. - ☐ If required, add new code for new diagnostics into
asad_chem_flux_diags.F90
and other UKCA routines as necessary. - ☐ Output your diagnostics in STASH at: um namelist Model Input and Output STASH Requests and Profiles STASH Requests.
- ☐ Run the TidyStashTransform transform macro.
- ☐ Save your suite.
- ☐ In the
roses/[SUITE-ID]
directory, runfcm commit
to commit your changes to the repository. - ☐ Run your suite.
Written by Luke Abraham 2021