Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
859 changes: 434 additions & 425 deletions benchmark/Manifest.toml → benchmark/archive/Manifest.toml

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
90 changes: 90 additions & 0 deletions benchmark/benchmark_hi_res_hydrostatic.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using Oceananigans
using SeawaterPolynomials: TEOS10EquationOfState
using CUDA

function many_steps!(model, Nt; Δt=1e-3)
for _ in 1:Nt
NVTX.@range "time step" begin
time_step!(model, Δt)
end
end
end

function hi_res_hydrostatic_model(grid;
vertical_coordinate = ZCoordinate(),
passive_tracers = (),
momentum_advection = WENOVectorInvariant(order=9),
tracer_advection = WENO(order=7),
closure = CATKEVerticalDiffusivity(),
timestepper = :QuasiAdamsBashforth2)

tracers = tuple(:T, :S, :e, passive_tracers...)
buoyancy = SeawaterBuoyancy(equation_of_state=TEOS10EquationOfState())
free_surface = SplitExplicitFreeSurface(substeps=30)
coriolis = HydrostaticSphericalCoriolis()

model = HydrostaticFreeSurfaceModel(; grid, momentum_advection, tracer_advection, coriolis,
buoyancy, closure, free_surface, tracers,
vertical_coordinate, timestepper)

# Sensible initial condition
Ξ(x, y, z) = rand()
dTdz = 1 / grid.Lz
Tᵢ(x, y, z) = 20 + dTdz * z + 1e-4 * Ξ(x, y, z)
Sᵢ(x, y, z) = 35 + 1e-4 * Ξ(x, y, z)
uᵢ(x, y, z) = 1e-3 * Ξ(x, y, z)

set!(model, T=Tᵢ, S=Sᵢ, u=uᵢ, v=uᵢ)

return model
end

# Configurations
# group = get(ENV, "BENCHMARK_GROUP", "all") |> Symbol

config = :channel
Nx = 512
Ny = 256
Nz = 128
arch = GPU()
immersed = false
Oceananigans.defaults.FloatType = Float64
Nt = 100

lat_lon_kw = (longitude=(0, 360), latitude=(-80, 80), z=(-1000, 0), size=(Nx, Ny, Nz), halo=(7, 7, 7))

model_kw = (;
# momentum_advection = nothing,
# tracer_advection = nothing,
# momentum_advection = nothing,
tracer_advection = WENO(order=7),
)

dλ = 20 # ridge width in degrees
ridge(λ, φ) = -1000 + 800 * exp(-(λ - 30)^2 / 2dλ^2)

if config == :channel
grid = LatitudeLongitudeGrid(arch; topology=(Periodic, Bounded, Bounded), lat_lon_kw...)

if immersed
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(ridge))
end

model = hi_res_hydrostatic_model(grid; model_kw...)
elseif config == :box

Oceananigans.defaults.FloatType = FT
grid = LatitudeLongitudeGrid(arch; topology=(Bounded, Bounded, Bounded), lat_lon_kw...)

if immersed
grid = ImmersedBoundaryGrid(grid, GridFittedBottom(ridge))
end

model = hi_res_hydrostatic_model(grid; model_kw...)
end

@time many_steps!(model, 1) # compile
@time many_steps!(model, 1) # compile
@time many_steps!(model, 1) # compile
@time many_steps!(model, 1) # compile
@time many_steps!(model, Nt)
2 changes: 1 addition & 1 deletion src/TimeSteppers/split_hydrostatic_runge_kutta_3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function SplitRungeKutta3TimeStepper(grid, prognostic_fields, args...;
kwargs...) where {TI, TG, PF}

@warn("Split barotropic-baroclinic time stepping with SplitRungeKutta3TimeStepper is experimental.\n" *
"Use at own risk, and report any issues encountered at [https://github.com/CliMA/Oceananigans.jl/issues](https://github.com/CliMA/Oceananigans.jl/issues).")
"Use at own risk, and report any issues encountered at https://github.com/CliMA/Oceananigans.jl/issues.")

FT = eltype(grid)
β¹ = 3
Expand Down
101 changes: 0 additions & 101 deletions test/benchmark_tests.jl

This file was deleted.