Difference between revisions of "Solution to UKCA Chemistry and Aerosol Tutorial 9 Task 9.1"
(9 intermediate revisions by the same user not shown) | |||
Line 8: | Line 8: | ||
<blockquote> |
<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 '''pa/UPA''' stream. |
+ | Output diagnostics of the reaction <math>\textrm{ALICE} + \textrm{OH} \longrightarrow \textrm{BOB} + \textrm{SEC\_ORG}</math> to STASH code '''34461''', the dry deposition of '''ALICE''' to STASH code '''34462''', and the wet deposition of '''BOB''' to '''34463'''. They should be outputted as a daily mean to the '''pa/UPA''' stream. |
</blockquote> |
</blockquote> |
||
Line 25: | Line 25: | ||
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 |
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, |
+ | asad_flux_defn('RXN',34461,'B',.FALSE.,0,4, & |
(/'ALICE ','OH '/), & |
(/'ALICE ','OH '/), & |
||
− | (/'BOB ',' |
+ | (/'BOB ','Sec_Org ',' ',' '/)), & |
asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, & |
asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, & |
||
(/'ALICE ',' '/), & |
(/'ALICE ',' '/), & |
||
Line 35: | Line 35: | ||
(/' ',' ',' ',' '/)) & |
(/' ',' ',' ',' '/)) & |
||
− | 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. |
+ | 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=== |
===STASHmaster file=== |
||
Line 53: | Line 53: | ||
#=============================================================================== |
#=============================================================================== |
||
# |
# |
||
− | 1| 1 | 34 | 461 |UKCA Tutorial: ALICE+OH->BOB |
+ | 1| 1 | 34 | 461 |UKCA Tutorial: ALICE+OH->BOB+Sec_Org| |
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | |
2| 0 | 0 | 1 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | |
||
3| 000000000000000000000000000000 | 00000000000000000001 | 3 | |
3| 000000000000000000000000000000 | 00000000000000000001 | 3 | |
||
Line 84: | Line 84: | ||
An example STASHmaster file can be found at |
An example STASHmaster file can be found at |
||
− | /home/ukca/userprestash/VN8. |
+ | /home/ukca/userprestash/VN8.4/Tutorial/Task9.1_Tutorial_Diags.presm |
===UMUI STASH table changes=== |
===UMUI STASH table changes=== |
||
Line 120: | Line 120: | ||
[[Image:ALICE_DryDep.png|thumb|150px|right|Figure 2: Dry deposition of ALICE 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.]] |
[[Image:BOB_WetDep.png|thumb|150px|right|Figure 3: Wet deposition of BOB in the lowest model level.]] |
||
− | Your ''' |
+ | Your '''pa''' file (located in your job directory) should now contain the following fields |
0 : 192 145 85 1 Stash code = 34001 |
0 : 192 145 85 1 Stash code = 34001 |
||
Line 129: | Line 129: | ||
5 : 192 145 85 1 Stash code = 34463 |
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. |
+ | The surface plot of the flux through the <math>\textrm{ALICE} + \textrm{OH} \longrightarrow \textrm{BOB} + \textrm{Sec\_Org}</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 |
'''Sample output''' from this job can be found in |
||
− | /work/n02/n02/ukca/Tutorial/sample_output/Task9.1/ |
+ | /work/n02/n02/ukca/Tutorial/vn8.4/sample_output/Task9.1/ |
− | on |
+ | on ARCHER, and in |
− | /projects/ukca/Tutorial/sample_ouput/Task9.1/ |
+ | <strike>/projects/ukca/Tutorial/vn8.4/sample_ouput/Task9.1/</strike> |
on MONSooN. |
on MONSooN. |
||
Line 147: | Line 147: | ||
The code changes can be viewed by using the following FCM command |
The code changes can be viewed by using the following FCM command |
||
− | fcm diff |
+ | fcm diff fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns@14713 fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns@14714 |
− | This gives the following |
+ | This gives the following output: |
Index: src/atmosphere/UKCA/asad_flux_dat.F90 |
Index: src/atmosphere/UKCA/asad_flux_dat.F90 |
||
=================================================================== |
=================================================================== |
||
− | --- src/atmosphere/UKCA/asad_flux_dat.F90 (revision |
+ | --- src/atmosphere/UKCA/asad_flux_dat.F90 (revision 14713) |
− | +++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision |
+ | +++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision 14714) |
@@ -102,7 +102,7 @@ |
@@ -102,7 +102,7 @@ |
||
CHARACTER(LEN=10) :: blank0 = ' ' ! Defines null product |
CHARACTER(LEN=10) :: blank0 = ' ' ! Defines null product |
||
Line 164: | Line 164: | ||
! Do we load standard diagnostics as done below (T), or use only reactions |
! Do we load standard diagnostics as done below (T), or use only reactions |
||
! specified in STASH (F) ? |
! specified in STASH (F) ? |
||
− | @@ - |
+ | @@ -923,6 +923,21 @@ |
− | (/' ',' ',' ',' '/)) & |
||
/) |
/) |
||
+ | |||
⚫ | |||
+ | +! UKCA Tutorial fluxes |
||
− | +! Tropospheric sulphur chemistry |
||
+ TYPE(asad_flux_defn), PARAMETER, PUBLIC :: & |
+ TYPE(asad_flux_defn), PARAMETER, PUBLIC :: & |
||
+ UKCA_Tutorial_Fluxes(3) = (/ & |
+ UKCA_Tutorial_Fluxes(3) = (/ & |
||
− | + asad_flux_defn('RXN',34461,'B',.FALSE.,0, |
+ | + asad_flux_defn('RXN',34461,'B',.FALSE.,0,4, & |
+ (/'ALICE ','OH '/), & |
+ (/'ALICE ','OH '/), & |
||
− | + (/'BOB ',' |
+ | + (/'BOB ','Sec_Org ',' ',' '/)), & |
+ asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, & |
+ asad_flux_defn('DEP',34462,'D',.FALSE.,0,1, & |
||
+ (/'ALICE ',' '/), & |
+ (/'ALICE ',' '/), & |
||
Line 182: | Line 181: | ||
+ (/' ',' ',' ',' '/)) & |
+ (/' ',' ',' ',' '/)) & |
||
+ /) |
+ /) |
||
⚫ | |||
+ |
+ |
||
PUBLIC :: ASAD_LOAD_DEFAULT_FLUXES |
PUBLIC :: ASAD_LOAD_DEFAULT_FLUXES |
||
Line 192: | Line 192: | ||
- asad_aerosol_chem & ! 16 232 |
- asad_aerosol_chem & ! 16 232 |
||
+ asad_aerosol_chem, & ! 16 232 |
+ asad_aerosol_chem, & ! 16 232 |
||
− | + UKCA_Tutorial_Fluxes & ! |
+ | + UKCA_Tutorial_Fluxes & ! 3 235 |
/) |
/) |
||
Latest revision as of 15:20, 15 December 2015
Back to UKCA Chemistry and Aerosol Tutorials
Back to the adding new diagnostics tutorial
Task
You were asked to
Output diagnostics of the reaction to STASH code 34461, the dry deposition of ALICE to STASH code 34462, and the wet deposition of BOB to 34463. They should be outputted as a daily mean to the pa/UPA stream.
and were given the hint
Remember to use the correct sampling frequency.
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,4, & (/'ALICE ','OH '/), & (/'BOB ','Sec_Org ',' ',' '/)), & 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+Sec_Org| 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 → Atmosphere → STASH → User-STASHmaster files. Diags, Progs & Ancils and the three diagnostics should be initialised to zero (Option 3) in Model Selection → Atmosphere → STASH → Initialisation of User Prognostics.
An example STASHmaster file can be found at
/home/ukca/userprestash/VN8.4/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 → Atmosphere → STASH → 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 → Copy Profile → 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 → Edit Profile → 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
Your pa file (located in your job 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 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/vn8.4/sample_output/Task9.1/
on ARCHER, and in
/projects/ukca/Tutorial/vn8.4/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 fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns@14713 fcm:um_br/dev/luke/vn8.4_UKCA_Tutorial_Solns@14714
This gives the following output:
Index: src/atmosphere/UKCA/asad_flux_dat.F90 =================================================================== --- src/atmosphere/UKCA/asad_flux_dat.F90 (revision 14713) +++ src/atmosphere/UKCA/asad_flux_dat.F90 (revision 14714) @@ -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) ? @@ -923,6 +923,21 @@ /) +! UKCA Tutorial fluxes + TYPE(asad_flux_defn), PARAMETER, PUBLIC :: & + UKCA_Tutorial_Fluxes(3) = (/ & + asad_flux_defn('RXN',34461,'B',.FALSE.,0,4, & + (/'ALICE ','OH '/), & + (/'BOB ','Sec_Org ',' ',' '/)), & + 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 Luke Abraham 2014