Reference
Contents
Index
ShallowWaters.ArakawaHsuVars
ShallowWaters.ArakawaHsuVars
ShallowWaters.BernoulliVars
ShallowWaters.BernoulliVars
ShallowWaters.BottomdragVars
ShallowWaters.BottomdragVars
ShallowWaters.Constants
ShallowWaters.Grid
ShallowWaters.LaplaceVars
ShallowWaters.LaplaceVars
ShallowWaters.NcFiles
ShallowWaters.NcFiles
ShallowWaters.Parameter
ShallowWaters.PrognosticVars
ShallowWaters.RungeKuttaVars
ShallowWaters.RungeKuttaVars
ShallowWaters.SSPRK3coeff
ShallowWaters.SSPRK3coeff
ShallowWaters.SemiLagrangeVars
ShallowWaters.SemiLagrangeVars
ShallowWaters.SmagorinskyVars
ShallowWaters.SmagorinskyVars
ShallowWaters.TendencyVars
ShallowWaters.TendencyVars
ShallowWaters.VolumeFluxVars
ShallowWaters.VolumeFluxVars
ShallowWaters.VorticityVars
ShallowWaters.VorticityVars
Base.convert
Base.convert
ShallowWaters.AHα!
ShallowWaters.AHβ!
ShallowWaters.AHγ!
ShallowWaters.AHδ!
ShallowWaters.ChannelWind
ShallowWaters.ConstantWind
ShallowWaters.DoubleGyreWind
ShallowWaters.FlatBottom
ShallowWaters.Ftime
ShallowWaters.InterfaceRelaxation
ShallowWaters.Ix!
ShallowWaters.Ixy!
ShallowWaters.Iy!
ShallowWaters.KelvinPump
ShallowWaters.NoWind
ShallowWaters.PV!
ShallowWaters.PV_ArakawaHsu!
ShallowWaters.PV_Sadourny!
ShallowWaters.PVadvection!
ShallowWaters.Ridge
ShallowWaters.Ridges
ShallowWaters.Seamount
ShallowWaters.ShearWind
ShallowWaters.UVfluxes!
ShallowWaters.Uflux!
ShallowWaters.Vflux!
ShallowWaters.add_drag_diff_tendencies!
ShallowWaters.add_halo
ShallowWaters.add_halo
ShallowWaters.adv_sst!
ShallowWaters.advection_coriolis!
ShallowWaters.axb!
ShallowWaters.backtraj!
ShallowWaters.bernoulli!
ShallowWaters.bilin
ShallowWaters.bottom_drag!
ShallowWaters.bottom_drag_linear!
ShallowWaters.bottom_drag_quadratic!
ShallowWaters.caxb!
ShallowWaters.clip
ShallowWaters.continuity!
ShallowWaters.continuity_forcing!
ShallowWaters.continuity_itself!
ShallowWaters.continuity_surf_relax!
ShallowWaters.coriolis_at_lat
ShallowWaters.countnans
ShallowWaters.cxab!
ShallowWaters.cxayb!
ShallowWaters.dambmc!
ShallowWaters.departure!
ShallowWaters.diffusion!
ShallowWaters.diffusion_constant!
ShallowWaters.diffusion_smagorinsky!
ShallowWaters.duration_estimate
ShallowWaters.dxaybzc!
ShallowWaters.feedback!
ShallowWaters.feedback_end!
ShallowWaters.feedback_init
ShallowWaters.fu!
ShallowWaters.fv!
ShallowWaters.gap
ShallowWaters.get_run_id_path
ShallowWaters.ghost_points!
ShallowWaters.ghost_points!
ShallowWaters.ghost_points_sst!
ShallowWaters.ghost_points_sst!
ShallowWaters.ghost_points_sst_nonperiodic!
ShallowWaters.ghost_points_sst_periodic!
ShallowWaters.ghost_points_u_nonperiodic!
ShallowWaters.ghost_points_u_periodic!
ShallowWaters.ghost_points_uv!
ShallowWaters.ghost_points_uv!
ShallowWaters.ghost_points_v_nonperiodic!
ShallowWaters.ghost_points_v_periodic!
ShallowWaters.ghost_points_η!
ShallowWaters.ghost_points_η!
ShallowWaters.ghost_points_η_nonperiodic!
ShallowWaters.ghost_points_η_periodic!
ShallowWaters.interp_uv!
ShallowWaters.m_per_lat
ShallowWaters.meshgrid
ShallowWaters.momentum_u!
ShallowWaters.momentum_v!
ShallowWaters.nan_detection!
ShallowWaters.nc_create
ShallowWaters.no_bottom_drag!
ShallowWaters.output_close!
ShallowWaters.preallocate
ShallowWaters.progress!
ShallowWaters.readable_secs
ShallowWaters.remove_halo
ShallowWaters.remove_halo
ShallowWaters.rhs!
ShallowWaters.rhs_linear!
ShallowWaters.rhs_nonlinear!
ShallowWaters.run_model
ShallowWaters.smagorinsky_coeff!
ShallowWaters.speed!
ShallowWaters.stress_tensor!
ShallowWaters.thickness!
ShallowWaters.time_integration
ShallowWaters.tracer_relax_consumption!
ShallowWaters.viscous_tensor_constant!
ShallowWaters.viscous_tensor_smagorinsky!
ShallowWaters.waves
ShallowWaters.wrap
ShallowWaters.yy_q
ShallowWaters.β_at_lat
ShallowWaters.∂x
ShallowWaters.∂x!
ShallowWaters.∂y
ShallowWaters.∂y!
ShallowWaters.∇²
ShallowWaters.∇²!
ShallowWaters.ArakawaHsuVars
— TypeArakawaHsu variables collected in a struct.
ShallowWaters.ArakawaHsuVars
— MethodGenerator function for ArakawaHsu VarCollection.
ShallowWaters.BernoulliVars
— TypeBernoulli variables collected in a struct.
ShallowWaters.BernoulliVars
— MethodGenerator function for Bernoulli VarCollection.
ShallowWaters.BottomdragVars
— TypeBottomdrag variables collected in a struct.
ShallowWaters.BottomdragVars
— MethodGenerator function for Bottomdrag VarCollection.
ShallowWaters.Constants
— MethodGenerator function for the mutable struct Constants.
ShallowWaters.Grid
— MethodGenerator function for the Grid struct.
ShallowWaters.LaplaceVars
— TypeLaplace variables collected in a struct.
ShallowWaters.LaplaceVars
— MethodGenerator function for Laplace VarCollection.
ShallowWaters.NcFiles
— MethodGenerator function for "empty" NcFiles struct.
ShallowWaters.NcFiles
— MethodGenerator function for NcFiles struct, creating the underlying netCDF files.
ShallowWaters.Parameter
— TypeCreates a Parameter struct with following options and default values T=Float32 # number format
Tprog=T # number format for prognostic variables
+Reference · ShallowWaters.jl Reference
Contents
Index
ShallowWaters.ArakawaHsuVars
ShallowWaters.ArakawaHsuVars
ShallowWaters.BernoulliVars
ShallowWaters.BernoulliVars
ShallowWaters.BottomdragVars
ShallowWaters.BottomdragVars
ShallowWaters.Constants
ShallowWaters.Grid
ShallowWaters.LaplaceVars
ShallowWaters.LaplaceVars
ShallowWaters.NcFiles
ShallowWaters.NcFiles
ShallowWaters.Parameter
ShallowWaters.PrognosticVars
ShallowWaters.RungeKuttaVars
ShallowWaters.RungeKuttaVars
ShallowWaters.SSPRK3coeff
ShallowWaters.SSPRK3coeff
ShallowWaters.SemiLagrangeVars
ShallowWaters.SemiLagrangeVars
ShallowWaters.SmagorinskyVars
ShallowWaters.SmagorinskyVars
ShallowWaters.TendencyVars
ShallowWaters.TendencyVars
ShallowWaters.VolumeFluxVars
ShallowWaters.VolumeFluxVars
ShallowWaters.VorticityVars
ShallowWaters.VorticityVars
Base.convert
Base.convert
ShallowWaters.AHα!
ShallowWaters.AHβ!
ShallowWaters.AHγ!
ShallowWaters.AHδ!
ShallowWaters.ChannelWind
ShallowWaters.ConstantWind
ShallowWaters.DoubleGyreWind
ShallowWaters.FlatBottom
ShallowWaters.Ftime
ShallowWaters.InterfaceRelaxation
ShallowWaters.Ix!
ShallowWaters.Ixy!
ShallowWaters.Iy!
ShallowWaters.KelvinPump
ShallowWaters.NoWind
ShallowWaters.PV!
ShallowWaters.PV_ArakawaHsu!
ShallowWaters.PV_Sadourny!
ShallowWaters.PVadvection!
ShallowWaters.Ridge
ShallowWaters.Ridges
ShallowWaters.Seamount
ShallowWaters.ShearWind
ShallowWaters.UVfluxes!
ShallowWaters.Uflux!
ShallowWaters.Vflux!
ShallowWaters.add_drag_diff_tendencies!
ShallowWaters.add_halo
ShallowWaters.add_halo
ShallowWaters.adv_sst!
ShallowWaters.advection_coriolis!
ShallowWaters.axb!
ShallowWaters.backtraj!
ShallowWaters.bernoulli!
ShallowWaters.bilin
ShallowWaters.bottom_drag!
ShallowWaters.bottom_drag_linear!
ShallowWaters.bottom_drag_quadratic!
ShallowWaters.caxb!
ShallowWaters.clip
ShallowWaters.continuity!
ShallowWaters.continuity_forcing!
ShallowWaters.continuity_itself!
ShallowWaters.continuity_surf_relax!
ShallowWaters.coriolis_at_lat
ShallowWaters.countnans
ShallowWaters.cxab!
ShallowWaters.cxayb!
ShallowWaters.dambmc!
ShallowWaters.departure!
ShallowWaters.diffusion!
ShallowWaters.diffusion_constant!
ShallowWaters.diffusion_smagorinsky!
ShallowWaters.duration_estimate
ShallowWaters.dxaybzc!
ShallowWaters.feedback!
ShallowWaters.feedback_end!
ShallowWaters.feedback_init
ShallowWaters.fu!
ShallowWaters.fv!
ShallowWaters.gap
ShallowWaters.get_run_id_path
ShallowWaters.ghost_points!
ShallowWaters.ghost_points!
ShallowWaters.ghost_points_sst!
ShallowWaters.ghost_points_sst!
ShallowWaters.ghost_points_sst_nonperiodic!
ShallowWaters.ghost_points_sst_periodic!
ShallowWaters.ghost_points_u_nonperiodic!
ShallowWaters.ghost_points_u_periodic!
ShallowWaters.ghost_points_uv!
ShallowWaters.ghost_points_uv!
ShallowWaters.ghost_points_v_nonperiodic!
ShallowWaters.ghost_points_v_periodic!
ShallowWaters.ghost_points_η!
ShallowWaters.ghost_points_η!
ShallowWaters.ghost_points_η_nonperiodic!
ShallowWaters.ghost_points_η_periodic!
ShallowWaters.interp_uv!
ShallowWaters.m_per_lat
ShallowWaters.meshgrid
ShallowWaters.momentum_u!
ShallowWaters.momentum_v!
ShallowWaters.nan_detection!
ShallowWaters.nc_create
ShallowWaters.no_bottom_drag!
ShallowWaters.output_close!
ShallowWaters.preallocate
ShallowWaters.progress!
ShallowWaters.readable_secs
ShallowWaters.remove_halo
ShallowWaters.remove_halo
ShallowWaters.rhs!
ShallowWaters.rhs_linear!
ShallowWaters.rhs_nonlinear!
ShallowWaters.run_model
ShallowWaters.smagorinsky_coeff!
ShallowWaters.speed!
ShallowWaters.stress_tensor!
ShallowWaters.thickness!
ShallowWaters.time_integration
ShallowWaters.tracer_relax_consumption!
ShallowWaters.viscous_tensor_constant!
ShallowWaters.viscous_tensor_smagorinsky!
ShallowWaters.waves
ShallowWaters.wrap
ShallowWaters.yy_q
ShallowWaters.β_at_lat
ShallowWaters.∂x
ShallowWaters.∂x!
ShallowWaters.∂y
ShallowWaters.∂y!
ShallowWaters.∇²
ShallowWaters.∇²!
ShallowWaters.ArakawaHsuVars
— TypeArakawaHsu variables collected in a struct.
sourceShallowWaters.ArakawaHsuVars
— MethodGenerator function for ArakawaHsu VarCollection.
sourceShallowWaters.BernoulliVars
— TypeBernoulli variables collected in a struct.
sourceShallowWaters.BernoulliVars
— MethodGenerator function for Bernoulli VarCollection.
sourceShallowWaters.BottomdragVars
— TypeBottomdrag variables collected in a struct.
sourceShallowWaters.BottomdragVars
— MethodGenerator function for Bottomdrag VarCollection.
sourceShallowWaters.Constants
— MethodGenerator function for the mutable struct Constants.
sourceShallowWaters.Grid
— MethodGenerator function for the Grid struct.
sourceShallowWaters.LaplaceVars
— TypeLaplace variables collected in a struct.
sourceShallowWaters.LaplaceVars
— MethodGenerator function for Laplace VarCollection.
sourceShallowWaters.NcFiles
— MethodGenerator function for "empty" NcFiles struct.
sourceShallowWaters.NcFiles
— MethodGenerator function for NcFiles struct, creating the underlying netCDF files.
sourceShallowWaters.Parameter
— TypeCreates a Parameter struct with following options and default values T=Float32 # number format
Tprog=T # number format for prognostic variables
Tcomm=Tprog # number format for ghost-point copies
Tini=Tprog # number format to reduce precision for initial conditions
@@ -123,6 +123,6 @@
init_starti::Int=-1 # timestep to start from (-1 meaning last)
get_id_mode::String="continue" # How to determine the run id: "continue" or "fill"
run_id::Int=-1 # Output with a specific run id
-init_interpolation::Bool=true # Interpolate the initial conditions in case grids don't match?
sourceShallowWaters.PrognosticVars
— MethodZero generator function for Grid G as argument.
sourceShallowWaters.RungeKuttaVars
— TypeRunge Kutta time stepping scheme diagnostic cariables collected in a struct.
sourceShallowWaters.RungeKuttaVars
— MethodGenerator function for RungeKutta VarCollection.
sourceShallowWaters.SSPRK3coeff
— TypeCoefficients for strong stability-preserving Runge-Kutta 3rd order. From: KETCHESON, LOĆZI, AND PARSANI, 2014. INTERNAL ERROR PROPAGATION IN EXPLICIT RUNGE–KUTTA METHODS, SIAM J NUMER ANAL 52/5. DOI:10.1137/130936245
sourceShallowWaters.SSPRK3coeff
— MethodGenerator function for a SSPRK3coeff struct.
sourceShallowWaters.SemiLagrangeVars
— TypeSemiLagrange variables collected in a struct.
sourceShallowWaters.SemiLagrangeVars
— MethodGenerator function for SemiLagrange VarCollection.
sourceShallowWaters.SmagorinskyVars
— TypeSmagorinsky variables collected in a struct.
sourceShallowWaters.SmagorinskyVars
— MethodGenerator function for Smagorinsky VarCollection.
sourceShallowWaters.TendencyVars
— TypeTendencies collected in a struct.
sourceShallowWaters.TendencyVars
— MethodGenerator function for Tendencies VarCollection.
sourceShallowWaters.VolumeFluxVars
— TypeVolumeFluxes collected in a struct.
sourceShallowWaters.VolumeFluxVars
— MethodGenerator function for VolumeFluxes VarCollection.
sourceShallowWaters.VorticityVars
— TypeVorticity variables collected in a struct.
sourceShallowWaters.VorticityVars
— MethodGenerator function for Vorticity VarCollection.
sourceBase.convert
— MethodConvert function for two arrays, X1, X2, in case their eltypes differ. Convert every element from X1 and store it in X2.
sourceBase.convert
— MethodConvert function for two arrays, X1, X2, in case their eltypes are identical. Just pass X1, such that X2 is pointed to the same place in memory.
sourceShallowWaters.AHα!
— MethodLinear combination α of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
sourceShallowWaters.AHβ!
— MethodLinear combination δ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
sourceShallowWaters.AHγ!
— MethodLinear combination γ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
sourceShallowWaters.AHδ!
— MethodLinear combination β of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
sourceShallowWaters.ChannelWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a cosine with strongest forcing in the middle and vanishing forcing at boundaries.
sourceShallowWaters.ConstantWind
— MethodReturns constant in in space forcing matrices Fx,Fy.
sourceShallowWaters.DoubleGyreWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally with a superposition of sin & cos for a double gyre circulation. See Cooper&Zanna 2015 or Kloewer et al 2018.
sourceShallowWaters.FlatBottom
— MethodReturns a matrix of constant water depth H.
sourceShallowWaters.Ftime
— MethodTime evolution of forcing.
sourceShallowWaters.InterfaceRelaxation
— MethodReturns a reference state for Newtonian cooling/surface relaxation shaped as a hyperbolic tangent to force the continuity equation.
sourceShallowWaters.Ix!
— MethodLinear interpolation of a variable u in the x-direction. m,n = size(ux) must be m+1,n = size(u).
sourceShallowWaters.Ixy!
— MethodBilinear interpolation a variable u in x and y-direction. m,n = size(uxy) must be m+1,n+1 = size(u).
sourceShallowWaters.Iy!
— MethodLinear interpolation a variable u in the y-direction. m,n = size(uy) must be m,n+1 = size(u).
sourceShallowWaters.KelvinPump
— MethodReturns Kelvin wave pumping forcing of the continuity equation.
sourceShallowWaters.NoWind
— MethodReturns constant in in space forcing matrices Fx,Fy.
sourceShallowWaters.PV!
— MethodPotential vorticity calculated as q = (f + ∂v/∂x - ∂u/∂y)/h.
sourceShallowWaters.PV_ArakawaHsu!
— MethodAdvection of potential vorticity qhv,qhu as in Arakawa and Hsu, 1990 Energy and enstrophy conserving (in the limit of non-divergent mass flux) scheme with τ = 0.
sourceShallowWaters.PV_Sadourny!
— MethodAdvection of potential vorticity qhv,qhu as in Sadourny, 1975 enstrophy conserving scheme.
sourceShallowWaters.PVadvection!
— MethodTransit function to call the specified advection scheme.
sourceShallowWaters.Ridge
— MethodReturns a matrix of water depth for the whole domain that contains a meridional Gaussian ridge in the middle. Water depth, heigth and width of the ridge are adjusted with the constants waterdepth, topofeatheight and topofeat_width.
sourceShallowWaters.Ridges
— MethodSame as Ridge() but for n ridges at various x positions.
sourceShallowWaters.Seamount
— MethodReturns a matrix of water depth for the whole domain that contains a Gaussian seamount in the middle. Water depth, heigth and width of the seamount are adjusted with the constants H, topofeatheight and topofeatwidth.
sourceShallowWaters.ShearWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a hyperbolic tangent with strongest shear in the middle.
sourceShallowWaters.UVfluxes!
— MethodCalculate the mass/volume fluxes U,V from u,v,η.
sourceShallowWaters.Uflux!
— MethodZonal mass flux U = uh.
sourceShallowWaters.Vflux!
— MethodMeridional mass flux V = vh.
sourceShallowWaters.add_drag_diff_tendencies!
— MethodUpdate u with bottom friction tendency (Bu,Bv) and biharmonic viscosity.
sourceShallowWaters.add_halo
— MethodExtends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.
sourceShallowWaters.add_halo
— MethodExtends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.
sourceShallowWaters.adv_sst!
— MethodAdvection of sst/tracer based on the departure points xd,yd via bilinear interpolation. Departure points are clipped/wrapped to remain within the domain. Boundary conditions either periodic (wrap around behaviour) or no-flux (no gradient via clipping). Once the respective 4 surrounding grid points are found do bilinear interpolation on the unit square.
sourceShallowWaters.advection_coriolis!
— MethodUpdate advective and Coriolis tendencies.
sourceShallowWaters.axb!
— MethodAdd to a x multiplied with b. a += x*b
sourceShallowWaters.backtraj!
— MethodSolves the trajectory equation for a given time step dt and the velocity uv (this can be u or v). One function for three cases
(i) u is interpolated from u-grid with halo onto T-grid (ii) v is interpolated from v-grid with halo onto T-grid (iii) u or v already on the T-grid: All matrices have same size.
Uses relative grid nodes in the departure points rd, such that actually solved is rd = 0 - dt*uv. The indices i,j of rd determine the arrival grid point.
sourceShallowWaters.bernoulli!
— MethodBernoulli potential p = 1/2*(u² + v²) + gη.
sourceShallowWaters.bilin
— MethodBilinear interpolation on (x,y) in the unit square [0,1]x[0,1]. The values at the corners are f00 = f(0,0), f01 = f(0,1), etc.
sourceShallowWaters.bottom_drag!
— MethodTransit function to call the specified bottom drag function.
sourceShallowWaters.bottom_drag_linear!
— MethodLinear bottom drag computed as rB*(u,v). rB is negative and contains the grid spacing Δ as gradient operators are dimensionless.
sourceShallowWaters.bottom_drag_quadratic!
— MethodQuadratic bottom drag Bu,Bv = cD/h * | uv | * uv
sourceShallowWaters.caxb!
— Methodc equals add a to x multiplied with b. c = a + x*b
sourceShallowWaters.clip
— MethodClips the relative lower-left corner index xyi (for both x or y indices) to remain within the domain. ij is the index of the underlying matrix. xy is the actual coordinate, mn (m or n) the size of the domain, and h1,h2 are the halo sizes (left/south and right/north).
sourceShallowWaters.continuity!
— MethodTransit function to call the specified continuity function.
sourceShallowWaters.continuity_forcing!
— MethodContinuity equation's right-hand side with time&space dependent forcing.
sourceShallowWaters.continuity_itself!
— MethodContinuity equation's right-hand side -∂x(uh) - ∂y(vh) without forcing.
sourceShallowWaters.continuity_surf_relax!
— MethodContinuity equation's right-hand side with surface relaxation -∂x(uh) - ∂y(vh) + γ*(η_ref - η).
sourceShallowWaters.coriolis_at_lat
— MethodCoriolis parameter f [1/s] at latitude ϕ [°] given Earth's rotation ω [1/s].
sourceShallowWaters.countnans
— MethodReturns the number of NaNs in an array.
sourceShallowWaters.cxab!
— Methodc equals add x multiplied to a plus b. c = x*(a+b)
sourceShallowWaters.cxayb!
— Methodc = xa + yb
sourceShallowWaters.dambmc!
— Methodd equals add a minus b minus c. c = (a - b) - c.
sourceShallowWaters.departure!
— MethodComputes the departure point for semi-Lagrangian advection following Diamantakis, 2014. u,v are assumed to be the time averaged velocities over the previous advection time step. (Presumably need to be changed to 2nd order extrapolation in case the tracer is not passive)
Uses fixed-point iteration once to find the departure point.
sourceShallowWaters.diffusion!
— MethodTransit function to call the specified diffusion scheme.
sourceShallowWaters.diffusion_constant!
— MethodBiharmonic diffusion operator with constant viscosity coefficient Viscosity = ν∇⁴ ⃗u. Although constant, the coefficient is actually inside Viscosity = ∇⋅ν∇∇² ⃗u.
sourceShallowWaters.diffusion_smagorinsky!
— MethodSmagorinsky-like biharmonic viscosity Viscosity = ∇ ⋅ (cSmag Δ⁴ |D| ∇∇² ⃗u) The Δ⁴-scaling is omitted as gradient operators are dimensionless.
sourceShallowWaters.duration_estimate
— MethodEstimates the total time the model integration will take.
sourceShallowWaters.dxaybzc!
— Methodd = xa + yb + z*c
sourceShallowWaters.feedback!
— MethodFeedback function that calls duration estimate, nan_detection and progress.
sourceShallowWaters.feedback_end!
— MethodFinalises the progress txt file.
sourceShallowWaters.feedback_init
— MethodInitialises the progress txt file.
sourceShallowWaters.fu!
— MethodCoriolis term f*u.
sourceShallowWaters.fv!
— MethodCoriolis term f*v.
sourceShallowWaters.gap
— MethodFinds the first gap in a list of integers.
sourceShallowWaters.get_run_id_path
— MethodChecks output folders to determine a 4-digit run id number.
sourceShallowWaters.ghost_points!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_sst!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_sst!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_sst_nonperiodic!
— MethodCopy ghost points for η from inside to the halo in the nonperiodic case.
sourceShallowWaters.ghost_points_sst_periodic!
— MethodCopy ghost points for η from inside to the halo in the periodic case.
sourceShallowWaters.ghost_points_u_nonperiodic!
— MethodCopy ghost points for u from inside to the halo in the nonperiodic case.
sourceShallowWaters.ghost_points_u_periodic!
— MethodCopy ghost points for u from inside to the halo in the periodic case.
sourceShallowWaters.ghost_points_uv!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_uv!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_v_nonperiodic!
— MethodCopy ghost points for v from inside to the halo in the nonperiodic case.
sourceShallowWaters.ghost_points_v_periodic!
— MethodCopy ghost points for v from inside to the halo in the periodic case.
sourceShallowWaters.ghost_points_η!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_η!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
sourceShallowWaters.ghost_points_η_nonperiodic!
— MethodCopy ghost points for η from inside to the halo in the nonperiodic case.
sourceShallowWaters.ghost_points_η_periodic!
— MethodCopy ghost points for η from inside to the halo in the periodic case.
sourceShallowWaters.interp_uv!
— MethodInterpolates the matrix uv into the matrix uvi, where xx, yy specify the coordinates as indices (including fraction. Interpolation only onto the inner entries of uvi. (They will be copied back later via the ghostpoint function). Two cases (i) u velocities: from u-grid with halo to T-grid (ii) v velocities: from v-grid with halo to T-grid.
sourceShallowWaters.m_per_lat
— MethodMeter per 1 degree of latitude (or longitude at the equator).
sourceShallowWaters.meshgrid
— MethodSimilar to the numpy meshgrid function: repeats x length(y)-times and vice versa. Returns two matrices xx,yy of same shape so that each row of xx is x and each column of yy is y.
sourceShallowWaters.momentum_u!
— MethodSum up the tendencies of the non-diffusive right-hand side for the u-component.
sourceShallowWaters.momentum_v!
— MethodSum up the tendencies of the non-diffusive right-hand side for the v-component.
sourceShallowWaters.nan_detection!
— MethodReturns a boolean whether the prognostic variables contains a NaN.
sourceShallowWaters.nc_create
— MethodCreates a netCDF file based on grid vectors x,y the variable name, its path, unit and long_name.
sourceShallowWaters.no_bottom_drag!
— MethodNo bottom drag.
sourceShallowWaters.output_close!
— MethodCloses netCDF and progress.txt files.
sourceShallowWaters.preallocate
— MethodPreallocate the diagnostic variables and return them as matrices in structs.
sourceShallowWaters.progress!
— MethodConverts time step into percent for feedback.
sourceShallowWaters.readable_secs
— MethodReturns a human readable string representing seconds in terms of days, hours, minutes or seconds.
sourceShallowWaters.remove_halo
— MethodCut off the halo from the prognostic variables.
sourceShallowWaters.remove_halo
— MethodCut off the halo from the prognostic variables.
sourceShallowWaters.rhs!
— MethodTransit function to call either the rhslinear or the rhsnonlinear.
sourceShallowWaters.rhs_linear!
— MethodTendencies du,dv of
∂u/∂t = fv - g∂η/∂x + Fx
- ∂v/∂t = -fu - g∂η/∂y + Fy
the linear shallow water equations.
sourceShallowWaters.rhs_nonlinear!
— MethodTendencies du,dv of
∂u/∂t = qhv - ∂(1/2*(u²+v²) + gη)/∂x + Fx
- ∂v/∂t = -qhu - ∂(1/2*(u²+v²) + gη)/∂y + Fy
the nonlinear shallow water equations.
sourceShallowWaters.run_model
— Methodu,v,η,sst = run_model()
runs ShallowWaters with default parameters as defined in src/DefaultParameters.jl
Examples
julia> u,v,η,sst = run_model(Float64,nx=200,output=true)
sourceShallowWaters.smagorinsky_coeff!
— MethodνSmag = cSmag * |D|, where deformation rate |D| = √((∂u/∂x - ∂v/∂y)^2 + (∂u/∂y + ∂v/∂x)^2). The grid spacing Δ is omitted here as the operators are dimensionless.
sourceShallowWaters.speed!
— MethodSquared velocities u²,v².
sourceShallowWaters.stress_tensor!
— MethodBiharmonic stress tensor ∇∇²(u,v) = (∂/∂x(∇²u), ∂/∂y(∇²u); ∂/∂x(∇²v), ∂/∂y(∇²v))
sourceShallowWaters.thickness!
— MethodLayer thickness h obtained by adding sea surface height η to bottom height H.
sourceShallowWaters.time_integration
— MethodIntegrates ShallowWaters forward in time.
sourceShallowWaters.tracer_relax_consumption!
— MethodTracer relaxation.
sourceShallowWaters.viscous_tensor_constant!
— MethodBiharmonic stress tensor times constant viscosity coefficient νB * ∇∇² ⃗u = (S11, S12; S21, S22)
sourceShallowWaters.viscous_tensor_smagorinsky!
— MethodBiharmonic stress tensor times Smagorinsky coefficient νSmag * ∇∇² ⃗u = (S11, S12; S21, S22).
sourceShallowWaters.waves
— MethodCreate a wave-checkerboard pattern over xx,yy like a nx x ny checkerboard. p is the power to which the waves are raised. Choose p<1 for rectangles, and p > 1 for more smootheness.
sourceShallowWaters.wrap
— MethodClips the relative lower-left corner index xyi (for both x or y indices) to remain within the domain. ij is the index of the underlying matrix. xy is the actual coordinate, mn (m or n) the size of the domain, and h is the halo size.
sourceShallowWaters.yy_q
— MethodHelper function to create yy_q based on the boundary condition bc.
sourceShallowWaters.β_at_lat
— MethodCoriolis parameter's derivative β wrt latitude [(ms)^-1] at latitude ϕ, given Earth's rotation ω [1/s] and radius R [m].
sourceShallowWaters.∂x!
— MethodCalculates the 2nd order centred gradient in x-direction on any grid (u,v,T or q). The size of dudx must be m-1,n compared to m,n = size(u)
sourceShallowWaters.∂x
— Method∂x is the 2nd order centred Gradient-operator ∂/∂x with grid spacing Δ (default 1).
sourceShallowWaters.∂y!
— MethodCalculates the 2nd order centred gradient in y-direction on any grid (u,v,T or q). The size of dudy must be m,n-1 compared to m,n = size(u).
sourceShallowWaters.∂y
— Method∂y is the 2nd order centred Gradient-operator ∂/∂y with grid spacing Δ (default 1).
sourceShallowWaters.∇²!
— Method∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2. The 1/Δ²-factor is omitted and moved into the viscosity coefficient.
sourceShallowWaters.∇²
— Method∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2 with grid spacing Δ (default 1).
sourceSettings
This document was generated with Documenter.jl version 0.27.25 on Thursday 30 May 2024. Using Julia version 1.10.3.
+init_interpolation::Bool=true # Interpolate the initial conditions in case grids don't match?
ShallowWaters.PrognosticVars
— MethodZero generator function for Grid G as argument.
ShallowWaters.RungeKuttaVars
— TypeRunge Kutta time stepping scheme diagnostic cariables collected in a struct.
ShallowWaters.RungeKuttaVars
— MethodGenerator function for RungeKutta VarCollection.
ShallowWaters.SSPRK3coeff
— TypeCoefficients for strong stability-preserving Runge-Kutta 3rd order. From: KETCHESON, LOĆZI, AND PARSANI, 2014. INTERNAL ERROR PROPAGATION IN EXPLICIT RUNGE–KUTTA METHODS, SIAM J NUMER ANAL 52/5. DOI:10.1137/130936245
ShallowWaters.SSPRK3coeff
— MethodGenerator function for a SSPRK3coeff struct.
ShallowWaters.SemiLagrangeVars
— TypeSemiLagrange variables collected in a struct.
ShallowWaters.SemiLagrangeVars
— MethodGenerator function for SemiLagrange VarCollection.
ShallowWaters.SmagorinskyVars
— TypeSmagorinsky variables collected in a struct.
ShallowWaters.SmagorinskyVars
— MethodGenerator function for Smagorinsky VarCollection.
ShallowWaters.TendencyVars
— TypeTendencies collected in a struct.
ShallowWaters.TendencyVars
— MethodGenerator function for Tendencies VarCollection.
ShallowWaters.VolumeFluxVars
— TypeVolumeFluxes collected in a struct.
ShallowWaters.VolumeFluxVars
— MethodGenerator function for VolumeFluxes VarCollection.
ShallowWaters.VorticityVars
— TypeVorticity variables collected in a struct.
ShallowWaters.VorticityVars
— MethodGenerator function for Vorticity VarCollection.
Base.convert
— MethodConvert function for two arrays, X1, X2, in case their eltypes differ. Convert every element from X1 and store it in X2.
Base.convert
— MethodConvert function for two arrays, X1, X2, in case their eltypes are identical. Just pass X1, such that X2 is pointed to the same place in memory.
ShallowWaters.AHα!
— MethodLinear combination α of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
ShallowWaters.AHβ!
— MethodLinear combination δ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
ShallowWaters.AHγ!
— MethodLinear combination γ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
ShallowWaters.AHδ!
— MethodLinear combination β of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990
ShallowWaters.ChannelWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a cosine with strongest forcing in the middle and vanishing forcing at boundaries.
ShallowWaters.ConstantWind
— MethodReturns constant in in space forcing matrices Fx,Fy.
ShallowWaters.DoubleGyreWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally with a superposition of sin & cos for a double gyre circulation. See Cooper&Zanna 2015 or Kloewer et al 2018.
ShallowWaters.FlatBottom
— MethodReturns a matrix of constant water depth H.
ShallowWaters.Ftime
— MethodTime evolution of forcing.
ShallowWaters.InterfaceRelaxation
— MethodReturns a reference state for Newtonian cooling/surface relaxation shaped as a hyperbolic tangent to force the continuity equation.
ShallowWaters.Ix!
— MethodLinear interpolation of a variable u in the x-direction. m,n = size(ux) must be m+1,n = size(u).
ShallowWaters.Ixy!
— MethodBilinear interpolation a variable u in x and y-direction. m,n = size(uxy) must be m+1,n+1 = size(u).
ShallowWaters.Iy!
— MethodLinear interpolation a variable u in the y-direction. m,n = size(uy) must be m,n+1 = size(u).
ShallowWaters.KelvinPump
— MethodReturns Kelvin wave pumping forcing of the continuity equation.
ShallowWaters.NoWind
— MethodReturns constant in in space forcing matrices Fx,Fy.
ShallowWaters.PV!
— MethodPotential vorticity calculated as q = (f + ∂v/∂x - ∂u/∂y)/h.
ShallowWaters.PV_ArakawaHsu!
— MethodAdvection of potential vorticity qhv,qhu as in Arakawa and Hsu, 1990 Energy and enstrophy conserving (in the limit of non-divergent mass flux) scheme with τ = 0.
ShallowWaters.PV_Sadourny!
— MethodAdvection of potential vorticity qhv,qhu as in Sadourny, 1975 enstrophy conserving scheme.
ShallowWaters.PVadvection!
— MethodTransit function to call the specified advection scheme.
ShallowWaters.Ridge
— MethodReturns a matrix of water depth for the whole domain that contains a meridional Gaussian ridge in the middle. Water depth, heigth and width of the ridge are adjusted with the constants waterdepth, topofeatheight and topofeat_width.
ShallowWaters.Ridges
— MethodSame as Ridge() but for n ridges at various x positions.
ShallowWaters.Seamount
— MethodReturns a matrix of water depth for the whole domain that contains a Gaussian seamount in the middle. Water depth, heigth and width of the seamount are adjusted with the constants H, topofeatheight and topofeatwidth.
ShallowWaters.ShearWind
— MethodReturns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a hyperbolic tangent with strongest shear in the middle.
ShallowWaters.UVfluxes!
— MethodCalculate the mass/volume fluxes U,V from u,v,η.
ShallowWaters.Uflux!
— MethodZonal mass flux U = uh.
ShallowWaters.Vflux!
— MethodMeridional mass flux V = vh.
ShallowWaters.add_drag_diff_tendencies!
— MethodUpdate u with bottom friction tendency (Bu,Bv) and biharmonic viscosity.
ShallowWaters.add_halo
— MethodExtends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.
ShallowWaters.add_halo
— MethodExtends the matrices u,v,η,sst with a halo of ghost points for boundary conditions.
ShallowWaters.adv_sst!
— MethodAdvection of sst/tracer based on the departure points xd,yd via bilinear interpolation. Departure points are clipped/wrapped to remain within the domain. Boundary conditions either periodic (wrap around behaviour) or no-flux (no gradient via clipping). Once the respective 4 surrounding grid points are found do bilinear interpolation on the unit square.
ShallowWaters.advection_coriolis!
— MethodUpdate advective and Coriolis tendencies.
ShallowWaters.axb!
— MethodAdd to a x multiplied with b. a += x*b
ShallowWaters.backtraj!
— MethodSolves the trajectory equation for a given time step dt and the velocity uv (this can be u or v). One function for three cases
(i) u is interpolated from u-grid with halo onto T-grid (ii) v is interpolated from v-grid with halo onto T-grid (iii) u or v already on the T-grid: All matrices have same size.
Uses relative grid nodes in the departure points rd, such that actually solved is rd = 0 - dt*uv. The indices i,j of rd determine the arrival grid point.
ShallowWaters.bernoulli!
— MethodBernoulli potential p = 1/2*(u² + v²) + gη.
ShallowWaters.bilin
— MethodBilinear interpolation on (x,y) in the unit square [0,1]x[0,1]. The values at the corners are f00 = f(0,0), f01 = f(0,1), etc.
ShallowWaters.bottom_drag!
— MethodTransit function to call the specified bottom drag function.
ShallowWaters.bottom_drag_linear!
— MethodLinear bottom drag computed as rB*(u,v). rB is negative and contains the grid spacing Δ as gradient operators are dimensionless.
ShallowWaters.bottom_drag_quadratic!
— MethodQuadratic bottom drag Bu,Bv = cD/h * | uv | * uv
ShallowWaters.caxb!
— Methodc equals add a to x multiplied with b. c = a + x*b
ShallowWaters.clip
— MethodClips the relative lower-left corner index xyi (for both x or y indices) to remain within the domain. ij is the index of the underlying matrix. xy is the actual coordinate, mn (m or n) the size of the domain, and h1,h2 are the halo sizes (left/south and right/north).
ShallowWaters.continuity!
— MethodTransit function to call the specified continuity function.
ShallowWaters.continuity_forcing!
— MethodContinuity equation's right-hand side with time&space dependent forcing.
ShallowWaters.continuity_itself!
— MethodContinuity equation's right-hand side -∂x(uh) - ∂y(vh) without forcing.
ShallowWaters.continuity_surf_relax!
— MethodContinuity equation's right-hand side with surface relaxation -∂x(uh) - ∂y(vh) + γ*(η_ref - η).
ShallowWaters.coriolis_at_lat
— MethodCoriolis parameter f [1/s] at latitude ϕ [°] given Earth's rotation ω [1/s].
ShallowWaters.countnans
— MethodReturns the number of NaNs in an array.
ShallowWaters.cxab!
— Methodc equals add x multiplied to a plus b. c = x*(a+b)
ShallowWaters.cxayb!
— Methodc = xa + yb
ShallowWaters.dambmc!
— Methodd equals add a minus b minus c. c = (a - b) - c.
ShallowWaters.departure!
— MethodComputes the departure point for semi-Lagrangian advection following Diamantakis, 2014. u,v are assumed to be the time averaged velocities over the previous advection time step. (Presumably need to be changed to 2nd order extrapolation in case the tracer is not passive)
Uses fixed-point iteration once to find the departure point.
ShallowWaters.diffusion!
— MethodTransit function to call the specified diffusion scheme.
ShallowWaters.diffusion_constant!
— MethodBiharmonic diffusion operator with constant viscosity coefficient Viscosity = ν∇⁴ ⃗u. Although constant, the coefficient is actually inside Viscosity = ∇⋅ν∇∇² ⃗u.
ShallowWaters.diffusion_smagorinsky!
— MethodSmagorinsky-like biharmonic viscosity Viscosity = ∇ ⋅ (cSmag Δ⁴ |D| ∇∇² ⃗u) The Δ⁴-scaling is omitted as gradient operators are dimensionless.
ShallowWaters.duration_estimate
— MethodEstimates the total time the model integration will take.
ShallowWaters.dxaybzc!
— Methodd = xa + yb + z*c
ShallowWaters.feedback!
— MethodFeedback function that calls duration estimate, nan_detection and progress.
ShallowWaters.feedback_end!
— MethodFinalises the progress txt file.
ShallowWaters.feedback_init
— MethodInitialises the progress txt file.
ShallowWaters.fu!
— MethodCoriolis term f*u.
ShallowWaters.fv!
— MethodCoriolis term f*v.
ShallowWaters.gap
— MethodFinds the first gap in a list of integers.
ShallowWaters.get_run_id_path
— MethodChecks output folders to determine a 4-digit run id number.
ShallowWaters.ghost_points!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_sst!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_sst!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_sst_nonperiodic!
— MethodCopy ghost points for η from inside to the halo in the nonperiodic case.
ShallowWaters.ghost_points_sst_periodic!
— MethodCopy ghost points for η from inside to the halo in the periodic case.
ShallowWaters.ghost_points_u_nonperiodic!
— MethodCopy ghost points for u from inside to the halo in the nonperiodic case.
ShallowWaters.ghost_points_u_periodic!
— MethodCopy ghost points for u from inside to the halo in the periodic case.
ShallowWaters.ghost_points_uv!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_uv!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_v_nonperiodic!
— MethodCopy ghost points for v from inside to the halo in the nonperiodic case.
ShallowWaters.ghost_points_v_periodic!
— MethodCopy ghost points for v from inside to the halo in the periodic case.
ShallowWaters.ghost_points_η!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_η!
— MethodDecide on boundary condition P.bc which ghost point function to execute.
ShallowWaters.ghost_points_η_nonperiodic!
— MethodCopy ghost points for η from inside to the halo in the nonperiodic case.
ShallowWaters.ghost_points_η_periodic!
— MethodCopy ghost points for η from inside to the halo in the periodic case.
ShallowWaters.interp_uv!
— MethodInterpolates the matrix uv into the matrix uvi, where xx, yy specify the coordinates as indices (including fraction. Interpolation only onto the inner entries of uvi. (They will be copied back later via the ghostpoint function). Two cases (i) u velocities: from u-grid with halo to T-grid (ii) v velocities: from v-grid with halo to T-grid.
ShallowWaters.m_per_lat
— MethodMeter per 1 degree of latitude (or longitude at the equator).
ShallowWaters.meshgrid
— MethodSimilar to the numpy meshgrid function: repeats x length(y)-times and vice versa. Returns two matrices xx,yy of same shape so that each row of xx is x and each column of yy is y.
ShallowWaters.momentum_u!
— MethodSum up the tendencies of the non-diffusive right-hand side for the u-component.
ShallowWaters.momentum_v!
— MethodSum up the tendencies of the non-diffusive right-hand side for the v-component.
ShallowWaters.nan_detection!
— MethodReturns a boolean whether the prognostic variables contains a NaN.
ShallowWaters.nc_create
— MethodCreates a netCDF file based on grid vectors x,y the variable name, its path, unit and long_name.
ShallowWaters.no_bottom_drag!
— MethodNo bottom drag.
ShallowWaters.output_close!
— MethodCloses netCDF and progress.txt files.
ShallowWaters.preallocate
— MethodPreallocate the diagnostic variables and return them as matrices in structs.
ShallowWaters.progress!
— MethodConverts time step into percent for feedback.
ShallowWaters.readable_secs
— MethodReturns a human readable string representing seconds in terms of days, hours, minutes or seconds.
ShallowWaters.remove_halo
— MethodCut off the halo from the prognostic variables.
ShallowWaters.remove_halo
— MethodCut off the halo from the prognostic variables.
ShallowWaters.rhs!
— MethodTransit function to call either the rhslinear or the rhsnonlinear.
ShallowWaters.rhs_linear!
— MethodTendencies du,dv of
∂u/∂t = fv - g∂η/∂x + Fx
+ ∂v/∂t = -fu - g∂η/∂y + Fy
the linear shallow water equations.
ShallowWaters.rhs_nonlinear!
— MethodTendencies du,dv of
∂u/∂t = qhv - ∂(1/2*(u²+v²) + gη)/∂x + Fx
+ ∂v/∂t = -qhu - ∂(1/2*(u²+v²) + gη)/∂y + Fy
the nonlinear shallow water equations.
ShallowWaters.run_model
— Methodu,v,η,sst = run_model()
runs ShallowWaters with default parameters as defined in src/DefaultParameters.jl
Examples
julia> u,v,η,sst = run_model(Float64,nx=200,output=true)
ShallowWaters.smagorinsky_coeff!
— MethodνSmag = cSmag * |D|, where deformation rate |D| = √((∂u/∂x - ∂v/∂y)^2 + (∂u/∂y + ∂v/∂x)^2). The grid spacing Δ is omitted here as the operators are dimensionless.
ShallowWaters.speed!
— MethodSquared velocities u²,v².
ShallowWaters.stress_tensor!
— MethodBiharmonic stress tensor ∇∇²(u,v) = (∂/∂x(∇²u), ∂/∂y(∇²u); ∂/∂x(∇²v), ∂/∂y(∇²v))
ShallowWaters.thickness!
— MethodLayer thickness h obtained by adding sea surface height η to bottom height H.
ShallowWaters.time_integration
— MethodIntegrates ShallowWaters forward in time.
ShallowWaters.tracer_relax_consumption!
— MethodTracer relaxation.
ShallowWaters.viscous_tensor_constant!
— MethodBiharmonic stress tensor times constant viscosity coefficient νB * ∇∇² ⃗u = (S11, S12; S21, S22)
ShallowWaters.viscous_tensor_smagorinsky!
— MethodBiharmonic stress tensor times Smagorinsky coefficient νSmag * ∇∇² ⃗u = (S11, S12; S21, S22).
ShallowWaters.waves
— MethodCreate a wave-checkerboard pattern over xx,yy like a nx x ny checkerboard. p is the power to which the waves are raised. Choose p<1 for rectangles, and p > 1 for more smootheness.
ShallowWaters.wrap
— MethodClips the relative lower-left corner index xyi (for both x or y indices) to remain within the domain. ij is the index of the underlying matrix. xy is the actual coordinate, mn (m or n) the size of the domain, and h is the halo size.
ShallowWaters.yy_q
— MethodHelper function to create yy_q based on the boundary condition bc.
ShallowWaters.β_at_lat
— MethodCoriolis parameter's derivative β wrt latitude [(ms)^-1] at latitude ϕ, given Earth's rotation ω [1/s] and radius R [m].
ShallowWaters.∂x!
— MethodCalculates the 2nd order centred gradient in x-direction on any grid (u,v,T or q). The size of dudx must be m-1,n compared to m,n = size(u)
ShallowWaters.∂x
— Method∂x is the 2nd order centred Gradient-operator ∂/∂x with grid spacing Δ (default 1).
ShallowWaters.∂y!
— MethodCalculates the 2nd order centred gradient in y-direction on any grid (u,v,T or q). The size of dudy must be m,n-1 compared to m,n = size(u).
ShallowWaters.∂y
— Method∂y is the 2nd order centred Gradient-operator ∂/∂y with grid spacing Δ (default 1).
ShallowWaters.∇²!
— Method∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2. The 1/Δ²-factor is omitted and moved into the viscosity coefficient.
ShallowWaters.∇²
— Method∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2 with grid spacing Δ (default 1).