Scheduled Downtime
On Friday 21 April 2023 @ 5pm MT, this website will be down for maintenance and expected to return online the morning of 24 April 2023 at the latest

Adding an emission of a new chemical


New member

I am trying to add in new chemicals into WRF-Chem. To do this, I
  • Copied and renamed a chemical mechanism from the KPP (in my case, it was RADM2_KPP)
    • I renamed the files inside my new chemical mechanism to reflect the new name
    • I adjusted the chemical equation file to reflect the chemical reactions associated with these chemicals
  • I adjusted the Registry/registry.chem files to reflect my updates
    • I added my new chemicals as state reals.
    • I added the anthropogenic emissions of these new chemicals as state reals per this answer. Later, I made these emissions print out into the history file.
    • I added a package for chem_opt, setting it as 999 with my new chemicals preceding ho2, per this answer.
    • I added a package for emiss_opt, setting it as 99 with the emissions of my new chemicals inserted into the list.
    • I added a package for emiss_inpt_opt, setting it as 99 (though my result has not changed if I set it as this in the namelist.input)
  • I modified (or at least I think I modified) each part of '.F' files where chem_opt pointed to the original chemical mechanism.
    • I've edited the emissions_driver.F, module_bioemi_megan2.F, chem_driver.F, module_chem_share.F, among other files. It gets a little confusing after I've compiled, as some files are preprocessed versions, and others are written by C-code

I generated a fictional emissions inventory with real data to see if the model is reading in the emissions. I made a random pixel fill in with 1 mol/km^2/hr of carbon monoxide and a similar value for the new chemical. Since I am debugging this issue, I ran it for 1 minute, and turned off unnecessary chemical-related parameterizations. The resulting emissions data for the new chemicals in the wrfout file was all 0's and there was no new chemical inside the fields. But there was non-zero carbon monoxide, so I know the model is reading in emissions. As I understand it, the code modification in module_emissions_anthropogenics.F only works if emis_ant is non-zero, which is what I gathered from my empty emissions arrays in wrfout. I just don't know what I need to edit to make it read in these added chemicals.

The answers linked to above leave off fairly ambiguously. Does anyone have experience with this?

In retrospect, it might have just been easier to modify RADM2_KPP without creating a new package. I've made a low-effort attempt at that, but I am more invested in this. I just don't see why this isn't working.

Thank you in advance.
I figured out the problem. With a runtime of 1 minute and a history_interval of 15 minutes, I was not actually seeing the emission. What I thought was CO emissions was just the intial values being set. And it (at least appears) that the emissions are initialized at 0, then written into the file before ever being read in from wrfchemi.

I figured this out by accidentally not changing the runtime back to 1 minute after I set it at 1 hour to run real.exe.