Difference between revisions of "UKCA Chemistry and Aerosol vn11.8 Tutorial 4"

From UKCA
(44 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=213'''
  +
|}
  +
  +
'''Remember to run <tt>mosrs-cache-password</tt> in your Rose suite and UM branch terminals.'''
   
 
==What you will do in this tutorial==
 
==What you will do in this tutorial==
Line 8: Line 19:
   
 
<span style="color:green">'''TASK4.1:''' Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called '''ALICE''' and the tracer in slot 499 will be called '''BOB'''. You should initialise these tracers to <code>1.000000e-15</code>. You should also output these two tracers through the '''UPA''' stream in STASH as 3-hour means. Do not make any UKCA code changes at this stage.</span>
 
<span style="color:green">'''TASK4.1:''' Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called '''ALICE''' and the tracer in slot 499 will be called '''BOB'''. You should initialise these tracers to <code>1.000000e-15</code>. You should also output these two tracers through the '''UPA''' stream in STASH as 3-hour means. Do not make any UKCA code changes at this stage.</span>
  +
  +
'''Note:''' if you are working at UM versions prior to UMvn11.7, you will only be able to use tracer slots up to 256 (rather than 499 as used here). For more information see the [[UKCA_Chemistry_and_Aerosol_vn10.9_Tutorial_4|vn10.9 Tutorials]].
   
 
==Make a branch==
 
==Make a branch==
Line 39: Line 52:
 
====Using your new metadata within Rose====
 
====Using your new metadata within Rose====
   
  +
Here you should click on the '''um''' app in Rose and change the '''meta''' setting from <code>um-atmos/vn11.8</code> to
There are two ways to ensure that your metadata is used within Rose:
 
 
===== 1. Open suites using <code>-M</code> =====
 
 
To pick-up the metadata changes, you should make sure that the '''meta''' path in '''um''' points to
 
 
um-atmos/HEAD
 
 
From now on, when you want to open your Rose suite for editing, instead of doing it through rosie, you should instead open the job for editing by going to your <code>$HOME/roses/'''[SUITE-ID]'''</code> directory, and opening it using the command
 
 
rose edit -M /path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta
 
 
where here '''<code>/path/to</code>''' means the full path to your suite on the machine that you are using (e.g. PUMA, the VM, etc.). If you don't do this, the STASHmaster changes will not be picked up, and you won't be able to select the tracers.
 
 
===== 2. Edit the <code>meta</code> path in your um app =====
 
 
Here you should click on the '''um''' app in Rose and change the '''meta''' setting from <code>um-atmos/vn11.</code> to
 
   
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD
Line 69: Line 66:
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>
   
if you wish to run from a working copy, and
+
(where <tt>/path/to/vn11.8_your_branch_name</tt> means the full linux path to your branch, e.g. <tt>/home/ukcatr01/vn11.8_UKCA_Tutorials</tt> etc.) if you wish to run from a working copy, and
   
 
branches/dev/'''<span style="color:green">[your MOSRS userid]</span>'''/vn11.8_<span style="color:blue">your_branch_name</span>
 
branches/dev/'''<span style="color:green">[your MOSRS userid]</span>'''/vn11.8_<span style="color:blue">your_branch_name</span>
Line 79: Line 76:
 
fcm info fcm:um.xm
 
fcm info fcm:um.xm
   
and check the last committed revision. If it is the same or higher than your last revision then your code changes will be picked-up. If it is less than your revision your code changes will not be included in the compile. On the VM, this is not an issue as there is no mirror.
+
and check the last committed revision. If it is the same or higher than your last revision then your code changes will be picked-up. If it is less than your revision your code changes will not be included in the compile. '''On the VM, this is not an issue as there is no mirror.'''
   
 
===STASHmaster_A===
 
===STASHmaster_A===
Line 87: Line 84:
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A
 
/path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A
   
This is a large file, as it contains all the possible STASH items. Scroll down the file until you get to section 34, and you will see how the tracers are defined. The key entries to consider are highlighted in '''<span style="color:red">red</span>'''. All entried are '''fixed-width''', so when editing the file, ensure not to change the spacing, otherwise you will get errors.
+
This is a large file, as it contains all the possible STASH items. Scroll down the file until you get to section 34, and you will see how the tracers are defined. The key entries to consider are highlighted in '''<span style="color:red">red</span>'''. All entries are '''fixed-width''', so when editing the file, ensure not to change the spacing, otherwise you will get errors.
   
 
#===============================================================================
 
#===============================================================================
Line 106: Line 103:
 
* '''<span style="color:red">34</span>:''' The ''STASH section'', in this case Section 34, UKCA prognostics.
 
* '''<span style="color:red">34</span>:''' The ''STASH section'', in this case Section 34, UKCA prognostics.
 
* '''<span style="color:red">1</span>:''' The ''STASH item'', in this case, the first item in s34, ozone.
 
* '''<span style="color:red">1</span>:''' The ''STASH item'', in this case, the first item in s34, ozone.
* '''<span style="color:red">O3 MASS MIXING RATIO AFTER TIMESTEP</span>:''' The ''name'' of the field in the STASHmaster file. This can be anything descriptive, but it isn't read by the model, and is only considered in Rose (or e.g. Xconv).
+
* '''<span style="color:red">O3 MASS MIXING RATIO AFTER TIMESTEP</span>:''' The ''name'' of the field in the STASHmaster file. This can be anything descriptive, but it isn't used by the model, and is only considered in Rose (or e.g. Xconv).
 
*
 
*
   
Line 116: Line 113:
 
'''Third Line:'''
 
'''Third Line:'''
   
* '''<span style="color:red">000000000000000000100000111110</span>:''' These are ''Options Codes'' which determine which scheme the STASH field (i.e. tracer in this case) are valid for. These are counted from the '''right''', '''''n1''''' to '''''n30''''', and for UKCA only the first 8 are used. These have the following meaning:
+
* '''<span style="color:red">000000000000000000100000111110</span>:''' These are ''Options Codes'' which determine which scheme the STASH field (i.e. tracer in this case) are valid for. These are counted from the '''right''', '''''n1''''' to '''''n30'''''. Only some of these are used, and have the following meaning:
 
** '''n1:''' Age-of-air tracer (''ageair'') or aerosol tracers
 
** '''n1:''' Age-of-air tracer (''ageair'') or aerosol tracers
 
** '''n2:''' Standard Tropospheric Chemistry scheme using the Backward Euler solver (''trop'')
 
** '''n2:''' Standard Tropospheric Chemistry scheme using the Backward Euler solver (''trop'')
Line 144: Line 141:
   
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
 
You should make these changes to STASHmaster_A, and then '''<code>fcm commit</code>''' these changes. This is important, otherwise the running suite will not be able to see the changes you have made once you have included your new STASHmaster_A file in Rose.
 
   
 
====Section 51====
 
====Section 51====
Line 165: Line 160:
 
You will notice that there are a number of changes to various codes, and this is to do with defining the grid that the diagnostic is valid on, whether it can be held in the dump, etc. For more information on what these codes mean, please see Appendix C in UMDP C4, which can be obtained from the SRS [https://code.metoffice.gov.uk/doc/um/latest/umdp.html here (password required)]. When making a new entry, the easiest thing to do is copy an existing entry and make the required changes to the item, name, PP field code, and option codes.
 
You will notice that there are a number of changes to various codes, and this is to do with defining the grid that the diagnostic is valid on, whether it can be held in the dump, etc. For more information on what these codes mean, please see Appendix C in UMDP C4, which can be obtained from the SRS [https://code.metoffice.gov.uk/doc/um/latest/umdp.html here (password required)]. When making a new entry, the easiest thing to do is copy an existing entry and make the required changes to the item, name, PP field code, and option codes.
   
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
+
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499 (and section 51 for pressure level equivalents).</span>
   
 
====Help text====
 
====Help text====
Line 177: Line 172:
 
and
 
and
   
[stashmaster:code(51499)]
+
[stashmaster:code(51498)]
 
description=ALICE MASS MIX RATIO ON PRESS LEVS
 
description=ALICE MASS MIX RATIO ON PRESS LEVS
 
help=UKCA Tutiorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
 
help=UKCA Tutiorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
 
=on pressure levels
 
=on pressure levels
   
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
+
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499 (and section 51 for pressure level equivalents).</span>
  +
  +
'''You should make these changes to STASHmaster_A and STASHmaster-meta.conf, and then <code>fcm commit</code> these changes. This is important, otherwise the running suite will not be able to see the changes you have made once you have included your new STASHmaster_A file in Rose.'''
   
 
====Use your new STASHmaster file in Rose====
 
====Use your new STASHmaster file in Rose====
Line 190: Line 187:
 
To get Rose to recognise your STASHmaster file, you will need to make a number of changes:
 
To get Rose to recognise your STASHmaster file, you will need to make a number of changes:
   
# Make sure to point the '''um''' metadata to your branch (if it isn't already) by either using Rose with <code>rose edit -M /path/to/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta</code> or my editing the '''um''' '''meta''' path (you should already be doing this after following the instructions in the [[#Metadata|metadata section]] above).
+
# Make sure to point the '''um''' metadata to your branch (if it isn't already) by editing the '''um''' '''meta''' path (you should already be doing this after following the instructions in the [[#Metadata|metadata section]] above).
 
# You need to open the <code>$HOME/roses/'''[SUITE-ID]'''/app/um/rose-app.conf</code> file in a text editor (e.g. vim, emacs, nedit etc.) and add the line <code>STASHMASTER=STASHmaster</code> inside the '''<code>[env]</code>''' block near the top of the file.
 
# You need to open the <code>$HOME/roses/'''[SUITE-ID]'''/app/um/rose-app.conf</code> file in a text editor (e.g. vim, emacs, nedit etc.) and add the line <code>STASHMASTER=STASHmaster</code> inside the '''<code>[env]</code>''' block near the top of the file.
 
# You need to open the <code>$HOME/roses/'''[SUITE-ID]'''/rose-suite.conf</code> file in a text editor and add the following lines at the top of the file:
 
# You need to open the <code>$HOME/roses/'''[SUITE-ID]'''/rose-suite.conf</code> file in a text editor and add the following lines at the top of the file:
 
[file:app/um/file/STASHmaster]
 
[file:app/um/file/STASHmaster]
 
source=fcm:um.xm_br/dev/'''<span style="color:green">[your MOSRS userid]</span>'''/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
 
source=fcm:um.xm_br/dev/'''<span style="color:green">[your MOSRS userid]</span>'''/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
:: You need to ensure that you have committed your STASHmaster_A changes, otherwise your new tracer(s) will not be seen at run-time during the reconfiguration or atmosphere steps.
+
::* You need to ensure that you have committed your STASHmaster_A changes, otherwise your new tracer(s) will not be seen at run-time during the reconfiguration or atmosphere steps.
:: For the VM '''only''' it is also possible to specify the full path to the STASHmaster directory. This is because the suite runs on the same machine that the branch is on.
+
::* For the VM '''only''' it is also possible to specify the full path to the STASHmaster directory. This is because the suite runs on the same machine that the branch is on.
 
[file:app/um/file/STASHmaster]
 
[file:app/um/file/STASHmaster]
 
source=/home/'''<span style="color:green">[your VM userid]</span>'''/src/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster
 
source=/home/'''<span style="color:green">[your VM userid]</span>'''/src/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster
   
 
'''You may wish to now <code>fcm commit</code> your suite changes. You can now re-open your suite.'''
 
'''You may wish to now <code>fcm commit</code> your suite changes. You can now re-open your suite.'''
  +
  +
When running your suite, if you get an error similar to:
  +
  +
[INFO] create: app/um/file
  +
[FAIL] file:app/um/file/STASHmaster=source=fcm:um.xm_br/dev/'''<span style="color:green">[your MOSRS userid]</span>'''/vn11.8_<span style="color:blue">your_branch_name</span>/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD: bad or missing value
  +
  +
you should try running '''mosrs-cache-password''' again to cache your MOSRS credentials.
   
 
===Initialise your new tracer(s)===
 
===Initialise your new tracer(s)===
Line 208: Line 212:
 
To add new fields, right click anywhere within the table and click '''Add new section'''. This will make a new entry with index '''1''', if you add another entry, it will be given index '''2''' etc.. Right-click on this and click on '''View namelist:items(''X'')''' (where '''''X''''' is the index number). This will open a new tab where you can select the STASH section and item for the field you want to initialise using the drop-down menus. Some UKCA tracers need to be given full 3D initial conditions in ancillary file format. However, for this example we will initialise the tracer to a small number, <math>1.000000 \times 10^{-15}</math>. To do this, select the radio button for '''Set to a specified constant value''' and put '''1.000000e-15''' in the dialog box labelled '''user_prog_rconst''' at the bottom of the panel.
 
To add new fields, right click anywhere within the table and click '''Add new section'''. This will make a new entry with index '''1''', if you add another entry, it will be given index '''2''' etc.. Right-click on this and click on '''View namelist:items(''X'')''' (where '''''X''''' is the index number). This will open a new tab where you can select the STASH section and item for the field you want to initialise using the drop-down menus. Some UKCA tracers need to be given full 3D initial conditions in ancillary file format. However, for this example we will initialise the tracer to a small number, <math>1.000000 \times 10^{-15}</math>. To do this, select the radio button for '''Set to a specified constant value''' and put '''1.000000e-15''' in the dialog box labelled '''user_prog_rconst''' at the bottom of the panel.
   
You will need to do this for each of the tracers you are adding (you can also ''clone'' existing entries). When you have finished, you will need to go to the '''STASH Requests''' panel (see the [[UKCA_Chemistry_and_Aerosol_vn11.8_Tutorial_3#STASH_Panel|STASH tutorial]]) and run the '''TidyStashTransform''' macro to correctly generate the required index value for each tracer initialisation.
+
You will need to do this for each of the tracers you are adding, and you can add multiple prognostics per entry. You can also ''clone'' existing entries to speed up the process. When you have finished, you will need to go to the '''STASH Requests''' panel (see the [[UKCA_Chemistry_and_Aerosol_vn11.8_Tutorial_3#STASH_Panel|STASH tutorial]]) and run the '''TidyStashTransform''' macro to correctly generate the required index value for each tracer initialisation.
   
 
===Output your new tracers===
 
===Output your new tracers===
Line 215: Line 219:
   
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
  +
  +
==Run your suite==
  +
  +
Now that you have made the required changes to Rose and in your branch, please run your suite. You may find that it fails on the <code>fcm_make</code>, <code>recon</code>, or <code>atmos</code> jobs. To find the errors and see output, you should either right-click the failed task in Gcylc and view the output, or go to the
  +
  +
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''
  +
  +
directory. Within this there are a number of directories. To see the log files, cd into
  +
  +
log/job/1/'''[JOB NAME]'''/NN
  +
  +
and view the job.err or job.out files. When the suite successfully runs, the fieldsfile output can be found in
  +
  +
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''/work/1/atmos/
  +
  +
=== Viewing output in Xconv ===
  +
  +
If you open the '''.pa''' file in Xconv, you should now see the following if you have outputted both the section 34 and section 51 fields:
  +
  +
4 : 96 72 27 1 Stash code = 51498
  +
5 : 96 72 27 1 Stash code = 51499
  +
  +
11 : 96 72 38 1 Stash code = 34498
  +
12 : 96 72 38 1 Stash code = 34499
  +
  +
'''Note here that these fields are not named <tt>ALICE</tt> and <tt>BOB</tt>, or however you have described them in your STASHmaster_A file.''' They are instead labelled by the unique STASH code identifier that you have defined for them. This is working as expected.
  +
  +
It is possible (although not necessary) to tell Xconv to read the STASHmaster_A file from your branch. To do this, in Xconv go to '''Setup <math>\rightarrow</math> Select STASH Master Files''' and then navigate to the location of the file in your branch's working copy in the left-hand side of the panel. When you have located it, highlight it and click '''Add'''. Then click '''Apply''', '''Save''', and '''Dismiss'''. Now Xconv will list the names of your species as you have called them in your STASHmaster_A file.
  +
  +
===Numerical Noise===
  +
  +
<gallery widths=300px heights=300px>
  +
Image:UMvn11.8_ALICE_noise.png|Numerical noise in the ALICE tracer (s34i498)
  +
Image:UMvn11.8_BOB_noise.png|Numerical noise in the BOB tracer (s34i499)
  +
</gallery>
  +
  +
When your suite has run successfully, and you view the fields for your new tracer(s) in Xconv, you may find that they have a speckled appearance, rather than being constant. This is due to numerical noise that has been introduced as the tracers go through the UM timesteps. Once the field is converted to 32-bit this should disappear. It will also cease to become apparent when emissions and reactions are applied to these tracers.
  +
  +
==Solution to Task4.1==
  +
  +
You were given the task:
  +
  +
* ''Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called '''ALICE''' and the tracer in slot 499 will be called '''BOB'''. You should initialise these tracers to <code>1.000000e-15</code>. You should also output these two tracers through the '''UPA''' stream in STASH as 3-hour means. Do not make any UKCA code changes at this stage.''
  +
  +
For a working Rose suite that has completed this task, please see
  +
* '''vm:''' <code>u-ca024@181051</code>
  +
  +
The specific Rose changes made are:
  +
  +
* '''vm:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/181051/c/a/0/2/4/trunk
  +
  +
'''vm:'''
  +
Index: app/um/rose-app.conf
  +
===================================================================
  +
--- app/um/rose-app.conf (revision 180902)
  +
+++ app/um/rose-app.conf (revision 181051)
  +
@@ -1,4 +1,4 @@
  +
-meta=um-atmos/vn11.8
  +
+meta=/home/vagrant/src/vn11.8_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD
  +
  +
[command]
  +
default=um-atmos
  +
@@ -27,6 +27,7 @@
  +
RECON_STDOUT_FILE=pe_output/atmos.fort6.pe
  +
RUNID=atmos
  +
SPECTRAL_FILE_DIR=$UMDIR/vn$VN/ctldata/spectral/ga7
  +
+STASHMASTER=STASHmaster
  +
UM_THREAD_LEVEL=MULTIPLE
  +
  +
[file:$DATAM]
  +
@@ -893,6 +894,19 @@
  +
!!user_prog_ancil_stash_req=
  +
!!user_prog_rconst=0.0
  +
  +
+[namelist:items(e897a2fb)]
  +
+ancilfilename=''
  +
+domain=1
  +
+!!interval=0
  +
+l_ignore_ancil_grid_check=
  +
+!!netcdf_varname=''
  +
+!!period=1
  +
+source=6
  +
+stash_req=34498,34499
  +
+update_anc=.false.
  +
+!!user_prog_ancil_stash_req=0
  +
+user_prog_rconst=1.000000e-15
  +
+
  +
[namelist:items(e8e484ca)]
  +
ancilfilename=''
  +
domain=1
  +
@@ -3658,6 +3672,22 @@
  +
tim_name='T3HMN'
  +
use_name='UPA'
  +
  +
+[namelist:umstash_streq(34498_e7e57cc6)]
  +
+dom_name='DALLTH'
  +
+isec=34
  +
+item=498
  +
+package=''
  +
+tim_name='T3HMN'
  +
+use_name='UPA'
  +
+
  +
+[namelist:umstash_streq(34499_07c8a074)]
  +
+dom_name='DALLTH'
  +
+isec=34
  +
+item=499
  +
+package=''
  +
+tim_name='T3HMN'
  +
+use_name='UPA'
  +
+
  +
[namelist:umstash_streq(34968_49e5e12c)]
  +
dom_name='DALLTH'
  +
isec=34
  +
@@ -3770,6 +3800,22 @@
  +
tim_name='T3HMN'
  +
use_name='UPA'
  +
  +
+[namelist:umstash_streq(51498_ccb8d5a7)]
  +
+dom_name='DP27CCM'
  +
+isec=51
  +
+item=498
  +
+package=''
  +
+tim_name='T3HMN'
  +
+use_name='UPA'
  +
+
  +
+[namelist:umstash_streq(51499_5c041195)]
  +
+dom_name='DP27CCM'
  +
+isec=51
  +
+item=499
  +
+package=''
  +
+tim_name='T3HMN'
  +
+use_name='UPA'
  +
+
  +
[namelist:umstash_streq(51999_8b73e62f)]
  +
dom_name='DP27CCM'
  +
isec=51
  +
Index: app/fcm_make/rose-app.conf
  +
===================================================================
  +
--- app/fcm_make/rose-app.conf (revision 180902)
  +
+++ app/fcm_make/rose-app.conf (revision 181051)
  +
@@ -43,4 +43,4 @@
  +
thread_utils=false
  +
timer_version=3A
  +
um_rev=$BASE_UM_REV
  +
-um_sources=
  +
+um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@93557
  +
Index: rose-suite.conf
  +
===================================================================
  +
--- rose-suite.conf (revision 180902)
  +
+++ rose-suite.conf (revision 181051)
  +
@@ -1,3 +1,6 @@
  +
+[file:app/um/file/STASHmaster]
  +
+source=fcm:um.xm_br/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
  +
+
  +
[jinja2:suite.rc]
  +
BUILD=true
  +
OFFLINE=false
  +
  +
These ARCHER differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task04.1/Task04.1_rose.patch</code>'''.
  +
  +
The specific UM changes made are:
  +
* https://code.metoffice.gov.uk/trac/um/changeset/93557/main/branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns
  +
  +
Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf
  +
===================================================================
  +
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 93540)
  +
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 93557)
  +
@@ -19390,6 +19390,14 @@
  +
help=Coarse Mode (Soluble) Sodium Nitrate Aerosol Mass Mixing
  +
=Ratio in kg/kg(Air)
  +
  +
+[stashmaster:code(34498)]
  +
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
  +
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
  +
+
  +
+[stashmaster:code(34499)]
  +
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
  +
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
  +
+
  +
[stashmaster:code(34866)]
  +
description=NH4 PARTIAL VOLUME CONC (AIT-SOL)
  +
help=Component partial volume of ammonium for the Aitken
  +
@@ -27596,6 +27604,16 @@
  +
=Mass Mixing Ratio
  +
=in kg/kg(Air) on pressure levels
  +
  +
+[stashmaster:code(51498)]
  +
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
  +
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
  +
+ =on pressure levels
  +
+
  +
+[stashmaster:code(51499)]
  +
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
  +
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
  +
+ =on pressure levels
  +
+
  +
[stashmaster:code(51872)]
  +
description=RTX22O2 MASS MIX RATIO ON PRESS LEVS
  +
help=Peroxy radicals from BPINENE oxidation with 17 C-H
  +
Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A
  +
===================================================================
  +
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 93540)
  +
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 93557)
  +
@@ -18682,6 +18682,18 @@
  +
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
  +
5| 0 | 2351 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
  +
#
  +
+1| 1 | 34 | 498 |ALICE MASS MIXING RATIO AFTER TSTEP |
  +
+2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
  +
+3| 000000000000000000000000010000 | 00000000000000000001 | 1 |
  +
+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 | 34 | 499 |BOB MASS MIXING RATIO AFTER TSTEP |
  +
+2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
  +
+3| 000000000000000000000000010000 | 00000000000000000001 | 1 |
  +
+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 | 34 | 866 |NH4 PARTIAL VOLUME CONC (AIT-SOL) |
  +
2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
  +
3| 100000000000000000005000000000 | 00000000000000000001 | 3 |
  +
@@ -29005,6 +29017,18 @@
  +
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
  +
5| 0 | 2252 | 0 | 8 | 0 | 0 | 0 | 0 | 0 |
  +
#
  +
+1| 1 | 51 | 498 |ALICE MMR ON PRESSURE LEVELS |
  +
+2| 0 | 0 | 1 | 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 | 51 | 499 |BOB MMR ON PRESSURE LEVELS |
  +
+2| 0 | 0 | 1 | 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 | 51 | 872 |RTX22O2 MASS MIX RATIO ON PRESS LEVS|
  +
2| 0 | 0 | 1 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 |
  +
3| 000000000000000000800000000000 | 00000000000000000001 | 3 |
  +
  +
  +
These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task04.1/Task04.1_code.patch</code>'''.
  +
  +
If you open the '''.pa''' file in Xconv, you should see the following fields:
  +
  +
4 : 96 72 27 1 Stash code = 51498
  +
5 : 96 72 27 1 Stash code = 51499
  +
  +
11 : 96 72 38 1 Stash code = 34498
  +
12 : 96 72 38 1 Stash code = 34499
  +
  +
  +
Sample output from this task can be found at '''<code>Tutorials/vn11.8/sample_output/Task04.1/atmosa.pa19810901_00</code>'''.
   
 
==Task 4.2: Add new tracers into UKCA==
 
==Task 4.2: Add new tracers into UKCA==
Line 221: Line 480:
   
 
==Required UKCA Code Changes==
 
==Required UKCA Code Changes==
  +
  +
Note that at some older UKCA versions it was necessary to make the UKCA changes in parallel with the UM-side changes covered above.
   
 
===<code>ukca_nmspec_mod.F90</code>===
 
===<code>ukca_nmspec_mod.F90</code>===
Line 335: Line 596:
 
When adding new tracers you should not overwrite tracers that are already in use by the chemistry scheme that you are using (e.g. StratTrop etc.), and it is best to also take care and avoid tracers in use by other schemes, if possible. You can see the tracers used by each scheme by looking in the <code>chch_defs</code> array at the top of the <code>ukca_chem_master.F90</code> module.
 
When adding new tracers you should not overwrite tracers that are already in use by the chemistry scheme that you are using (e.g. StratTrop etc.), and it is best to also take care and avoid tracers in use by other schemes, if possible. You can see the tracers used by each scheme by looking in the <code>chch_defs</code> array at the top of the <code>ukca_chem_master.F90</code> module.
   
Here you should put a new species, <tt>'ALICE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</tt>, into tracer slot 498 (currently specified as <code>'XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</code>, which means that it is empty and is not in use by any scheme at the moment).
+
Here you should put a new species, <tt>'ALICE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</tt>, into tracer slot 498 (currently specified as <tt>'XXX&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'</tt>, which means that it is empty and is not in use by any scheme at the moment).
   
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i498.</span>
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i498.</span>
Line 341: Line 602:
 
===<code>ukca_chem_master.F90</code>===
 
===<code>ukca_chem_master.F90</code>===
   
We will go through changes that need to be made for the StratTrop chemistry scheme (defined in the file '''<code>ukca_chem_master.F90</code>''', using the code '''<code>ST</code>'''), but equivalent changes would need to be made for others, e.g. TropIsop or Strat. For this example we will only refer to this scheme.
+
We will go through changes that need to be made for the StratTrop chemistry scheme (defined in the file '''<code>ukca_chem_master.F90</code>''', using the code '''<code>st</code>'''), but equivalent changes would need to be made for others, e.g. TropIsop or Strat. For this example we will only refer to this scheme.
   
 
In this file the list of species used in chemistry is defined by the array '''<code>chch_defs_master</code>'''. The list of species is held in a ''derived type'', of the format:
 
In this file the list of species used in chemistry is defined by the array '''<code>chch_defs_master</code>'''. The list of species is held in a ''derived type'', of the format:
Line 362: Line 623:
 
* '''<code>W</code>''' is '''1''' if the species is wet-deposited, and '''0''' otherwise.
 
* '''<code>W</code>''' is '''1''' if the species is wet-deposited, and '''0''' otherwise.
 
* '''<code><span style="color:red">SCHEME</span></code>''' defines the chemistry scheme used, e.g.:
 
* '''<code><span style="color:red">SCHEME</span></code>''' defines the chemistry scheme used, e.g.:
*: ST = Stratosphere-Troposphere scheme
+
*: <code>st</code> = Stratosphere-Troposphere scheme
*: T = Troposphere scheme
+
*: <code>t</code> = Troposphere scheme
*: S = Stratosphere scheme
+
*: <code>s</code> = Stratosphere scheme
*: R = RAQ scheme
+
*: <code>r</code> = RAQ scheme
*: OL = Offline-oxidants scheme
+
*: <code>ol</code> = Offline-oxidants scheme
*: TI = Troposphere-Isoprene scheme
+
*: <code>ti</code> = Troposphere-Isoprene scheme
  +
*: <code>cs</code> = CRI-Strat scheme
** If the same species is used in multiple schemes these are added, e.g. <code>ST+S+TI</code> etc.
 
  +
** If the same species is used in multiple schemes these are added, e.g. <code>st+s+ti+cs</code> etc.
 
* '''<code><span style="color:green">QUALIFIER</span></code>''' (and '''<code><span style="color:blue">DISQUALIFIER</span></code>''') defines lines to add (or remove) on top of the base chemistry scheme depending on if certain additional options have been chosen, e.g.
 
* '''<code><span style="color:green">QUALIFIER</span></code>''' (and '''<code><span style="color:blue">DISQUALIFIER</span></code>''') defines lines to add (or remove) on top of the base chemistry scheme depending on if certain additional options have been chosen, e.g.
 
*: 0 = no qualifier/disqualifer used
 
*: 0 = no qualifier/disqualifer used
*: A = Aerosol chemistry additions required to run GLOMAP-mode
+
*: <code>a</code> = Aerosol chemistry additions required to run GLOMAP-mode
*: TH = Tropospheric heterogeneous reactions
+
*: <code>th</code> = Tropospheric heterogeneous reactions
*: HP = Heterogeneous PSC chemistry
+
*: <code>hp</code> = Heterogeneous PSC chemistry
*: ES = Extended stratospheric reactions
+
*: <code>es</code> = Extended stratospheric reactions
  +
*: <code>rn</code> = RO2 a non-transported prognostic (StratTrop chemistry only)
** As with the '''<code><span style="color:red">SCHEME</span></code>''' codes, these are also additive if required, e.g. <code>A+TH</code> etc.
 
  +
*: <code>rp</code> = RO2 permutation chemistry (StratTrop chemistry only)
* '''<code>VN</code>''' gives the model version the addition is added at. This is future functionality that will allow for multiple rates to be included in the source-code. '''This is currently not used, so please set to <code>107</code>.'''
 
  +
** As with the '''<code><span style="color:red">SCHEME</span></code>''' codes, these are also additive if required, e.g. <code>a+th</code> etc.
  +
* '''<code>VN</code>''' gives the model version the addition is added at. This is future functionality that will allow for multiple rates to be included in the source-code. '''The currently used version is <code>111</code>, so please continue to use this for this Tutorial.'''
   
 
Therefore to add-in the ALICE species, we should insert a line similar to this one
 
Therefore to add-in the ALICE species, we should insert a line similar to this one
   
chch_t1(116,'ALICE ',1,'TR ',' ',0,0,ST,0,0,111),&
+
chch_t1(272,'ALICE ',1,'TR ',' ',0,0,st,0,0,111), &
   
 
into '''<code>chch_defs_master</code>''', remembering to also '''increment the size of this array, given by <code>n_chch_master</code>'''
 
into '''<code>chch_defs_master</code>''', remembering to also '''increment the size of this array, given by <code>n_chch_master</code>'''
Line 386: Line 650:
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
   
===<code>ukca_setd1defs.F90</code>===
+
===<code>ukca_config_defs_mod.F90</code>===
   
In '''<code>ukca_setd1defs.F90</code>''' you will find code blocks which set values for various parameters depending on the scheme used. In this example you will need to scroll down to the section which defines the '''StratTrop''' (also known as ''CheST'') chemistry, which is located in the ''Stratospheric Chemistry'' section and is referenced by using the '''<code>L_ukca_strattrop</code>''' logical.
+
In '''<code>ukca_config_defs_mod.F90</code>''' you will find code blocks which set values for various parameters depending on the scheme used. In this example you will need to scroll down to the section which defines the '''StratTrop''' (also known as ''CheST'') chemistry, which is located in the ''Stratospheric Chemistry'' section and is referenced by using the '''<code>ukca_config%l_ukca_strattrop</code>''' logical.
   
The IF block tests against <code>L_ukca_strattrop</code> and <code>L_ukca_achem</code> (which determines whether or not you require the additional chemistry used to drive the GLOMAP-mode aerosol scheme). You should increment the value of '''<code>n_chem_tracers</code>''' by the number of chemical tracers that you are adding in '''both''' sections of the IF block, as this tracer is not defined to be for aerosol chemistry only. If your additional tracers are aerosol chemistry additions then you should increment the value of '''<code>n_aero_tracers</code>'''.
+
The IF block tests against <code>ukca_config%l_ukca_strattrop</code> and <code>ukca_config%l_ukca_achem</code> (which determines whether or not you require the additional chemistry used to drive the GLOMAP-mode aerosol scheme). You should increment the value of '''<code>n_chem_tracers</code>''' by the number of chemical tracers that you are adding in '''both''' sections of the IF block, as this tracer is not defined to be for aerosol chemistry only. If your additional tracers are aerosol chemistry additions then you should increment the value of '''<code>n_aero_tracers</code>'''.
   
 
If you are adding to a different chemistry scheme then you will need to make these changes accordingly.
 
If you are adding to a different chemistry scheme then you will need to make these changes accordingly.
Line 418: Line 682:
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
 
<span style="color:green">'''Remember:''' You need to add '''2''' tracers, ALICE in s34i498 and BOB in s34i499.</span>
   
==Run your suite==
+
==Run your suite again==
   
Now that you have made the required changes to Rose and in your branch, please run your suite. You may find that it fails on the, <code>fcm_make2</code>, <code>recon</code>, or <code>atmos</code> jobs. To find the errors and see output, you should either right-click the failed task in Gcylc and view the output, or go to the
+
Now that you have made the required changes to Rose and in your branch, please run your suite again. You may find that it fails on the <code>fcm_make</code>, <code>recon</code>, or <code>atmos</code> jobs. To find the errors and see output, you should either right-click the failed task in Gcylc and view the output, or go to the
   
 
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''
 
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''
Line 432: Line 696:
 
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''/work/1/atmos/
 
/home/'''[your VM userid]'''/cylc-run/'''[SUITE-ID]'''/work/1/atmos/
   
  +
==Solution to Task 4.2==
===Numerical Noise===
 
 
<gallery widths=300px heights=300px>
 
Image:Vn10.9_s34i064_noise.png|Numerical noise in the ALICE tracer (s34i064)
 
Image:Vn10.9_s34i065_noise.png|Numerical noise in the BOB tracer (s34i065)
 
</gallery>
 
 
When your suite has run successfully, and you view the fields for your new tracer(s) in Xconv, you may find that they have a speckled appearance, rather than being constant. This is due to numerical noise that has been introduced as the tracers go through the UM timesteps. Once the field is converted to 32-bit this should disappear. It will also cease to become apparent when emissions and reactions are applied to these tracers.
 
 
==Solution to Task 4.1==
 
   
 
You were given the task
 
You were given the task
   
* ''Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called '''ALICE''' and the tracer in slot 499 will be called '''BOB''' and initialise these tracers to <code>1.000000e-15</code>. You should also output these two tracers through the '''UPA''' stream in STASH as 3-hour means. In UKCA, you should set the conversion factor for each of these to 1.0.''
+
* ''In UKCA, make the code changes required to include these species, ALICE and BOB, into the StratTrop chemical mechanism. You should set the conversion factor for each of these to 1.0. In the <code>nm_spec</code> array you should put these into slots 498 for ALICE and 499 for BOB.''
   
 
For a working Rose suite that has completed this task, please see
 
For a working Rose suite that has completed this task, please see
* '''ARCHER:''' <code>u-as292@59818</code>
+
* '''vm:''' <code>u-ca024@181072</code>
* '''vm:''' <code>u-as297@59815</code>
 
   
 
The specific Rose changes made are:
 
The specific Rose changes made are:
   
* '''ARCHER:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/59818/a/s/2/9/2/trunk
+
* '''vm:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/181072/c/a/0/2/1/trunk
* '''vm:''' https://code.metoffice.gov.uk/trac/roses-u/changeset/59815/a/s/2/9/7/trunk
 
   
'''ARCHER:'''
 
Index: app/um/rose-app.conf
 
===================================================================
 
--- app/um/rose-app.conf (revision 59777)
 
+++ app/um/rose-app.conf (revision 59818)
 
@@ -1,4 +1,4 @@
 
-meta=um-atmos/vn10.9
 
+meta=um-atmos/HEAD
 
 
[command]
 
default=um-atmos
 
@@ -24,6 +24,7 @@
 
RECON_KEEP_MPP_STDOUT=true
 
RUNID=atmos
 
SPECTRAL_FILE_DIR=$UM_INSTALL_DIR/vn$VN/ctldata/spectral/ga7
 
+STASHMASTER=STASHmaster
 
 
[file:$DATAM]
 
mode=mkdir
 
@@ -644,6 +645,18 @@
 
!!user_prog_ancil_stash_req=0
 
!!user_prog_rconst=0
 
 
+[namelist:items(3e9a6939)]
 
+ancilfilename=''
 
+domain=1
 
+!!interval=0
 
+!!netcdf_varname=''
 
+!!period=1
 
+source=6
 
+stash_req=34064
 
+update_anc=.false.
 
+!!user_prog_ancil_stash_req=0
 
+user_prog_rconst=1.000000e-12
 
+
 
[namelist:items(4a4f86c3)]
 
ancilfilename='$UM_INSTALL_DIR/ancil/atmos/n48e/orca1/seaice/reynolds/1981_2012_360/v1/qrclim.seaice'
 
domain=1
 
@@ -728,6 +741,18 @@
 
!!user_prog_ancil_stash_req=
 
user_prog_rconst=1.000000e-12
 
 
+[namelist:items(c3e3b7ad)]
 
+ancilfilename=''
 
+domain=1
 
+!!interval=0
 
+!!netcdf_varname=''
 
+!!period=1
 
+source=6
 
+stash_req=34065
 
+update_anc=.false.
 
+!!user_prog_ancil_stash_req=0
 
+user_prog_rconst=1.000000e-12
 
+
 
[namelist:items(c54d9b29)]
 
ancilfilename='$UM_INSTALL_DIR/ancil/atmos/n48e/orca1/land_sea_mask/etop01/v1/qrparm.mask'
 
domain=1
 
@@ -3295,6 +3320,22 @@
 
tim_name='T3HMN'
 
use_name='UPA'
 
 
+[namelist:umstash_streq(34064_487e535d)]
 
+dom_name='DALLTH'
 
+isec=34
 
+item=64
 
+package=''
 
+tim_name='T3HMN'
 
+use_name='UPA'
 
+
 
+[namelist:umstash_streq(34065_6dc07351)]
 
+dom_name='DALLTH'
 
+isec=34
 
+item=65
 
+package=''
 
+tim_name='T3HMN'
 
+use_name='UPA'
 
+
 
[namelist:umstash_streq(34106_ebb7bb67)]
 
dom_name='DALLTH'
 
isec=34
 
Index: app/fcm_make/rose-app.conf
 
===================================================================
 
--- app/fcm_make/rose-app.conf (revision 59777)
 
+++ app/fcm_make/rose-app.conf (revision 59818)
 
@@ -42,4 +42,4 @@
 
stash_version=1A
 
timer_version=3A
 
um_rev=vn10.9
 
-um_sources=
 
+um_sources=branches/dev/lukeabraham/vn10.9_UKCA_Tutorial_Solns@46535
 
Index: rose-suite.conf
 
===================================================================
 
--- rose-suite.conf (revision 59777)
 
+++ rose-suite.conf (revision 59818)
 
@@ -1,3 +1,6 @@
 
+[file:app/um/file/STASHmaster]
 
+source=fcm:um.xm_br/dev/lukeabraham/vn10.9_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
 
+
 
[jinja2:suite.rc]
 
ARCHER_GROUP='n02-chem'
 
ARCHER_QUEUE='short'
 
 
'''vm:'''
 
'''vm:'''
Index: app/um/rose-app.conf
 
===================================================================
 
--- app/um/rose-app.conf (revision 59775)
 
+++ app/um/rose-app.conf (revision 59815)
 
@@ -1,4 +1,4 @@
 
-meta=um-atmos/vn10.9
 
+meta=um-atmos/HEAD
 
 
[command]
 
default=um-atmos
 
@@ -26,6 +26,7 @@
 
RECON_STDOUT_FILE=pe_output/atmos.fort6.pe
 
RUNID=atmos
 
SPECTRAL_FILE_DIR=$UMDIR/vn$VN/ctldata/spectral/ga7
 
+STASHMASTER=STASHmaster
 
UM_THREAD_LEVEL=MULTIPLE
 
 
[file:$DATAM]
 
@@ -647,6 +648,18 @@
 
!!user_prog_ancil_stash_req=0
 
!!user_prog_rconst=0
 
 
+[namelist:items(3e9a6939)]
 
+ancilfilename=''
 
+domain=1
 
+!!interval=0
 
+!!netcdf_varname=''
 
+!!period=1
 
+source=6
 
+stash_req=34064
 
+update_anc=.false.
 
+!!user_prog_ancil_stash_req=0
 
+user_prog_rconst=1.000000e-12
 
+
 
[namelist:items(4a4f86c3)]
 
ancilfilename='$UMDIR/ancil/atmos/n48e/orca1/seaice/reynolds/1981_2012_360/v1/qrclim.seaice'
 
domain=1
 
@@ -731,6 +744,18 @@
 
!!user_prog_ancil_stash_req=
 
user_prog_rconst=1.000000e-12
 
 
+[namelist:items(c3e3b7ad)]
 
+ancilfilename=''
 
+domain=1
 
+!!interval=0
 
+!!netcdf_varname=''
 
+!!period=1
 
+source=6
 
+stash_req=34065
 
+update_anc=.false.
 
+!!user_prog_ancil_stash_req=0
 
+user_prog_rconst=1.000000e-12
 
+
 
[namelist:items(c54d9b29)]
 
ancilfilename='$UMDIR/ancil/atmos/n48e/orca1/land_sea_mask/etop01/v1/qrparm.mask'
 
domain=1
 
@@ -3887,6 +3912,22 @@
 
tim_name='T3HMN'
 
use_name='UPA'
 
 
+[namelist:umstash_streq(34064_487e535d)]
 
+dom_name='DALLTH'
 
+isec=34
 
+item=64
 
+package=''
 
+tim_name='T3HMN'
 
+use_name='UPA'
 
+
 
+[namelist:umstash_streq(34065_6dc07351)]
 
+dom_name='DALLTH'
 
+isec=34
 
+item=65
 
+package=''
 
+tim_name='T3HMN'
 
+use_name='UPA'
 
+
 
[namelist:umstash_streq(34106_ebb7bb67)]
 
dom_name='DALLTH'
 
isec=34
 
 
Index: app/fcm_make/rose-app.conf
 
Index: app/fcm_make/rose-app.conf
 
===================================================================
 
===================================================================
--- app/fcm_make/rose-app.conf (revision 59775)
+
--- app/fcm_make/rose-app.conf (revision 181051)
+++ app/fcm_make/rose-app.conf (revision 59815)
+
+++ app/fcm_make/rose-app.conf (revision 181072)
@@ -42,4 +42,4 @@
+
@@ -43,4 +43,4 @@
  +
thread_utils=false
stash_version=1A
 
 
timer_version=3A
 
timer_version=3A
um_rev=vn10.9
+
um_rev=$BASE_UM_REV
  +
-um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@93557
-um_sources=
 
+um_sources=branches/dev/lukeabraham/vn10.9_UKCA_Tutorial_Solns@46535
+
+um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@93589
Index: rose-suite.conf
 
===================================================================
 
--- rose-suite.conf (revision 59775)
 
+++ rose-suite.conf (revision 59815)
 
@@ -1,3 +1,6 @@
 
+[file:app/um/file/STASHmaster]
 
+source=fcm:um.xm_br/dev/lukeabraham/vn10.9_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
 
+
 
[jinja2:suite.rc]
 
BUILD=true
 
OFFLINE=false
 
   
These ARCHER differences can be found in the file '''<code>/home/ukca/Tutorial/vn10.9/worked_solutions/Task4.1/Task4.1_rose.patch</code>''' on PUMA.
+
These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task04.2/Task04.2_rose.patch</code>'''.
   
 
The specific UM changes made are:
 
The specific UM changes made are:
  +
* https://code.metoffice.gov.uk/trac/um/changeset/93589/main/branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns
   
Index: src/atmosphere/UKCA/ukca_setd1defs.F90
 
===================================================================
 
--- src/atmosphere/UKCA/ukca_setd1defs.F90 (revision 46527)
 
+++ src/atmosphere/UKCA/ukca_setd1defs.F90 (revision 46535)
 
@@ -321,7 +321,7 @@
 
(/'NO ','CH4 ','CO ','HCHO ', &
 
'C2H6 ','C3H8 ','Me2CO ','MeCHO ', &
 
'C5H8 ','NO_aircrft'/)
 
- n_chem_tracers = 71 ! No chem tracers
 
+ n_chem_tracers = 73 ! No chem tracers
 
nr_therm = 220 ! thermal reactions
 
nr_phot = 55 ! photolytic (ATA)
 
 
@@ -337,7 +337,7 @@
 
'SO2_high ','NH3 ','DMS ','SO2_nat ', &
 
'BC_biomass','OC_biomass','NO_aircrft'/)
 
n_aero_tracers = 12
 
- n_chem_tracers = 71 ! No chem tracers
 
+ n_chem_tracers = 73 ! No chem tracers
 
IF (L_ukca_trophet) THEN
 
nr_therm = 241 ! thermal reactions
 
ELSE
 
 
Index: src/atmosphere/UKCA/ukca_chem_master.F90
 
Index: src/atmosphere/UKCA/ukca_chem_master.F90
 
===================================================================
 
===================================================================
--- src/atmosphere/UKCA/ukca_chem_master.F90 (revision 46527)
+
--- src/atmosphere/UKCA/ukca_chem_master.F90 (revision 93557)
+++ src/atmosphere/UKCA/ukca_chem_master.F90 (revision 46535)
+
+++ src/atmosphere/UKCA/ukca_chem_master.F90 (revision 93589)
@@ -79,7 +79,7 @@
+
@@ -94,7 +94,7 @@
! define below the chemistry schemes
+
INTEGER, PARAMETER :: rp = 128 ! RO2-Permutation chemistry (ST only)
 
 
! define size of master chemistry
+
! Define size of master chemistry
-INTEGER, PARAMETER :: n_chch_master = 148 ! number of known species
+
-INTEGER, PARAMETER :: n_chch_master = 327 ! number of known species
+INTEGER, PARAMETER :: n_chch_master = 150 ! number of known species
+
+INTEGER, PARAMETER :: n_chch_master = 329 ! number of known species
INTEGER, PARAMETER :: n_het_master = 10 ! number of heterogeneous reactions
+
INTEGER, PARAMETER :: n_het_master = 18 ! number of heterogeneous reactions
INTEGER, PARAMETER :: n_dry_master = 57 ! number of dry deposition reactions
+
INTEGER, PARAMETER :: n_dry_master = 149 ! number of dry deposition reactions
INTEGER, PARAMETER :: n_wet_master = 49 ! number of wet deposition reactions
+
INTEGER, PARAMETER :: n_wet_master = 106 ! number of wet deposition reactions
@@ -376,7 +376,9 @@
+
@@ -843,7 +843,11 @@
  +
! 270 DD:140,WD: 96,
chch_t1(112,'TOLP1 ',1,'SS ',' ',0,0,0,R,0,0,107),&
 
chch_t1(113,'MEMALD ',1,'TR ',' ',0,0,0,R,0,0,107),&
+
chch_t1(270,'ARNOH17 ',1,'TR ',' ',1,1,cs,0,0,107), &
  +
! 271 DD:141, ANHY ~ MALANHY (327)
chch_t1(114,'GLY ',1,'TR ',' ',0,1,0,R,0,0,107),&
 
-chch_t1(115,'oXYLENE ',1,'TR ',' ',0,0,1,R,0,0,107)/)
+
-chch_t1(271,'ANHY ',1,'TR ',' ',1,0,cs,0,0,107) &
+chch_t1(115,'oXYLENE ',1,'TR ',' ',0,0,1,R,0,0,107),&
+
+chch_t1(271,'ANHY ',1,'TR ',' ',1,0,cs,0,0,107), &
  +
+! 272
+chch_t1(116,'ALICE ',1,'TR ',' ',0,0,0,ST,0,0,107),&
 
+chch_t1(117,'BOB ',1,'TR ',' ',0,0,0,ST,0,0,107)/)
+
+chch_t1(272,'ALICE ',1,'TR ',' ',0,0,st,0,0,111), &
  +
+! 273
  +
+chch_t1(273,'BOB ',1,'TR ',' ',0,0,st,0,0,111) &
  +
/)
 
 
  +
! ----------------------------------------------------------------------
! Heterogeneous chemistry
 
! Columns take the following meanings:
 
 
Index: src/atmosphere/UKCA/ukca_constants.F90
 
Index: src/atmosphere/UKCA/ukca_constants.F90
 
===================================================================
 
===================================================================
--- src/atmosphere/UKCA/ukca_constants.F90 (revision 46527)
+
--- src/atmosphere/UKCA/ukca_constants.F90 (revision 93557)
+++ src/atmosphere/UKCA/ukca_constants.F90 (revision 46535)
+
+++ src/atmosphere/UKCA/ukca_constants.F90 (revision 93589)
@@ -272,6 +272,10 @@
+
@@ -343,6 +343,10 @@
REAL, PARAMETER :: c_isosvoc2 = 2.3473 ! as C5H8
+
! Same as Sec_org
REAL, PARAMETER :: c_isosoa = 4.4874 ! 130.0
+
REAL, PARAMETER :: c_cri = 5.1782
 
 
+! UKCA Tutorial Tracers:
+
+! Additions for UKCA Tutorial
+REAL, PARAMETER :: c_ALICE = 1.0000
+
+REAL, PARAMETER :: C_ALICE = 1.0000
+REAL, PARAMETER :: c_BOB = 1.0000
+
+REAL, PARAMETER :: C_BOB = 1.0000
 
+
 
+
 
! molecular masses in g/mol of emitted species,
 
! molecular masses in g/mol of emitted species,
 
! for budget calculations
 
! for budget calculations
 
REAL, PARAMETER :: m_ho2 = 33.007
 
REAL, PARAMETER :: m_ho2 = 33.007
  +
Index: src/atmosphere/UKCA/ukca_config_defs_mod.F90
  +
===================================================================
  +
--- src/atmosphere/UKCA/ukca_config_defs_mod.F90 (revision 93557)
  +
+++ src/atmosphere/UKCA/ukca_config_defs_mod.F90 (revision 93589)
  +
@@ -315,7 +315,7 @@
  +
(/'NO ','CH4 ','CO ','HCHO ', &
  +
'C2H6 ','C3H8 ','Me2CO ','MeCHO ', &
  +
'C5H8 ', nm_meoh_em ,'NO_aircrft'/)
  +
- n_chem_tracers = 71 ! No chem tracers
  +
+ n_chem_tracers = 73 ! No chem tracers
  +
nr_therm = 220 ! thermal reactions
  +
nr_phot = 55 ! photolytic (ATA)
  +
  +
@@ -331,7 +331,7 @@
  +
'SO2_high ','NH3 ','DMS ','SO2_nat ', &
  +
'BC_biomass','OC_biomass','NO_aircrft'/)
  +
n_aero_tracers = 12
  +
- n_chem_tracers = 71 ! No chem tracers
  +
+ n_chem_tracers = 73 ! No chem tracers
  +
IF (ukca_config%l_ukca_trophet) THEN
  +
nr_therm = 241 ! thermal reactions
  +
ELSE
 
Index: src/atmosphere/UKCA/ukca_nmspec_mod.F90
 
Index: src/atmosphere/UKCA/ukca_nmspec_mod.F90
 
===================================================================
 
===================================================================
--- src/atmosphere/UKCA/ukca_nmspec_mod.F90 (revision 46527)
+
--- src/atmosphere/UKCA/ukca_nmspec_mod.F90 (revision 93557)
+++ src/atmosphere/UKCA/ukca_nmspec_mod.F90 (revision 46535)
+
+++ src/atmosphere/UKCA/ukca_nmspec_mod.F90 (revision 93589)
@@ -86,7 +86,7 @@
+
@@ -172,7 +172,7 @@
'BrO ','BrCl ','BrONO2 ','N2O ','HCl ', & !50
+
'XXX ','XXX ','XXX ','XXX ','XXX ', & !485
'HOCl ','HBr ','HOBr ','ClONO2 ','CFCl3 ', &
+
'XXX ','XXX ','XXX ','XXX ','XXX ', & !490
'CF2Cl2 ','MeBr ','N ','O(3P) ','MACRO2 ', & !60
+
'XXX ','XXX ','XXX ','XXX ','XXX ', & !495
-'MeCl ','CF2ClBr ','CCl4 ','CF2ClCFCl2','CHF2Cl ', &
+
-'XXX ','XXX ','XXX ','XXX ' & !499
+'MeCl ','CF2ClBr ','CCl4 ','ALICE ','BOB ', &
+
+'XXX ','XXX ','ALICE ','BOB ' & !499
  +
/)
'MeCCl3 ','CF3Br ','H2OS ','CH2Br2 ','H2 ', & !70
 
  +
'DMS ','SO2 ','H2SO4 ','MSA ','DMSO ', &
 
  +
IF (l_ukca_raq .OR. l_ukca_raqaero) THEN
'NH3 ','CS2 ','COS ','H2S ','H ', & !80
 
 
Index: src/atmosphere/UKCA/ukca_cspecies.F90
 
Index: src/atmosphere/UKCA/ukca_cspecies.F90
 
===================================================================
 
===================================================================
--- src/atmosphere/UKCA/ukca_cspecies.F90 (revision 46527)
+
--- src/atmosphere/UKCA/ukca_cspecies.F90 (revision 93557)
+++ src/atmosphere/UKCA/ukca_cspecies.F90 (revision 46535)
+
+++ src/atmosphere/UKCA/ukca_cspecies.F90 (revision 93589)
@@ -296,6 +296,9 @@
+
@@ -180,7 +180,7 @@
  +
c_nucarb12, c_udcarb8, c_udcarb11, c_udcarb14, c_tncarb26, c_tncarb10, &
WHERE (advt == 'ORGNIT ') c_species = c_orgnit
 
  +
c_tncarb12, c_tncarb11, c_ccarb12, c_tncarb15, c_rcooh25, c_txcarb24, &
  +
c_txcarb22, c_ru12pan, c_rtn26pan, c_aroh14, c_aroh17, c_arnoh14, &
  +
- c_arnoh17, c_anhy, c_cri
  +
+ c_arnoh17, c_anhy, c_cri, c_alice, c_bob
  +
  +
USE asad_mod, ONLY: advt, nadvt, speci, jpctr, jpspec
  +
USE ukca_config_specification_mod, ONLY: ukca_config
  +
@@ -449,6 +449,9 @@
  +
WHERE (advt == 'RAROH17 ') c_species = c_cri
 
WHERE (advt == 'PASSIVE O3') c_species = 1.0
 
WHERE (advt == 'PASSIVE O3') c_species = 1.0
 
WHERE (advt == 'AGE OF AIR') c_species = 1.0
 
WHERE (advt == 'AGE OF AIR') c_species = 1.0
+! UKCA Tutorial Tracers:
+
+! UKCA Tutorial species
+WHERE (advt == 'ALICE ') c_species = c_ALICE
+
+WHERE (advt == 'ALICE ') c_species = c_alice
+WHERE (advt == 'BOB ') c_species = c_BOB
+
+WHERE (advt == 'BOB ') c_species = c_bob
 
 
 
! non-advected tracers
 
! non-advected tracers
 
c_na_species=0.0
 
c_na_species=0.0
Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf
 
===================================================================
 
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 46527)
 
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 46535)
 
@@ -16215,6 +16215,14 @@
 
description=O3P MASS MIXING RATIO AFTER TIMESTEP
 
help=Oxygen atom (ground state) Mass Mixing Ratio in kg/kg(Air)
 
 
+[stashmaster:code(34064)]
 
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
 
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
 
+
 
+[stashmaster:code(34065)]
 
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
 
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
 
+
 
[stashmaster:code(34070)]
 
description=H2 MASS MIXING RATIO AFTER TIMESTEP
 
help=Hydrogen Mass Mixing Ratio in kg/kg(Air)
 
@@ -22480,6 +22488,16 @@
 
description=O3P MASS MIXING RATIO ON PRESS LEVS
 
help=Oxygen atom (ground state) Mass Mixing Ratio in kg/kg(Air)
 
 
+[stashmaster:code(51064)]
 
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
 
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
 
+ =on pressure levels
 
+
 
+[stashmaster:code(51065)]
 
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
 
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
 
+ =on pressure levels
 
+
 
[stashmaster:code(51070)]
 
description=H2 MASS MIXING RATIO ON PRESS LEVS
 
help=Hydrogen Mass Mixing Ratio in kg/kg(Air)
 
Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A
 
===================================================================
 
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 46527)
 
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 46535)
 
@@ -15942,6 +15942,18 @@
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 2160 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
#
 
+1| 1 | 34 | 64 |ALICE MASS MIXING RATIO AFTER TSTEP |
 
+2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
 
+3| 000000000000000000000000010000 | 00000000000000000001 | 1 |
 
+4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
+5| 0 | 2164 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
+#
 
+1| 1 | 34 | 65 |BOB MASS MIXING RATIO AFTER TSTEP |
 
+2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
 
+3| 000000000000000000000000010000 | 00000000000000000001 | 1 |
 
+4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
+5| 0 | 2165 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
+#
 
1| 1 | 34 | 69 |CH3OH MASS MIXING RATIO AFTER TS |
 
2| 2 | 0 | 1 | 1 | 2 | 40 | 11 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000100 | 00000000000000000001 | 1 |
 
@@ -24580,6 +24592,18 @@
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 2160 | 0 | 8 | 0 | 0 | 0 | 0 | 0 |
 
#
 
+1| 1 | 51 | 64 |ALICE MMR ON PRESSURE LEVELS |
 
+2| 0 | 0 | 1 | 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 | 2164 | 0 | 8 | 0 | 0 | 0 | 0 | 0 |
 
+#
 
+1| 1 | 51 | 65 |BOB MMR ON PRESSURE LEVELS |
 
+2| 0 | 0 | 1 | 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 | 2165 | 0 | 8 | 0 | 0 | 0 | 0 | 0 |
 
+#
 
1| 1 | 51 | 69 |CH3OH MASS MIX RATIO ON PRESS LEVS |
 
2| 0 | 0 | 1 | 1 | 3 | 1 | 2 | 0 | 0 | 0 | 1 |
 
3| 000000000000000000000000000100 | 00000000000000000001 | 3 |
 
 
These differences can be found in the file '''<code>/home/ukca/Tutorial/vn10.9/worked_solutions/Task4.1/Task4.1_code.patch</code>''' on PUMA.
 
   
  +
These differences can be found in the file '''<code>Tutorials/vn11.8/worked_solutions/Task04.2/Task04.2_code.patch</code>'''.
If you open the '''.pa''' file in Xconv, you should see the following fields:
 
   
  +
Sample output from this task can be found at '''<code>Tutorials/vn11.8/sample_output/Task04.2/atmosa.pa19810901_00</code>'''.
7 : 96 72 38 1 field2164: Stash code = 34064
 
8 : 96 72 38 1 field2165: Stash code = 34065
 
 
Sample output from this task can be found at '''<code>/work/n02/n02/ukca/Tutorial/vn10.9/sample_output/Task4.1/atmosa.pa19810901_00</code>''' on ARCHER.
 
   
 
==Checklist==
 
==Checklist==
Line 845: Line 836:
 
: <span style="font-size:20px">☐</span> Make a branch at the required MetUM version using <code>fcm branch-create</code>.
 
: <span style="font-size:20px">☐</span> Make a branch at the required MetUM version using <code>fcm branch-create</code>.
 
: <span style="font-size:20px">☐</span> Checkout your branch using <code>fcm checkout</code>.
 
: <span style="font-size:20px">☐</span> Checkout your branch using <code>fcm checkout</code>.
: <span style="font-size:20px">☐</span> Choose slots for your new tracer(s) from the list in <code>ukca_set_nmspec.F90</code>, and add the correct names for them in these slots.
+
: <span style="font-size:20px">☐</span> Choose slots for your new tracer(s) from the list in <code>ukca_nmspec_mod.F90</code>.
: <span style="font-size:20px">☐</span> Add the tracer(s) to the <code>chch_defs_strattrop</code> array in <code>ukca_chem_master.F90</code>.
 
: <span style="font-size:20px">☐</span> Increase the value of <code> n_chem_tracers</code> in <code>ukca_setd1defs.F90</code>.
 
: <span style="font-size:20px">☐</span> Add a C_species value for each tracer in <code>ukca_constants.F90</code>.
 
: <span style="font-size:20px">☐</span> Append the CASE statement in <code>ukca_cspecies.F90</code> to add this value to the <code>c_species</code> array.
 
: <span style="font-size:20px">☐</span> <code>fcm commit</code> the changes to your branch.
 
 
: <span style="font-size:20px">☐</span> Make the required changes to branch's STASHmaster_A file, to add the new tracers.
 
: <span style="font-size:20px">☐</span> Make the required changes to branch's STASHmaster_A file, to add the new tracers.
 
: <span style="font-size:20px">☐</span> Add help text for your tracers in your branch's STASHmaster-meta.conf file.
 
: <span style="font-size:20px">☐</span> Add help text for your tracers in your branch's STASHmaster-meta.conf file.
  +
: <span style="font-size:20px">☐</span> <code>fcm commit</code> the STASH changes to your branch.
 
: <span style="font-size:20px">☐</span> Using a text editor, open the <code>app/um/rose-app.conf</code> file from your <code>roses/[SUITE-ID]</code> directory, and add the line <code>STASHMASTER=STASHmaster</code> in the <code>[env]</code> block, then save and close the file.
 
: <span style="font-size:20px">☐</span> Using a text editor, open the <code>app/um/rose-app.conf</code> file from your <code>roses/[SUITE-ID]</code> directory, and add the line <code>STASHMASTER=STASHmaster</code> in the <code>[env]</code> block, then save and close the file.
 
: <span style="font-size:20px">☐</span> Using a text editor, open the <code>rose-suite.conf</code> file from your <code>roses/[SUITE-ID]</code> directory, and add the following lines to the top of the file, before saving and closing it:
 
: <span style="font-size:20px">☐</span> Using a text editor, open the <code>rose-suite.conf</code> file from your <code>roses/[SUITE-ID]</code> directory, and add the following lines to the top of the file, before saving and closing it:
 
[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/HEAD/etc/stash/STASHmaster@HEAD
 
source=fcm:um.xm_br/dev/[your MOSRS userid]/vnX.Y_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
: <span style="font-size:20px">☐</span> Edit your suite using <code>rose edit -M /path/to/your/branch/working/copy</code>.
+
: <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> Make sure to point the metadata in your suite to um-atmos/HEAD.
 
 
: <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> Initialise your tracers in your suite at: um <math>\rightarrow</math> namelist <math>\rightarrow</math> Reconfiguration and Ancillary Control <math>\rightarrow</math> Configure ancils and initialise dump fields.
 
: <span style="font-size:20px">☐</span> Initialise your tracers in your suite at: um <math>\rightarrow</math> namelist <math>\rightarrow</math> Reconfiguration and Ancillary Control <math>\rightarrow</math> Configure ancils and initialise dump fields.
Line 866: Line 852:
 
: <span style="font-size:20px">☐</span> In the <code>roses/[SUITE-ID]</code> directory, run <code>fcm commit</code> to commit your changes to the repository.
 
: <span style="font-size:20px">☐</span> In the <code>roses/[SUITE-ID]</code> directory, run <code>fcm commit</code> to commit your changes to the repository.
 
: <span style="font-size:20px">☐</span> Run your suite.
 
: <span style="font-size:20px">☐</span> Run your suite.
  +
: <span style="font-size:20px">☐</span> Add your new tracer(s) from into the list in <code>ukca_nmspec_mod.F90</code>.
  +
: <span style="font-size:20px">☐</span> Add the tracer(s) to the <code>chch_defs_strattrop</code> array in <code>ukca_chem_master.F90</code>.
  +
: <span style="font-size:20px">☐</span> Increase the value of <code> n_chem_tracers</code> in <code>ukca_config_defs_mod.F90</code>.
  +
: <span style="font-size:20px">☐</span> Add a C_species value for each tracer in <code>ukca_constants.F90</code>.
  +
: <span style="font-size:20px">☐</span> Append the CASE statement in <code>ukca_cspecies.F90</code> to add this value to the <code>c_species</code> array.
  +
: <span style="font-size:20px">☐</span> <code>fcm commit</code> the changes to your branch.
  +
: <span style="font-size:20px">☐</span> Run your suite again.
   
 
[[UKCA Chemistry and Aerosol vn11.8 Tutorial 5|Tutorial 5]]
 
[[UKCA Chemistry and Aerosol vn11.8 Tutorial 5|Tutorial 5]]

Revision as of 10:00, 29 September 2021

UKCA Chemistry and Aerosol Tutorials at vn11.8

Difficulty HARD
Time to Complete 2 or more hours
Video instructions https://youtu.be/6XqYfW2qHKY?t=213

Remember to run mosrs-cache-password in your Rose suite and UM branch terminals.

What you will do in this tutorial

In this tutorial you will learn how to make the required changes in Rose and in UKCA to include new chemical tracers. As you learn how to do this you will add two new tracers to the UKCA tutorial suite you have already been running.

Task 4.1: Add new tracers into Rose

TASK4.1: Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called ALICE and the tracer in slot 499 will be called BOB. You should initialise these tracers to 1.000000e-15. You should also output these two tracers through the UPA stream in STASH as 3-hour means. Do not make any UKCA code changes at this stage.

Note: if you are working at UM versions prior to UMvn11.7, you will only be able to use tracer slots up to 256 (rather than 499 as used here). For more information see the vn10.9 Tutorials.

Make a branch

As UKCA is a framework, it must have the infrastructure around it to allow it to work, with the infrastructure being the UM itself. In this tutorial you will add in two new chemical tracers. This can be done in two steps, the Rose-side changes, and then the UKCA-side changes. Note that you cannot make the UKCA changes first.

For this tutorial you will need to make a new branch in the usual way. You should do this now.

You will have learned how to make UM branches in the NCAS-CMS FCM Tutorial. However, now you should use um.x_tr as the source of your branch.

For example, first you should make a ticket on the Met Office SRS Trac pages (login required) and then make the branch like so

fcm branch-create --type dev -k ticket_number your_branch_name fcm:um.x_tr@vn11.8

before checking-out your branch by

fcm checkout fcm:um.x_br/dev/[your MOSRS userid]/vn11.8_your_branch_name

More information on FCM can be found at the NCAS-CMS FCM pages or the FCM User Guide

You should

  1. ensure that you assign the ticket to yourself when you create it. The easiest way to do this is to click start work under the modify ticket option.
  2. When making changes always include your ticket number and MOSRS userid in your comment when you commit to your branch to enable the changes to be easily traced back to you. The easiest way to do this is to have each comment start with #ticket_number userid.
  3. Ensure that you select a Milestone of Not for builds. Usual changes should be given this as a milestone, or Hopefully. You should only change this to a particular UM release when you are working on it to commit to the trunk.

Metadata

In Rose, the GUI appearance is controlled by metadata, and it is possible to edit this metadata to add new variables to panels. We will not do this in this tutorial, but you will need to change where Rose looks for metadata, as the STASHmaster_A is also metadata.

Using your new metadata within Rose

Here you should click on the um app in Rose and change the meta setting from um-atmos/vn11.8 to

/path/to/vn11.8_your_branch_name/rose-meta/um-atmos/HEAD

Then click Apply and then save the suite.

Rose Changes

Include your branch for code changes

Although we haven't made any code changes yet, you will (at some point) need to include your branch in Rose so that the UKCA code changes can be picked-up and compiled. To do this go to fcm_make env Sources and add a new branch by clicking the plus symbol in the um_sources section. You should then put

/path/to/vn11.8_your_branch_name

(where /path/to/vn11.8_your_branch_name means the full linux path to your branch, e.g. /home/ukcatr01/vn11.8_UKCA_Tutorials etc.) if you wish to run from a working copy, and

branches/dev/[your MOSRS userid]/vn11.8_your_branch_name

if you want to run from the repository. You can specify specific revision numbers by putting @REV at the end of this line (where REV is the revision number, e.g. 12345 etc.).

Note that if you specify revision numbers you will need to change these each time you make a change and commit it. Another potential issue here is the use of a mirror for the UM code. On some systems the code is not taken directly from MOSRS, but from a local mirror of the full repository. This usually updates every 5 minutes or so, so to check whether it has updated or not, you should type the command

fcm info fcm:um.xm

and check the last committed revision. If it is the same or higher than your last revision then your code changes will be picked-up. If it is less than your revision your code changes will not be included in the compile. On the VM, this is not an issue as there is no mirror.

STASHmaster_A

In Rose-based jobs, adding new UKCA tracers is done through editing the STASHmaster_A file directly. Take a look at the STASHmaster_A file, found in

/path/to/vn11.8_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A

This is a large file, as it contains all the possible STASH items. Scroll down the file until you get to section 34, and you will see how the tracers are defined. The key entries to consider are highlighted in red. All entries are fixed-width, so when editing the file, ensure not to change the spacing, otherwise you will get errors.

#===============================================================================
# Section 34 UKCA Chemistry
#===============================================================================
#
1|    1 |   34 |    1 |O3 MASS MIXING RATIO AFTER TIMESTEP |
2|    2 |    0 |    1 |    1 |    2 |   40 |   11 |    0 |    0 |    0 |    0 |
3| 000000000000000000100000111110 | 00000000000000000001 |    1 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 | 2101 |    0 |   65 |    0 |    0 |    0 |    0 |    0 |
#

The meaning of these entries is:

First Line:

  • 34: The STASH section, in this case Section 34, UKCA prognostics.
  • 1: The STASH item, in this case, the first item in s34, ozone.
  • O3 MASS MIXING RATIO AFTER TIMESTEP: The name of the field in the STASHmaster file. This can be anything descriptive, but it isn't used by the model, and is only considered in Rose (or e.g. Xconv).

Second Line:

  • 2: The Space Code, which tells the UM whether the field should be held in the restart dump or not. For prognostics, this should be 2 (which means that they should be stored in the restart dump), but for diagnostics that are only passed to output files, this should be 0.


Third Line:

  • 000000000000000000100000111110: These are Options Codes which determine which scheme the STASH field (i.e. tracer in this case) are valid for. These are counted from the right, n1 to n30. Only some of these are used, and have the following meaning:
    • n1: Age-of-air tracer (ageair) or aerosol tracers
    • n2: Standard Tropospheric Chemistry scheme using the Backward Euler solver (trop)
    • n3: Regional Air Quality Chemistry scheme using the Backward Euler solver (raq)
    • n4: Tropospheric Chemistry with Isoprene scheme using the Newton-Raphson solver (tropisop)
    • n5: Stratospheric-Tropospheric Chemistry using the Newton-Raphson solver (strattrop, also know as CheST)
    • n6: Standard Stratospheric Chemistry using the Newton-Raphson solver (strat)
    • n7: Offline-oxidants scheme (to drive GLOMAP-mode) using the Newton-Raphson solver (offline)
    • n8: Offline-oxidants scheme (to drive GLOMAP-mode) using the Newton-Raphson solver (offline_be)
    • n12: CRI-Strat scheme using the Newton-Raphson solver (cristrat)

Therefore, looking at the option code for ozone (s34i001), it is valid for the trop, raq, tropisop, strattrop, strat, and cristrat chemistry schemes.

Fifth Line:

  • 2101: This is the PP Field Code. Existing UKCA fields will have different numbers for these, but for all new fields, you should set this number to 0.

So to make a STASH entry for a single tracer called ALICE in slot s34i498 that is only valid in the StratTrop scheme, the STASHmaster_A entry would look like

#
1|    1 |   34 |  498 |ALICE MASS MIXING RATIO AFTER TSTEP |
2|    2 |    0 |    1 |    1 |    2 |   40 |   11 |    0 |    0 |    0 |    0 |
3| 000000000000000000000000010000 | 00000000000000000001 |    1 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 |    0 |    0 |   65 |    0 |    0 |    0 |    0 |    0 |
#

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499.

Section 51

All STASH entries in Section 34 need a corresponding pressure-level field to be added to section 51. The equivalent STASHmaster_A entry for s51 ozone is:

#
#===============================================================================
# Section 51 UKCA Chemistry on pressure levels
#===============================================================================
#
1|    1 |   51 |    1 |O3 MASS MIXING RATIO ON PRESS LEVS  |
2|    0 |    0 |    1 |    1 |    3 |    1 |    2 |    0 |    0 |    0 |    1 |
3| 000000000000000000000000111110 | 00000000000000000001 |    3 |
4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
5|    0 | 2101 |    0 |    8 |    0 |    0 |    0 |    0 |    0 |
#

You will notice that there are a number of changes to various codes, and this is to do with defining the grid that the diagnostic is valid on, whether it can be held in the dump, etc. For more information on what these codes mean, please see Appendix C in UMDP C4, which can be obtained from the SRS here (password required). When making a new entry, the easiest thing to do is copy an existing entry and make the required changes to the item, name, PP field code, and option codes.

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499 (and section 51 for pressure level equivalents).

Help text

You should also add appropriate help text into the vn11.8_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf file, e.g.

[stashmaster:code(34498)]
description=ALICE MASS MIXING RATIO AFTER TIMESTEP
help=UKCA Tutiorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)

and

[stashmaster:code(51498)]
description=ALICE  MASS MIX RATIO ON PRESS LEVS
help=UKCA Tutiorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
    =on pressure levels

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499 (and section 51 for pressure level equivalents).

You should make these changes to STASHmaster_A and STASHmaster-meta.conf, and then fcm commit these changes. This is important, otherwise the running suite will not be able to see the changes you have made once you have included your new STASHmaster_A file in Rose.

Use your new STASHmaster file in Rose

Before you make these changes you should first save and close your suite.

To get Rose to recognise your STASHmaster file, you will need to make a number of changes:

  1. Make sure to point the um metadata to your branch (if it isn't already) by editing the um meta path (you should already be doing this after following the instructions in the metadata section above).
  2. You need to open the $HOME/roses/[SUITE-ID]/app/um/rose-app.conf file in a text editor (e.g. vim, emacs, nedit etc.) and add the line STASHMASTER=STASHmaster inside the [env] block near the top of the file.
  3. You need to open the $HOME/roses/[SUITE-ID]/rose-suite.conf file in a text editor and add the following lines at the top of the file:
[file:app/um/file/STASHmaster]
source=fcm:um.xm_br/dev/[your MOSRS userid]/vn11.8_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
  • You need to ensure that you have committed your STASHmaster_A changes, otherwise your new tracer(s) will not be seen at run-time during the reconfiguration or atmosphere steps.
  • For the VM only it is also possible to specify the full path to the STASHmaster directory. This is because the suite runs on the same machine that the branch is on.
[file:app/um/file/STASHmaster]
source=/home/[your VM userid]/src/vn11.8_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster

You may wish to now fcm commit your suite changes. You can now re-open your suite.

When running your suite, if you get an error similar to:

[INFO] create: app/um/file
[FAIL] file:app/um/file/STASHmaster=source=fcm:um.xm_br/dev/[your MOSRS userid]/vn11.8_your_branch_name/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD: bad or missing value

you should try running mosrs-cache-password again to cache your MOSRS credentials.

Initialise your new tracer(s)

Your new tracer(s) is a prognostic variable, as therefore the UM requires prior knowledge of the values it has to be able to run properly. To do this you need to go to um namelist Reconfiguration and Ancillary Control Configure ancils and initialise dump fields. Here you will see a list of fields. You can change the order of these by e.g. STASH number, as this often makes it easier to view.

To add new fields, right click anywhere within the table and click Add new section. This will make a new entry with index 1, if you add another entry, it will be given index 2 etc.. Right-click on this and click on View namelist:items(X) (where X is the index number). This will open a new tab where you can select the STASH section and item for the field you want to initialise using the drop-down menus. Some UKCA tracers need to be given full 3D initial conditions in ancillary file format. However, for this example we will initialise the tracer to a small number, . To do this, select the radio button for Set to a specified constant value and put 1.000000e-15 in the dialog box labelled user_prog_rconst at the bottom of the panel.

You will need to do this for each of the tracers you are adding, and you can add multiple prognostics per entry. You can also clone existing entries to speed up the process. When you have finished, you will need to go to the STASH Requests panel (see the STASH tutorial) and run the TidyStashTransform macro to correctly generate the required index value for each tracer initialisation.

Output your new tracers

To output your tracers, go to the STASH panel and output your tracers as described in the What is STASH? tutorial.

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499.

Run your suite

Now that you have made the required changes to Rose and in your branch, please run your suite. You may find that it fails on the fcm_make, recon, or atmos jobs. To find the errors and see output, you should either right-click the failed task in Gcylc and view the output, or go to the

/home/[your VM userid]/cylc-run/[SUITE-ID]

directory. Within this there are a number of directories. To see the log files, cd into

log/job/1/[JOB NAME]/NN

and view the job.err or job.out files. When the suite successfully runs, the fieldsfile output can be found in

/home/[your VM userid]/cylc-run/[SUITE-ID]/work/1/atmos/

Viewing output in Xconv

If you open the .pa file in Xconv, you should now see the following if you have outputted both the section 34 and section 51 fields:

4    : 96    72    27    1     Stash code = 51498
5    : 96    72    27    1     Stash code = 51499

11   : 96    72    38    1     Stash code = 34498
12   : 96    72    38    1     Stash code = 34499

Note here that these fields are not named ALICE and BOB, or however you have described them in your STASHmaster_A file. They are instead labelled by the unique STASH code identifier that you have defined for them. This is working as expected.

It is possible (although not necessary) to tell Xconv to read the STASHmaster_A file from your branch. To do this, in Xconv go to Setup Select STASH Master Files and then navigate to the location of the file in your branch's working copy in the left-hand side of the panel. When you have located it, highlight it and click Add. Then click Apply, Save, and Dismiss. Now Xconv will list the names of your species as you have called them in your STASHmaster_A file.

Numerical Noise

When your suite has run successfully, and you view the fields for your new tracer(s) in Xconv, you may find that they have a speckled appearance, rather than being constant. This is due to numerical noise that has been introduced as the tracers go through the UM timesteps. Once the field is converted to 32-bit this should disappear. It will also cease to become apparent when emissions and reactions are applied to these tracers.

Solution to Task4.1

You were given the task:

  • Add in two new tracers in to slots 498 and 499 for the StratTrop chemistry scheme. The tracer in slot 498 will be called ALICE and the tracer in slot 499 will be called BOB. You should initialise these tracers to 1.000000e-15. You should also output these two tracers through the UPA stream in STASH as 3-hour means. Do not make any UKCA code changes at this stage.

For a working Rose suite that has completed this task, please see

  • vm: u-ca024@181051

The specific Rose changes made are:

vm:

Index: app/um/rose-app.conf
===================================================================
--- app/um/rose-app.conf	(revision 180902)
+++ app/um/rose-app.conf	(revision 181051)
@@ -1,4 +1,4 @@
-meta=um-atmos/vn11.8
+meta=/home/vagrant/src/vn11.8_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD
 
 [command]
 default=um-atmos
@@ -27,6 +27,7 @@
 RECON_STDOUT_FILE=pe_output/atmos.fort6.pe
 RUNID=atmos
 SPECTRAL_FILE_DIR=$UMDIR/vn$VN/ctldata/spectral/ga7
+STASHMASTER=STASHmaster
 UM_THREAD_LEVEL=MULTIPLE
 
 [file:$DATAM]
@@ -893,6 +894,19 @@
 !!user_prog_ancil_stash_req=
 !!user_prog_rconst=0.0
 
+[namelist:items(e897a2fb)]
+ancilfilename=
+domain=1
+!!interval=0
+l_ignore_ancil_grid_check=
+!!netcdf_varname=
+!!period=1
+source=6
+stash_req=34498,34499
+update_anc=.false.
+!!user_prog_ancil_stash_req=0
+user_prog_rconst=1.000000e-15
+
 [namelist:items(e8e484ca)]
 ancilfilename=
 domain=1
@@ -3658,6 +3672,22 @@
 tim_name='T3HMN'
 use_name='UPA'
 
+[namelist:umstash_streq(34498_e7e57cc6)]
+dom_name='DALLTH'
+isec=34
+item=498
+package=
+tim_name='T3HMN'
+use_name='UPA'
+
+[namelist:umstash_streq(34499_07c8a074)]
+dom_name='DALLTH'
+isec=34
+item=499
+package=
+tim_name='T3HMN'
+use_name='UPA'
+
 [namelist:umstash_streq(34968_49e5e12c)]
 dom_name='DALLTH'
 isec=34
@@ -3770,6 +3800,22 @@
 tim_name='T3HMN'
 use_name='UPA'
 
+[namelist:umstash_streq(51498_ccb8d5a7)]
+dom_name='DP27CCM'
+isec=51
+item=498
+package=
+tim_name='T3HMN'
+use_name='UPA'
+
+[namelist:umstash_streq(51499_5c041195)]
+dom_name='DP27CCM'
+isec=51
+item=499
+package=
+tim_name='T3HMN'
+use_name='UPA'
+
 [namelist:umstash_streq(51999_8b73e62f)]
 dom_name='DP27CCM'
 isec=51
Index: app/fcm_make/rose-app.conf
===================================================================
--- app/fcm_make/rose-app.conf	(revision 180902)
+++ app/fcm_make/rose-app.conf	(revision 181051)
@@ -43,4 +43,4 @@
 thread_utils=false
 timer_version=3A
 um_rev=$BASE_UM_REV
-um_sources=
+um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@93557
Index: rose-suite.conf
===================================================================
--- rose-suite.conf	(revision 180902)
+++ rose-suite.conf	(revision 181051)
@@ -1,3 +1,6 @@
+[file:app/um/file/STASHmaster]
+source=fcm:um.xm_br/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns/rose-meta/um-atmos/HEAD/etc/stash/STASHmaster@HEAD
+
 [jinja2:suite.rc]
 BUILD=true
 OFFLINE=false

These ARCHER differences can be found in the file Tutorials/vn11.8/worked_solutions/Task04.1/Task04.1_rose.patch.

The specific UM changes made are:

Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf
===================================================================
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf	(revision 93540)
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf	(revision 93557)
@@ -19390,6 +19390,14 @@
 help=Coarse Mode (Soluble) Sodium Nitrate Aerosol Mass Mixing
     =Ratio in kg/kg(Air)
 
+[stashmaster:code(34498)]
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
+
+[stashmaster:code(34499)]
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
+
 [stashmaster:code(34866)]
 description=NH4 PARTIAL VOLUME CONC (AIT-SOL)   
 help=Component partial volume of ammonium for the Aitken 
@@ -27596,6 +27604,16 @@
     =Mass Mixing Ratio
     =in kg/kg(Air) on pressure levels
 
+[stashmaster:code(51498)]
+description=ALICE MASS MIXING RATIO AFTER TIMESTEP
+help=UKCA Tutorial Tracer ALICE Mass Mixing Ratio in kg/kg(Air)
+    =on pressure levels
+
+[stashmaster:code(51499)]
+description=BOB MASS MIXING RATIO AFTER TIMESTEP
+help=UKCA Tutorial Tracer BOB Mass Mixing Ratio in kg/kg(Air)
+    =on pressure levels
+
 [stashmaster:code(51872)]
 description=RTX22O2 MASS MIX RATIO ON PRESS LEVS
 help=Peroxy radicals from BPINENE oxidation with 17 C-H
Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A
===================================================================
--- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A	(revision 93540)
+++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A	(revision 93557)
@@ -18682,6 +18682,18 @@
 4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
 5|    0 | 2351 |    0 |   65 |    0 |    0 |    0 |    0 |    0 |
 #
+1|    1 |   34 |  498 |ALICE MASS MIXING RATIO AFTER TSTEP |
+2|    2 |    0 |    1 |    1 |    2 |   40 |   11 |    0 |    0 |    0 |    0 |
+3| 000000000000000000000000010000 | 00000000000000000001 |    1 |
+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 |   34 |  499 |BOB MASS MIXING RATIO AFTER TSTEP   |
+2|    2 |    0 |    1 |    1 |    2 |   40 |   11 |    0 |    0 |    0 |    0 |
+3| 000000000000000000000000010000 | 00000000000000000001 |    1 |
+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 |   34 |  866 |NH4 PARTIAL VOLUME CONC (AIT-SOL)   |
 2|    2 |    0 |    1 |    1 |    2 |   40 |   11 |    0 |    0 |    0 |    0 |
 3| 100000000000000000005000000000 | 00000000000000000001 |    3 |
@@ -29005,6 +29017,18 @@
 4|    1 |    0 | -99  -99  -99  -99  -99  -99  -99  -99  -99  -99 |
 5|    0 | 2252 |    0 |    8 |    0 |    0 |    0 |    0 |    0 |
 #
+1|    1 |   51 |  498 |ALICE MMR ON PRESSURE LEVELS        |
+2|    0 |    0 |    1 |    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 |   51 |  499 |BOB MMR ON PRESSURE LEVELS          |
+2|    0 |    0 |    1 |    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 |   51 |  872 |RTX22O2 MASS MIX RATIO ON PRESS LEVS|
 2|    0 |    0 |    1 |    1 |    3 |    1 |    2 |    0 |    0 |    0 |    1 |
 3| 000000000000000000800000000000 | 00000000000000000001 |    3 |


These differences can be found in the file Tutorials/vn11.8/worked_solutions/Task04.1/Task04.1_code.patch.

If you open the .pa file in Xconv, you should see the following fields:

4    : 96    72    27    1     Stash code = 51498
5    : 96    72    27    1     Stash code = 51499

11   : 96    72    38    1     Stash code = 34498
12   : 96    72    38    1     Stash code = 34499


Sample output from this task can be found at Tutorials/vn11.8/sample_output/Task04.1/atmosa.pa19810901_00.

Task 4.2: Add new tracers into UKCA

TASK4.2: In UKCA, make the code changes required to include these species, ALICE and BOB, into the StratTrop chemical mechanism. You should set the conversion factor for each of these to 1.0. In the nm_spec array you should put these into slots 498 for ALICE and 499 for BOB.

Required UKCA Code Changes

Note that at some older UKCA versions it was necessary to make the UKCA changes in parallel with the UM-side changes covered above.

ukca_nmspec_mod.F90

Inside UKCA there is a master mapping array that tells the UKCA code which transported species are placed into a particular item number in section 34. At vn11.8 these are contained in the first 499 slots.

This array is called nm_spec, and it can be found in ukca_nmspec_mod.F90. At vn11.8, it looks like this:

nm_spec(1:a_max_ukcavars) = (/                                                 &
'O3        ','NO        ','NO3       ','NO2       ','N2O5      ',              &
'HO2NO2    ','HONO2     ','H2O2      ','CH4       ','CO        ',  & !10
'HCHO      ','MeOOH     ','HONO      ','C2H6      ','EtOOH     ',              &
'MeCHO     ','PAN       ','C3H8      ','n-PrOOH   ','i-PrOOH   ',  & !20
'EtCHO     ','Me2CO     ','MeCOCH2OOH','PPAN      ','MeONO2    ',              &
'O3_S      ','C5H8      ','ISOOH     ','ISON      ','MACR      ',  & !30
'MACROOH   ','MPAN      ','HACET     ','MGLY      ','NALD      ',              &
'HCOOH     ','MeCO3H    ','MeCO2H    ','H2O       ','ISO2      ',  & !40
'Cl        ','ClO       ','Cl2O2     ','OClO      ','Br        ',              &
'BrO       ','BrCl      ','BrONO2    ','N2O       ','HCl       ',  & !50
'HOCl      ','HBr       ','HOBr      ','ClONO2    ','CFCl3     ',              &
'CF2Cl2    ','MeBr      ','N         ','O(3P)     ','MACRO2    ',  & !60
'C2H4      ','C4H10     ','oXYLENE   ','TBUT2ENE  ','APINENE   ',              &
'BPINENE   ','C2H2      ','BENZENE   ','CH2Br2    ','H2        ',  & !70
'DMS       ','SO2       ','H2SO4     ','MSA       ','DMSO      ',              &
'NH3       ','CS2       ','COS       ','H2S       ','H         ',  & !80
'OH        ','HO2       ','MeOO      ','EtOO      ','MeCO3     ',              &
'n-PrOO    ','i-PrOO    ','EtCO3     ','MeCOCH2OO ','MeOH      ',  & !90
'Monoterp  ','Sec_Org   ','C3H6      ','SO3       ','C4H9OOH   ',              &
'MEK       ','TOLUENE   ','NO2       ','BrO       ','HCl       ',  & !100
'Nuc_SOL_ND','Nuc_SOL_SU','Ait_SOL_ND','Ait_SOL_SU','Ait_SOL_BC',              &
'Ait_SOL_OC','Acc_SOL_ND','Acc_SOL_SU','Acc_SOL_BC','Acc_SOL_OC',  & !110
'Acc_SOL_SS','Acc_SOL_DU','Cor_SOL_ND','Cor_SOL_SU','Cor_SOL_BC',              &
'Cor_SOL_OC','Cor_SOL_SS','Cor_SOL_DU','Ait_INS_ND','Ait_INS_BC',  & !120
'Ait_INS_OC','Acc_INS_ND','Acc_INS_DU','Cor_INS_ND','Cor_INS_DU',              &
'Nuc_SOL_OC','Ait_SOL_SS','Nuc_SOL_SO','Ait_SOL_SO','Acc_SOL_SO',  & !130
'Cor_SOL_SO','Nuc_SOL_NH','Ait_SOL_NH','Acc_SOL_NH','Cor_SOL_NH',              &
'Nuc_SOL_NT','Ait_SOL_NT','Acc_SOL_NT','Cor_SOL_NT','EtOH      ',  & !140
'i-PrOH    ','n-PrOH    ','HOCH2CHO  ','HOC2H4OOH ','EtCO3H    ',  & !145
'HOCH2CO3H ','NOA       ','EtONO2    ','PASSIVE O3','AGE OF AIR',  & !150
'i-PrONO2  ','MeO2NO2   ','HOC2H4NO3 ','PHAN      ','MeSCH2OO  ',  & !155
'MeS       ','MeSO      ','MeSO2     ','MeSO3     ','MSIA      ',  & !160
'CARB14    ','CARB17    ','CARB11A   ','CARB7     ','CARB10    ',  & !165
'CARB13    ','CARB16    ','UCARB10   ','CARB3     ','CARB6     ',  & !170
'CARB9     ','CARB12    ','CARB15    ','UCARB12   ','NUCARB12  ',  & !175
'UDCARB8   ','UDCARB11  ','UDCARB14  ','TNCARB26  ','TNCARB10  ',  & !180
'RN10NO3   ','RN13NO3   ','RN16NO3   ','RN19NO3   ','RA13NO3   ',  & !185
'RA16NO3   ','RA19NO3   ','RTX24NO3  ','RN10OOH   ','RN13OOH   ',  & !190
'RN16OOH   ','RN19OOH   ','RN8OOH    ','RN11OOH   ','RN14OOH   ',  & !195
'RN17OOH   ','RU14OOH   ','RU12OOH   ','RU10OOH   ','NRU14OOH  ',  & !200
'NRU12OOH  ','RN9OOH    ','RN12OOH   ','RN15OOH   ','RN18OOH   ',  & !205
'NRN6OOH   ','NRN9OOH   ','NRN12OOH  ','RA13OOH   ','RA16OOH   ',  & !210
'RA19OOH   ','RTN28OOH  ','NRTN28OOH ','RTN26OOH  ','RTN25OOH  ',  & !215
'RTN24OOH  ','RTN23OOH  ','RTN14OOH  ','RTN10OOH  ','RTX28OOH  ',  & !220
'RTX24OOH  ','RTX22OOH  ','NRTX28OOH ','RAROH14   ','RAROH17   ',  & !225
'RU12PAN   ','RTN26PAN  ','TNCARB12  ','TNCARB11  ','RTN23NO3  ',  & !230
'CCARB12   ','TNCARB15  ','RCOOH25   ','TXCARB24  ','TXCARB22  ',  & !235
'RN9NO3    ','RN12NO3   ','RN15NO3   ','RN18NO3   ','RU14NO3   ',  & !240
'RTN28NO3  ','RTN25NO3  ','RTX28NO3  ','RTX22NO3  ','AROH14    ',  & !245
'ARNOH14   ','AROH17    ','ARNOH17   ','ANHY      ','Acc_SOL_NN',  & !250
'Cor_SOL_NN','XXX       ','XXX       ','XXX       ','XXX       ',  & !255
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !260
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !265
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !270
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !275
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !280
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !285
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !290
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !295
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !300
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !305
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !310
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !315
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !320
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !325
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !330
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !335
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !340
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !345
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !350
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !355
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !360
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !365
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !370
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !375
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !380
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !385
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !390
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !395
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !400
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !405
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !410
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !415
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !420
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !425
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !430
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !435
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !440
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !445
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !450
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !455
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !460
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !465
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !470
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !475
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !480
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !485
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !490
'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !495
'XXX       ','XXX       ','XXX       ','XXX       '                & !499
 /)

This array is case sensitive and each string is a fixed length of 10 characters, with the whitespace being made up of spaces and not another type of white space (e.g. tabs).

When adding new tracers you should not overwrite tracers that are already in use by the chemistry scheme that you are using (e.g. StratTrop etc.), and it is best to also take care and avoid tracers in use by other schemes, if possible. You can see the tracers used by each scheme by looking in the chch_defs array at the top of the ukca_chem_master.F90 module.

Here you should put a new species, 'ALICE     ', into tracer slot 498 (currently specified as 'XXX       ', which means that it is empty and is not in use by any scheme at the moment).

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i498.

ukca_chem_master.F90

We will go through changes that need to be made for the StratTrop chemistry scheme (defined in the file ukca_chem_master.F90, using the code st), but equivalent changes would need to be made for others, e.g. TropIsop or Strat. For this example we will only refer to this scheme.

In this file the list of species used in chemistry is defined by the array chch_defs_master. The list of species is held in a derived type, of the format:

chch_t1( N,'SPECIES   ',  X,'TYPE      ','FAMILY    ',  D,  W, SCHEME, QUALIFIER, DISQUALIFIER, VN),  &

Where:

  • N is an integer. The value should be incremented for each new species that is added.
  • 'SPECIES   ' is the name of the species, e.g. 'O3        '
  • X number of odd atoms
  • 'TYPE      ' describes whether the species is
    a tracer ('TR        ')
    a steady-state species ('SS        ')
    a constant ('CT        ')
    a constant field ('CF        ').
    For SS, CT, and CF, special code will need to be added.
  • 'FAMILY    ' is the family that the species belongs to. This field is not currently used.
  • D is 1 if the species is dry-deposited, and 0 otherwise.
  • W is 1 if the species is wet-deposited, and 0 otherwise.
  • SCHEME defines the chemistry scheme used, e.g.:
    st = Stratosphere-Troposphere scheme
    t = Troposphere scheme
    s = Stratosphere scheme
    r = RAQ scheme
    ol = Offline-oxidants scheme
    ti = Troposphere-Isoprene scheme
    cs = CRI-Strat scheme
    • If the same species is used in multiple schemes these are added, e.g. st+s+ti+cs etc.
  • QUALIFIER (and DISQUALIFIER) defines lines to add (or remove) on top of the base chemistry scheme depending on if certain additional options have been chosen, e.g.
    0 = no qualifier/disqualifer used
    a = Aerosol chemistry additions required to run GLOMAP-mode
    th = Tropospheric heterogeneous reactions
    hp = Heterogeneous PSC chemistry
    es = Extended stratospheric reactions
    rn = RO2 a non-transported prognostic (StratTrop chemistry only)
    rp = RO2 permutation chemistry (StratTrop chemistry only)
    • As with the SCHEME codes, these are also additive if required, e.g. a+th etc.
  • VN gives the model version the addition is added at. This is future functionality that will allow for multiple rates to be included in the source-code. The currently used version is 111, so please continue to use this for this Tutorial.

Therefore to add-in the ALICE species, we should insert a line similar to this one

chch_t1(272,'ALICE     ',1,'TR        ','          ',0,0,st,0,0,111),          &

into chch_defs_master, remembering to also increment the size of this array, given by n_chch_master

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499.

ukca_config_defs_mod.F90

In ukca_config_defs_mod.F90 you will find code blocks which set values for various parameters depending on the scheme used. In this example you will need to scroll down to the section which defines the StratTrop (also known as CheST) chemistry, which is located in the Stratospheric Chemistry section and is referenced by using the ukca_config%l_ukca_strattrop logical.

The IF block tests against ukca_config%l_ukca_strattrop and ukca_config%l_ukca_achem (which determines whether or not you require the additional chemistry used to drive the GLOMAP-mode aerosol scheme). You should increment the value of n_chem_tracers by the number of chemical tracers that you are adding in both sections of the IF block, as this tracer is not defined to be for aerosol chemistry only. If your additional tracers are aerosol chemistry additions then you should increment the value of n_aero_tracers.

If you are adding to a different chemistry scheme then you will need to make these changes accordingly.

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i498.

ukca_constants.F90

The unit of the tracers is kg(species)/kg(air) (i.e. mass mixing ratio, or mmr), but inside UKCA these species are converted to volume mixing ratio (or vmr). To enable UKCA to do this you will need to add the conversion factor(s) for your new tracer(s) into the code. This is done in the ukca_constants.F90 module.

Open this file and add the required conversion factor(s). The naming convention for these is M_species is the molecular mass of the new species in g/mol, and C_species for the converson factor from vmr to mmr (calculated as M_species/M_air, where M_air=28.97). In actuality, only the C_species listing is always required, although you may need to add the M_species value later if you are emitting into the new species that you are adding.

For example:

REAL, PARAMETER :: C_ALICE      = 1.0000

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499.

ukca_cspecies.F90

After you have added in the C_species conversion factors, you will need to tell UKCA to use them for your species. To do this you need to edit the ukca_cspecies.F90 module, which contains code which contructs the c_species array of conversion factors for the advected tracers. This contains a subroutine called ukca_calc_cspecies which has a long block of code that you need to edit to add an entry like this:

WHERE (advt == 'ALICE     ') c_species = C_ALICE

The advt array is automatically generated by UKCA at run-time from the chch_defs_master chemistry scheme definition you edited earlier, so your new tracer(s) will exist within it. You need to add in a new line for each of your tracers which sets the value of the c_species array to your individual C_species parameter. Add the line(s) in at the end of the block.

Remember: You need to add 2 tracers, ALICE in s34i498 and BOB in s34i499.

Run your suite again

Now that you have made the required changes to Rose and in your branch, please run your suite again. You may find that it fails on the fcm_make, recon, or atmos jobs. To find the errors and see output, you should either right-click the failed task in Gcylc and view the output, or go to the

/home/[your VM userid]/cylc-run/[SUITE-ID]

directory. Within this there are a number of directories. To see the log files, cd into

log/job/1/[JOB NAME]/NN

and view the job.err or job.out files. When the suite successfully runs, the fieldsfile output can be found in

/home/[your VM userid]/cylc-run/[SUITE-ID]/work/1/atmos/

Solution to Task 4.2

You were given the task

  • In UKCA, make the code changes required to include these species, ALICE and BOB, into the StratTrop chemical mechanism. You should set the conversion factor for each of these to 1.0. In the nm_spec array you should put these into slots 498 for ALICE and 499 for BOB.

For a working Rose suite that has completed this task, please see

  • vm: u-ca024@181072

The specific Rose changes made are:

vm:

Index: app/fcm_make/rose-app.conf
===================================================================
--- app/fcm_make/rose-app.conf	(revision 181051)
+++ app/fcm_make/rose-app.conf	(revision 181072)
@@ -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@93557
+um_sources=branches/dev/lukeabraham/vn11.8_UKCA_Tutorial_Solns@93589

These differences can be found in the file Tutorials/vn11.8/worked_solutions/Task04.2/Task04.2_rose.patch.

The specific UM changes made are:

Index: src/atmosphere/UKCA/ukca_chem_master.F90
===================================================================
--- src/atmosphere/UKCA/ukca_chem_master.F90	(revision 93557)
+++ src/atmosphere/UKCA/ukca_chem_master.F90	(revision 93589)
@@ -94,7 +94,7 @@
 INTEGER, PARAMETER :: rp = 128    ! RO2-Permutation chemistry (ST only)
 
 ! Define size of master chemistry
-INTEGER, PARAMETER :: n_chch_master = 327 ! number of known species
+INTEGER, PARAMETER :: n_chch_master = 329 ! number of known species
 INTEGER, PARAMETER :: n_het_master  =  18 ! number of heterogeneous reactions
 INTEGER, PARAMETER :: n_dry_master  = 149 ! number of dry deposition reactions
 INTEGER, PARAMETER :: n_wet_master  = 106 ! number of wet deposition reactions
@@ -843,7 +843,11 @@
 ! 270 DD:140,WD: 96,
 chch_t1(270,'ARNOH17   ',1,'TR        ','          ',1,1,cs,0,0,107),          &
 ! 271 DD:141, ANHY ~ MALANHY (327)
-chch_t1(271,'ANHY      ',1,'TR        ','          ',1,0,cs,0,0,107)           &
+chch_t1(271,'ANHY      ',1,'TR        ','          ',1,0,cs,0,0,107),          &
+! 272
+chch_t1(272,'ALICE     ',1,'TR        ','          ',0,0,st,0,0,111),          &
+! 273
+chch_t1(273,'BOB       ',1,'TR        ','          ',0,0,st,0,0,111)           &
  /)
 
 ! ----------------------------------------------------------------------
Index: src/atmosphere/UKCA/ukca_constants.F90
===================================================================
--- src/atmosphere/UKCA/ukca_constants.F90	(revision 93557)
+++ src/atmosphere/UKCA/ukca_constants.F90	(revision 93589)
@@ -343,6 +343,10 @@
 !                            Same as Sec_org
 REAL, PARAMETER :: c_cri        = 5.1782
 
+! Additions for UKCA Tutorial
+REAL, PARAMETER :: C_ALICE      = 1.0000
+REAL, PARAMETER :: C_BOB        = 1.0000
+
 !     molecular masses in g/mol of emitted species,
 !     for budget calculations
 REAL, PARAMETER :: m_ho2     =  33.007
Index: src/atmosphere/UKCA/ukca_config_defs_mod.F90
===================================================================
--- src/atmosphere/UKCA/ukca_config_defs_mod.F90	(revision 93557)
+++ src/atmosphere/UKCA/ukca_config_defs_mod.F90	(revision 93589)
@@ -315,7 +315,7 @@
           (/'NO        ','CH4       ','CO        ','HCHO      ',               &
             'C2H6      ','C3H8      ','Me2CO     ','MeCHO     ',               &
             'C5H8      ', nm_meoh_em ,'NO_aircrft'/)
-      n_chem_tracers = 71         ! No chem tracers
+      n_chem_tracers = 73         ! No chem tracers
       nr_therm       = 220        ! thermal reactions
       nr_phot        = 55         ! photolytic (ATA)
 
@@ -331,7 +331,7 @@
             'SO2_high  ','NH3       ','DMS       ','SO2_nat   ',               &
             'BC_biomass','OC_biomass','NO_aircrft'/)
       n_aero_tracers = 12
-      n_chem_tracers = 71         ! No chem tracers
+      n_chem_tracers = 73         ! No chem tracers
       IF (ukca_config%l_ukca_trophet) THEN
         nr_therm     = 241        ! thermal reactions
       ELSE
Index: src/atmosphere/UKCA/ukca_nmspec_mod.F90
===================================================================
--- src/atmosphere/UKCA/ukca_nmspec_mod.F90	(revision 93557)
+++ src/atmosphere/UKCA/ukca_nmspec_mod.F90	(revision 93589)
@@ -172,7 +172,7 @@
 'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !485
 'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !490
 'XXX       ','XXX       ','XXX       ','XXX       ','XXX       ',  & !495
-'XXX       ','XXX       ','XXX       ','XXX       '                & !499
+'XXX       ','XXX       ','ALICE     ','BOB       '                & !499
  /)
 
 IF (l_ukca_raq .OR. l_ukca_raqaero) THEN
Index: src/atmosphere/UKCA/ukca_cspecies.F90
===================================================================
--- src/atmosphere/UKCA/ukca_cspecies.F90	(revision 93557)
+++ src/atmosphere/UKCA/ukca_cspecies.F90	(revision 93589)
@@ -180,7 +180,7 @@
     c_nucarb12, c_udcarb8, c_udcarb11, c_udcarb14, c_tncarb26, c_tncarb10,     &
     c_tncarb12, c_tncarb11, c_ccarb12, c_tncarb15, c_rcooh25, c_txcarb24,      &
     c_txcarb22, c_ru12pan, c_rtn26pan, c_aroh14, c_aroh17, c_arnoh14,          &
-    c_arnoh17, c_anhy, c_cri
+    c_arnoh17, c_anhy, c_cri, c_alice, c_bob
 
 USE asad_mod,        ONLY: advt, nadvt, speci, jpctr, jpspec
 USE ukca_config_specification_mod, ONLY: ukca_config
@@ -449,6 +449,9 @@
 WHERE (advt == 'RAROH17   ') c_species = c_cri
 WHERE (advt == 'PASSIVE O3') c_species = 1.0
 WHERE (advt == 'AGE OF AIR') c_species = 1.0
+! UKCA Tutorial species
+WHERE (advt == 'ALICE     ') c_species = c_alice
+WHERE (advt == 'BOB       ') c_species = c_bob
 
 ! non-advected tracers
 c_na_species=0.0

These differences can be found in the file Tutorials/vn11.8/worked_solutions/Task04.2/Task04.2_code.patch.

Sample output from this task can be found at Tutorials/vn11.8/sample_output/Task04.2/atmosa.pa19810901_00.

Checklist

If required, copy an appropriate Rose suite to use to test your changes.
Make a new ticket on the Met Office SRS Trac pages.
Make a branch at the required MetUM version using fcm branch-create.
Checkout your branch using fcm checkout.
Choose slots for your new tracer(s) from the list in ukca_nmspec_mod.F90.
Make the required changes to branch's STASHmaster_A file, to add the new tracers.
Add help text for your tracers in your branch's STASHmaster-meta.conf file.
fcm commit the STASH changes to your branch.
Using a text editor, open the app/um/rose-app.conf file from your roses/[SUITE-ID] directory, and add the line STASHMASTER=STASHmaster in the [env] block, then save and close the file.
Using a text editor, open the rose-suite.conf file from your roses/[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/HEAD/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.
Initialise your tracers in your suite at: um namelist Reconfiguration and Ancillary Control Configure ancils and initialise dump fields.
Output your tracers 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, run fcm commit to commit your changes to the repository.
Run your suite.
Add your new tracer(s) from into the list in ukca_nmspec_mod.F90.
Add the tracer(s) to the chch_defs_strattrop array in ukca_chem_master.F90.
Increase the value of n_chem_tracers in ukca_config_defs_mod.F90.
Add a C_species value for each tracer in ukca_constants.F90.
Append the CASE statement in ukca_cspecies.F90 to add this value to the c_species array.
fcm commit the changes to your branch.
Run your suite again.

Tutorial 5


Written by Luke Abraham 2020