Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

abstract out biogeochemical particles #244

Merged
merged 2 commits into from
Jan 27, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Particles/Particles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ import Oceananigans.OutputWriters: fetch_output
import Base: length, size, show, summary
import Adapt: adapt_structure

struct BiogeochemicalParticles{N, B, A, F, T, I, S, X, Y, Z}
abstract type AbstractBiogeochemicalParticles end

struct BiogeochemicalParticles{N, B, A, F, T, I, S, X, Y, Z} <: AbstractBiogeochemicalParticles
biogeochemistry :: B
advection :: A
fields :: F
Expand Down Expand Up @@ -119,8 +121,8 @@ Adapt.adapt_structure(to, p::BiogeochemicalParticles{N}) where N =
adapt(to, p.z))

# Type piracy...oops
const BGC_WITH_PARTICLES = Union{<:DiscreteBiogeochemistry{<:Any, <:Any, <:Any, <:BiogeochemicalParticles},
<:ContinuousBiogeochemistry{<:Any, <:Any, <:Any, <:BiogeochemicalParticles}}
const BGC_WITH_PARTICLES = Union{<:DiscreteBiogeochemistry{<:Any, <:Any, <:Any, <:AbstractBiogeochemicalParticles},
<:ContinuousBiogeochemistry{<:Any, <:Any, <:Any, <:AbstractBiogeochemicalParticles}}

const MODEL_WITH_BGC_PARTICLES =
Union{<:NonhydrostaticModel{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:Any, <:BGC_WITH_PARTICLES},
Expand Down