Skip to content

Adds explicit calcite#377

Draft
jagoosw wants to merge 19 commits into
mainfrom
jsw/explicit-calcite
Draft

Adds explicit calcite#377
jagoosw wants to merge 19 commits into
mainfrom
jsw/explicit-calcite

Conversation

@jagoosw

@jagoosw jagoosw commented May 21, 2026

Copy link
Copy Markdown
Collaborator

Following #367 this PR adds explicit calcite to CarbonateSystem. It is activated with the keyword argument explicit_calcite like CarbonateSystem(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 plankton or detritus to be nothing and adds testing for them.

@johnryantaylor @lgloege

Relies on #365

@jagoosw jagoosw added enhancement New feature or request feature blocked labels May 21, 2026
@jagoosw

jagoosw commented May 21, 2026

Copy link
Copy Markdown
Collaborator Author

There are now 384 combinations of nutrients/plankton/detritus/inorganic carbon/oxygen being tested so we might need to reconsider how they're tested

Comment on lines +130 to +131
T = model.tracers.T
S = model.tracers.S

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit_calcite=true requires T and S to be model variables, but this isn't clear to the user

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we aren't using explicit calcite?

@johnryantaylor

Copy link
Copy Markdown
Collaborator

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
@johnryantaylor

Copy link
Copy Markdown
Collaborator

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'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.
@jagoosw

jagoosw commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator Author

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'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?

I think we can rename it to PIC, but I think it might make sense todo some more refactoring of this PR after #378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked enhancement New feature or request feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants