Skip to content

How to export bottom drag? #3081

Apr 22, 2023 · 2 comments · 4 replies
Discussion options

You must be logged in to vote

Unfortunately there is no user interface to build Field from boundary conditions, though we do need one. It's still possible, but a bit of work. This code is fairly general I think:

using Oceananigans.BoundaryConditions: getbc
using Oceananigans: fields

# Boundary condition extractor in "kernel function form"
@inline kernel_getbc(i, j, k, grid, boundary_condition, clock, fields) =
    getbc(boundary_condition, i, j, grid, clock, fields)

# Kernel arguments
grid = model.grid
clock = model.clock
model_fields = merge(fields(model), model.auxiliary_fields)
u, v, w = model.velocities
u_bc = u.boundary_conditions.bottom
v_bc = v.boundary_conditions.bottom

# Build operations
u_bc_op = KernelFu…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@jhdong2016
Comment options

@jhdong2016
Comment options

@simone-silvestri
Comment options

Answer selected by jhdong2016
Comment options

You must be logged in to vote
1 reply
@glwagner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants