@@ -4,10 +4,10 @@ tracer evolution equations.
4
4
5
5
Forcing functions will be called with the signature
6
6
```
7
- f(i, j, k, grid, t, U, C, params )
7
+ f(i, j, k, grid, t, U, C, p )
8
8
```
9
9
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 ` .
11
11
12
12
Once you have defined all the forcing functions needed by the model, ` ModelForcing ` can be used to create a named tuple
13
13
of forcing functions that can be passed to the ` Model ` constructor.
@@ -25,11 +25,11 @@ const τ⁻¹ = 1 / 60 # Damping/relaxation time scale [s⁻¹].
25
25
const Δμ = 0.01L # Sponge layer width [m] set to 1% of the domain height.
26
26
@inline μ(z, Lz) = τ⁻¹ * exp(-(z+Lz) / Δμ)
27
27
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]
31
31
32
- forcing = ModelForcing(Fu =Fu, Fv =Fv, Fw =Fw)
32
+ forcing = ModelForcing(u =Fu, v =Fv, w =Fw)
33
33
model = Model(grid=grid, forcing=forcing)
34
34
nothing # hide
35
35
```
0 commit comments