geoschem / geos-chem

GEOS-Chem "Science Codebase" repository. Contains GEOS-Chem science routines, run directory generation scripts, and interface code. This repository is used as a submodule within the GCClassic and GCHP wrappers, as well as in other modeling contexts (external ESMs).
http://geos-chem.org
Other
170 stars 166 forks source link

[BUG/ISSUE] Molar weights of Prod/Loss species #413

Closed fritzt closed 4 years ago

fritzt commented 4 years ago

Report a GEOS-Chem bug or technical issue

Describe the bug:

I have noticed that the species_database does not always provide molar weights for production and loss family (e.g POx, LOx, PSO4, ...) and are thus given a missing molar weight of "-999.0". When performing unit conversion in flexchem_mod.F90, this leads to negative values of prod/loss species.

The reason why I am bringing this up is that I need to have access to PSO4 for CESM-GC. I could always create a new array, fill it with PSO4 from State_Chm%Species before the unit conversion is applied and surround all of this with CPP flags, in a similar fashion as how it is done for TOMAS with H2SO4_RATE:

https://github.com/geoschem/geos-chem/blob/b95926b8b53d27817090c36e1c9f939110ce03f1/GeosCore/flexchem_mod.F90#L1117-L1148

However, since I have access to State_Chm%Species after the call to Do_Chemistry, I would ideally like to obtain PSO4 from there.

The questions that come to mind are:

Expected behavior:

Prod/Loss species should be positive.

Actual behavior:

Prod/Loss species are converted to negative values in flexchem_mod.F90 due to a negative molar weight.

Error messages

None

Required information:

Your GEOS-Chem version and runtime environment:

Input and log files to attach

None required

fritzt commented 4 years ago

I just realized that this is similar to #404

msulprizio commented 4 years ago

Hi @fritzt. I think it does make most sense to define these "species" with molecular weights of the species that they are tracking. We can store this in the MW_g field of State_Chm, as with the other molecular weights. We will include this update in 13.0.0.

msulprizio commented 4 years ago

This is now resolved in commit https://github.com/geoschem/geos-chem/commit/f60d49020fc60eaa34690b3f084dfdd76e36b56f and will be included in GEOS-Chem 13.0.0.