From 2623cbc3eb5812e79b850449c1162b21d29f88bd Mon Sep 17 00:00:00 2001 From: Charles Kawczynski Date: Mon, 17 Jun 2024 21:26:49 -0400 Subject: [PATCH] Pass device to FiniteDifferenceSpace --- src/shared_utilities/Domains.jl | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/shared_utilities/Domains.jl b/src/shared_utilities/Domains.jl index 23b43428e3..b445e870ef 100644 --- a/src/shared_utilities/Domains.jl +++ b/src/shared_utilities/Domains.jl @@ -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) @@ -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, @@ -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])