Skip to content
Closed
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
AtmosphericProfilesLibrary = "86bc3604-9858-485a-bdbe-831ec50de11d"
Breeze = "660aa2fb-d4c8-4359-a52c-9c057bc511da"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Expand Down
16 changes: 13 additions & 3 deletions examples/prescribed_sea_surface_temperature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,18 @@ using Oceananigans
using Oceananigans.Units
using Oceananigans.Models: BoundaryConditionOperation
using Printf
using CUDA
using CairoMakie

# until https://github.com/CliMA/Oceananigans.jl/pull/5100 is merged
using Adapt: Adapt

function Adapt.adapt_structure(to, bckf::Oceananigans.Models.BoundaryConditionKernelFunction{Side}) where Side
bc = Adapt.adapt(to, bckf.bc)
BC = typeof(bc)
return Oceananigans.Models.BoundaryConditionKernelFunction{Side, BC}(bc)
end

# ## Grid setup
#
# We use a 2D domain (x-z plane) with periodic horizontal boundaries and a bounded
Expand All @@ -36,7 +46,7 @@ using CairoMakie
# energy-containing scales of convective turbulence while remaining computationally
# tractable for this demonstration.

grid = RectilinearGrid(size = (128, 128), halo = (5, 5),
grid = RectilinearGrid(GPU(), size = (128, 128), halo = (5, 5),
x = (-10kilometers, 10kilometers),
z = (0, 10kilometers),
topology = (Periodic, Flat, Bounded))
Expand Down Expand Up @@ -111,9 +121,9 @@ Uᵍ = 1e-2 # Minimum wind speed (m/s)
#
# For `BulkVaporFlux`, the saturation specific humidity is computed from the surface
# temperature. Surface temperature can be provided as a `Field`, a `Function`, or a `Number`.
#
#
# In this example, we specify the sea surface temperature as a top hat function
# i.e. representing a pair of ocean fronts in a periodic domain, with a
# i.e. representing a pair of ocean fronts in a periodic domain, with a
# difference of 4 degrees K,

ΔT = 4 # K
Expand Down