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

Code for reading emission files

This post was from a previous version of the WRF&MPAS-A Support Forum. New replies have been disabled and if you have follow up questions related to this post, then please start a new thread from the forum home page.

neyestani

New member
Hi there,

I appreciate it if someone could help me to find the code (module) for reading emission files.
I'm adding a new aerosol species in my emission files (created externally, not with Convert_Emiss). So I want to edit the code/module responsible for reading the emission files to add the new species. I checked "chem/module_emissions_anthropogenics.F", but it seems this module only converts emissions array (emis_ant) to mixing ratios (chem array). However, I cannot find the code that creates this emissions array (emis_ant) based on my emission files (wrfchemi*).
Simply, I want to find the code that opens and reads my emission files.


Thank you,
Soroush
 
Hi Soroush,

To add an emitted species, you need to first add it to the Registry/registry.chem under the emiss_opt that you are using. For example, if you are using emiss_opt=3 (eradmsorg) and you wanted to emit species XXX, you would need to add e_XXX under the emiss_opt==3 package. You additionally need to define it as an emission array (e.g., for emissions of no there is a line: state real e_no i+jf emis_ant 1 Z i5r "E_NO" "EMISSIONS" "mol km^-2 hr^-1"). By adding the species to the emission package, the code expects your wrfchemi files to have that variable and will automatically add it to the emis_ant array. Finally, in module_emissions_anthropgenics.F, you add the emis_ant of XXX to the XXX chemical tendency array (with some conversion from rate to increase in mixing ratio in bottom layer). Hope this helps.

Jordan
 
Hi Jordan,

I have one more question, please.
I followed the steps you mentioned. However, when I try to compile it, I receive an error for new variable index declaration:
Error: Symbol 'p_e_eci_a' at (1) has no IMPLICIT type
However, I've added the new emitted species to registry.chem as admission array and under emiss_opt package (=10).

Am I missing something here?


Thank you,
Soroush
 
Hi Soroush,

Can you attach your registry.chem? And did you also add the species as a state variable in the emis_ant array? For example, see emissions of so2:

state real e_so2 i+jf emis_ant 1 Z i5r "E_SO2" "EMISSIONS" "mol km^-2 hr^-1"

Jordan
 
Hi Jordan,

Please find registry.chem file attached (I added txt extension, only for attaching here).
Yes, I did. I copied e_eci and e_ecj state variables (lines 74 & 75) as new variables (e_eci_a, e_eci_bb, e_ecj_a, and e_ecj_bb) in lines 154 ~ 157.


Thanks,
Soroush
 

Attachments

  • registry.chem.txt
    592.8 KB · Views: 61
Hi Soroush,

Everything looks fine with the registry. After you changed the registry, did you perform a ./clean -a ? That is required any time the registry is changed. Otherwise, can you attach your full compile log, and if the compile aborted for a specific program, please also attach that file (.F)

Jordan
 
Hi Jordan,

Thank you for the help.
That's right, the problem was that I didn't perform ./clean -a after changing registry.chem file.
Now it's working.


Best,
Soroush
 
Top