It is assumed here that the starting point is a coupled model, involving both the UM and NEMO, already at the resolution required (probably ORCA1), and that the desire is to add MEDUSA to this.
Adding MEDUSA requires
It's not currently possible to turn MEDUSA off with a simple switch, and only changing a subset of these options will create a mess of a job, which will almost certainly fail.
In addition to the changes above, we want to couple some fields from MEDUSA to the UM and in the reverse direction and that requires further changes. The changes needed for this are shown in green. All the changes needed are described in the sections below below.
This file is needed for all the settings required by the TOP_SRC code in NEMO - which includes the MEDUSA code - and this includes the long list of parameters needed to run MEDUSA.
Creating this file from scratch would be a massive undertaking, so in all likelihood the addition of MEDUSA will require taking an existing file from an existing job. The parameters in this file have not changed for a few months and so this file should be consistent across all our jobs (although maybe we should try and version control it somewhere). Hence, there should be a number of jobs you can take this file, such as our current PD job, u-aj599, (as of 24 March 2017).
The environment variables defined in this file should be
To ensure the dust field is properly coupled to MEDUSA check the following is true.
Having created app/ocean_passive_tracers/rose-app.conf in the section above, it's necessary to import it into the coupled app. This is done by editing the top line of app/coupled/rose-app.conf so that it reads
import=um nemo_cice ocean_passive_tracers
The only differences to this app, should be the addition of the extra coupling fields.
The only other difference is the addition of the coupling which
requires the following lines adding below the `sn_rcv_antm' line
and the following lines adding below the `sn_snd_alb' line
sn_rcv_atm_dust='medusa','no','','',''
sn_rcv_atm_pco2='medusa','no','','',''
sn_snd_bio_co2='medusa','no','','',''
sn_snd_bio_dms='medusa','no','','',''
The field definitions for ocean passive tracers need adding to the iodef.xml file, by adding a link to field_def_bgc.xml above the link to core field definitions file, field_def.xml, so we have
〈field_definition src="./field_def_bgc.xml"/〉 〈field_definition src="./field_def.xml"/〉
There should not be any repetition between field_def.xml and field_def_bgc.xml now, but there has been in the past. By linking to field_def_bgc.xml, Tim Graham thinks that this will take precedence if any fields are defined twice.
The group definition for the ocean passive tracers also need adding just before the line `〈/file_group〉', with the code below
〈file id="file11" name_suffix="_ptrc_T" description="Medusa sms variables" 〉 〈field_group group_ref="groupMEDUSA" /〉 〈field_group group_ref="groupIDTRA" /〉 〈field_group group_ref="groupCFC" /〉 〈field_group group_ref="groupAGE" /〉 〈/file〉 〈file id="file12" name_suffix="_diad_T" description="Medusa diagnostic variables" 〉 〈field_group group_ref="groupMEDUSA_dia" /〉 〈field_group group_ref="groupMEDUSA_3dd" /〉 〈field_group group_ref="groupMEDUSA_dms" /〉 〈field_group group_ref="groupIDTRA_dia" /〉 〈field_group group_ref="groupCFC_dia" /〉 〈field_group group_ref="groupMEDUSA_cmip6" /〉 〈/file〉
However, check the file id numbers. Here we start with id="file11", but if any further groups have been added to the core ocean definitions then this may need to be increased, e.g. if the last id in the core ocean definitions is "file14", our new ids will need to be "file15" and "file16".
The only changes needed to the UM app is to enable the coupling.
Some of the coupling fields will only be turned on if l_oasis_obgc, where `obgc' stands for Ocean BioGeoChemistry, is set to true.
The two fields received by the UM from MEDUSA are DMS concentration (stash 132) and CO2 flux (stash 250). These fields need to be turned on, otherwise a problem will occur when the coupling code tries to write these received fields to D1. To do this the following stash items need adding
[namelist:items(91826e0f)] ancilfilename='' domain=1 !!interval=5 !!netcdf_varname='unset' !!period=3 source=4 stash_req=132 update_anc=.false. !!user_prog_ancil_stash_req= !!user_prog_rconst=0.0
and
[namelist:items(ce05eb52)] ancilfilename='' domain=1 !!interval=0 !!netcdf_varname='unset' !!period=1 source=4 stash_req=250 update_anc=.false. !!user_prog_ancil_stash_req=0 !!user_prog_rconst=0
To allow the total dust deposition flux to be sent from the UM to NEMO/MEDUSA, add the following STASH item
[namelist:items(7486d0f1)] ancilfilename='' domain=1 !!interval=1 !!netcdf_varname='unset' !!period=1 source=3 stash_req=197 update_anc=.false. !!user_prog_ancil_stash_req= !!user_prog_rconst=0.0
which ensures that there's a dust field permanently available to send to the ocean (a stash request is not written to the dump, and so is unavailable at the start of a run). However, this field needs to populated from the stash request below
[namelist:streq(03440_d0f5c1e1)] dom_name='DIAG' isec=3 item=440 package='' tim_name='TCOUPMN' use_name='UPCOUP'
where stash 3,440 is the total dust deposition flux and this stash entry ensures that it is averaged over the correct period.
The partial pressure of CO2 (pCO2) is calculated from the surface value of CO2. If we don't have interactive CO2, when i_co2_opt=1 or 2, CO2 is just a constant everywhere set by the variable co2_mmr, and this is used to calculate the 2D field sent to the ocean (no changes are needed). However, changes are required if there is interactive CO2 (i_co2_opt=3), which are similar to the changes for the total dust deposition flux above. The stash item below needs adding
[namelist:items(068de6e4)] ancilfilename='' domain=1 !!interval=1 !!netcdf_varname='unset' !!period=1 source=3 stash_req=196 update_anc=.false. !!user_prog_ancil_stash_req= !!user_prog_rconst=0.0
(The stash item 252 also needs to be on, but if you have interactive CO2 then this should already be on.) To ensure the stash item above is properly populated the following stash request is also needed
[namelist:streq(00252_91e56b40)] dom_name='DIAG' isec=0 item=252 package='' tim_name='TCOUPMN' use_name='UPCOUP'
which ensures that surface value of CO2 exists over the correct averaging period.
We're coupling four new fields (two in each direction), so the argument under $NFIELDS needs increasing from 74 to 78. In addition the following code needs adding below the `model01_OIceKn_cat05' entry
############################################################################ # TRANSDEF: OCNT ATMT 76 90 ###################################################### model01_OBioDMS dms_conc 470 10800 1 atmos_restart.nc EXPORTED 362 332 192 144 tor1 atm3 SEQ=+1 P 2 P 0 # MAPPING # rmp_tor1_to_atm3_CONSERV_FRACAREA.nc # ############################################################################ # TRANSDEF: OCNT ATMT 77 91 ###################################################### model01_OBioCO2 oCO2flux 470 10800 1 atmos_restart.nc EXPORTED 362 332 192 144 tor1 atm3 SEQ=+1 P 2 P 0 # MAPPING # rmp_tor1_to_atm3_CONSERV_FRACAREA.nc #
and the following code below the `icesouth model01_OAntmass' entry
############################################################################ # TRANSDEF: ATMT OCNT 78 92 1 ###################################################### atmpco2 model01_OATMPCO2 466 10800 1 atmos_restart.nc EXPORTED 192 144 362 332 atm3 tor1 SEQ=+2 P 0 P 2 # MAPPING # rmp_atm3_to_tor1_CONSERV_DESTAREA.nc # ############################################################################ # TRANSDEF: ATMT OCNT 79 93 1 ###################################################### atmdust model01_OATMDUST 466 10800 1 atmos_restart.nc EXPORTED 192 144 362 332 atm3 tor1 SEQ=+2 P 0 P 2 # MAPPING # rmp_atm3_to_tor1_CONSERV_DESTAREA.nc #