AquaticEcoDynamics / libaed-water

Code for the AED water quality model
GNU General Public License v3.0
6 stars 6 forks source link

IN and IP community diag reporting #51

Closed MichaelBarryBMT closed 2 years ago

MichaelBarryBMT commented 2 years ago

Hi Matt

This makes sure that phytoplankton community IN and IP totals are reported to be consistent with summing group equivalents, regardless of whether IN and IP are state variables.

Without this modification, the case where two phyto groups are simulated (with the first including IN and IP and the second assuming constant X_ncon and X_pcon) has the IN and IP from the first group written twice to the IN and IP community diagnostic, so that the respective diags are just double the IN and IP of the first phyto group. This is because INi and IPi are not updated before being written to the community diagnostic, if IN and IP are not state variables. This makes the diagnostic variable hard to interpret and not able to be used in mass balance calculations.

This suggested change makes that update to INi and IPi for every phyto group regardless of whether IN and IP are simulated or not, and therefore corrects the diag output and allows for its interpretation and use in mass balance calcs.

MB