Skip to content

Commit 9de314e

Browse files
authored
Merge pull request #861 from CliMA/ck/future_deps
Pass context to FiniteDifferenceSpace
2 parents 588c8b5 + 98edf35 commit 9de314e

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

experiments/ClimaCore/heat-diffusion/run.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,13 @@ domain_atm = CC.Domains.IntervalDomain(
195195
CC.Geometry.ZPoint{FT}(parameters.zmax_atm);
196196
boundary_names = (:bottom, :top),
197197
);
198+
context = CC.ClimaComms.context()
198199
mesh_atm = CC.Meshes.IntervalMesh(domain_atm, nelems = parameters.n); # struct, allocates face boundaries to 5,6: atmos
199-
center_space_atm = CC.Spaces.CenterFiniteDifferenceSpace(mesh_atm); # collection of the above, discretises space into FD and provides coords
200+
if pkgversion(CC) >= v"0.14.10"
201+
center_space_atm = CC.Spaces.CenterFiniteDifferenceSpace(context, mesh_atm) # collection of the above, discretises space into FD and provides coords
202+
else
203+
center_space_atm = CC.Spaces.CenterFiniteDifferenceSpace(mesh_atm) # collection of the above, discretises space into FD and provides coords
204+
end
200205

201206
# - initialize prognostic variables, either as ClimaCore's Field objects or as Arrays
202207
T_atm_0 = CC.Fields.ones(FT, center_space_atm) .* parameters.T_atm_ini; # initiates a spatially uniform atm progostic var

experiments/ClimaCore/sea_breeze/atmos_rhs.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import TerminalLoggers
109109

110110
import ClimaCore as CC
111111
import ClimaCore.Geometry:
112+
import ClimaComms
112113

113114
Logging.global_logger(TerminalLoggers.TerminalLogger())
114115

@@ -123,8 +124,13 @@ function hvspace_2D(xlim = (-π, π), zlim = (0, 4π), helem = 20, velem = 20, n
123124
CC.Geometry.ZPoint{FT}(zlim[2]);
124125
boundary_names = (:bottom, :top),
125126
)
127+
context = ClimaComms.context()
126128
vertmesh = CC.Meshes.IntervalMesh(vertdomain, nelems = velem)
127-
vert_center_space = CC.Spaces.CenterFiniteDifferenceSpace(vertmesh)
129+
if pkgversion(CC) >= v"0.14.10"
130+
vert_center_space = CC.Spaces.CenterFiniteDifferenceSpace(context, vertmesh)
131+
else
132+
vert_center_space = CC.Spaces.CenterFiniteDifferenceSpace(vertmesh)
133+
end
128134

129135
horzdomain =
130136
CC.Domains.IntervalDomain(CC.Geometry.XPoint{FT}(xlim[1]) .. CC.Geometry.XPoint{FT}(xlim[2]), periodic = true)

src/Regridder.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function hdwrite_regridfile_rll_to_cgll(
179179
space2d_undistributed = CC.Spaces.SpectralElementSpace2D(topology, CC.Spaces.Quadratures.GLL{Nq}())
180180

181181
if space isa CC.Spaces.ExtrudedFiniteDifferenceSpace
182-
vert_center_space = CC.Spaces.CenterFiniteDifferenceSpace(CC.Spaces.vertical_topology(space).mesh)
182+
vert_center_space = CC.Spaces.CenterFiniteDifferenceSpace(CC.Spaces.vertical_topology(space))
183183
space_undistributed = CC.Spaces.ExtrudedFiniteDifferenceSpace(space2d_undistributed, vert_center_space)
184184
else
185185
space_undistributed = space2d_undistributed

0 commit comments

Comments
 (0)