NOAA-CEFI-Regional-Ocean-Modeling / ocean_BGC

3 stars 4 forks source link

Bacteria code clean up #63

Closed charliestock closed 3 weeks ago

charliestock commented 1 month ago

I was going through the bacterial growth and uptake section of the code today and flagged a few things for clean up. None will change answers for our runs, but I wanted to raise them while I was going through the code as we work toward CMIP7.

1: We use 3 times the half-saturation constant for small phytoplankton nitrate limitation to modulate anammox:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L2969-L2971

I don't think this will matter much, but is there a reason why we multiply by 3? Maybe this needs its own parameter?

2: I noticed we are taking in the nitrification parameters (scheme_nitrif, o2_min_nit, k_o2_nit ) from a namelist that Fabian likely set up to ease compiling requirements:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L188-L190

We should eliminate this inconsistency as we complete Theresa's pull request that updates the parameter settings.

3: We may want to have an option for "do_chemoautotrophic_prod" similar to the case2 water example we discussed in prior weeks. This is effectively "false" in all of our runs to date and it is imposed through specific choices of the parameter values. Activating it would require different parameters in a manner similar to the "case2" case:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L735-L740

I think the primary weakness in our approach to moving toward a default "true" is in our approach to diagnosing the fraction of phytoplankton that are heterotrophs:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L3042-L3047

I am working on a pull request that will clean up and improve commenting in the bacterial production and uptake part of the code. Jessica, maybe you could take a look at some of these issues and we could discuss before submitting a pull request for further consideration by the group at the next doc & dev meeting?

charliestock commented 1 month ago

Discussed with @jessluo on Friday 5/24. We agreed that the chemoautotrophy option - which was not exercised in the CEFI code - allowed for only a preliminary evaluation but was not a long-term approach. In addition, our preliminary calculations suggested a very limited impact on bacterial production overall. We thus agreed that the associated code could be removed as part of the cleanup, rather than included as an option in the trunk code. A more robust inclusion of chemoautrophic production could be achieved through the inclusion of bacterial functional types in future work.

COBALTv3/CEFI will thus continue to use the simple nitrification reaction here:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L475-L477

We will also replace the more complex anammox stoichiometry here:

https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/ocean_BGC/blob/e62cd4c6bf4ebb4220be71d4c9d0f50c087075e3/generic_tracers/generic_COBALT.F90#L490-L497

With the simpler option:

10NH4+ + 6NO3- ---> 8N2 + 18H2O + 4H+

The effect of this reaction on alkalinity will be to decrease it by 0.4 mole units per mole of NH4+ removed.

We will confirm details with John Dunne and submit the pull request shortly. This should not change answers, though removing some of the complexity added to provide a first order assessment of chemoautotrophy impacts may impact things at the level of the machine precision.

charliestock commented 1 month ago

We have confirmed John's agreement with our suggested approach. Let's discuss whether we should delay the pull request until after Theresa's parameter I/O request goes through at the 5/28 doc & dev meeting.

jessluo commented 1 month ago

Agree with removing the chemoautotrophy bacteria production as discussed. Just a note that if we do that, we should move the anammox and nitrification code back down to section 5, Detrital dissolution and remineralization calculation.

yichengt900 commented 3 weeks ago

PR #66 is merged.