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

problems using the seawater equation of state #2916

Closed
francispoulin opened this issue Feb 10, 2023 · 2 comments
Closed

problems using the seawater equation of state #2916

francispoulin opened this issue Feb 10, 2023 · 2 comments

Comments

@francispoulin
Copy link
Collaborator

We have a minimum working example that tries to use a nonlinear equation of state, but when we define the model, we get an error saying, the following,

nested task error: MethodError: no method matching ρ′(::Float64, ::Float64, ::Float64, ::typeof(SeawaterPolynomials.TEOS10.TEOS10EquationOfState))
    Closest candidates are:
      ρ′(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any) at ~/Software/Oceananigans.jl/src/BuoyancyModels/nonlinear_equation_of_state.jl:27
      ρ′(::Any, ::Any, ::Any, ::SeawaterPolynomials.BoussinesqEquationOfState{<:SeawaterPolynomials.SecondOrderSeawaterPolynomials.SecondOrderSeawaterPolynomial}) at ~/.julia/packages/SeawaterPolynomials/JiuSX/src/SecondOrderSeawaterPolynomials.jl:64
      ρ′(::Any, ::Any, ::Any, ::SeawaterPolynomials.BoussinesqEquationOfState{<:SeawaterPolynomials.TEOS10.TEOS10SeawaterPolynomial}) at ~/.julia/packages/SeawaterPolynomials/JiuSX/src/TEOS10.jl:186

We are following the documentation shown here.

Can someone help us fix this?

The code is copied below.

using Oceananigans
using SeawaterPolynomials

grid = RectilinearGrid(CPU();
                       size = (10, 10), 
                          x = ( 0, 1),
                          z = (-1, 0),
                   topology = (Periodic, Flat, Bounded))
                   
eos = SeawaterPolynomials.TEOS10EquationOfState
buoyancy = SeawaterBuoyancy(equation_of_state=eos)

model = NonhydrostaticModel(; grid, buoyancy, tracers = (:T, :S),)
@simone-silvestri
Copy link
Collaborator

you have to instantiate the equation of state

eos = SeawaterPolynomials.TEOS10EquationOfState()

@francispoulin
Copy link
Collaborator Author

Thank you @simone-silvestri ! That worked beautifully.

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

No branches or pull requests

2 participants