Skip to content

Commit 581df5b

Browse files
Fixes
1 parent 08ca81f commit 581df5b

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

examples/column/vanleer_advection.jl

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
#=
2+
julia --project=.buildkite
3+
ENV["CLIMACOMMS_DEVICE"] = "CUDA"
4+
using Revise; include("examples/column/vanleer_advection.jl")
5+
=#
16
using Test
27
using LinearAlgebra
38
import ClimaComms
@@ -51,13 +56,13 @@ end
5156

5257
# Define a pulse wave or square wave
5358

54-
FT = Float64
55-
t₀ = FT(0.0)
56-
t₁ = FT(6)
57-
z₀ = FT(0.0)
58-
zₕ = FT(2π)
59-
z₁ = FT(1.0)
60-
speed = FT(-1.0)
59+
const FT = Float64
60+
const t₀ = FT(0.0)
61+
const t₁ = FT(6)
62+
const z₀ = FT(0.0)
63+
const zₕ = FT(2π)
64+
const z₁ = FT(1.0)
65+
const speed = FT(-1.0)
6166
pulse(z, t, z₀, zₕ, z₁) = abs(z - speed * t) zₕ ? z₁ : z₀
6267

6368
n = 2 .^ 8
@@ -135,6 +140,14 @@ for (i, stretch_fn) in enumerate(stretch_fns)
135140
err = norm(q_final .- q_analytic)
136141
rel_mass_err = norm((sum(q_final) - sum(q_init)) / sum(q_init))
137142

143+
@test err 0.25
144+
@test rel_mass_err 10eps()
145+
146+
device = ClimaComms.device(q_init)
147+
if device isa ClimaComms.CUDADevice
148+
continue
149+
end
150+
138151
if j == 1
139152
fig = Plots.plot(q_analytic; label = "Exact", color = :red)
140153
end
@@ -162,7 +175,5 @@ for (i, stretch_fn) in enumerate(stretch_fns)
162175
),
163176
)
164177
end
165-
@test err 0.25
166-
@test rel_mass_err 10eps()
167178
end
168179
end

0 commit comments

Comments
 (0)