Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in bubble_3d_invariant_rhoe.jl -- getindex #2054

Open
waywardpidgeon opened this issue Oct 21, 2024 · 3 comments
Open

error in bubble_3d_invariant_rhoe.jl -- getindex #2054

waywardpidgeon opened this issue Oct 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@waywardpidgeon
Copy link

When running the example in the documented manner (on a processor with a GPU) I get the error:

PS C:\Users\kab\cc\ccex3\ClimaCore.jl> julia --project=examples -e 'using Pkg; Pkg.instantiate()'
PS C:\Users\kab\cc\ccex3\ClimaCore.jl> julia --project=examples examples/hybrid/box/bubble_3d_invariant_rhoe.jl
┌ Info: Context information
│ device = ClimaComms.CPUSingleThreaded()
│ context = ClimaComms.SingletonCommsContext{ClimaComms.CPUSingleThreaded}(ClimaComms.CPUSingleThreaded())
│ nprocs = 1
│ Float_type = Float64
└ resolution = "low"
┌ Info: Initial condition
│ energy_0 = 2.3016359030341293e13
│ mass_0 = 1.114751401521199e9
└ κ₄ = 193.32836229901798
Walltime = 42.6583429 seconds
┌ Info: summary
│ Es[end] = 2.3016359030341324e13
└ Mass[end] = 1.1147514015211978e9
ERROR: LoadError: MethodError: no method matching getindex(::ClimaCore.DataLayouts.IJF{ClimaCore.Geometry.XYPoint{Float64}, 4, SubArray{Float64, 3, Array{Float64, 4}, Tuple{Base.Slice{Base.OneTo{Int64}}, Base.Slice{Base.OneTo{Int64}}, UnitRange{Int64}, Int64}, true}}, ::Int64, ::Int64)

Closest candidates are:
getindex(::Union{ClimaCore.DataLayouts.IF, ClimaCore.DataLayouts.IFH, ClimaCore.DataLayouts.IJF, ClimaCore.DataLayouts.IJFH, ClimaCore.DataLayouts.VF, ClimaCore.DataLayouts.VIFH, ClimaCore.DataLayouts.VIJFH}, ::CartesianIndex)
@ ClimaCore C:\Users\kab.julia\packages\ClimaCore\SvZXu\src\DataLayouts\DataLayouts.jl:1432

Stacktrace:
[1] _slice_along(field::ClimaCore.Fields.Field{ClimaCore.DataLayouts.VIJFH{Float64, 16, 4, Array{Float64, 5}}, ClimaCore.Spaces.ExtrudedFiniteDifferenceSpace{ClimaCore.Grids.ExtrudedFiniteDifferenceGrid{ClimaCore.Grids.SpectralElementGrid2D{ClimaCore.Topologies.Topology2D{ClimaComms.SingletonCommsContext{ClimaComms.CPUSingleThreaded}, ClimaCore.Meshes.RectilinearMesh{ClimaCore.Meshes.IntervalMesh{ClimaCore.Domains.IntervalDomain{ClimaCore.Geometry.XPoint{Float64}, Nothing}, LinRange{ClimaCore.Geometry.XPoint{Float64}, Int64}}, ClimaCore.Meshes.IntervalMesh{ClimaCore.Domains.IntervalDomain{ClimaCore.Geometry.YPoint{Float64}, Nothing}, LinRange{ClimaCore.Geometry.YPoint{Float64}, Int64}}}, CartesianIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, LinearIndices{2, Tuple{Base.OneTo{Int64}, Base.OneTo{Int64}}}, Vector{Tuple{Int64, Int64, Int64, Int64, Bool}}, Vector{Tuple{Int64, Int64, Int64, Int64, Bool}}, Vector{Tuple{Int64, Int64}}, Vector{Int64}, Vector{Tuple{Bool, Int64, Int64}}, Vector{Int64}, Vector{Int64}, @NamedTuple{}, Vector{Tuple{Int64, Int64}}}, GLL{4}, ClimaCore.Geometry.CartesianGlobalGeometry, ClimaCore.DataLayouts.IJFH{ClimaCore.Geometry.LocalGeometry{(1, 2), ClimaCore.Geometry.XYPoint{Float64}, Float64, SMatrix{2, 2, Float64, 4}}, 4, Array{Float64, 4}}, ClimaCore.DataLayouts.IJFH{Float64, 4, Array{Float64, 4}}, ClimaCore.DataLayouts.IFH{ClimaCore.Geometry.SurfaceGeometry{Float64, UVVector{Float64}}, 4, Array{Float64, 3}}, @NamedTuple{}}, ClimaCore.Grids.FiniteDifferenceGrid{ClimaCore.Topologies.IntervalTopology{ClimaComms.SingletonCommsContext{ClimaComms.CPUSingleThreaded}, ClimaCore.Meshes.IntervalMesh{ClimaCore.Domains.IntervalDomain{ClimaCore.Geometry.ZPoint{Float64}, Tuple{Symbol, Symbol}}, LinRange{ClimaCore.Geometry.ZPoint{Float64}, Int64}}, @NamedTuple{bottom::Int64, top::Int64}}, ClimaCore.Geometry.CartesianGlobalGeometry, ClimaCore.DataLayouts.VF{ClimaCore.Geometry.LocalGeometry{(3,), ClimaCore.Geometry.ZPoint{Float64}, Float64, SMatrix{1, 1, Float64, 1}}, 16, Matrix{Float64}}, ClimaCore.DataLayouts.VF{ClimaCore.Geometry.LocalGeometry{(3,), ClimaCore.Geometry.ZPoint{Float64}, Float64, SMatrix{1, 1, Float64, 1}}, 17, Matrix{Float64}}}, ClimaCore.Grids.Flat, ClimaCore.Geometry.CartesianGlobalGeometry, ClimaCore.DataLayouts.VIJFH{ClimaCore.Geometry.LocalGeometry{(1, 2, 3), ClimaCore.Geometry.XYZPoint{Float64}, Float64, SMatrix{3, 3, Float64, 9}}, 16, 4, Array{Float64, 5}}, ClimaCore.DataLayouts.VIJFH{ClimaCore.Geometry.LocalGeometry{(1, 2, 3), ClimaCore.Geometry.XYZPoint{Float64}, Float64, SMatrix{3, 3, Float64, 9}}, 17, 4, Array{Float64, 5}}}, ClimaCore.Grids.CellCenter}}, coord::ClimaCore.Geometry.YPoint{Float64})
@ ClimaCorePlots C:\Users\kab.julia\packages\ClimaCorePlots\U4Dpn\src\ClimaCorePlots.jl:310
[2] macro expansion
@ C:\Users\kab.julia\packages\ClimaCorePlots\U4Dpn\src\ClimaCorePlots.jl:383 [inlined]
[3] apply_recipe(plotattributes::AbstractDict{Symbol, Any}, field::ClimaCore.Fields.Field{V, S} where {V<:ClimaCore.DataLayouts.AbstractData, S<:(ClimaCore.Spaces.ExtrudedFiniteDifferenceSpace{<:ClimaCore.Grids.ExtrudedFiniteDifferenceGrid{<:ClimaCore.Grids.SpectralElementGrid2D}})})
@ ClimaCorePlots C:\Users\kab.julia\packages\RecipesBase\BRe07\src\RecipesBase.jl:300
[4] _process_userrecipes!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline C:\Users\kab.julia\packages\RecipesPipeline\BGM3l\src\user_recipe.jl:38
[5] recipe_pipeline!(plt::Any, plotattributes::Any, args::Any)
@ RecipesPipeline C:\Users\kab.julia\packages\RecipesPipeline\BGM3l\src\RecipesPipeline.jl:72
[6] _plot!(plt::Plots.Plot, plotattributes::Any, args::Any)
@ Plots C:\Users\kab.julia\packages\Plots\kLeqV\src\plot.jl:223
[7] #plot#188
@ C:\Users\kab.julia\packages\Plots\kLeqV\src\plot.jl:102 [inlined]
[8] plot
@ C:\Users\kab.julia\packages\Plots\kLeqV\src\plot.jl:93 [inlined]
[9] bubble_3d_invariant_ρe(ARGS::Vector{String}, comms_ctx::ClimaComms.SingletonCommsContext{ClimaComms.CPUSingleThreaded}, ::Type{Float64})
@ Main C:\Users\kab\cc\ccex3\ClimaCore.jl\examples\hybrid\box\bubble_3d_invariant_rhoe.jl:540
[10] top-level scope
@ C:\Users\kab\cc\ccex3\ClimaCore.jl\examples\hybrid\box\bubble_3d_invariant_rhoe.jl:551
in expression starting at C:\Users\kab\cc\ccex3\ClimaCore.jl\examples\hybrid\box\bubble_3d_invariant_rhoe.jl:551

@waywardpidgeon waywardpidgeon added the bug Something isn't working label Oct 21, 2024
@charleskawczynski
Copy link
Member

Hi @waywardpidgeon, which version of Julia are you using? (can you please copy-paste julia> versioninfo()

Also, just for improving readability of your error messages, you can wrap your code segments on a new line inside triple back tics: "```", which will format the code. And if those back tics start with

```julia
# code

Then you'll also get Julia-specific syntax highlighting.

@waywardpidgeon
Copy link
Author

ok
I now see how to run these example in hybrid using driver.jl so will close the comments and try again.

@waywardpidgeon
Copy link
Author

Is this what is meant?

versioninfo()

Julia Version 1.10.5
Commit 6f3fdf7b36 (2024-08-27 14:19 UTC)
Build Info:Engine
Official https://julialang.org/ release
Platform Info:ties → ClimaUtilitiesClimaCoreExt
OS: Windows (x86_64-w64-mingw32)sClimaCoreNCDatasetsExt
CPU: 24 × 13th Gen Intel(R) Core(TM) i7-13700FrpolationsExt
WORD_SIZE: 64angulation
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
Threads: 1 default, 0 interactive, 1 GC (on 24 virtual cores)
✓ DiffEqBase → DiffEqBaseDistributionsExt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants