From 1ec12b9288697d4f53efeff074d90cc34ef2c09b Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Wed, 4 Oct 2023 15:11:42 -0700 Subject: [PATCH 1/2] Try to fix moist gpu example --- .../vertical_diffusion_boundary_layer.jl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/prognostic_equations/vertical_diffusion_boundary_layer.jl b/src/prognostic_equations/vertical_diffusion_boundary_layer.jl index c0a3ac4f78..fe96532abe 100644 --- a/src/prognostic_equations/vertical_diffusion_boundary_layer.jl +++ b/src/prognostic_equations/vertical_diffusion_boundary_layer.jl @@ -85,15 +85,14 @@ function vertical_diffusion_boundary_layer_tendency!( FT = eltype(Y) interior_uₕ = Fields.level(Y.c.uₕ, 1) interior_coordinates = Fields.level(Fields.coordinate_field(Y.c), 1) - z_surface = - Fields.level(Fields.coordinate_field(Y.f).z[colidx], Fields.half) ᶠp = ᶠρK_E = p.ᶠtemp_scalar @. ᶠp[colidx] = ᶠinterp(ᶜp[colidx]) + ᶜΔz_surface = Fields.Δz_field(interior_coordinates) @. ᶠρK_E[colidx] = ᶠinterp(Y.c.ρ[colidx]) * eddy_diffusivity_coefficient( C_E, norm(interior_uₕ[colidx]), - interior_coordinates.z[colidx] - z_surface, + ᶜΔz_surface[colidx] / 2, ᶠp[colidx], ) From 4a8921d4d02565011f0ed92d8dddda8d6aa9a3fa Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Wed, 4 Oct 2023 17:11:09 -0700 Subject: [PATCH 2/2] Update src/prognostic_equations/vertical_diffusion_boundary_layer.jl Co-authored-by: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> --- src/prognostic_equations/vertical_diffusion_boundary_layer.jl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/prognostic_equations/vertical_diffusion_boundary_layer.jl b/src/prognostic_equations/vertical_diffusion_boundary_layer.jl index fe96532abe..c00963d1ee 100644 --- a/src/prognostic_equations/vertical_diffusion_boundary_layer.jl +++ b/src/prognostic_equations/vertical_diffusion_boundary_layer.jl @@ -84,10 +84,9 @@ function vertical_diffusion_boundary_layer_tendency!( FT = eltype(Y) interior_uₕ = Fields.level(Y.c.uₕ, 1) - interior_coordinates = Fields.level(Fields.coordinate_field(Y.c), 1) ᶠp = ᶠρK_E = p.ᶠtemp_scalar @. ᶠp[colidx] = ᶠinterp(ᶜp[colidx]) - ᶜΔz_surface = Fields.Δz_field(interior_coordinates) + ᶜΔz_surface = Fields.Δz_field(interior_uₕ) @. ᶠρK_E[colidx] = ᶠinterp(Y.c.ρ[colidx]) * eddy_diffusivity_coefficient( C_E,