Difference between revisions of "UKCA Chemistry and Aerosol UMvn13.0 Tutorial 8"
Line 85: | Line 85: | ||
However, <span style="font-size: 110%; color: red">'''don't panic'''</span>. '''You are not expected to know python to complete this tutorial.''' You will be provided with an example script to use that you only need to edit a few lines to get to work. You do not need to write a script from scratch, just read-through the provided script and try to understand what it does, and why. |
However, <span style="font-size: 110%; color: red">'''don't panic'''</span>. '''You are not expected to know python to complete this tutorial.''' You will be provided with an example script to use that you only need to edit a few lines to get to work. You do not need to write a script from scratch, just read-through the provided script and try to understand what it does, and why. |
||
− | === |
+ | === Python notebook === |
In the directory: |
In the directory: |
||
Line 100: | Line 100: | ||
* [https://github.com/theabro/ukca/blob/master/Tutorials/UMvn13.0/notebooks/cf_UM-UKCA_T08.ipynb cf_UM-UKCA_T08.ipynb] |
* [https://github.com/theabro/ukca/blob/master/Tutorials/UMvn13.0/notebooks/cf_UM-UKCA_T08.ipynb cf_UM-UKCA_T08.ipynb] |
||
* [https://github.com/theabro/ukca/blob/master/Tutorials/UMvn13.0/notebooks/iris_UM-UKCA_T08.ipynb iris_UM-UKCA_T08.ipynb] |
* [https://github.com/theabro/ukca/blob/master/Tutorials/UMvn13.0/notebooks/iris_UM-UKCA_T08.ipynb iris_UM-UKCA_T08.ipynb] |
||
+ | |||
+ | Connect to the notebook using |
||
+ | |||
+ | * <div style="font-size: 140%;">'''http://localhost:4801/?token=UKCATraining'''</div> |
||
==Solution to Task8.1== |
==Solution to Task8.1== |
Revision as of 14:25, 14 November 2022
UKCA Chemistry and Aerosol Tutorials at UMvn13.0
Difficulty | HARD |
Time to Complete | 2 or more hours |
Video instructions |
Remember to run mosrs-cache-password.
What you will learn in this Tutorial
During this tutorial you will learn how to make new UKCA netCDF emissions files. Then you will learn how to add new emissions into UKCA so that they emit into one of your new tracers.
At the end of the previous tutorial you will now know how to create new tracers in the UM for use by UKCA. However, while the chemical reaction(s) added in tutorial 4 are active, as the tracers have been initialised to very small values these are not behaving as could be expected. This tutorial will teach you how to create an emissions file that the UKCA will read, and that you can then tell UKCA to use and emit into your tracer(s). These emissions will then become the higher concentrations that will drive the new chemistry.
This tutorial will go through the steps needed to make an emission into a tracer which UKCA does not currently emit into. The steps in making the NetCDF file will be the same for a species which is currently emitted into, although in this simpler case you would not need to make any code changes.
This example only deals with a single field. For a more detailed examples on changing emissions for all species, please see the Emissions for ACSIS webpage.
Task 8.1: Create a new NetCDF emissions file
Task 8.1: In theTutorials/UMvn13.0/Task05.1directory there is the file Emissions_of_ALICE.nc which is a 0.5x0.5 degree resolution surface emission field. You should regrid this file to the N48 ENDGame grid, and output it as a netCDF file that has the required netCDF metadata for a climatological surface emission without any diurnal cycle.
The netCDF emissions system
UKCA uses netCDF files to specify the emissions into UKCA species. Using netCDF files means that the metadata in the file can be used to specify various options, such as which diurnal cycle to use.
Metadata
In Global Atmosphere 7.0 and above, UKCA emissions are prescribed using NetCDF files, rather than using the the UM ancillary file format as NetCDF files allow for more flexibility and include informative metadata. For further information also see the UKCA documentation paper.
Emission field metadata
Each emission field in the NetCDF files needs to include the following variable metadata attributes (there is no requirement for the netCDF variable names themselves except that they be no longer than 80 characters):
- standard_name: It should be included if an appropriate name is present in the CF Standard Name Table (see http://cfconventions.org/standard-names.html). An example of a valid ‘standard name’ is
“tendency_of_atmosphere_mass_content_of_nitrogen_monoxide_due_to_emission”
(note that all substrings have to be separated by underscores). - long_name: It is recommendable but only compulsory if there is no ‘standard_name’ available for that emission field. There are no specific CF conventions for standard names, but within the UKCA code all substrings should be separated by white space as shown in this example:
“tendency of atmosphere mass content of nitrogen monoxide due to emission”.
The reason for this is given in the description of the attribute units. - tracer_name: This attribute has to be equal to the name of a tracer (or of an emission field such as ‘NO - aircrft’) present in the list of emissions for the given chemical scheme, i.e. em_chem_spec. This name is used by the subroutine UKCA_ADD_EMISS to add the emission field to the corresponding tracer. There should be at least one emission field in the NetCDF files (or alternatively an online emission field) with the value of tracer name equal to one of the items in em_chem_spec, otherwise the subroutine UKCA_EMISS_INIT (in module UKCA_EMISS_MOD) will report a missing tracer in the emission files and the model will stop with error.
- units: According to CF conventions, all emissions should be expressed in . As a consequence, all files will contain the attribute
units = "kg m-2 s-1"
However, under some circumstances emission fields need to be reported as kg of a given species (e.g. nitrogen, carbon, sulfur). When that is the case this needs to be indicated in the standard name attribute if possible (see example below), otherwise in the long name attribute. As an example, in the case of an emission field reported as kg of carbon, the attribute units will be “kg m-2 s-1” while the attribute standard name should contain the substring “expressed_as_carbon” if that is accepted by CF conventions for standard names (see http://cf-pcmdi.llnl.gov/documents/cf-standard-names); otherwise the attribute long name should contain the substring “expressed as carbon”. The UM subroutines BASE_EMISS_FACTORS and GET_BASE_SCALING will look for such substrings and apply some conversions if needed. It is therefore essential that the substrings in standard_name and long_name are separated by underscores and white spaces, respectively, as indicated above. - hourly_scaling: (optional) A character attribute used to apply a diurnal cycle to emissions data with daily or lower frequency. Allowed values:
- none (or attribute not present): no scaling
- traffic_uk: used for UK air quality studies
- TNO_MACC_EU_SNAPnn (where nn=01 to 11): Hourly factors of emissions for Europe. Calculated by TNO for the MACC project.
- diurnal_isopems (for isoprene emissions): use the routine UKCA DIURNAL ISOP EMS to calculate a diurnal cycle using solar zenith angle and latitude to compute the expected number of sunshine hours.
- daily_scaling (optional): A character attribute used to apply a weekly cycle to emissions weekly or lower frequency. Only allowed when the model is using the Gregorian calendar. Allowed values:
- none (or attribute not present): no scaling
- traffic_uk: used for UK air quality studies
- TNO_MACC_GB_SNAPnn (where nn=01 to 11): Hourly factors of emissions for Great Britain. Calculated by TNO for the MACC project.
- vertical_scaling (optional): A character attribute defining the vertical distribution of the emission. This allows the user to supply a 2D field to be applied over multiple levels. Allowed values:
- surface (or attribute not present): treat as surface emission
- all_levels, 3D: field is three-dimensional and is provided on model levels (must have the same number of levels as the model)
- high_level: spread a 2D field over multiple model levels, weighting by model layer thickness to achieve a uniform distribution in height. Must be accompanied by variable attributes lowest_level and lowest_level to indicate the model levels over which to distribute the emission.
- step1: used for air quality simulations, spreads emission over lowest 3 layers of the model; only allowed with 38 model levels.
- EMEP_modified_SNAPnn (where nn=01 to 11): Average vertical profiles for SNAP sectors, similar to implementation for EMEP model. See routine vertical emiss factors for details.
- Bieser_modified_SNAPnn (where nn=01 to 11): Average vertical profiles for SNAP sectors, similar to implementation of Bieser et al. (2011) with the SMOKE model and including fugitive emissions. See routine vertical_emiss_factors for details. In addition, each NetCDF file has to include two global attributes with information that is valid for all emission fields present in the file:
Time coordinate metadata
These metadata items are associated with the time dimension coordinate:
- calendar: A string indicating the calendar used, e.g. gregorian, 360day etc.
- calendar_flexible (optional): Integer number indicating whether or not the emission field can be used with other calendar types. This is typically allowed when used with monthly mean values.
- 0: Cannot be used with other calendar types
- 1: Can be used with other calendar types (i.e. a field designated as a 360day could also be used in a simulation using the Gregorian calendar, e.g. when nudging).
Global metadata
These metadata items are set globally:
- update_freq_in_hours: Integer indicating the frequency (in hours) at which all emission fields present in that file should be read to update emissions(:)%values (:,:,:) in the UKCA code. Update points are calculated relative the model’s ancil reftime.
- update_type: Integer number indicating the times at which the data is provided. The same conventions as for ancillary files have been adopted:
- 0: Single time
- 1: Time series
- 2: Periodic time series
- When emissions are treated as time series (update_type=1) the user is responsible for creating emission fields which cover the whole period for which the model is run; otherwise the model will not find the time registers to do interpolations and will stop with error. When emissions are periodic (update_type=2) each emission field has to include exactly 12 monthly average emissions (Jan, Feb, ..., Dec). Other attributes, in particular some global attributes, as well as some additional fields (e.g. a variable indicating the type of grid mapping) should be present in the files to comply with CF conventions for NetCDF data, but they are not used by the UKCA code.
Using python to regrid your emissions
For this task we will be using the cf-python library to regrid the emissions. This can also be done using the Met Office Iris library. For information on using Iris to regrid emissions, please see the UKCA UMvn11.8 Tutorials.
However, don't panic. You are not expected to know python to complete this tutorial. You will be provided with an example script to use that you only need to edit a few lines to get to work. You do not need to write a script from scratch, just read-through the provided script and try to understand what it does, and why.
Python notebook
In the directory:
Tutorials/UMvn13.0/Task08.1
you will find the file Emissions_of_ALICE.nc. Using this file, and using your output .pa file from your suite, you should regrid the emissions into the N48 ENDGame grid. You will later use the resulting NetCDF file in your suite. Jupyter notebooks either using cf-python or Iris have been provided to regrid these emissions, and can be found here:
Tutorials/UMvn13.0/notebooks/cf_UM-UKCA_T08.ipynb Tutorials/UMvn13.0/notebooks/iris_UM-UKCA_T08.ipynb
This can also be seen online here:
Connect to the notebook using
Solution to Task8.1
You were given the task:
- In the
Tutorials/vn11.8/Task05.1
directory there is the file Emissions_of_ALICE.nc which is a 0.5x0.5 degree resolution surface emission field. You should regrid this file to the N48 ENDGame grid, and output it as a netCDF file that has the required netCDF metadata for a climatological surface emission without any diurnal cycle.
It should be straight-forward to point to your .pa file to use in the script. You should read through it and have an understanding of how it works.
Once the file has been regridded, you should see the output looking like this:
A file that has been produced by the above script can be found at
Tutorials/UMvn13.0/sample_output/Task08.1/ukca_emiss_ALICE.nc
Task 8.2: make the required code changes to add your emission into UKCA
TASK 5.2: You should now make the UKCA code changes to add your emission into the ALICE tracer. Use STASH code s50i315 for the diagnostic and output this to the UPA stream as a 3-hour mean.
Hint |
---|
You will need to add-in the molar mass of ALICE. You can calculate this from the mass of air and the conversion factor defined in Task 3.1. You will need to add code to allow a diagnostic of the emission to be output. |
Rose changes
Include your new emissions file
There are several ways that the location of emissions files can be defined within the UKCA panel. These are:
- With a full path to the file
- Using environment variables set using an ancil_versions file
- A mixture of (1) and (2)
- By specifying a top-level directory in the ukca_em_dir Rose variable, and then paths to the required files within ukca_em_files
Within Rose you may also find that the files are in separate boxes (one for each file) or in a single long list.
The UKCA training suite uses option 1 above, specifying the full path in ukca_em_files. Note that ukca_em_dir is blank in this suite.
It is easier to add the emissions file by editing the app/um/rose-app.conf file directly in a text editor than by using rose edit. This is because Rose can sometimes make all the files appear on a single line, whereas in the text file they will be on separate lines. To find this block save and close your suite, and then open the app/um/rose-app.conf file in a text editor (e.g. emacs, vim, or leafpad). Search for ukca_em_files and you will find the text below:
ukca_em_files='$UMDIR/ancil/atmos/n48e/ukca_emiss/gfed3.1/clim_2002_2011/v2/ukca_emiss_BC_biomass.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/gfed3.1/clim_2002_2011/v2/ukca_emiss_OC_biomass.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/andres_kasgnoc/v1/ukca_emiss_SO2_nat.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_Monoterp.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/1970_2010/v1/ukca_emiss_SO2_low.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_BC_fossil.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_BC_biofuel.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_OC_fossil.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_OC_biofuel.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/1970_2010/v1/ukca_emiss_SO2_high.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/1970_2010/v1/ukca_emiss_DMS.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/1970_2010/v1/ukca_emiss_NH3.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_NO_aircrft.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_HCHO.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_CH4.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_MeCHO.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_C3H8.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_NO.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_C2H6.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_Me2CO.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_C5H8.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_NVOC.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_CO.nc'
you will need to add a new line at the end of the block, with the = sign aligned, specifying the path to your new file. Don't forget to add a comma (,) at the end of the line above.
Diagnostics
You should add your new diagnostics to the STASH panel as you have done in Tutorial 6 and [7]. You won't need to make any changes to the location of the STASHmaster file so long as you commit your changes prior to running the suite.
Code changes
Code changes are split between changes that need to be made to the UM and those that are made to UKCA.
UKCA code changes
Code changes to use the new emissions
src/control/core/top_level/ukca_config_defs_mod.F90
You will need to edit the em_chem_spec array for the scheme that you are using to include the new species that you are emitting into. By convention, these are ordered as 2D fields followed by 3D fields, with chemical emissions first and then aerosol emissions, although this order is unimportant other than the fact that the 2D emissions should be placed before the 3D emissions of 'SO2_nat', 'BC_biomass', 'OC_biomass', and 'NO_aircrft' if these are present.
If the tracer is purely chemical and is always on (i.e. is not included only when aerosol chemistry is turned on) then you will need to put this in both em_chem_spec arrays (i.e. one for the chemistry scheme without aerosols and one with aerosols). Also remember to increment this size of the em_chem_spec array, given by n_chem_emissions variable.
For this example you will need to make changes for StratTrop and CRI-Strat (version 2) schemes, both with an without aerosol chemistry.
src/science/core/chemistry/ukca_constants.F90
You will need to define the M_species for the emitted species. This should be consistent with the C_species value set in the previous tutorial.
src/science/core/chemistry/get_molmass_mod.F90
You will need to add to the species_name CASE statement, to include a line such as this
CASE ('ALICE ') get_molmass = m_alice
for each new species that you are emitting into.
As the M_species conversion factors are defined in the ukca_constants module you will need to explicitly add them to the
USE ukca_constants, ONLY: ...
statement at the top of the module.
Code changes for the emissions diagnostics
Additionally, by default, when emitting into a new species, the code requires you to create a diagnostic for these emissions as well. These changes are also considered below.
src/control/core/diagnostics/ukca_emdiags_struct_mod.F90
This routine contains the derived type that holds the emissions fluxes for all species. You will need to add a logical (used to determine whether the output has been requested in STASH) and a pointer to a 2D or 3D array that will hold the emissions flux.
src/control/core/diagnostics/ukca_update_emdiagstruct_mod.F90
In this routine you will need to add the initialisation of the logical added in ukca_emdiags_struct_mod.F90, as well as a small block of code that copies the 2D/3D em_diags data into the newly created pointer in the derived type. The logical will also need to be set to .TRUE. if STASH output has been requested (determined by the sf(item,section) look-up array).
Here is it easiest to copy an existing code-block and make the necessary changes for your new emission.
src/control/core/diagnostics/ukca_emiss_diags_mod.F90
In this routine you will add a unique code-block for this diagnostic that copies the pointer in the derived type into the stashwork array using the copydiag or copydiag_3d routines. The stashwork array contains all the fields that will be output through STASH.
Here is it easiest to copy an existing code-block and make the necessary changes for your new emission.
src/science/core/emissions/ukca_emiss_ctl_mod.F90
The call to ukca_emiss_diags is protected by an IF statement, and you'll need to add a check to the entry in the sf array to see if the diagnostic is on. This should be of the format sf(N,section), where N is the item number of your new emissions diagnostic.
UM code changes
These code changes need to be made in a UM branch, and relate to the emissions diagnostics.
src/control/ukca_interface/get_emdiag_stash_mod.F90
Once you have decided on the STASH code to use, you need to add the species and 3-digit item code to this routine in the CASE statement.
STASHmaster_A and STASHmaster-meta.conf
These files are contained in the rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/ directory of the UM.
You should add a diagnostic in a similar way to the section 34 tracers, but in this case to section 50. It is best to copy an existing 2D (or 3D) emissions diagnostic specification into an empty slot at the end of the emissions list (e.g. section 50, item 315 for instance), and make only the required edits to that.
Once you have made these code changes you should commit your branch to ensure that these STASHmaster changes are picked-up by your suite correctly when running.
Note that 2D emissions diagnostics won't need to have a corresponding pressure-level field added in section 52. Only 3D emissions diagnostics fields will need this.
Worked Solution to Task 8.2
You were given the task
- You should now make the UKCA code changes to add your emission into the ALICE tracer. Use STASH code s50i315 for the diagnostic and output this to the UPA stream as a 3-hour mean.
You were given the hints
- You will need to add-in the molar mass of ALICE. You can calculate this from the mass of air and the conversion factor defined in Task 3.1.
- You will need to add code to allow a diagnostic of the emission to be output.
Once you have made the required code and Rose changes, you should now see that the ALICE tracer now looks a bit like the emissions field you created in Task 8.1.
The specific Rose changes made are:
Index: app/um/rose-app.conf =================================================================== --- app/um/rose-app.conf (revision 237210) +++ app/um/rose-app.conf (revision 237703) @@ -3091,6 +3091,7 @@ ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_C5H8.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_NVOC.nc', ='$UMDIR/ancil/atmos/n48e/ukca_emiss/cmip5/2000/v1/ukca_emiss_CO.nc' + ='/home/vagrant/ukca_emiss_ALICE.nc' ukca_h1202mmr=3.788e-13 ukca_h1211mmr=2.225e-11 ukca_h1301mmr=1.363e-11 @@ -3956,6 +3957,14 @@ tim_name='T3HMN' use_name='UPA' +[namelist:umstash_streq(50315_f7d499b0)] +dom_name='DIAG' +isec=50 +item=315 +package= +tim_name='T3HMN' +use_name='UPA' + [namelist:umstash_streq(51001_3e6241a4)] dom_name='DP27CCM' isec=51
These differences can be found here:
Tutorials/UMvn13.0/worked_solutions/Task08.2/Task08.2_rose.patch
The specific UKCA changes made are:
Index: src/control/core/diagnostics/ukca_emdiags_struct_mod.F90 =================================================================== --- src/control/core/diagnostics/ukca_emdiags_struct_mod.F90 (revision 488) +++ src/control/core/diagnostics/ukca_emdiags_struct_mod.F90 (revision 556) @@ -65,6 +65,8 @@ LOGICAL :: l_em_etcho LOGICAL :: l_em_hoch2cho LOGICAL :: l_em_mek + ! UKCA Tutorial + LOGICAL :: l_em_alice ! Pointers to hold emission diagnostics @@ -104,6 +106,8 @@ REAL, POINTER :: em_etcho (:,:) REAL, POINTER :: em_hoch2cho(:,:) REAL, POINTER :: em_mek (:,:) + ! UKCA Tutorial + REAL, POINTER :: em_alice (:,:) END TYPE emdiags_struct Index: src/control/core/diagnostics/ukca_emiss_diags_mod.F90 =================================================================== --- src/control/core/diagnostics/ukca_emiss_diags_mod.F90 (revision 488) +++ src/control/core/diagnostics/ukca_emiss_diags_mod.F90 (revision 556) @@ -491,6 +491,15 @@ emdiags%em_mek (:,:), row_length, rows) END IF +!--------------------------------------------------------------------- +! Sec 50, item 315: ALICE surface emissions for UKCA Tutorial +item = get_emdiag_stash ('ALICE ') +IF (sf(item, section)) THEN + CALL copydiag (stashwork (si(item,section,im_index): & + si_last(item,section,im_index)), & + emdiags%em_alice (:,:), row_length, rows) +END IF + IF (lhook) CALL dr_hook(ModuleName//':'//RoutineName,zhook_out,zhook_handle) RETURN Index: src/control/core/diagnostics/ukca_update_emdiagstruct_mod.F90 =================================================================== --- src/control/core/diagnostics/ukca_update_emdiagstruct_mod.F90 (revision 488) +++ src/control/core/diagnostics/ukca_update_emdiagstruct_mod.F90 (revision 556) @@ -121,6 +121,8 @@ emdiags%l_em_etcho = .FALSE. emdiags%l_em_hoch2cho= .FALSE. emdiags%l_em_mek = .FALSE. + ! UKCA Tutorial + emdiags%l_em_alice = .FALSE. l_first = .FALSE. END IF @@ -535,6 +537,17 @@ END IF END IF +! UKCA Tutorial +CASE ('ALICE ') + IF (emdiags%l_em_alice) THEN + emdiags%em_alice (:,:) = em_diags (:,:,1) + ELSE + IF (sf(item,section)) THEN + ALLOCATE (emdiags%em_alice (row_length, rows)) + emdiags%em_alice (:,:) = em_diags (:,:,1) + emdiags%l_em_alice = .TRUE. + END IF + END IF CASE DEFAULT ! Report error unless this is an aerosol emission (BC_fossil:, etc) Index: src/control/core/top_level/ukca_config_defs_mod.F90 =================================================================== --- src/control/core/top_level/ukca_config_defs_mod.F90 (revision 488) +++ src/control/core/top_level/ukca_config_defs_mod.F90 (revision 556) @@ -307,7 +307,7 @@ ! ======================= ELSE IF (ukca_config%l_ukca_strattrop) THEN IF (.NOT. ukca_config%l_ukca_achem) THEN ! If NOT using aerosol chemistry - n_chem_emissions = 10 + n_chem_emissions = 11 n_3d_emissions = 1 ! aircraft NOX n_aero_tracers = 0 ALLOCATE(em_chem_spec(n_chem_emissions+n_3d_emissions)) @@ -314,13 +314,13 @@ em_chem_spec = & ['NO ','CH4 ','CO ','HCHO ', & 'C2H6 ','C3H8 ','Me2CO ','MeCHO ', & - 'C5H8 ', nm_meoh_em ,'NO_aircrft'] + 'C5H8 ', nm_meoh_em ,'ALICE ','NO_aircrft'] n_chem_tracers = 73 ! No chem tracers nr_therm = 221 ! thermal reactions nr_phot = 55 ! photolytic (ATA) ELSE ! If using aerosol chemistry - n_chem_emissions = 19 ! em_chem_spec below + n_chem_emissions = 20 ! em_chem_spec below n_3d_emissions = 4 ! BC, OC, volc SO2 & aircraft NOX ALLOCATE(em_chem_spec(n_chem_emissions+n_3d_emissions)) em_chem_spec = & @@ -328,8 +328,8 @@ 'C2H6 ','C3H8 ','Me2CO ','MeCHO ', & 'C5H8 ','BC_fossil ','BC_biofuel','OM_fossil ', & 'OM_biofuel','Monoterp ', nm_meoh_em ,'SO2_low ', & - 'SO2_high ','NH3 ','DMS ','SO2_nat ', & - 'BC_biomass','OM_biomass','NO_aircrft'] + 'SO2_high ','NH3 ','DMS ','ALICE ', & + 'SO2_nat ','BC_biomass','OM_biomass','NO_aircrft'] n_aero_tracers = 12 n_chem_tracers = 73 ! No chem tracers IF (ukca_config%l_ukca_trophet) THEN @@ -389,7 +389,7 @@ nr_therm = 572 ! thermal reactions nr_phot = 121 ! photolytic reacs END IF - n_chem_emissions = 26 + n_chem_emissions = 27 n_3d_emissions = 1 ! aircraft NOX ALLOCATE(em_chem_spec(n_chem_emissions+n_3d_emissions)) em_chem_spec = & @@ -399,7 +399,7 @@ 'BPINENE ','BENZENE ','TOLUENE ','oXYLENE ', & nm_meoh_em ,'EtOH ','HCHO ','MeCHO ', & 'EtCHO ','Me2CO ','MEK ','HCOOH ', & - 'MeCO2H ','HOCH2CHO ','NO_aircrft'] + 'MeCO2H ','HOCH2CHO ','ALICE ','NO_aircrft'] ELSE ! With aerosol IF (ukca_config%i_ukca_chem_version >= 119) THEN ! CRI-Strat 2 with aerosol n_chem_tracers = 173 ! advected chemical tracers (+9, -4) @@ -420,7 +420,7 @@ nr_therm = 593 ! thermal reactions END IF END IF - n_chem_emissions = 34 ! em_chem_spec below + n_chem_emissions = 35 ! em_chem_spec below n_3d_emissions = 4 ! BC, OC, volc SO2 & aircraft NOX ALLOCATE(em_chem_spec(n_chem_emissions+n_3d_emissions)) em_chem_spec = & @@ -432,8 +432,8 @@ 'EtCHO ','Me2CO ','MEK ','HCOOH ', & 'MeCO2H ','HOCH2CHO ','BC_fossil ','BC_biofuel', & 'OM_fossil ','OM_biofuel','SO2_low ','SO2_high ', & - 'NH3 ','DMS ','SO2_nat ','BC_biomass', & - 'OM_biomass','NO_aircrft'] + 'NH3 ','DMS ','ALICE ', & + 'SO2_nat ','BC_biomass','OM_biomass','NO_aircrft'] END IF ELSE Index: src/science/core/chemistry/get_molmass_mod.F90 =================================================================== --- src/science/core/chemistry/get_molmass_mod.F90 (revision 488) +++ src/science/core/chemistry/get_molmass_mod.F90 (revision 556) @@ -50,7 +50,7 @@ m_nh3, m_no, m_no2, m_oclo, m_ocs, m_oxylene, & m_so2, m_so4, m_toluene, m_c2h2, m_tbut2ene, & m_benzene, m_etoh, m_etcho, m_mek, m_hcooh, & - m_meco2h, m_hoch2cho + m_meco2h, m_hoch2cho, m_alice USE ereport_mod, ONLY: ereport USE parkind1, ONLY: jpim, jprb ! DrHook @@ -283,6 +283,11 @@ CASE ('HOCH2CHO ') get_molmass = m_hoch2cho +! ----------------------------------------- +! UKCA Tutorial Tracer +CASE ('ALICE ') + get_molmass = m_alice + ! ----------------------------------------- ! Others (report warning) CASE ('AGE ') Index: src/science/core/chemistry/ukca_constants.F90 =================================================================== --- src/science/core/chemistry/ukca_constants.F90 (revision 488) +++ src/science/core/chemistry/ukca_constants.F90 (revision 556) @@ -615,6 +615,9 @@ ! - Using m_cri = 150g/mol (same as Sec_org) REAL, PARAMETER :: m_cri = 150.0 +! UKCA Tutorial tracers - only ALICE is emitted +REAL, PARAMETER :: m_alice = 28.97 + ! For solar calculations REAL :: fxb ! Latitude of tropic of Capricorn (radians) REAL :: fxc ! Hours per day / pi Index: src/science/core/emissions/ukca_emiss_ctl_mod.F90 =================================================================== --- src/science/core/emissions/ukca_emiss_ctl_mod.F90 (revision 488) +++ src/science/core/emissions/ukca_emiss_ctl_mod.F90 (revision 556) @@ -1097,7 +1097,7 @@ sf(304,section) .OR. sf(305,section) .OR. sf(306,section) .OR. & sf(307,section) .OR. sf(308,section) .OR. sf(309,section) .OR. & sf(310,section) .OR. sf(311,section) .OR. sf(312,section) .OR. & - sf(313,section) .OR. sf(314,section) ) THEN + sf(313,section) .OR. sf(314,section) .OR. sf(315,section) ) THEN CALL ukca_emiss_diags (row_length, rows, model_levels, & len_stashwork50, stashwork50)
These differences can be found here:
Tutorials/UMvn13.0/worked_solutions/Task08.2/Task08.2_ukca.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 112662) +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster-meta.conf (revision 112818) @@ -27059,6 +27059,14 @@ = =Available only if NetCDF emission system of UKCA is used +[stashmaster:code(50315)] +description=ALICE surf emissions (kg m-2 s-1) +help=Surface emission flux of ALICE (2D) + =kg m-2 s-1 + =Valid on all timesteps + = + =Available only if NetCDF emission system of UKCA is used + [stashmaster:code(50331)] help=Chemical reaction flux for COS + hv => CO + SO2 =(moles/s) Index: rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A =================================================================== --- rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 112662) +++ rose-meta/um-atmos/HEAD/etc/stash/STASHmaster/STASHmaster_A (revision 112818) @@ -28211,6 +28211,12 @@ 4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | 5| 0 | 0 | 0 | 129 | 0 | 0 | 0 | 0 | 0 | # +1| 1 | 50 | 315 |ALICE surf emissions (kg m-2 s-1) | +2| 0 | 0 | 1 | 1 | 5 | -1 | -1 | 0 | 0 | 0 | 0 | +3| 000000000000000000010000010000 | 00000000000000000001 | 3 | +4| 1 | 0 | -99 -99 -99 -99 -99 -99 -99 -99 -99 -99 | +5| 0 | 0 | 0 | 129 | 0 | 0 | 0 | 0 | 0 | +# 1| 1 | 50 | 331 |RXN FLUX: COS + hv => CO + SO2 | 2| 0 | 0 | 17 | 1 | 2 | 10 | 11 | 0 | 0 | 0 | 0 | 3| 000000000000000000110000010000 | 00000000000000000001 | 3 | Index: src/control/ukca_interface/get_emdiag_stash_mod.F90 =================================================================== --- src/control/ukca_interface/get_emdiag_stash_mod.F90 (revision 112662) +++ src/control/ukca_interface/get_emdiag_stash_mod.F90 (revision 112818) @@ -175,6 +175,9 @@ CASE ('MEK ') get_emdiag_stash = 314 +CASE ('ALICE ') + get_emdiag_stash = 315 + CASE DEFAULT ! Report error ierr = 1
These differences can be found here:
Tutorials/UMvn13.0/worked_solutions/Task08.2/Task08.2_um.patch
Sample output from this task can be found at
Tutorials/UMvn13.0/sample_output/Task08.2/
Checklist
- ☐ Obtain emissions data for the species of interest.
- ☐ Regrid the emissions to the correct MetUM resolution that you are using.
- ☐ Save these emissions as netCDF, including the required metadata that UKCA requires.
- ☐ In your suite, include this file in the ukca_em_files variable in the UKCA panel: um namelist UM Science Settings Section 34 - UKCA: UK Aerosols and Chemistry Emissions.
- ☐ Put the species being emitted into the em_chem_spec array in ukca_config_defs_mod.F90, and increment n_chem_emissions.
- ☐ Put the correct M_species value in ukca_constants.F90.
- ☐ In get_molmass_mod.F90, append the CASE statement with your new species.
- ☐ Make diagnostics output slots for your new emissions in STASHmaster_A and add help-text to STASHmaster-meta.conf.
- ☐ If required, 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.
- ☐ If required, 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.
- ☐ If required, include your branch in your suite at: fcm_make env Sources.
- ☐ In get_emdiag_stash_mod.F90 add the species and 3-digit item code to the CASE statement.
- ☐ In ukca_emdiags_struct_mod.F90 add a logical and array pointer to the derived type for your new species.
- ☐ In ukca_update_emdiagstruct_mod.F90 initialise your new derived type entries, and add a block of code to copy the emissions field into the diagnostic pointer.
- ☐ In ukca_emiss_diags_mod.F90 add a code block to copy the field to the stashwork array using copydiag/copydiag_3d.
- ☐ In ukca_emiss_ctl_mod.F90 add the sf(ITEM,section) check in the IF statement protecting the call to ukca_emiss_diags.
- ☐ fcm commit the changes to your branch.
- ☐ Output your emissions diagnostic in: 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.
UKCA Chemistry and Aerosol Tutorials at UMvn13.0
Written by Luke Abraham 2022