Skip to content

Commit

Permalink
Merge pull request #667 from CliMA/ck/future_deps
Browse files Browse the repository at this point in the history
Pass device to FiniteDifferenceSpace
  • Loading branch information
Sbozzolo authored Jul 24, 2024
2 parents d909007 + 2623cbc commit aabf29d
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 aabf29d

Please sign in to comment.