Adds explicit calcite#377
Conversation
|
There are now 384 combinations of nutrients/plankton/detritus/inorganic carbon/oxygen being tested so we might need to reconsider how they're tested |
| T = model.tracers.T | ||
| S = model.tracers.S |
There was a problem hiding this comment.
explicit_calcite=true requires T and S to be model variables, but this isn't clear to the user
There was a problem hiding this comment.
I added T and S as required tracers when explicit_calcite=true
|
|
||
| @inline (bgc::NutrientsPlanktonDetritus{<:Any, <:Any, <:VariableRedfieldDetritus})(i, j, k, grid, ::Val{:bPOC}, clock, fields, auxiliary_fields) = ( | ||
| (1 - bgc.detritus.small_solid_waste_fraction) * solid_carbon_waste(bgc, i, j, k, fields, auxiliary_fields) | ||
| + calcite_production(bgc, i, j, k, fields, auxiliary_fields) |
There was a problem hiding this comment.
what happens if we aren't using explicit calcite?
|
Sorry to be a pain, but I wonder if we should change "calcite" to PIC so that the naming convention is more generic. In some OAE contexts we might want this to be aragonite which has a different solubility compared to calcite. |
I changed the name of the function that was called calcite_concentration since this was really the equilibrium concentration of calcium carbonate ion. I also made T, S required tracers when explicit_calcite is true
I'm still not sure the answer to this. Do we want to leave this as calcite and add functionality for aragonite if needed, or have a generic form of precipitated mineral for which we can change the constants if needed? @jagoosw do you have any thoughts on this? |
Updated carbon-chemistry.md to reflect the function name change from the previous commit and added text describing the explicit calcite functionality.
I think we can rename it to PIC, but I think it might make sense todo some more refactoring of this PR after #378 |
Following #367 this PR adds explicit calcite to
CarbonateSystem. It is activated with the keyword argumentexplicit_calcitelikeCarbonateSystem(grid; explicit_calcite=true)where the grid is needed to build the saturation state diagnostic.It also works with multiple realisations, e.g.
CarbonateSystem(grid, 2; explicit_calcite=true). This was a bit more involved because now the DIC and alkalinity evolve differently in different realisations depending on the calcite.This change results in no-ops when it is turned off so shouldn't effect peformance, and although this has explicit precipitation which is often excluded (and probably should be turned off sometimes) it adds almost no cost since we're computing$\Omega$ anyway.
This PR also adds methods to allow
planktonordetritusto benothingand adds testing for them.@johnryantaylor @lgloege
Relies on #365