"CPU not defined" error #1362
Replies: 3 comments 12 replies
-
Hi @Lichriszz, could you say what version of Oceananigans.jl you used? E.g. the output of julia> using Pkg; Pkg.status() and julia> versioninfo() |
Beta Was this translation helpful? Give feedback.
-
Hi @Lichriszz thanks for reporting this error. As @navidcy said, I think the shallow water model is not yet exported but @francispoulin can better comment on its status. I've fixed the bug in PR #1363 so it should make it's way into the next tagged release. If you want to use the shallow water model, for now to get around the bug I think you need to explicitly specify the using Oceananigans, Oceananigans.Advection, Oceananigans.Architectures
using Oceananigans.Models: ShallowWaterModel
grid = RegularCartesianGrid(size=(128, 128, 1), extent=(2π, 2π, 2π))
model = ShallowWaterModel(architecture = CPU(), grid = grid, gravitational_acceleration = 10.0) I think you need to specify a number for |
Beta Was this translation helpful? Give feedback.
-
Thanks @Lichriszz for pointing this out and sorry there was a problem to begin with. I have played with an example for geostrophic adjustment, both one- and two-dimensional, and now working on the instability of a barotropic Bickley jet. Coming soon I hope! What kind of example would you be looking for? |
Beta Was this translation helpful? Give feedback.
-
Hi,
When I run the shallow water model, I got an error message saying:
"LoadError: UndefVarError: CPU not defined
in expression starting at /Users/.../Desktop/Research/shallow water test.jl:8
(::Core.var"#Type##kw")(::NamedTuple{(:grid, :gravitational_acceleration),Tuple{RegularCartesianGrid{Float64,Periodic,Periodic,Bounded,OffsetArrays.OffsetArray{Float64,1,StepRangeLen{Float64,Base.TwicePrecision{Float64},Base.TwicePrecision{Float64}}}},Nothing}}, ::Type{ShallowWaterModel}) at shallow_water_model.jl:75
top-level scope at shallow water test.jl:8
include_string(::Function, ::Module, ::String, ::String) at loading.jl:1088"
Here are my codes:
using Pkg
pkg"add Oceananigans, JLD2, Plots"
using Oceananigans, Oceananigans.Advection, Oceananigans.Architectures
grid = RegularCartesianGrid(size=(128, 128, 1), extent=(2π, 2π, 2π))
model = ShallowWaterModel(grid = grid,
gravitational_acceleration = nothing,
)
Can anyone help? Some examples of the ShallowWaterModel function would be helpful.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions