Difference between revisions of "Solution to UKCA Chemistry and Aerosol Tutorial 11 Task 11.1"

From UKCA
(Blanked the page)
 
Line 1: Line 1:
[[UKCA Chemistry and Aerosol Tutorials | Back to UKCA Chemistry and Aerosol Tutorials]]
 
 
[[UKCA Chemistry and Aerosol Tutorial 11#Task 11.1: Output new diagnostics | Back to the adding new diagnostics tutorial]]
 
 
==Task==
 
 
You were asked to
 
 
<blockquote>
 
Output diagnostics of the reaction <math>\textrm{ALICE} + \textrm{OH} \longrightarrow \textrm{BOB}</math> to STASH code '''34461''', the dry deposition of '''ALICE''' to STASH code '''34462''', and the wet deposition of '''BOB''' to '''34463'''. They should be outputted as a daily mean to the '''pb/UPB''' stream.
 
</blockquote>
 
 
and were given the hint
 
 
<blockquote>
 
Remember to use the correct sampling frequency.
 
</blockquote>
 
 
==Solution==
 
 
As well as making some code changes and making a new user STASHmaster file, you will also need to make some changes to the STASH table to output the diagnostics correctly.
 
 
===Changes to asad_flux_dat.F90===
 
 
The only code changes that need to be made are in '''asad_flux_dat.F90''', where you will need to add the following diagnostic specification blocks
 
 
asad_flux_defn('RXN',34461,'B',.FALSE.,0,3, &
 
(/'ALICE ','OH '/), &
 
(/'BOB ',' ',' ',' '/)), &
 
asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, &
 
(/'ALICE ',' '/), &
 
(/' ',' ',' ',' '/)), &
 
asad_flux_defn('DEP',34463,'W',.FALSE.,0,1, &
 
(/'BOB ',' '/), &
 
(/' ',' ',' ',' '/)) &
 
 
It is probably best to make this as a separate array, rather than add this to the end of an existing array. You should then add this array into the '''asad_chemical_fluxes''' master array that holds all the possible diagnostics. You should also increase the '''n_chemical_fluxes''' integer by 3 to '''235''' to take account of these extra fluxes.
 
 
===STASHmaster file===
 
 
You will need to make a user STASHmaster file which looks similar to
 
 
H1| SUBMODEL_NUMBER=1
 
H2| SUBMODEL_NAME=ATMOS
 
H3| UM_VERSION=8.2
 
#
 
#|Model |Sectn | Item |Name |
 
#|Space |Point | Time | Grid |LevelT|LevelF|LevelL|PseudT|PseudF|PseudL|LevCom|
 
#| Option Codes | Version Mask | Halo |
 
#|DataT |DumpP | PC1 PC2 PC3 PC4 PC5 PC6 PC7 PC8 PC9 PCA |
 
#|Rotate| PPF | USER | LBVC | BLEV | TLEV |RBLEVV| CFLL | CFFF |
 
#
 
#===============================================================================
 
#
 
1| 1 | 34 | 461 |UKCA Tutorial: ALICE+OH->BOB Flux |
 
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 1871 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
#
 
1| 1 | 34 | 462 |UKCA Tutorial: ALICE Dry Dep (3D) |
 
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 1871 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
#
 
1| 1 | 34 | 463 |UKCA Tutorial: BOB Wet Dep (3D) |
 
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000000 | 00000000000000000001 | 3 |
 
4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 |
 
5| 0 | 1871 | 0 | 65 | 0 | 0 | 0 | 0 | 0 |
 
#
 
#===============================================================================
 
#
 
1| -1 | -1 | -1 |END OF FILE MARK |
 
2| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
 
3| 000000000000000000000000000000 | 00000000000000000000 | 0 |
 
4| 0 | 0 | -99 -99 -99 -99 -30 -99 -99 -99 -99 -99 |
 
5| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
 
#
 
 
This should be included in the UMUI in '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; User-STASHmaster files. Diags, Progs & Ancils''' and the three diagnostics should be initialised to zero ('''Option''' '''3''') in '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; Initialisation of User Prognostics'''.
 
 
An example STASHmaster file can be found at
 
 
/home/ukca/userprestash/VN8.2/Tutorial/Task9.1_Tutorial_Diags.presm
 
 
===UMUI STASH table changes===
 
 
Once you have added in your new user STASHmaster file, you can now output these diagnostics through the STASH panel, by placing entries in the STASH table. However, to do this properly you will need to make a new STASH '''Time Profile'''.
 
 
Go to '''Model Selection &rarr; Atmosphere &rarr; STASH &rarr; STASH. Specification of Diagnostics requirements''' to make these changes.
 
 
====Create a new time profile====
 
 
We want to output these diagnostics as daily means, but we cannot use the existing '''TDAYM''' time profile, as the ''sampling frequency'' is incorrect. We also don't want to alter the existing ''TDAYM'' profile as this will then affect all diagnostics currently outputted using this profile. To make the required changes you need to
 
 
# Select the '''TDAYM''' profile (it should now highlight yellow)
 
## Go to '''Profiles &rarr; Copy Profile &rarr; Copy time'''
 
## You will now be asked for a new name to copy this profile to (e.g. '''TDYMUKCA''')
 
# Now select this new profile
 
## Edit it by going to '''Profiles &rarr; Edit Profile &rarr; Edit time'''
 
## Set the '''Frequency (every)''' to '''3'''
 
## Change the '''Sampling offset''' to '''2'''
 
## Click '''Close''' to save these changes
 
 
You have now created a new time profile with the correct sampling frequency for UKCA diagnostics.
 
 
====Output the diagnostics====
 
 
Now that you have created the new time profile ('''TDYMUKCA'''), you should use it to output the diagnostics as
 
 
34 461 UKCA Tutorial: ALICE+OH->BOB Flux TDYMUKCA DALLTH UPB Y + Y
 
34 462 UKCA Tutorial: ALICE Dry Dep (3D) TDYMUKCA DALLTH UPB Y + Y
 
34 463 UKCA Tutorial: BOB Wet Dep (3D) TDYMUKCA DALLTH UPB Y + Y
 
 
==Output==
 
 
[[Image:ALICE_OH_Flux.png|thumb|150px|right|Figure 1: Flux through the ALICE+OH->BOB Reaction in the lowest model level.]]
 
[[Image:ALICE_DryDep.png|thumb|150px|right|Figure 2: Dry deposition of ALICE in the lowest model level.]]
 
[[Image:BOB_WetDep.png|thumb|150px|right|Figure 3: Wet deposition of BOB in the lowest model level.]]
 
Your '''pb''' file (located in your '''[[UKCA & UMUI Tutorials: Things to know before you start#Archiving|archive]]''' directory) should now contain the following fields
 
 
0 : 192 145 85 1 Stash code = 34001
 
1 : 192 145 85 1 Stash code = 34064
 
2 : 192 145 85 1 Stash code = 34065
 
3 : 192 145 85 1 Stash code = 34461
 
4 : 192 145 85 1 Stash code = 34462
 
5 : 192 145 85 1 Stash code = 34463
 
 
The surface plot of the flux through the <math>\textrm{ALICE} + \textrm{OH} \longrightarrow \textrm{BOB}</math> can be seen in Figure 1, the dry deposition flux of ALICE is in Figure 2, and the wet deposition flux of BOB is in Figure 3. All fluxes are in moles/gridcell/s.
 
 
'''Sample output''' from this job can be found in
 
 
/work/n02/n02/ukca/Tutorial/sample_output/Task9.1/
 
 
on HECToR, and in
 
 
/projects/ukca/Tutorial/sample_ouput/Task9.1/
 
 
on MONSooN.
 
 
==Worked Solution==
 
 
There is a worked solution to this problem in the UMUI Tutorial experiment. This is job '''j''': ''Tutorial: solution to Task 9.1 - add new diagnostics''.
 
 
The code changes can be viewed by using the following FCM command
 
 
fcm diff -g fcm:um_br/dev/luke/vn8.2_UKCA_Tutorial_Solns@12227 fcm:um_br/dev/luke/vn8.2_UKCA_Tutorial_Solns@12230
 
 
This gives the following (non-graphical) output:
 
 
Index: src/atmosphere/UKCA/asad_flux_dat.F90
 
===================================================================
 
--- src/atmosphere/UKCA/asad_flux_dat.F90 (revision 12227)
 
+++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision 12230)
 
@@ -102,7 +102,7 @@
 
CHARACTER(LEN=10) :: blank0 = ' ' ! Defines null product
 
 
! Number of chemical fluxes defined below
 
- INTEGER, PARAMETER :: n_chemical_fluxes = 232
 
+ INTEGER, PARAMETER :: n_chemical_fluxes = 235
 
 
! Do we load standard diagnostics as done below (T), or use only reactions
 
! specified in STASH (F) ?
 
@@ -922,6 +922,21 @@
 
(/' ',' ',' ',' '/)) &
 
/)
 
 
+
 
+! Tropospheric sulphur chemistry
 
+ TYPE(asad_flux_defn), PARAMETER, PUBLIC :: &
 
+ UKCA_Tutorial_Fluxes(3) = (/ &
 
+ asad_flux_defn('RXN',34461,'B',.FALSE.,0,3, &
 
+ (/'ALICE ','OH '/), &
 
+ (/'BOB ',' ',' ',' '/)), &
 
+ asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, &
 
+ (/'ALICE ',' '/), &
 
+ (/' ',' ',' ',' '/)), &
 
+ asad_flux_defn('DEP',34463,'W',.FALSE.,0,1, &
 
+ (/'BOB ',' '/), &
 
+ (/' ',' ',' ',' '/)) &
 
+ /)
 
+
 
PUBLIC :: ASAD_LOAD_DEFAULT_FLUXES
 
INTERFACE ASAD_LOAD_DEFAULT_FLUXES
 
MODULE PROCEDURE ASAD_LOAD_DEFAULT_FLUXES
 
@@ -1005,7 +1020,8 @@
 
asad_strat_oh_loss, & ! 26 181
 
asad_strat_o3_budget, & ! 20 201
 
asad_strat_o3_misc, & ! 15 216
 
- asad_aerosol_chem & ! 16 232
 
+ asad_aerosol_chem, & ! 16 232
 
+ UKCA_Tutorial_Fluxes & ! 3 235
 
/)
 
 
ELSE
 
 
----
 
''Written by [[User:Nla27 | Luke Abraham]] 2014''
 

Latest revision as of 17:11, 25 February 2014