OceanBioME / OceanBioME.jl

🌊 🦠 🌿 A fast and flexible modelling environment written in Julia for modelling the coupled interactions between ocean biogeochemistry, carbonate chemistry, and physics
https://oceanbiome.github.io/OceanBioME.jl/
MIT License
40 stars 20 forks source link

(0.5.0) Updated sediment to work with all grids and model types #127

Closed jagoosw closed 1 year ago

jagoosw commented 1 year ago

This PR makes sediment models work with immersed boundary grids and improves sediment testing on all grid and model types.

This breaks the sediment, nitrogen/carbon flux, and sinking flux APIs.

jagoosw commented 1 year ago

Think this is probably the most straightforward way to set this up, and in this case the bottom cell only has to be calculated once

jagoosw commented 1 year ago

I think in the same vein it may be worth modifying PAR integration to only integrate down to the bottom cell since a lot of the globe doesn't reach the bottom of the underlying grid (and at the moment I think we integrate it for the land area too)

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 76.00% and project coverage change: -0.24% :warning:

Comparison is base (ef69e24) 63.82% compared to head (3a352ad) 63.58%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #127 +/- ## ========================================== - Coverage 63.82% 63.58% -0.24% ========================================== Files 28 28 Lines 1020 1049 +29 ========================================== + Hits 651 667 +16 - Misses 369 382 +13 ``` | [Files Changed](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME) | Coverage Δ | | |---|---|---| | [src/Light/2band.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL0xpZ2h0LzJiYW5kLmps) | `88.88% <ø> (ø)` | | | [src/Light/Light.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL0xpZ2h0L0xpZ2h0Lmps) | `33.33% <ø> (ø)` | | | [src/Models/AdvectedPopulations/NPZD.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL01vZGVscy9BZHZlY3RlZFBvcHVsYXRpb25zL05QWkQuamw=) | `90.90% <50.00%> (-1.10%)` | :arrow_down: | | [src/Boundaries/Sediments/Sediments.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL0JvdW5kYXJpZXMvU2VkaW1lbnRzL1NlZGltZW50cy5qbA==) | `65.71% <63.63%> (+6.89%)` | :arrow_up: | | [src/Models/AdvectedPopulations/LOBSTER/LOBSTER.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL01vZGVscy9BZHZlY3RlZFBvcHVsYXRpb25zL0xPQlNURVIvTE9CU1RFUi5qbA==) | `85.00% <66.66%> (+0.78%)` | :arrow_up: | | [...c/Boundaries/Sediments/instant\_remineralization.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL0JvdW5kYXJpZXMvU2VkaW1lbnRzL2luc3RhbnRfcmVtaW5lcmFsaXphdGlvbi5qbA==) | `85.00% <100.00%> (+2.64%)` | :arrow_up: | | [src/Boundaries/Sediments/simple\_multi\_G.jl](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME#diff-c3JjL0JvdW5kYXJpZXMvU2VkaW1lbnRzL3NpbXBsZV9tdWx0aV9HLmps) | `90.38% <100.00%> (+0.80%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/OceanBioME/OceanBioME.jl/pull/127/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=OceanBioME)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

jagoosw commented 1 year ago

Since it's just the codecov failing (and I'm not bothered by the lines in the NPZD model it says aren't being tested as it's just a warning and function no one will probably ever use) I'm happy for this PR to be merged now

jagoosw commented 1 year ago

The example was failing because I'd changed the sediment models to only use flat fields, but we can't output these still due to https://github.com/CliMA/Oceananigans.jl/issues/2770 which I've not fixed yet

jagoosw commented 1 year ago

Nonhydrostatic + RK3 is not getting tested but it should