Skip to content

Commit

Permalink
Remove deprecated method
Browse files Browse the repository at this point in the history
Add to NEWS

boundary_tags -> boundary_names kwarg

Fixes
  • Loading branch information
charleskawczynski committed Mar 4, 2024
1 parent eac9943 commit a0142af
Show file tree
Hide file tree
Showing 84 changed files with 248 additions and 583 deletions.
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ClimaCore.jl Release Notes

Main
-------
- ![][badge-💥breaking] support for many deprecated methods have been dropped PR [#1632](https://github.com/CliMA/ClimaCore.jl/pull/1632).
- ![][badge-🤖precisionΔ]![][badge-🚀performance] Slight performance improvement by replacing `rdiv` with `rmul`. PR ([#1496](https://github.com/CliMA/ClimaCore.jl/pull/1496)) Machine-precision differences are expected.

v0.12.1
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/3d/se_kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function initialize_mwe(device, ::Type{FT}) where {FT}
z_domain = Domains.IntervalDomain(
Geometry.ZPoint(zero(z_max)),
Geometry.ZPoint(z_max);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
z_mesh = Meshes.IntervalMesh(z_domain, nelems = z_elem)
z_topology = Topologies.IntervalTopology(context, z_mesh)
Expand Down
10 changes: 4 additions & 6 deletions benchmarks/3d/vector_laplacian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,19 @@ using ClimaCore:
Quadratures
using CUDA, BenchmarkTools

context = ClimaComms.context()
hdomain = Domains.SphereDomain(6.37122e6)
hmesh = Meshes.EquiangularCubedSphere(hdomain, 30)
htopology = Topologies.Topology2D(hmesh)
htopology = Topologies.Topology2D(context, hmesh)
hspace = Spaces.SpectralElementSpace2D(htopology, Quadratures.GLL{4}())

vdomain = Domains.IntervalDomain(
Geometry.ZPoint(0.0),
Geometry.ZPoint(10e3);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vmesh = Meshes.IntervalMesh(vdomain; nelems = 45)
vtopology = Topologies.IntervalTopology(
ClimaComms.SingletonCommsContext(ClimaComms.device()),
vmesh,
)
vtopology = Topologies.IntervalTopology(context, vmesh)
vspace = Spaces.CenterFiniteDifferenceSpace(vtopology)

cspace = Spaces.ExtrudedFiniteDifferenceSpace(hspace, vspace)
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/bickleyjet/core_vs_ref.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ for Nq in Nqs
volume!(dydt, y0, (parameters,), 0.0)
# TODO: move this to volume!
dydt_data = Fields.field_values(dydt)
dydt_data .= RecursiveApply.rdiv.(dydt_data, space.local_geometry.WJ)
dydt_data .=
RecursiveApply.rdiv.(dydt_data, Spaces.local_geometry_data(space).WJ)

# setup reference
X = coordinates(Val(Nq), n1, n2)
Expand Down Expand Up @@ -83,7 +84,8 @@ for Nq in Nqs
add_face!(dydt, y0, (parameters,), 0.0)
# TODO: move this to volume!
dydt_data = Fields.field_values(dydt)
dydt_data .= RecursiveApply.rdiv.(dydt_data, space.local_geometry.WJ)
dydt_data .=
RecursiveApply.rdiv.(dydt_data, Spaces.local_geometry_data(space).WJ)

fill!(dydt_ref, 0.0)
add_face_ref!(dydt_ref, y0_ref, (n1, n2, parameters, Val(Nq)), 0.0)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/lib/ClimaCoreTempestRemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ end

# write out our cubed sphere mesh
meshfile_cc = "mesh_cubedsphere.g"
write_exodus(meshfile_cc, Spaces.horizontal_space(cspace).topology)
write_exodus(meshfile_cc, Spaces.topology(Spaces.horizontal_space(cspace)))

# write out RLL mesh
nlat = 90
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/introduction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using ClimaComms,

column_domain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.ZPoint(0.0) .. ClimaCore.Geometry.ZPoint(10.0),
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
#----------------------------------------------------------------------------

Expand Down
3 changes: 2 additions & 1 deletion examples/bickleyjet/bickleyjet_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ function rhs!(dydt, y, (parameters, numflux), t)

# 6. Solve for final result
dydt_data = Fields.field_values(dydt)
dydt_data .= RecursiveApply.rdiv.(dydt_data, space.local_geometry.WJ)
dydt_data .=
RecursiveApply.rdiv.(dydt_data, Spaces.local_geometry_data(space).WJ)
M = Quadratures.cutoff_filter_matrix(
Float64,
Spaces.quadrature_style(space),
Expand Down
2 changes: 1 addition & 1 deletion examples/common_spaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function make_hybrid_spaces(h_space, z_max, z_elem; z_stretch)
z_domain = Domains.IntervalDomain(
Geometry.ZPoint(zero(z_max)),
Geometry.ZPoint(z_max);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
z_mesh = Meshes.IntervalMesh(z_domain, z_stretch; nelems = z_elem)
z_topology = Topologies.IntervalTopology(z_mesh)
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/box/bubble_3d_invariant_rhoe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ function hvspace_3D(
vertdomain = Domains.IntervalDomain(
Geometry.ZPoint{FT}(zlim[1]),
Geometry.ZPoint{FT}(zlim[2]);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vertmesh = Meshes.IntervalMesh(vertdomain, nelems = zelem)
verttopo = Topologies.IntervalTopology(
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/plane/isothermal_channel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function hvspace_2D(
horztopology = Topologies.IntervalTopology(horzmesh)
quad = Quadratures.GLL{npoly + 1}()
horzspace = Spaces.SpectralElementSpace1D(horztopology, quad)
z_surface = warp_fn.(Fields.coordinate_field(horzspace))
z_surface = Geometry.ZPoint.(warp_fn.(Fields.coordinate_field(horzspace)))
hv_face_space = Spaces.ExtrudedFiniteDifferenceSpace(
horzspace,
vert_face_space,
Expand Down
2 changes: 1 addition & 1 deletion examples/hybrid/sphere/nonhydrostatic_gravity_wave.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function sphere_3D(
vertdomain = Domains.IntervalDomain(
Geometry.ZPoint{FT}(zlim[1]),
Geometry.ZPoint{FT}(zlim[2]);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vertmesh = Meshes.IntervalMesh(vertdomain, nelems = zelem)
vert_center_space = Spaces.CenterFiniteDifferenceSpace(vertmesh)
Expand Down
14 changes: 7 additions & 7 deletions lib/ClimaCoreMakie/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@ OUTPUT_DIR = mkpath(get(ENV, "CI_OUTPUT_DIR", tempname()))

@testset "spectral element 2D cubed-sphere" begin
R = 6.37122e6
context = ClimaComms.SingletonCommsContext()

domain = ClimaCore.Domains.SphereDomain(R)
mesh = ClimaCore.Meshes.EquiangularCubedSphere(domain, 6)
grid_topology = ClimaCore.Topologies.Topology2D(
ClimaComms.SingletonCommsContext(),
mesh,
)
grid_topology = ClimaCore.Topologies.Topology2D(context, mesh)
quad = ClimaCore.Quadratures.GLL{5}()
space = ClimaCore.Spaces.SpectralElementSpace2D(grid_topology, quad)
coords = ClimaCore.Fields.coordinate_field(space)
Expand Down Expand Up @@ -75,6 +73,7 @@ end

@testset "extruded" begin

context = ClimaComms.context()
domain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.XPoint(-1000.0),
ClimaCore.Geometry.XPoint(1000.0),
Expand All @@ -87,16 +86,17 @@ end
horz_coords = ClimaCore.Fields.coordinate_field(horz_space)

z_surface = map(horz_coords) do coord
100 * exp(-(coord.x / 100)^2)
Geometry.ZPoint(100 * exp(-(coord.x / 100)^2))
end

vert_domain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.ZPoint(0.0),
ClimaCore.Geometry.ZPoint(1000.0);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vert_mesh = ClimaCore.Meshes.IntervalMesh(vert_domain, nelems = 36)
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vert_mesh)
vtopology = Topologies.IntervalTopology(context, vert_mesh)
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vtopology)
vert_face_space =
ClimaCore.Spaces.FaceFiniteDifferenceSpace(vert_center_space)

Expand Down
8 changes: 4 additions & 4 deletions lib/ClimaCorePlots/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ OUTPUT_DIR = mkpath(get(ENV, "CI_OUTPUT_DIR", tempname()))
@testset "spectral element 1D" begin
domain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.XPoint(0.0) .. ClimaCore.Geometry.XPoint(π),
boundary_tags = (:left, :right),
boundary_names = (:left, :right),
)
mesh = ClimaCore.Meshes.IntervalMesh(domain; nelems = 5)
grid_topology = ClimaCore.Topologies.IntervalTopology(mesh)
Expand Down Expand Up @@ -109,7 +109,7 @@ end
vertdomain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.ZPoint{FT}(0),
ClimaCore.Geometry.ZPoint{FT}(1000);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vertmesh = ClimaCore.Meshes.IntervalMesh(vertdomain, nelems = velem)
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
Expand Down Expand Up @@ -197,7 +197,7 @@ end
vertdomain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.ZPoint{FT}(0),
ClimaCore.Geometry.ZPoint{FT}(1000);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vertmesh = ClimaCore.Meshes.IntervalMesh(vertdomain, nelems = velem)
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
Expand Down Expand Up @@ -246,7 +246,7 @@ end
vertdomain = ClimaCore.Domains.IntervalDomain(
ClimaCore.Geometry.ZPoint{FT}(0),
ClimaCore.Geometry.ZPoint{FT}(1000);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vertmesh = ClimaCore.Meshes.IntervalMesh(vertdomain, nelems = velem)
vert_center_space = ClimaCore.Spaces.CenterFiniteDifferenceSpace(vertmesh)
Expand Down
3 changes: 2 additions & 1 deletion lib/ClimaCoreTempestRemap/src/onlineremap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ function generate_map(

if target_space_distr != nothing
# Create map from unique (TempestRemap convention) to local element indices
target_local_elem_gidx = target_space_distr.topology.local_elem_gidx # gidx = local_elem_gidx[lidx]
target_local_elem_gidx =
Spaces.topology(target_space_distr).local_elem_gidx # gidx = local_elem_gidx[lidx]
target_global_elem_lidx = Dict{Int, Int}() # inverse of local_elem_gidx: lidx = global_elem_lidx[gidx]
for (lidx, gidx) in enumerate(target_local_elem_gidx)
target_global_elem_lidx[gidx] = lidx
Expand Down
10 changes: 5 additions & 5 deletions lib/ClimaCoreTempestRemap/test/netcdf.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ end
vdomain = Domains.IntervalDomain(
Geometry.ZPoint(0.0),
Geometry.ZPoint(50.0);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vmesh = Meshes.IntervalMesh(vdomain, nelems = nlevels)
vspace = Spaces.CenterFiniteDifferenceSpace(vmesh)
Expand Down Expand Up @@ -181,7 +181,7 @@ end
vdomain = Domains.IntervalDomain(
Geometry.ZPoint(0.0),
Geometry.ZPoint(50.0);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vmesh = Meshes.IntervalMesh(vdomain, nelems = nlevels)
vspace = Spaces.CenterFiniteDifferenceSpace(vmesh)
Expand Down Expand Up @@ -316,11 +316,11 @@ end
vdomain = Domains.IntervalDomain(
Geometry.ZPoint(0.0),
Geometry.ZPoint(50.0);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vmesh = Meshes.IntervalMesh(vdomain, nelems = nlevels)
vfspace = Spaces.FaceFiniteDifferenceSpace(vmesh)
z_surface = test_warp.(Fields.coordinate_field(hspace))
z_surface = Geometry.ZPoint.(test_warp.(Fields.coordinate_field(hspace)))
fhvspace = Spaces.ExtrudedFiniteDifferenceSpace(
hspace,
vfspace,
Expand Down Expand Up @@ -425,7 +425,7 @@ end
vdomain = Domains.IntervalDomain(
Geometry.ZPoint(0.0),
Geometry.ZPoint(50.0);
boundary_tags = (:bottom, :top),
boundary_names = (:bottom, :top),
)
vmesh = Meshes.IntervalMesh(vdomain, nelems = nlevels)
vspace = Spaces.CenterFiniteDifferenceSpace(vmesh)
Expand Down
8 changes: 0 additions & 8 deletions lib/ClimaCoreVTK/src/ClimaCoreVTK.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,4 @@ function writepvd(basename::String, times, fields::NamedTuple; vtkargs...)
end
end

Base.@deprecate writevtk(basename::String, times, fields; vtkargs...) writepvd(
basename,
times,
fields;
vtkargs...,
)


end # module
6 changes: 0 additions & 6 deletions src/DataLayouts/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -538,9 +538,6 @@ function Base.copyto!(
dest::VIFH{S, Ni},
bc::Base.Broadcast.Broadcasted{VIFHStyle{Ni, A}},
) where {S, Ni, A}
# if enable_threading()
# return _threaded_copyto!(dest, bc)
# end
return _serial_copyto!(dest, bc)
end

Expand Down Expand Up @@ -588,8 +585,5 @@ function Base.copyto!(
dest::VIJFH{S, Nij},
bc::Base.Broadcast.Broadcasted{VIJFHStyle{Nij, A}},
) where {S, Nij, A}
# if enable_threading()
# return _threaded_copyto!(dest, bc)
# end
return _serial_copyto!(dest, bc)
end
3 changes: 1 addition & 2 deletions src/Domains/Domains.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ function IntervalDomain(
coord_min::Geometry.Abstract1DPoint,
coord_max::Geometry.Abstract1DPoint;
periodic = false,
boundary_tags = nothing, # TODO: deprecate this
boundary_names::BCTagType = boundary_tags,
boundary_names::BCTagType = nothing,
)
if !periodic && isnothing(boundary_names)
throw(
Expand Down
19 changes: 0 additions & 19 deletions src/Fields/Fields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,6 @@ local_geometry_field(space::AbstractSpace) =
Field(Spaces.local_geometry_data(space), space)
local_geometry_field(field::Field) = local_geometry_field(axes(field))

Base.@deprecate dz_field(space::AbstractSpace) Δz_field(space) false
Base.@deprecate dz_field(field::Field) Δz_field(field) false

"""
Δz_field(field::Field)
Δz_field(space::AbstractSpace)
Expand Down Expand Up @@ -457,22 +454,6 @@ function Spaces.weighted_dss!(
return nothing
end

# Add definitions for backward compatibility
Spaces.weighted_dss2!(
field::Field,
dss_buffer = Spaces.create_dss_buffer(field),
) = Spaces.weighted_dss!(field, dss_buffer)

Spaces.weighted_dss_start2!(field::Field, ghost_buffer) =
Spaces.weighted_dss_start!(field, ghost_buffer)

Spaces.weighted_dss_internal2!(field::Field, ghost_buffer) =
Spaces.weighted_dss_internal!(field, ghost_buffer)

Spaces.weighted_dss_ghost2!(field, ghost_buffer) =
Spaces.weighted_dss_ghost!(field, ghost_buffer)


"""
Spaces.create_dss_buffer(field::Field)
Expand Down
9 changes: 0 additions & 9 deletions src/Fields/broadcast.jl
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,3 @@ function Base.Broadcast.copyto!(field::Field, nt::NamedTuple)
),
)
end


# TODO: deprecate these

allow_mismatched_diagonalized_spaces() = false

is_diagonalized_spaces(::Type{S}, ::Type{S}) where {S <: AbstractSpace} = true

is_diagonalized_spaces(::Type, ::Type) = false
11 changes: 0 additions & 11 deletions src/Hypsography/Hypsography.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,6 @@ of the domain, using the method of [GalChen1975](@cite).
"""
struct LinearAdaption{F <: Fields.Field} <: HypsographyAdaption
surface::F
function LinearAdaption(surface::Fields.Field)
if eltype(surface) <: Real
@warn "`LinearAdaptation`: `surface` argument scalar field has been deprecated. Use a field `ZPoint`s."
surface = Geometry.ZPoint.(surface)
end
new{typeof(surface)}(surface)
end
end

Adapt.adapt_structure(to, adaption::LinearAdaption) =
Expand Down Expand Up @@ -132,10 +125,6 @@ struct SLEVEAdaption{F <: Fields.Field, FT <: Real} <: HypsographyAdaption
) where {FT <: Real}
@assert 0 <= ηₕ <= 1
@assert s >= 0
if eltype(surface) <: Real
@warn "`SLEVEAdaption`: `surface` argument scalar field has been deprecated. Use a field `ZPoint`s."
surface = Geometry.ZPoint.(surface)
end
new{typeof(surface), FT}(surface, ηₕ, s)
end
end
Expand Down
5 changes: 0 additions & 5 deletions src/InputOutput/readers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ struct HDF5Reader{C <: ClimaComms.AbstractCommsContext}
grid_cache::Dict{Any, Any}
end

@deprecate HDF5Reader(filename::AbstractString) HDF5Reader(
filename,
ClimaComms.SingletonCommsContext(),
)

function HDF5Reader(
filename::AbstractString,
context::ClimaComms.AbstractCommsContext,
Expand Down
Loading

0 comments on commit a0142af

Please sign in to comment.