compdyn / partmc

Particle-resolved stochastic atmospheric aerosol model
http://lagrange.mechse.illinois.edu/partmc/
GNU General Public License v2.0
27 stars 15 forks source link

Add multiple groups for mixing state index #152

Closed mwest1066 closed 3 years ago

mwest1066 commented 3 years ago

This extends the existing group mechanism when calculating the mixing state index to allow multiple groups, via a new optional groups argument to aero_state_mixing_state_metrics(). An example of using this new argument is provided in scenarios/1_urban_plume/urban_plume_process.F90.

jcurtis2 commented 3 years ago

Compared the default chi calculation versus chi where we define groups consisting of each individual species. The results are the same as expected.

Just for clarification, the way I interpret the code for groupings is that if a species isn't in any of the groups, it is to be excluded?

jcurtis2 commented 3 years ago

Currently if a species is omitted from the array of groups, it is excluded in the aero_state_mass_entropies calculation but it isn't excluded from any aero_state_masses() calculation. As a result, masses and masses_of_avg_part in aero_state_mixing_state_metrics are incorrect as they are including species that do not appear in groups. This is only correct if you also have specified to exclude those missing species.

mwest1066 commented 3 years ago

Currently if a species is omitted from the array of groups, it is excluded in the aero_state_mass_entropies calculation but it isn't excluded from any aero_state_masses() calculation. As a result, masses and masses_of_avg_part in aero_state_mixing_state_metrics are incorrect as they are including species that do not appear in groups. This is only correct if you also have specified to exclude those missing species.

Excellent catch! Let me see what I can do about that.