Skip to content

Commit

Permalink
Pass device to FiniteDifferenceSpace
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski authored and Sbozzolo committed Jul 24, 2024
1 parent d909007 commit 2623cbc
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/shared_utilities/Domains.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,13 @@ function Column(;
)
end

subsurface_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(mesh)
device = ClimaComms.device()
if pkgversion(ClimaCore) >= v"0.14.10"
subsurface_space =
ClimaCore.Spaces.CenterFiniteDifferenceSpace(device, mesh)
else
subsurface_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(mesh)
end
surface_space = obtain_surface_space(subsurface_space)
space = (; surface = surface_space, subsurface = subsurface_space)
fields = get_additional_domain_fields(subsurface_space)
Expand Down Expand Up @@ -352,7 +358,14 @@ function HybridBox(;
reverse_mode = true,
)
end
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
device = ClimaComms.device()
if pkgversion(ClimaCore) >= v"0.14.10"
vert_center_space =
ClimaCore.Spaces.CenterFiniteDifferenceSpace(device, vertmesh)
else
vert_center_space =
ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
end

horzdomain = Plane(;
xlim = xlim,
Expand Down Expand Up @@ -468,7 +481,14 @@ function SphericalShell(;
reverse_mode = true,
)
end
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
device = ClimaComms.device()
if pkgversion(ClimaCore) >= v"0.14.10"
vert_center_space =
ClimaCore.Spaces.CenterFiniteDifferenceSpace(device, vertmesh)
else
vert_center_space =
ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
end

horzdomain = ClimaCore.Domains.SphereDomain(radius)
horzmesh = ClimaCore.Meshes.EquiangularCubedSphere(horzdomain, nelements[1])
Expand Down

0 comments on commit 2623cbc

Please sign in to comment.