Skip to content

Commit 6845a11

Browse files
Merge pull request #4028 from CliMA/dy/weak_curl_vorticity
Modify advection to discretely conserve vorticity
2 parents d248230 + cbe4a94 commit 6845a11

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

reproducibility_tests/ref_counter.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
264
1+
265
22

33
# **README**
44
#
@@ -20,6 +20,9 @@
2020

2121

2222
#=
23+
265
24+
- Modify advection to discretely conserve vorticity
25+
2326
264
2427
- Allow entrainment and detrainment when updraft area fraction is negligible
2528

src/diagnostics/core_diagnostics.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ add_diagnostic_variable!(
199199
units = "s^-1",
200200
comments = "Vertical component of relative vorticity",
201201
compute! = (out, state, cache, time) -> begin
202-
vort = @. w_component.(Geometry.WVector(curlₕ(cache.precomputed.ᶜu)))
202+
vort = @. w_component.(Geometry.WVector(wcurlₕ(cache.precomputed.ᶜu)))
203203
# We need to ensure smoothness, so we call DSS
204204
Spaces.weighted_dss!(vort)
205205
if isnothing(out)

src/prognostic_equations/advection.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
232232
ᶠω¹²ʲs = p.scratch.ᶠtemp_CT12ʲs
233233

234234
if point_type <: Geometry.Abstract3DPoint
235-
@. ᶜω³ = curlₕ(Y.c.uₕ)
235+
@. ᶜω³ = wcurlₕ(Y.c.uₕ)
236236
elseif point_type <: Geometry.Abstract2DPoint
237237
@. ᶜω³ = zero(ᶜω³)
238238
end
@@ -241,9 +241,9 @@ NVTX.@annotate function explicit_vertical_advection_tendency!(Yₜ, Y, p, t)
241241
for j in 1:n
242242
@. ᶠω¹²ʲs.:($$j) = ᶠω¹²
243243
end
244-
@. ᶠω¹² += CT12(curlₕ(Y.f.u₃))
244+
@. ᶠω¹² += CT12(wcurlₕ(Y.f.u₃))
245245
for j in 1:n
246-
@. ᶠω¹²ʲs.:($$j) += CT12(curlₕ(Y.f.sgsʲs.:($$j).u₃))
246+
@. ᶠω¹²ʲs.:($$j) += CT12(wcurlₕ(Y.f.sgsʲs.:($$j).u₃))
247247
end
248248
# Without the CT12(), the right-hand side would be a CT1 or CT2 in 2D space.
249249

0 commit comments

Comments
 (0)