Skip to content

(0.19.0b) Improves gas exchange + adds MARBL's oxygen solubility - #410

Closed
jagoosw wants to merge 55 commits into
mainfrom
jsw/gas-exchange-changes
Closed

jagoosw wants to merge 55 commits into
mainfrom
jsw/gas-exchange-changes

Conversation

@jagoosw

@jagoosw jagoosw commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

This PR changes the water side computation to a use the aquious concentration ([ $CO_2\text{(aq)}$ ]) rather than figacity ([ $fCO_2$ ]) for consistency with MARBL and the OCMIP protocol. The flux is now compared to MARBL computed values which is an improvement on the previous testing which just included the different parts.

This PR also introduces GarciaGordonOxygenSaturation which goes in the air_concentration slot for oxygen and computes the saturation directly from temperature and salinity as per MARBL etc.

In the API the breaking changes are dropping first_virial_coefficient, cross_virial_coefficient, and air_pressure from CarbonDioxideConcentration, and solubility from the transfer velocity wrappers (they are now plain transfer velocities). The value of $CO_2$ fluxes has also changed.

@jagoosw jagoosw changed the title Improves gas exchange Improves gas exchange + adds MARBL's oxygen solubility Sep 9, 2026
jagoosw and others added 12 commits September 10, 2026 00:30
`K0` is defined in `OceanBioME.Models.CarbonChemistryModel`, not in the
`GasExchangeModel` module the docstring lives in, so Documenter couldn't
resolve the unqualified @ref and the docs build failed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TH7fhhztRhnmURhX3tWFMD
The CO₂ gas exchange rework is breaking, so this needs a minor bump rather
than the patch bumps it has had so far (0.18.4 -> 0.18.7). Under Julia's 0.x
convention the leading non-zero is the major version.

Breaking changes
================

1. `CarbonDioxideConcentration` lost the `first_virial_coefficient`,
   `cross_virial_coefficient` and `air_pressure` keyword arguments. Code that
   passes any of them now throws a `MethodError`. The virial coefficients live
   on the `carbon_chemistry` instead, so `wc.first_virial_coefficient` becomes
   `wc.carbon_chemistry.first_virial_coefficient`, and the atmospheric pressure
   moved to the air side (`CarbonDioxideAirConcentration`).

2. `CarbonDioxideConcentration`'s type parameters went from
   `{DIC, Alk, CC, FV, CV, AP}` to `{DIC, Alk, CC}`, breaking any dispatch on,
   or direct construction of, the old form.

3. SILENT: `surface_value(::CarbonDioxideConcentration, ...)` used to return
   pCO₂ in ppmv and now returns [CO₂(aq)] in mmol / m³. The same call returns a
   different physical quantity in different units with no error.

4. Default CO₂ fluxes change by ~15%. The air side moved from `K0` to the Weiss
   and Price (1980) dry-air solubility `ff` (~2% smaller) and the water side from
   pCO₂ to fCO₂ (~0.35%); because the flux is a small difference of two much
   larger terms, that is amplified roughly 6.6x. Existing simulations will not
   reproduce their previous results.

5. SILENT: `SchmidtScaledTransferVelocity`'s default `solubility` changed from a
   `K0`-folding closure to `UnitSolubility`, i.e. a bare piston velocity. Anyone
   relying on the old default now gets a transfer velocity short by the
   solubility factor.

6. An `air_concentration` given as a bare number, function or `Field` is now a
   dry air mole fraction in ppmv that is converted to a concentration by `ff`
   and the density, rather than being used directly as a partial pressure.

Not breaking
============

- Exports are purely additive (`GarciaGordonOxygenSaturation`,
  `CarbonDioxideAirConcentration`).
- `equilibrium_constants.jl` is purely additive (the `FF` struct).
- `CarbonChemistry` is unchanged.
- The deleted `regularize.jl` was never `include`d, so it was dead code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FVXDvng4Sv12CyBvYxaHuX
@jagoosw
jagoosw requested a review from lgloege September 14, 2026 14:24
@jagoosw

jagoosw commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

I'm going to merge after #399 then release both together

@jagoosw jagoosw changed the title Improves gas exchange + adds MARBL's oxygen solubility (0.19.0b) Improves gas exchange + adds MARBL's oxygen solubility Sep 14, 2026
@jagoosw

jagoosw commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator Author

Moving to #411 to make just one breaking change

@jagoosw jagoosw closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant