Skip to content

Commit 9d32277

Browse files
Try out columnwise
1 parent ac53bcc commit 9d32277

File tree

1 file changed

+63
-1
lines changed

1 file changed

+63
-1
lines changed

src/prognostic_equations/remaining_tendency.jl

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,71 @@ NVTX.@annotate function hyperdiffusion_tendency!(Yₜ, Yₜ_lim, Y, p, t)
1010
apply_hyperdiffusion_tendency!(Yₜ, Y, p, t)
1111
end
1212

13+
function ᶜremaining_tendency(ᶜY, ᶠY, p, t)
14+
nt = (;
15+
ᶜremaining_tendency_ρ(ᶜY, ᶠY, p, t)...,
16+
ᶜremaining_tendency_uₕ(ᶜY, ᶠY, p, t)...,
17+
ᶜremaining_tendency_ρe_tot(ᶜY, ᶠY, p, t)...,
18+
ᶜremaining_tendency_sgsʲs(ᶜY, ᶠY, p, t)...,
19+
)
20+
return nt
21+
end
22+
function ᶠremaining_tendency(ᶜY, ᶠY, p, t)
23+
nt = (;
24+
ᶠremaining_tendency_u₃(ᶜY, ᶠY, p, t)...,
25+
ᶠremaining_tendency_sgsʲs(ᶜY, ᶠY, p, t)...,
26+
)
27+
return nt
28+
end
29+
30+
function ᶜremaining_tendency_ρ(ᶜY, ᶠY, p, t)
31+
in propertynames(ᶜY) || return ()
32+
∑tendencies = zero(eltype(ᶜY.ρ))
33+
return (;ρ=∑tendencies)
34+
end
35+
function ᶜremaining_tendency_uₕ(ᶜY, ᶠY, p, t)
36+
:uₕ in propertynames(ᶜY) || return ()
37+
∑tendencies = zero(eltype(ᶜY.uₕ))
38+
return (;uₕ=∑tendencies)
39+
end
40+
function ᶜremaining_tendency_ρe_tot(ᶜY, ᶠY, p, t)
41+
:ρe_tot in propertynames(ᶜY) || return ()
42+
∑tendencies = zero(eltype(ᶜY.ρe_tot))
43+
return (;ρe_tot=∑tendencies)
44+
end
45+
function ᶜremaining_tendency_sgsʲs(ᶜY, ᶠY, p, t)
46+
:sgsʲs in propertynames(ᶜY) || return ()
47+
∑tendencies = zero(eltype(ᶜY.sgsʲs))
48+
return (;sgsʲs=∑tendencies)
49+
end
50+
function ᶠremaining_tendency_u₃(ᶜY, ᶠY, p, t)
51+
:u₃ in propertynames(ᶠY) || return ()
52+
∑tendencies = zero(eltype(ᶠY.u₃))
53+
return (;u₃=∑tendencies)
54+
end
55+
function ᶠremaining_tendency_sgsʲs(ᶜY, ᶠY, p, t)
56+
:sgsʲs in propertynames(ᶠY) || return ()
57+
∑tendencies = zero(eltype(ᶠY.sgsʲs))
58+
return (;sgsʲs=∑tendencies)
59+
end
60+
1361
NVTX.@annotate function remaining_tendency!(Yₜ, Yₜ_lim, Y, p, t)
62+
device = ClimaComms.device(axes(Y.c))
63+
p_rt = (;)
64+
Operators.columnwise!(
65+
device,
66+
ᶜremaining_tendency,
67+
ᶠremaining_tendency,
68+
Yₜ.c,
69+
Yₜ.f,
70+
Y.c,
71+
Y.f,
72+
p_rt,
73+
t,
74+
Val(false),
75+
Val(false),
76+
)
1477
Yₜ_lim .= zero(eltype(Yₜ_lim))
15-
Yₜ .= zero(eltype(Yₜ))
1678
horizontal_tracer_advection_tendency!(Yₜ_lim, Y, p, t)
1779
fill_with_nans!(p)
1880
horizontal_advection_tendency!(Yₜ, Y, p, t)

0 commit comments

Comments
 (0)