You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**NOTE:** A `BoussinesqEquationOfState` must be used in the `model` to calculate
24
-
`seawater_density`. See the [relevant documentation](https://clima.github.io/OceananigansDocumentation/dev/model_setup/buoyancy_and_equation_of_state/#Idealized-nonlinear-equations-of-state)
25
-
for how to set `SeawaterBuoyancy` using a `BoussinesqEquationOfState`.
39
+
The optional keyword argument `geopotential_height` is only used
40
+
if ones wishes to calculate `Eₚ` with a potential density referenced to `geopotential_height`,
41
+
rather than in-situ density, when using a `BoussinesqEquationOfState`.
26
42
27
43
Example
28
44
=======
29
45
30
-
The default behaviour of `PotentialEnergy` uses the *in-situ density* in the calculation:
46
+
Usage with a `BuoyancyTracer` buoyacny model
47
+
```jldoctest
48
+
julia> using Oceananigans
49
+
50
+
julia> using Oceanostics.PotentialEnergyEquationTerms: PotentialEnergy
├── grid: 1×1×100 RectilinearGrid{Float64, Flat, Flat, Bounded} on CPU with 0×0×3 halo
61
+
├── timestepper: QuasiAdamsBashforth2TimeStepper
62
+
├── tracers: b
63
+
├── closure: Nothing
64
+
├── buoyancy: BuoyancyTracer with ĝ = NegativeZDirection()
65
+
└── coriolis: Nothing
66
+
67
+
julia> PotentialEnergy(model)
68
+
KernelFunctionOperation at (Center, Center, Center)
69
+
├── grid: 1×1×100 RectilinearGrid{Float64, Flat, Flat, Bounded} on CPU with 0×0×3 halo
70
+
├── kernel_function: bz_ccc (generic function with 2 methods)
71
+
└── arguments: ("1×1×100 Field{Center, Center, Center} on RectilinearGrid on CPU",)
72
+
```
73
+
74
+
The default behaviour of `PotentialEnergy` uses the *in-situ density* in the calculation
75
+
when the equation of state is a `BoussinesqEquationOfState`:
31
76
```jldoctest
32
77
julia> using Oceananigans, SeawaterPolynomials.TEOS10
33
78
@@ -65,7 +110,7 @@ julia> PotentialEnergy(model)
65
110
KernelFunctionOperation at (Center, Center, Center)
66
111
├── grid: 1×1×100 RectilinearGrid{Float64, Flat, Flat, Bounded} on CPU with 0×0×3 halo
67
112
├── kernel_function: g′z_ccc (generic function with 1 method)
68
-
└── arguments: ("KernelFunctionOperation at (Center, Center, Center)", "KernelFunctionOperation at (Center, Center, Center)", "(g=9.80665, ρ₀=1020.0)")
113
+
└── arguments: ("KernelFunctionOperation at (Center, Center, Center)", "(g=9.80665, ρ₀=1020.0)")
69
114
```
70
115
71
116
To use a reference density set a constant value for the keyword argument `geopotential_height`
KernelFunctionOperation at (Center, Center, Center)
92
137
├── grid: 1×1×100 RectilinearGrid{Float64, Flat, Flat, Bounded} on CPU with 0×0×3 halo
93
138
├── kernel_function: g′z_ccc (generic function with 1 method)
94
-
└── arguments: ("KernelFunctionOperation at (Center, Center, Center)", "KernelFunctionOperation at (Center, Center, Center)", "(g=9.80665, ρ₀=1020.0)")
139
+
└── arguments: ("KernelFunctionOperation at (Center, Center, Center)", "(g=9.80665, ρ₀=1020.0)")
95
140
```
96
141
"""
97
-
@inlinefunctionPotentialEnergy(model; geopotential_height =model_geopotential_height(model), location = (Center, Center, Center))
142
+
@inlinefunctionPotentialEnergy(model; location = (Center, Center, Center),
0 commit comments