milankl / ShallowWaters.jl

A type-flexible shallow water model that can run with 16-bit arithmetic.
MIT License
115 stars 20 forks source link

Bathtub topography option #166

Open swilliamson7 opened 1 year ago

swilliamson7 commented 1 year ago

In default_parameters.jlthere seems to be an option for topography="bathtub", but when setting this in run_model I get the error:

ERROR: LoadError: AssertionError: Topography 'bathtub' unsupported
Stacktrace:
 [1] Parameter
   @ Main.ShallowWaters ~/.julia/packages/Parameters/MK0O4/src/Parameters.jl:0 [inlined]
 [2] Main.ShallowWaters.Parameter(T::Type, Tprog::Type, Tcomm::Type, Tini::Type, nx::Int64, Lx::Float64, L_ratio::Int64, g::Float64, H::Float64, ρ::Float64, ϕ::Float64, ω::Float64, R::Float64, scale::Int64, scale_sst::Int64, wind_forcing_x::String, wind_forcing_y::String, Fx0::Float64, Fy0::Float64, seasonal_wind_x::Bool, seasonal_wind_y::Bool, ωFx::Int64, ωFy::Int64, topography::String, topo_ridges_positions::Vector{…}, topo_height::Float64, topo_width::Float64, surface_relax::Bool, t_relax::Float64, η_refh::Float64, η_refw::Float64, surface_forcing::Bool, ωFη::Float64, A::Float64, ϕk::Float64, wk::Float64, time_scheme::String, RKo::Int64, RKs::Int64, RKn::Int64, cfl::Float64, Ndays::Int64, nstep_diff::Int64, nstep_advcor::Int64, compensated::Bool, bc::String, α::Float64, adv_scheme::String, dynamics::String, bottom_drag::String, cD::Float64, τD::Float64, diffusion::String, νB::Float64, cSmag::Float64, tracer_advection::Bool, tracer_relaxation::Bool, tracer_consumption::Bool, sst_initial::String, sst_rect_coords::Vector{…}, Uadv::Float64, SSTmax::Float64, SSTmin::Float64, τSST::Int64, jSST::Int64, SSTw::Float64, SSTϕ::Float64, SSTwaves_ny::Int64, SSTwaves_nx::Int64, SSTwaves_p::Float64, output::Bool, output_vars::Vector{…}, output_dt::Int64, outpath::String, compression_level::Int64, return_time::Bool, initial_cond::String, initpath::String, init_run_id::Int64, init_starti::Int64, get_id_mode::String, run_id::Int64, init_interpolation::Bool)
   @ Main.ShallowWaters ~/.julia/packages/Parameters/MK0O4/src/Parameters.jl:0
 [3] _
   @ Main.ShallowWaters ~/.julia/packages/Parameters/MK0O4/src/Parameters.jl:493 [inlined]
 [4] #mk_run_model#64
   @ Main.ShallowWaters ~/Documents/GitHub/ShallowWaters.jl/src/run_model.jl:169 [inlined]
 [5] mk_run_model
   @ Main.ShallowWaters ~/Documents/GitHub/ShallowWaters.jl/src/run_model.jl:165 [inlined]
 [6] top-level scope
   @ ~/Documents/GitHub/ShallowWaters.jl/my_scripts/run_script.jl:5
 [7] include(fname::String)
   @ Base.MainInclude ./client.jl:489
 [8] top-level scope
   @ REPL[59]:1
in expression starting at /Users/swilliamson/Documents/GitHub/ShallowWaters.jl/my_scripts/run_script.jl:5
Some type information was truncated. Use `show(err)` to see complete types.
milankl commented 1 year ago

I think that was experimental and I seem to have removed it. However, you could add it in again, define similar to

https://github.com/milankl/ShallowWaters.jl/blob/0169c122f52d764fa26a2bb31c2733a610fdb719/src/forcing.jl#L141-L151

and add it as an option here

https://github.com/milankl/ShallowWaters.jl/blob/0169c122f52d764fa26a2bb31c2733a610fdb719/src/forcing.jl#L39-L47

milankl commented 1 year ago

I had defined it in https://github.com/milankl/ShallowWaters.jl/pull/78 but then removed again you can reactivate that code!!