Skip to content

Commit 19ce5d4

Browse files
committed
Add sedimentation of rhoa, q_tot and moisture tracers to edmf. Working RICO
1 parent 756dcf6 commit 19ce5d4

File tree

7 files changed

+170
-62
lines changed

7 files changed

+170
-62
lines changed

.buildkite/Manifest-v1.11.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file is machine-generated - editing it directly is not advised
22

3-
julia_version = "1.11.4"
3+
julia_version = "1.11.3"
44
manifest_format = "2.0"
55
project_hash = "04945e2a7116cfacb2d57340f477dbe23e208227"
66

@@ -363,7 +363,7 @@ version = "0.5.17"
363363
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
364364

365365
[[deps.ClimaAtmos]]
366-
deps = ["Adapt", "ArgParse", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "Insolation", "Interpolations", "LazyArtifacts", "LazyBroadcast", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "NullBroadcasts", "RRTMGP", "Random", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "UnrolledUtilities", "YAML"]
366+
deps = ["Adapt", "ArgParse", "Artifacts", "AtmosphericProfilesLibrary", "ClimaComms", "ClimaCore", "ClimaDiagnostics", "ClimaParams", "ClimaTimeSteppers", "ClimaUtilities", "CloudMicrophysics", "Dates", "Insolation", "Interpolations", "LazyArtifacts", "LazyBroadcast", "LinearAlgebra", "Logging", "NCDatasets", "NVTX", "NullBroadcasts", "PrettyTables", "RRTMGP", "Random", "SciMLBase", "StaticArrays", "Statistics", "SurfaceFluxes", "Thermodynamics", "UnrolledUtilities", "YAML"]
367367
path = ".."
368368
uuid = "b2c96348-7fb7-4fe0-8da9-78d88439e717"
369369
version = "0.30.3"
@@ -1808,7 +1808,7 @@ version = "2.5.4+0"
18081808
[[deps.OpenLibm_jll]]
18091809
deps = ["Artifacts", "Libdl"]
18101810
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
1811-
version = "0.8.1+4"
1811+
version = "0.8.1+2"
18121812

18131813
[[deps.OpenMPI_jll]]
18141814
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Hwloc_jll", "JLLWrappers", "LazyArtifacts", "Libdl", "MPIPreferences", "TOML", "Zlib_jll"]

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
2525
NCDatasets = "85f8d34a-cbdd-5861-8df4-14fed0d494ab"
2626
NVTX = "5da4648a-3479-48b8-97b9-01cb529c0a1f"
2727
NullBroadcasts = "0d71be07-595a-4f89-9529-4065a4ab43a6"
28+
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
2829
RRTMGP = "a01a1ee8-cea4-48fc-987c-fc7878d79da1"
2930
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3031
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
@@ -57,6 +58,7 @@ Logging = "1"
5758
NCDatasets = "0.14.2"
5859
NVTX = "0.3, 1"
5960
NullBroadcasts = "0.1"
61+
PrettyTables = "2.4.0"
6062
RRTMGP = "0.21.2"
6163
Random = "1"
6264
SciMLBase = "2.12"

config/model_configs/prognostic_edmfx_rico_column.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ edmfx_nh_pressure: true
1515
edmfx_filter: true
1616
prognostic_tke: true
1717
moist: "nonequil"
18-
cloud_model: "quadrature_sgs"
18+
cloud_model: "grid_scale" #"quadrature_sgs"
1919
call_cloud_diagnostics_per_stage: true
2020
precip_model: "1M"
2121
config: "column"
@@ -25,8 +25,8 @@ y_elem: 2
2525
z_elem: 100
2626
z_stretch: false
2727
perturb_initstate: false
28-
dt: "10secs"
29-
t_end: "6hours"
28+
dt: "2secs"
29+
t_end: "6hours" #"1200secs" #"6hours"
3030
dt_save_state_to_disk: "10mins"
3131
toml: [toml/prognostic_edmfx_1M.toml]
3232
netcdf_interpolation_num_points: [8, 8, 100]

src/cache/precomputed_quantities.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ function precomputed_quantities(Y, atmos)
151151
ᶜSqᵢᵖʲs = similar(Y.c, NTuple{n, FT}),
152152
ᶜSqᵣᵖʲs = similar(Y.c, NTuple{n, FT}),
153153
ᶜSqₛᵖʲs = similar(Y.c, NTuple{n, FT}),
154+
ᶜwₗʲs = similar(Y.c, NTuple{n, FT}),
155+
ᶜwᵢʲs = similar(Y.c, NTuple{n, FT}),
156+
ᶜwᵣʲs = similar(Y.c, NTuple{n, FT}),
157+
ᶜwₛʲs = similar(Y.c, NTuple{n, FT}),
154158
ᶜSqₗᵖ⁰ = similar(Y.c, FT),
155159
ᶜSqᵢᵖ⁰ = similar(Y.c, FT),
156160
ᶜSqᵣᵖ⁰ = similar(Y.c, FT),

src/cache/prognostic_edmf_precomputed_quantities.jl

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,13 +608,60 @@ NVTX.@annotate function set_prognostic_edmf_precomputed_quantities_precipitation
608608
(; ᶜSqₗᵖ⁰, ᶜSqᵢᵖ⁰, ᶜSqᵣᵖ⁰, ᶜSqₛᵖ⁰, ᶜρ⁰, ᶜts⁰) = p.precomputed
609609
(; ᶜq_liq⁰, ᶜq_ice⁰, ᶜq_rai⁰, ᶜq_sno⁰) = p.precomputed
610610

611+
(; ᶜwₗʲs, ᶜwᵢʲs, ᶜwᵣʲs, ᶜwₛʲs) = p.precomputed
612+
611613
# TODO - can I re-use them between js and env?
612614
ᶜSᵖ = p.scratch.ᶜtemp_scalar
613615
ᶜSᵖ_snow = p.scratch.ᶜtemp_scalar_2
614616

615617
n = n_mass_flux_subdomains(p.atmos.turbconv_model)
618+
FT = eltype(params)
616619

617620
for j in 1:n
621+
622+
# compute terminal velocity for precipitation
623+
@. ᶜwᵣʲs.:($$j) = CM1.terminal_velocity(
624+
cmp.pr,
625+
cmp.tv.rain,
626+
ᶜρʲs.:($$j),
627+
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_rai),
628+
)
629+
@. ᶜwₛʲs.:($$j) = CM1.terminal_velocity(
630+
cmp.ps,
631+
cmp.tv.snow,
632+
ᶜρʲs.:($$j),
633+
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_sno),
634+
)
635+
# compute sedimentation velocity for cloud condensate [m/s]
636+
@. ᶜwₗʲs.:($$j) = CMNe.terminal_velocity(
637+
cmc.liquid,
638+
cmc.Ch2022.rain,
639+
ᶜρʲs.:($$j),
640+
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_liq),
641+
)
642+
@. ᶜwᵢʲs.:($$j) = CMNe.terminal_velocity(
643+
cmc.ice,
644+
cmc.Ch2022.small_ice,
645+
ᶜρʲs.:($$j),
646+
max(zero(Y.c.ρ), Y.c.sgsʲs.:($$j).q_ice),
647+
)
648+
#=
649+
header = (["CFL", "ρa", "mse", "q_tot", "q_liq", "q_ice", "q_rai", "q_sno", "ᶜwₗʲ", "ᶜwᵢʲ", "ᶜwᵣʲ", "ᶜwₛʲ",])
650+
PRT.pretty_table(hcat(
651+
parent(Fields.Δz_field(axes(Y.c)))[:] ./ dt,
652+
parent(Y.c.sgsʲs.:($j).ρa)[:, :, 1, 1, 1],
653+
parent(Y.c.sgsʲs.:($j).mse)[:, :, 1, 1, 1],
654+
parent(Y.c.sgsʲs.:($j).q_tot)[:, :, 1, 1, 1],
655+
parent(Y.c.sgsʲs.:($j).q_liq)[:, :, 1, 1, 1],
656+
parent(Y.c.sgsʲs.:($j).q_ice)[:, :, 1, 1, 1],
657+
parent(Y.c.sgsʲs.:($j).q_rai)[:, :, 1, 1, 1],
658+
parent(Y.c.sgsʲs.:($j).q_sno)[:, :, 1, 1, 1],
659+
parent(ᶜwₗʲs.:($j))[:, :, 1, 1, 1],
660+
parent(ᶜwᵢʲs.:($j))[:, :, 1, 1, 1],
661+
parent(ᶜwᵣʲs.:($j))[:, :, 1, 1, 1],
662+
parent(ᶜwₛʲs.:($j))[:, :, 1, 1, 1],
663+
) , show_row_number = true, header = header, crop = :none)
664+
=#
618665
# Precipitation sources and sinks from the updrafts
619666
compute_precipitation_sources!(
620667
ᶜSᵖ,

src/prognostic_equations/advection.jl

Lines changed: 97 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ using LinearAlgebra: ×, dot
66
import ClimaCore.Fields as Fields
77
import ClimaCore.Geometry as Geometry
88

9+
import PrettyTables as PRT
10+
911
NVTX.@annotate function horizontal_advection_tendency!(Yₜ, Y, p, t)
1012
n = n_mass_flux_subdomains(p.atmos.turbconv_model)
1113
(; ᶜΦ) = p.core
@@ -230,58 +232,111 @@ function edmfx_sgs_vertical_advection_tendency!(
230232
end
231233

232234
for j in 1:n
235+
# Flux form vertical advection of area farction with the grid mean velocity
233236
@. ᶜa_scalar = draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j))
234-
vtt = vertical_transport(
235-
ᶜρʲs.:($j),
236-
ᶠu³ʲs.:($j),
237-
ᶜa_scalar,
238-
dt,
239-
edmfx_upwinding,
240-
)
237+
vtt = vertical_transport(ᶜρʲs.:($j), ᶠu³ʲs.:($j), ᶜa_scalar, dt, edmfx_upwinding)
241238
@. Yₜ.c.sgsʲs.:($$j).ρa += vtt
242239

243-
va = vertical_advection(
244-
ᶠu³ʲs.:($j),
245-
Y.c.sgsʲs.:($j).mse,
246-
edmfx_upwinding,
247-
)
240+
# Advective form advection of mse and q_tot with the grid mean velocity
241+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).mse, edmfx_upwinding)
248242
@. Yₜ.c.sgsʲs.:($$j).mse += va
249-
250-
va = vertical_advection(
251-
ᶠu³ʲs.:($j),
252-
Y.c.sgsʲs.:($j).q_tot,
253-
edmfx_upwinding,
254-
)
243+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).q_tot, edmfx_upwinding)
255244
@. Yₜ.c.sgsʲs.:($$j).q_tot += va
245+
256246
if p.atmos.moisture_model isa NonEquilMoistModel &&
257247
p.atmos.precip_model isa Microphysics1Moment
258-
# TODO - add precipitation terminal velocity
259-
# TODO - add cloud sedimentation velocity
260-
# TODO - add their contributions to mean energy and mass
261-
va = vertical_advection(
262-
ᶠu³ʲs.:($j),
263-
Y.c.sgsʲs.:($j).q_liq,
264-
edmfx_upwinding,
265-
)
248+
# TODO - add precipitation terminal velocity in implicit solver/tendency with if/else
249+
# TODO - add cloud sedimentation velocity in implicit solver/tendency with if/else
250+
251+
# Advective form advection of moisture tracers with the grid mean velocity
252+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).q_liq, edmfx_upwinding)
266253
@. Yₜ.c.sgsʲs.:($$j).q_liq += va
267-
va = vertical_advection(
268-
ᶠu³ʲs.:($j),
269-
Y.c.sgsʲs.:($j).q_ice,
270-
edmfx_upwinding,
271-
)
254+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).q_ice, edmfx_upwinding)
272255
@. Yₜ.c.sgsʲs.:($$j).q_ice += va
273-
va = vertical_advection(
274-
ᶠu³ʲs.:($j),
275-
Y.c.sgsʲs.:($j).q_rai,
276-
edmfx_upwinding,
277-
)
256+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).q_rai, edmfx_upwinding)
278257
@. Yₜ.c.sgsʲs.:($$j).q_rai += va
279-
va = vertical_advection(
280-
ᶠu³ʲs.:($j),
281-
Y.c.sgsʲs.:($j).q_sno,
282-
edmfx_upwinding,
283-
)
258+
va = vertical_advection(ᶠu³ʲs.:($j), Y.c.sgsʲs.:($j).q_sno, edmfx_upwinding)
284259
@. Yₜ.c.sgsʲs.:($$j).q_sno += va
285-
end
260+
261+
FT = eltype(params)
262+
(; ᶜwₗʲs, ᶜwᵢʲs, ᶜwᵣʲs, ᶜwₛʲs, ᶜtsʲs) = p.precomputed
263+
264+
ᶜinv_ρ̂_∂ρ̂∂z = (@. lazy(divide_by_ρa(FT(1), Y.c.sgsʲs.:($$j).ρa, FT(0), Y.c.ρ, turbconv_model) * ᶜgradᵥ(ᶠinterp(Y.c.sgsʲs.:($$j).ρa))))
265+
ᶠwₗ³ʲs = (@. lazy( CT3(ᶠinterp(Geometry.WVector(-1 * ᶜwₗʲs.:($$j))))))
266+
ᶠwᵢ³ʲs = (@. lazy( CT3(ᶠinterp(Geometry.WVector(-1 * ᶜwᵢʲs.:($$j))))))
267+
ᶠwᵣ³ʲs = (@. lazy( CT3(ᶠinterp(Geometry.WVector(-1 * ᶜwᵣʲs.:($$j))))))
268+
ᶠwₛ³ʲs = (@. lazy( CT3(ᶠinterp(Geometry.WVector(-1 * ᶜwₛʲs.:($$j))))))
269+
270+
ᶜa = (@. lazy(draft_area(Y.c.sgsʲs.:($$j).ρa, ᶜρʲs.:($$j))))
271+
272+
# Flux form vertical advection of rho * area with sedimantation contributions
273+
vtt = vertical_transport(ᶜρʲs.:($j), ᶠwₗ³ʲs, (@. lazy(ᶜa * Y.c.sgsʲs.:($$j).q_liq)), dt, edmfx_upwinding)
274+
@. Yₜ.c.sgsʲs.:($$j).ρa += vtt
275+
vtt = vertical_transport(ᶜρʲs.:($j), ᶠwᵢ³ʲs, (@. lazy(ᶜa * Y.c.sgsʲs.:($$j).q_ice)), dt, edmfx_upwinding)
276+
@. Yₜ.c.sgsʲs.:($$j).ρa += vtt
277+
vtt = vertical_transport(ᶜρʲs.:($j), ᶠwᵣ³ʲs, (@. lazy(ᶜa * Y.c.sgsʲs.:($$j).q_rai)), dt, edmfx_upwinding)
278+
@. Yₜ.c.sgsʲs.:($$j).ρa += vtt
279+
vtt = vertical_transport(ᶜρʲs.:($j), ᶠwₛ³ʲs, (@. lazy(ᶜa * Y.c.sgsʲs.:($$j).q_sno)), dt, edmfx_upwinding)
280+
@. Yₜ.c.sgsʲs.:($$j).ρa += vtt
281+
282+
# q_tot and moisture tracers advective form advection with sedimentation velocity
283+
va = vertical_advection(ᶠwₗ³ʲs, Y.c.sgsʲs.:($j).q_liq, edmfx_upwinding)
284+
@. Yₜ.c.sgsʲs.:($$j).q_tot += (1 - Y.c.sgsʲs.:($$j).q_tot) * va
285+
@. Yₜ.c.sgsʲs.:($$j).q_liq += va
286+
va = vertical_advection(ᶠwᵢ³ʲs, Y.c.sgsʲs.:($j).q_ice, edmfx_upwinding)
287+
@. Yₜ.c.sgsʲs.:($$j).q_tot += (1 - Y.c.sgsʲs.:($$j).q_tot) * va
288+
@. Yₜ.c.sgsʲs.:($$j).q_ice += va
289+
va = vertical_advection(ᶠwᵣ³ʲs, Y.c.sgsʲs.:($j).q_rai, edmfx_upwinding)
290+
@. Yₜ.c.sgsʲs.:($$j).q_tot += (1 - Y.c.sgsʲs.:($$j).q_tot) * va
291+
@. Yₜ.c.sgsʲs.:($$j).q_rai += va
292+
va = vertical_advection(ᶠwₛ³ʲs, Y.c.sgsʲs.:($j).q_sno, edmfx_upwinding)
293+
@. Yₜ.c.sgsʲs.:($$j).q_tot += (1 - Y.c.sgsʲs.:($$j).q_tot) * va
294+
@. Yₜ.c.sgsʲs.:($$j).q_sno += va
295+
296+
# q_tot and moisture tracers terms proportional to 1/ρ̂ ∂zρ̂
297+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwₗʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_liq * (1 - Y.c.sgsʲs.:($$j).q_tot)
298+
@. Yₜ.c.sgsʲs.:($$j).q_liq -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwₗʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_liq
299+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwᵢʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_ice * (1 - Y.c.sgsʲs.:($$j).q_tot)
300+
@. Yₜ.c.sgsʲs.:($$j).q_ice -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwᵢʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_ice
301+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwᵣʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_rai * (1 - Y.c.sgsʲs.:($$j).q_tot)
302+
@. Yₜ.c.sgsʲs.:($$j).q_rai -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwᵣʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_rai
303+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwₛʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_sno * (1 - Y.c.sgsʲs.:($$j).q_tot)
304+
@. Yₜ.c.sgsʲs.:($$j).q_sno -= dot(ᶜinv_ρ̂_∂ρ̂∂z, CT3(Geometry.WVector(-1 * ᶜwₛʲs.:($$j)))) * Y.c.sgsʲs.:($$j).q_sno
305+
306+
# q_tot and moisture tracer terms proportional to velocity gradients
307+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= ᶜdivᵥ(ᶠwₗ³ʲs) * Y.c.sgsʲs.:($$j).q_liq * (1 - Y.c.sgsʲs.:($$j).q_tot)
308+
@. Yₜ.c.sgsʲs.:($$j).q_liq -= ᶜdivᵥ(ᶠwₗ³ʲs) * Y.c.sgsʲs.:($$j).q_liq
309+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= ᶜdivᵥ(ᶠwᵢ³ʲs) * Y.c.sgsʲs.:($$j).q_ice * (1 - Y.c.sgsʲs.:($$j).q_tot)
310+
@. Yₜ.c.sgsʲs.:($$j).q_ice -= ᶜdivᵥ(ᶠwᵢ³ʲs) * Y.c.sgsʲs.:($$j).q_ice
311+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= ᶜdivᵥ(ᶠwᵣ³ʲs) * Y.c.sgsʲs.:($$j).q_rai * (1 - Y.c.sgsʲs.:($$j).q_tot)
312+
@. Yₜ.c.sgsʲs.:($$j).q_rai -= ᶜdivᵥ(ᶠwᵣ³ʲs) * Y.c.sgsʲs.:($$j).q_rai
313+
@. Yₜ.c.sgsʲs.:($$j).q_tot -= ᶜdivᵥ(ᶠwₛ³ʲs) * Y.c.sgsʲs.:($$j).q_sno * (1 - Y.c.sgsʲs.:($$j).q_tot)
314+
@. Yₜ.c.sgsʲs.:($$j).q_sno -= ᶜdivᵥ(ᶠwₛ³ʲs) * Y.c.sgsʲs.:($$j).q_sno
315+
end
286316
end
287317
end
318+
319+
#(; ᶜΦ) = p.core
320+
#thp = CAP.thermodynamics_params(params)
321+
322+
#@. ᶜa_scalar = Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜΦ
323+
#vtt = vertical_transport(FT(1), (@. lazy( CT3(ᶠinterp(Geometry.WVector(ᶜwᵣʲs.:($$j)))))), ᶜa_scalar, dt, edmfx_upwinding)
324+
#@. Yₜ.c.sgsʲs.:($$j).q_rai -= vtt
325+
#@. Yₜ.c.sgsʲs.:($$j).q_rai -= ᶜinv_ρ̂_∂ρ̂∂z * ᶜwᵣʲs.:($$j) * (Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜϕ)
326+
327+
#(@. lazy(ᶠu³ʲs.:($$j) - CT3(ᶠinterp(Geometry.WVector(ᶜwₗʲs.:($$j)))))),
328+
329+
#@. Yₜ.c.sgsʲs.:($$j).mse -= ifelse(
330+
# Y.c.sgsʲs.:($$j).ρa <= eps(FT),
331+
# FT(0),
332+
# (
333+
# 1 / Y.c.sgsʲs.:($$j).ρa *
334+
# ᶜdivᵥ(ᶠinterp(Y.c.sgsʲs.:($$j).ρa * (
335+
# Geometry.WVector(ᶜwₗʲs.:($$j)) * (Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
336+
# Geometry.WVector(ᶜwᵢʲs.:($$j)) * (Iᵢ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
337+
# Geometry.WVector(ᶜwᵣʲs.:($$j)) * (Iₗ(thp, ᶜtsʲs.:($$j)) + ᶜΦ) +
338+
# Geometry.WVector(ᶜwₛʲs.:($$j)) * (Iᵢ(thp, ᶜtsʲs.:($$j)) + ᶜΦ)
339+
# )))
340+
# )
341+
#)
342+

src/prognostic_equations/implicit/implicit_tendency.jl

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,32 @@ end
7070
# expressions are less convoluted?
7171

7272
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:none})
73-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
74-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
73+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
74+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
7575
return @. lazy(-(ᶜadvdivᵥ(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * ᶠu³ * ᶠinterp(ᶜχ))))
7676
end
7777
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:first_order})
78-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
79-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
78+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
79+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
8080
return @. lazy(-(ᶜadvdivᵥ(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * ᶠupwind1(ᶠu³, ᶜχ))))
8181
end
8282
@static if pkgversion(ClimaCore) v"0.14.22"
8383
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:vanleer_limiter})
84-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
85-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
84+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
85+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
8686
return @. lazy(
8787
-(ᶜadvdivᵥ(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * ᶠlin_vanleer(ᶠu³, ᶜχ, dt))),
8888
)
8989
end
9090
end
9191
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:third_order})
92-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
93-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
92+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
93+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
9494
return @. lazy(-(ᶜadvdivᵥ(ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * ᶠupwind3(ᶠu³, ᶜχ))))
9595
end
9696
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:boris_book})
97-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
98-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
97+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
98+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
9999
return @. lazy(
100100
-(ᶜadvdivᵥ(
101101
ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * (
@@ -109,8 +109,8 @@ function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:boris_book})
109109
)
110110
end
111111
function vertical_transport(ᶜρ, ᶠu³, ᶜχ, dt, ::Val{:zalesak})
112-
ᶜJ = Fields.local_geometry_field(ᶜρ).J
113-
ᶠJ = Fields.local_geometry_field(ᶠu³).J
112+
ᶜJ = Fields.local_geometry_field(axes(ᶜρ)).J
113+
ᶠJ = Fields.local_geometry_field(axes(ᶠu³)).J
114114
return @. lazy(
115115
-(ᶜadvdivᵥ(
116116
ᶠinterp(ᶜρ * ᶜJ) / ᶠJ * (
@@ -136,8 +136,8 @@ function implicit_vertical_advection_tendency!(Yₜ, Y, p, t)
136136
(; moisture_model, turbconv_model, rayleigh_sponge, precip_model) = p.atmos
137137
(; dt) = p
138138
n = n_mass_flux_subdomains(turbconv_model)
139-
ᶜJ = Fields.local_geometry_field(Y.c).J
140-
ᶠJ = Fields.local_geometry_field(Y.f).J
139+
ᶜJ = Fields.local_geometry_field(axes(Y.c)).J
140+
ᶠJ = Fields.local_geometry_field(axes(Y.f)).J
141141
(; ᶠgradᵥ_ᶜΦ) = p.core
142142
(; ᶜh_tot, ᶜspecific, ᶠu³, ᶜp) = p.precomputed
143143

0 commit comments

Comments
 (0)