Skip to content

Commit 88a4f8f

Browse files
authored
Update forcing function model setup documentation (#604)
Update forcing function model setup documentation
2 parents 8d1b164 + 1baef0f commit 88a4f8f

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Oceananigans"
22
uuid = "9e8cae18-63c1-5223-a75c-80ca9d6e9a09"
3-
version = "0.19.0"
3+
version = "0.20.0"
44

55
[deps]
66
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

docs/src/model_setup/forcing_functions.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ tracer evolution equations.
44

55
Forcing functions will be called with the signature
66
```
7-
f(i, j, k, grid, t, U, C, params)
7+
f(i, j, k, grid, t, U, C, p)
88
```
99
where `i, j, k` is the grid index, `grid` is `model.grid`, `t` is the `model.clock.time`, `U` is the named tuple
10-
`model.velocities`, `C` is the named tuple `C.tracers`, and `params` is the user-defined `model.parameters`.
10+
`model.velocities`, `C` is the named tuple `C.tracers`, and `p` is the user-defined `model.parameters`.
1111

1212
Once you have defined all the forcing functions needed by the model, `ModelForcing` can be used to create a named tuple
1313
of forcing functions that can be passed to the `Model` constructor.
@@ -25,11 +25,11 @@ const τ⁻¹ = 1 / 60 # Damping/relaxation time scale [s⁻¹].
2525
const Δμ = 0.01L # Sponge layer width [m] set to 1% of the domain height.
2626
@inline μ(z, Lz) = τ⁻¹ * exp(-(z+Lz) / Δμ)
2727
28-
@inline Fu(grid, U, Φ, i, j, k) = @inbounds -μ(grid.zC[k], grid.Lz) * U.u[i, j, k]
29-
@inline Fv(grid, U, Φ, i, j, k) = @inbounds -μ(grid.zC[k], grid.Lz) * U.v[i, j, k]
30-
@inline Fw(grid, U, Φ, i, j, k) = @inbounds -μ(grid.zF[k], grid.Lz) * U.w[i, j, k]
28+
@inline Fu(i, j, k, grid, t, U, C, p) = @inbounds -μ(grid.zC[k], grid.Lz) * U.u[i, j, k]
29+
@inline Fv(i, j, k, grid, t, U, C, p) = @inbounds -μ(grid.zC[k], grid.Lz) * U.v[i, j, k]
30+
@inline Fw(i, j, k, grid, t, U, C, p) = @inbounds -μ(grid.zF[k], grid.Lz) * U.w[i, j, k]
3131
32-
forcing = ModelForcing(Fu=Fu, Fv=Fv, Fw=Fw)
32+
forcing = ModelForcing(u=Fu, v=Fv, w=Fw)
3333
model = Model(grid=grid, forcing=forcing)
3434
nothing # hide
3535
```

0 commit comments

Comments
 (0)