Skip to content

Commit

Permalink
allowscalar
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbyrne committed Jul 20, 2023
1 parent 32e372f commit 6af8766
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions test/Fields/field.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import ClimaCore:
using LinearAlgebra: norm
using Statistics: mean
using ForwardDiff
using CUDA

include(
joinpath(pkgdir(ClimaCore), "test", "TestUtilities", "TestUtilities.jl"),
Expand All @@ -35,7 +36,7 @@ function spectral_space_2D(; n1 = 1, n2 = 1, Nij = 4)
space = Spaces.SpectralElementSpace2D(grid_topology, quad)
return space
end

#=
@testset "1×1 2D domain space" begin
Nij = 4
n1 = n2 = 1
Expand Down Expand Up @@ -667,13 +668,13 @@ end
C .= Ref(zero(eltype(C)))
@test all(==(0.0), parent(C))
end
=#
function integrate_bycolumn!(∫y, Y)
Fields.bycolumn(axes(Y.y)) do colidx
Operators.column_integral_definite!(∫y[colidx], Y.y[colidx])
nothing
end
end

"""
convergence_rate(err, Δh)
Expand Down Expand Up @@ -711,7 +712,9 @@ convergence_rate(err, Δh) =
zcf = Fields.coordinate_field(Y.y).z
Δz = Fields.Δz_field(axes(zcf))
Δz_col = Δz[Fields.ColumnIndex((1, 1), 1)]
Δz_1 = parent(Δz_col)[1]
Δz_1 = CUDA.allowscalar() do
parent(Δz_col)[1]
end
key = (space, zelem)
if !haskey(results, key)
results[key] =
Expand Down

0 comments on commit 6af8766

Please sign in to comment.