Sorry to bother you again. Last Nov. I raised a question re adding an online emission flux for an existing UKCA tracer (BrCl), but I did have much time to work on it until recently. What I did are:
adding a new emission species (BrCl) in subroutine /src/control/core/top_level/ukca_config_defs_mod.F90;
defining an online index (ibrcl_ssa) in subroutine /src/science/core/emissions/ukca_emiss_mod: ukca_onl_emiss_init :
IF (ANY (em_chem_spec == 'BrCl ')) THEN
ibrcl_ssa = num_cdf_em_flds + num_onln_em_flds + 1
num_onln_em_flds = num_onln_em_flds + 1
ENDIF
then within routine ukca_emiss_ctl_mod.F90, I passed the emission flux calcuated to emissions(ibrcl_ssa)%values(:,:,1).
However, the suite (ID: u-dm976) crushed with error message:
? Error code: 1
? Error from routine: GET_EMDIAG_STASH
? Error message: Unexpected UKCA emiss diagnostic: BrCl
? Error from processor: 402
? Error number: 778
Do I need to add “BrCl” as a new emitted specise within ukca_config_defs_mod.F90 if it is just online emitted? BTW, I cannot see the STASHmaster_A file. How do I get the um branch back?
If I do not need to add BrCl as a new emission species, then things may be easier. As I donot need to handle STARSHmaster file and diagnostics. But how do I pass the calculated emission flux to a specific species like BrCl? Thanks!
The error here is due to the emission diagnostic handling code not finding the STASH entry for the new diagnostic. If you have created an UM branch with STASHmaster changes this will have to be included in the fcm_make app. The emissions diagnostics are mapped to STASH numbers in UM routine src/control/ukca_interface/get_emdiag_stash.F90.
For online emissions there is no need to include these in em_chem_spec array- this is for file emissions only. The setting up of emissions(ibrcl_ssa)%xxx items in ukca_emiss_mod will ensure that the emission field is registered.
In the data structure, emissions(x)%tracer_name specifies which UKCA tracer the values should be added, but this has to be of 10 character length with trailing blanks if needed.
Finally, the emission values get added to the corresponding tracer in routine ukca_add_emiss so the emissions need to be calculated and added to emissions(ibrcl_ssa)%values before this point.
I did not have an UM branch for the suite (u-dm976), all the braches listed in the Sources are:
branches/dev/marcstringer/um13.0_bug_fixes@604
branches/dev/lukeabraham/um13.0_all_ntp_fix@1783
branches/dev/xinyang/r3049_bsn_br_v1@5384
I remebered I just created a UKCA branch, but donot know how to re-create a UM branch for this suite. If I have to create a new UM branch before the UKCA branch (or do everything from the beginning), please let me how to do it. Thanks!
An UM branch and STASHmaster changes will be needed if you want to output the new emission field as a diagnostic.
If needed, I can try to look if there is a simple recent example for doing this. Alternatively there is an exercise on creating emissions diagnostics in the UKCA tutorials. UKCA Chemistry and Aerosol UMvn13.0 Tutorial 8 - UKCA
Thanks! I have made some progress, but still have some confusions:
I copied a “UKCA” suite (u-dn546) and added the new UM branch generated (/home/n02/n02/emxin/vn13.0_ssa_brcl@311510) in GUI “um_sources”. is it right? Should I copy a new “UM” suite to run the model?
Although I can edit the file (app/um/rose-aap.conf) and commit the changes, I found all the updates are lost after I save the GUI (with other changes made). This looks strange and I do not know why. Note that the changes made in the new UM branch (eg in STASHmaster_A) are not affected by saving GUI.
What you are using is an UM model, which uses UKCA for Chem/aero, JULES as land-surface, (radiation from SOCRATES and so on). This extracts source code from all the different repositories including UKCA.
The GUI overwrites the rose-app.conf file when Saved (and Closed), so you can either edit this file manually or via GUI, not both at the same time.
Thanks for the prompt response. I now manually edit the files and save them before I open the GUI to make sure the changes are not lost. However, the suite u-dn546 crashed with errors likely linking to these files changed, see attached screenshot.
It looks like the STASHmaster specification was reversed in your last commit. Changeset 311546 for d/n/5/4/6/trunk – roses-u
The GUI should not remove any changes to rose-app.conf, unless you had another instance open before you made these.