Skip to content

Allow Oceananigans v0.97#234

Open
giordano wants to merge 5 commits intomainfrom
mg/oceananigans
Open

Allow Oceananigans v0.97#234
giordano wants to merge 5 commits intomainfrom
mg/oceananigans

Conversation

@giordano
Copy link
Copy Markdown
Collaborator

@giordano
Copy link
Copy Markdown
Collaborator Author

giordano commented Aug 25, 2025

Probably need code adaptation

MethodError: no method matching VectorInvariant(; vorticity_scheme::WENO{5, Float64, Float32, Nothing, WENO{4, Float64, Float32, Nothing, WENO{3, Float64, Float32, Nothing, WENO{2, Float64, Float32, Nothing, UpwindBiased{1, Float64, Nothing, Centered{1, Float64, Nothing}}, Centered{1, Float64, Nothing}}, Centered{2, Float64, Centered{1, Float64, Nothing}}}, Centered{3, Float64, Centered{2, Float64, Centered{1, Float64, Nothing}}}}, Centered{4, Float64, Centered{3, Float64, Centered{2, Float64, Centered{1, Float64, Nothing}}}}}, vertical_scheme::Centered{1, Float64, Nothing}, divergence_scheme::WENO{3, Float64, Float32, Nothing, WENO{2, Float64, Float32, Nothing, UpwindBiased{1, Float64, Nothing, Centered{1, Float64, Nothing}}, Centered{1, Float64, Nothing}}, Centered{2, Float64, Centered{1, Float64, Nothing}}})
This error has been manually thrown, explicitly, so the method may exist but be intentionally marked as unimplemented.

Closest candidates are:
  VectorInvariant(; vorticity_scheme, vorticity_stencil, vertical_advection_scheme, divergence_scheme, kinetic_energy_gradient_scheme, upwinding, multi_dimensional_stencil) got unsupported keyword argument "vertical_scheme"
   @ Oceananigans ~/.julia/packages/Oceananigans/HXg2B/src/Advection/vector_invariant_advection.jl:82

Stacktrace:
 [1] kwerr(kw::@NamedTuple{vorticity_scheme::WENO{5, Float64, Float32, Nothing, WENO{4, Float64, Float32, Nothing, WENO{3, Float64, Float32, Nothing, WENO{2, Float64, Float32, Nothing, UpwindBiased{1, Float64, Nothing, Centered{1, Float64, Nothing}}, Centered{1, Float64, Nothing}}, Centered{2, Float64, Centered{1, Float64, Nothing}}}, Centered{3, Float64, Centered{2, Float64, Centered{1, Float64, Nothing}}}}, Centered{4, Float64, Centered{3, Float64, Centered{2, Float64, Centered{1, Float64, Nothing}}}}}, vertical_scheme::Centered{1, Float64, Nothing}, divergence_scheme::WENO{3, Float64, Float32, Nothing, WENO{2, Float64, Float32, Nothing, UpwindBiased{1, Float64, Nothing, Centered{1, Float64, Nothing}}, Centered{1, Float64, Nothing}}, Centered{2, Float64, Centered{1, Float64, Nothing}}}}, args::Type)
   @ Base ./error.jl:165
 [2] default_momentum_advection()
   @ ClimaOcean.OceanSimulations ~/.julia/packages/ClimaOcean/UuK0U/src/OceanSimulations/ocean_simulation.jl:71
 [3] macro expansion
   @ /opt/hostedtoolcache/julia/1.11.6/x64/share/julia/stdlib/v1.11/Profile/src/Profile.jl:58 [inlined]
 [4] macro expansion
   @ ~/work/GB-25/GB-25/src/model_utils.jl:26 [inlined]
 [5] data_free_ocean_climate_model_init(arch::ReactantState; resolution::Int64, Nz::Int64)
   @ GordonBell25 ~/work/GB-25/GB-25/src/data_free_ocean_climate_model.jl:26
 [6] data_free_ocean_climate_model_init(arch::ReactantState)
   @ GordonBell25 ~/work/GB-25/GB-25/src/data_free_ocean_climate_model.jl:12

@giordano
Copy link
Copy Markdown
Collaborator Author

Good news: the issue is only the ocean_climate_simulation model, the other one is running successfully, including correctness.

@simone-silvestri
Copy link
Copy Markdown
Collaborator

Some constructors have changed in Oceananigans. You need to update ClimaOcean together with it (the current version is 0.8.2).

@giordano
Copy link
Copy Markdown
Collaborator Author

Ah, thanks, will update ClimaOcean too. But if Oceananigans v0.97 and ClimaOcean v0.5 aren't compatible, shouldn't there be compatibility constraints not allowing this combination?

@giordano
Copy link
Copy Markdown
Collaborator Author

ERROR: LoadError: UndefVarError: `exponential_z_faces` not defined in `GordonBell25`
Stacktrace:
 [1] simple_latitude_longitude_grid(arch::Distributed{ReactantState, nothing, Partition{Int64, Int64, Int64}, Tuple{Int64, Int64, Int64}, Int64, Tuple{Int64, Int64, Int64}, Reactant.Sharding.Mesh{2, Vector{Int64}}, Nothing, Nothing, Base.RefValue{Int64}, Vector{Reactant.XLA.IFRT.Device}}, Nx::Int64, Ny::Int64, Nz::Int64; halo::Tuple{Int64, Int64, Int64})
   @ GordonBell25 ~/work/GB-25/GB-25/src/model_utils.jl:54
 [2] simple_latitude_longitude_grid
   @ ~/work/GB-25/GB-25/src/model_utils.jl:53 [inlined]

@simone-silvestri
Copy link
Copy Markdown
Collaborator

Ah, thanks, will update ClimaOcean too. But if Oceananigans v0.97 and ClimaOcean v0.5 aren't compatible, shouldn't there be compatibility constraints not allowing this combination?

Hmmm, I guess you are right. How do you restrict compatibility with future versions of a package?

@glwagner
Copy link
Copy Markdown
Collaborator

glwagner commented Sep 8, 2025

ERROR: LoadError: UndefVarError: `exponential_z_faces` not defined in `GordonBell25`
Stacktrace:
 [1] simple_latitude_longitude_grid(arch::Distributed{ReactantState, nothing, Partition{Int64, Int64, Int64}, Tuple{Int64, Int64, Int64}, Int64, Tuple{Int64, Int64, Int64}, Reactant.Sharding.Mesh{2, Vector{Int64}}, Nothing, Nothing, Base.RefValue{Int64}, Vector{Reactant.XLA.IFRT.Device}}, Nx::Int64, Ny::Int64, Nz::Int64; halo::Tuple{Int64, Int64, Int64})
   @ GordonBell25 ~/work/GB-25/GB-25/src/model_utils.jl:54
 [2] simple_latitude_longitude_grid
   @ ~/work/GB-25/GB-25/src/model_utils.jl:53 [inlined]

exponential_z_faces should be replaced with ExponentialCoordinate (and in our great wisdom this will soon be called ExponentialDiscretization)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants