Skip to content

Implement river spread and river mixing - #486

Merged
simone-silvestri merged 11 commits into
mainfrom
ss/river-spread-and-mouth-mixing
Sep 8, 2026
Merged

simone-silvestri merged 11 commits into
mainfrom
ss/river-spread-and-mouth-mixing

Conversation

@simone-silvestri

Copy link
Copy Markdown
Member

When we have a river inlet in the ocean, the salinity can drop to zero since the incoming freshwater sits on the first cell and creates a lens which never mixes.

For this reason this PR introduces a couple of common strategies in climate modeling

  • heightened diffusivity at the river mouth (introduced by default when passing a river routing to the ocean_simulation)
  • horizontal spread of freshwater fluxes coming from the river (a tunable parameter, 1.2 degrees spread by default)

It also refactors a bit the river routing to apply also to datasets like JRA55

@codecov

codecov Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.78571% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Lands/river_routing.jl 81.17% 16 Missing ⚠️
src/DataWrangling/JRA55/JRA55_prescribed_land.jl 0.00% 6 Missing ⚠️
src/DataWrangling/GloFAS/glofas_prescribed_land.jl 0.00% 3 Missing ⚠️
src/Oceans/ocean_simulation.jl 94.44% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/Lands/river_routing.jl Outdated
Comment thread src/Lands/river_routing.jl Outdated
Comment on lines +218 to +219
node_λφ(λc::AbstractVector, φc::AbstractVector, i, j) = (λc[i], φc[j])
node_λφ(λc::AbstractMatrix, φc::AbstractMatrix, i, j) = (λc[i, j], φc[i, j])

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 wonder if it is possible to not define these functions and hard code at the call site instead since this does something very specific, up to you

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Applied Oceananigans' *node functions instead

Comment thread src/Lands/river_routing.jl
@simone-silvestri
simone-silvestri merged commit 344871d into main Sep 8, 2026
6 of 7 checks passed
@simone-silvestri
simone-silvestri deleted the ss/river-spread-and-mouth-mixing branch September 8, 2026 13:48
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.

2 participants