Skip to content

Commit

Permalink
mnwe
Browse files Browse the repository at this point in the history
  • Loading branch information
trontrytel committed Jan 13, 2025
1 parent 38240d3 commit 7a10879
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/parameters/Parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,17 @@ include("MicrophysicsP3.jl")
# Terminal velocity parameters (can be used with different microph. schemes)
include("TerminalVelocity.jl")

for T in (
Chen2022VelTypeRain,
Chen2022VelTypeSmallIce,
Chen2022VelTypeLargeIce,
Chen2022VelType,
CloudLiquid,
)
@eval Base.Broadcast.broadcastable(x::$T) = x;
@eval Base.ndims(::Type{<:$T}) = 0;
@eval Base.size(::$T) = ();
@eval Base.@propagate_inbounds Base.getindex(x::$T, i) = x;
end

end # module
6 changes: 3 additions & 3 deletions test/gpu_clima_core_test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import CloudMicrophysics.MicrophysicsNonEq as CMN
function make_column(::Type{FT}) where {FT}

context = ClimaComms.SingletonCommsContext(ClimaComms.CUDADevice())
#context = ClimaComms.context()

vert_domain = CC.Domains.IntervalDomain(
CC.Geometry.ZPoint{FT}(FT(0)),
Expand All @@ -32,6 +33,7 @@ end
function make_extruded_sphere(::Type{FT}) where {FT}

context = ClimaComms.SingletonCommsContext(ClimaComms.CUDADevice())
#context = ClimaComms.context()

# Define vertical
# domain
Expand Down Expand Up @@ -162,6 +164,7 @@ function main_3d(::Type{FT}) where {FT}
space_3d_w = make_extruded_sphere(FT)

ρq = CC.Fields.ones(space_3d_ρq) .* FT(1e-3)

ρ = CC.Fields.ones(space_3d_ρ)
w = CC.Fields.zeros(space_3d_w)

Expand All @@ -178,15 +181,12 @@ using Test
@testset "GPU inference failure 1D Float64" begin
main_1d(Float64)
end

@testset "GPU inference failure 3D Float64" begin
main_3d(Float64)
end

@testset "GPU inference failure 1D Float32" begin
main_1d(Float32)
end

@testset "GPU inference failure 3D Float32" begin
main_3d(Float32)
end

0 comments on commit 7a10879

Please sign in to comment.