Skip to content

Commit 1ac7c71

Browse files
committed
fix a bug in edmf diffusion
1 parent 97799b5 commit 1ac7c71

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-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-
255
1+
256
22

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

2121

2222
#=
23+
256
24+
- Fix a bug in EDMF diffusive flux
25+
2326
255
2427
- Add radiation tendency to prognostic edmf updrafts
2528

src/cache/temporary_quantities.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ function implicit_temporary_quantities(Y, atmos)
1111
FT = Spaces.undertype(center_space)
1212
uvw_vec = UVW(FT(0), FT(0), FT(0))
1313
return (;
14-
ᶠtemp_scalar = Fields.Field(FT, face_space), # ᶠρaK_h, ᶠρaK_u
14+
ᶠtemp_scalar = Fields.Field(FT, face_space), # ᶠρaK_h
15+
ᶠtemp_scalar_2 = Fields.Field(FT, face_space), # ᶠρaK_u
1516
ᶜtemp_scalar = Fields.Field(FT, center_space), # ᶜρχₜ_diffusion, ᶜa_scalar
1617
ᶜtemp_scalar_2 = Fields.Field(FT, center_space), # ᶜKᵥʲ
1718
ᶜtemp_scalar_3 = Fields.Field(FT, center_space), # ᶜK_h_scaled
@@ -27,7 +28,8 @@ function temporary_quantities(Y, atmos)
2728
CTh = CTh_vector_type(Y.c)
2829
uvw_vec = UVW(FT(0), FT(0), FT(0))
2930
return (;
30-
ᶠtemp_scalar = Fields.Field(FT, face_space), # ᶠp, ᶠρK_E
31+
ᶠtemp_scalar = Fields.Field(FT, face_space), # ᶠp, ᶠρK_h
32+
ᶠtemp_scalar_2 = Fields.Field(FT, face_space), # ᶠρK_u
3133
ᶜtemp_scalar = Fields.Field(FT, center_space), # ᶜ1
3234
ᶜtemp_scalar_2 = Fields.Field(FT, center_space), # ᶜtke_exch
3335
ᶜtemp_scalar_3 = Fields.Field(FT, center_space),

src/prognostic_equations/edmfx_sgs_flux.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ function edmfx_sgs_diffusive_flux_tendency!(
369369
ᶜK_h = @. lazy(eddy_diffusivity(ᶜK_u, ᶜprandtl_nvec))
370370
ᶠρaK_h = p.scratch.ᶠtemp_scalar
371371
@. ᶠρaK_h = ᶠinterp(ᶜρa⁰) * ᶠinterp(ᶜK_h)
372-
ᶠρaK_u = p.scratch.ᶠtemp_scalar
372+
ᶠρaK_u = p.scratch.ᶠtemp_scalar_2
373373
@. ᶠρaK_u = ᶠinterp(ᶜρa⁰) * ᶠinterp(ᶜK_u)
374374

375375
# Total enthalpy diffusion
@@ -497,7 +497,7 @@ function edmfx_sgs_diffusive_flux_tendency!(
497497

498498
ᶠρaK_h = p.scratch.ᶠtemp_scalar
499499
@. ᶠρaK_h = ᶠinterp(Y.c.ρ) * ᶠinterp(ᶜK_h)
500-
ᶠρaK_u = p.scratch.ᶠtemp_scalar
500+
ᶠρaK_u = p.scratch.ᶠtemp_scalar_2
501501
@. ᶠρaK_u = ᶠinterp(Y.c.ρ) * ᶠinterp(ᶜK_u)
502502

503503
# Total enthalpy diffusion

0 commit comments

Comments
 (0)