Skip to content

Commit

Permalink
add a default vertical coordinate
Browse files Browse the repository at this point in the history
  • Loading branch information
simone-silvestri authored Jan 19, 2025
1 parent 10e8a8c commit bb0808a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ JLD2 = "0.4, 0.5"
KernelAbstractions = "0.9"
MPI = "0.20"
NCDatasets = "0.12, 0.13, 0.14"
Oceananigans = "0.95.4 - 0.99"
Oceananigans = "0.95.7 - 0.99"
OffsetArrays = "1.14"
OrthogonalSphericalShellGrids = "0.2.1"
Scratch = "1"
Expand Down
13 changes: 6 additions & 7 deletions src/OceanSimulations/OceanSimulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ default_free_surface(grid) = SplitExplicitFreeSurface(grid; cfl=0.7)
const TripolarOfSomeKind = Union{TripolarGrid, ImmersedBoundaryGrid{<:Any, <:Any, <:Any, <:Any, <:TripolarGrid}}
default_free_surface(grid::TripolarOfSomeKind) = SplitExplicitFreeSurface(grid; substeps=70)

default_vertical_coordinate(grid) = Oceananigans.Models.ZCoordinate()
default_vertical_coordinate(::MutableGridOfSomeKind) = Oceananigans.Models.ZStar()

function default_ocean_closure()
mixing_length = CATKEMixingLength(Cᵇ=0.01)
turbulent_kinetic_energy_equation = CATKEEquation(Cᵂϵ=1.0)
Expand All @@ -73,12 +76,6 @@ default_tracer_advection() = FluxFormAdvection(WENO(order=7),
@inline u_immersed_bottom_drag(i, j, k, grid, clock, fields, μ) = @inbounds - μ * fields.u[i, j, k] * spᶠᶜᶜ(i, j, k, grid, fields)
@inline v_immersed_bottom_drag(i, j, k, grid, clock, fields, μ) = @inbounds - μ * fields.v[i, j, k] * spᶜᶠᶜ(i, j, k, grid, fields)

function add_required_boundary_conditions(user_boundary_conditions, grid, bottom_drag_coefficient)

return boundary_conditions
end


# TODO: Specify the grid to a grid on the sphere; otherwise we can provide a different
# function that requires latitude and longitude etc for computing coriolis=FPlane...
function ocean_simulation(grid;
Expand All @@ -98,6 +95,7 @@ function ocean_simulation(grid;
equation_of_state = TEOS10EquationOfState(; reference_density),
boundary_conditions::NamedTuple = NamedTuple(),
tracer_advection = default_tracer_advection(),
vertical_coordinate = default_vertical_coordinate(grid),
verbose = false)

FT = eltype(grid)
Expand Down Expand Up @@ -200,7 +198,8 @@ function ocean_simulation(grid;
free_surface,
coriolis,
forcing,
boundary_conditions)
boundary_conditions,
vertical_coordinate)

ocean = Simulation(ocean_model; Δt, verbose)

Expand Down

0 comments on commit bb0808a

Please sign in to comment.