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

Bathtub topography option #166

Open
swilliamson7 opened this issue Sep 14, 2023 · 2 comments
Open

Bathtub topography option #166

swilliamson7 opened this issue Sep 14, 2023 · 2 comments

Comments

@swilliamson7
Copy link
Collaborator

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
Copy link
Owner

milankl commented Sep 14, 2023

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

function Seamount(::Type{T},P::Parameter,G::Grid) where {T<:AbstractFloat}
@unpack x_T_halo,y_T_halo,Lx,Ly = G
@unpack topo_width,topo_height,H = P
xx_T,yy_T = meshgrid(x_T_halo,y_T_halo)
bumpx = exp.(-((xx_T .- Lx/2).^2)/(2*topo_width^2))
bumpy = exp.(-((yy_T .- Ly/2).^2)/(2*topo_width^2))
return T.(H .- topo_height*bumpx.*bumpy)
end

and add it as an option here

if topography == "ridge"
H,_ = Ridge(T,P,G)
elseif topography == "ridges"
H = Ridges(T,P,G)
elseif topography == "seamount"
H = Seamount(T,P,G)
elseif topography == "flat"
H = FlatBottom(T,P,G)
end

@milankl
Copy link
Owner

milankl commented Sep 14, 2023

I had defined it in #78 but then removed again you can reactivate that code!!

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

No branches or pull requests

2 participants