Skip to content

Commit 2bb62fa

Browse files
Merge pull request #3832 from CliMA/ck/kinetic
Loosen compute_kinetic types
2 parents 660894d + 926cf05 commit 2bb62fa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/utils/utilities.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,13 @@ individual velocity components:
5858
cell centers, and
5959
- `uᵥ` should be a `Covariant3Vector`-valued field at cell faces.
6060
"""
61-
function compute_kinetic(uₕ::Fields.Field, uᵥ::Fields.Field)
61+
function compute_kinetic(uₕ, uᵥ)
6262
@assert eltype(uₕ) <: Union{C1, C2, C12}
6363
@assert eltype(uᵥ) <: C3
64+
FT = Spaces.undertype(axes(uₕ))
65+
onehalf = FT(1 / 2)
6466
return @. lazy(
65-
1 / 2 * (
67+
onehalf * (
6668
dot(C123(uₕ), CT123(uₕ)) +
6769
ᶜinterp(dot(C123(uᵥ), CT123(uᵥ))) +
6870
2 * dot(CT123(uₕ), ᶜinterp(C123(uᵥ)))

0 commit comments

Comments
 (0)