diff --git a/previews/PR178/reference/index.html b/previews/PR178/reference/index.html index 765fd8e..b400280 100644 --- a/previews/PR178/reference/index.html +++ b/previews/PR178/reference/index.html @@ -1,5 +1,5 @@ -Reference · ShallowWaters.jl

Reference

Contents

Index

ShallowWaters.ParameterType

Creates 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.ParameterType

Creates 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?
source
ShallowWaters.SSPRK3coeffType

Coefficients 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

source
Base.convertMethod

Convert function for two arrays, X1, X2, in case their eltypes differ. Convert every element from X1 and store it in X2.

source
Base.convertMethod

Convert 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.

source
ShallowWaters.AHα!Method

Linear combination α of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHβ!Method

Linear combination δ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHγ!Method

Linear combination γ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHδ!Method

Linear combination β of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.ChannelWindMethod

Returns 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.

source
ShallowWaters.DoubleGyreWindMethod

Returns 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.

source
ShallowWaters.Ix!Method

Linear interpolation of a variable u in the x-direction. m,n = size(ux) must be m+1,n = size(u).

source
ShallowWaters.Ixy!Method

Bilinear interpolation a variable u in x and y-direction. m,n = size(uxy) must be m+1,n+1 = size(u).

source
ShallowWaters.Iy!Method

Linear interpolation a variable u in the y-direction. m,n = size(uy) must be m,n+1 = size(u).

source
ShallowWaters.PV_ArakawaHsu!Method

Advection 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.

source
ShallowWaters.RidgeMethod

Returns 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.

source
ShallowWaters.SeamountMethod

Returns 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.

source
ShallowWaters.ShearWindMethod

Returns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a hyperbolic tangent with strongest shear in the middle.

source
ShallowWaters.adv_sst!Method

Advection 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.

source
ShallowWaters.backtraj!Method

Solves 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.

source
ShallowWaters.bilinMethod

Bilinear 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.

source
ShallowWaters.clipMethod

Clips 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).

source
ShallowWaters.departure!Method

Computes 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.

source
ShallowWaters.diffusion_constant!Method

Biharmonic diffusion operator with constant viscosity coefficient Viscosity = ν∇⁴ ⃗u. Although constant, the coefficient is actually inside Viscosity = ∇⋅ν∇∇² ⃗u.

source
ShallowWaters.diffusion_smagorinsky!Method

Smagorinsky-like biharmonic viscosity Viscosity = ∇ ⋅ (cSmag Δ⁴ |D| ∇∇² ⃗u) The Δ⁴-scaling is omitted as gradient operators are dimensionless.

source
ShallowWaters.interp_uv!Method

Interpolates 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.

source
ShallowWaters.meshgridMethod

Similar 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.

source
ShallowWaters.rhs_linear!Method

Tendencies du,dv of

    ∂u/∂t = fv - g∂η/∂x + Fx
-    ∂v/∂t = -fu - g∂η/∂y + Fy

the linear shallow water equations.

source
ShallowWaters.rhs_nonlinear!Method

Tendencies 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.

source
ShallowWaters.run_modelMethod
u,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)
source
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.

source
ShallowWaters.wavesMethod

Create 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.

source
ShallowWaters.wrapMethod

Clips 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.

source
ShallowWaters.β_at_latMethod

Coriolis parameter's derivative β wrt latitude [(ms)^-1] at latitude ϕ, given Earth's rotation ω [1/s] and radius R [m].

source
ShallowWaters.∂x!Method

Calculates 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)

source
ShallowWaters.∂xMethod

∂x is the 2nd order centred Gradient-operator ∂/∂x with grid spacing Δ (default 1).

source
ShallowWaters.∂y!Method

Calculates 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).

source
ShallowWaters.∂yMethod

∂y is the 2nd order centred Gradient-operator ∂/∂y with grid spacing Δ (default 1).

source
ShallowWaters.∇²!Method

∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2. The 1/Δ²-factor is omitted and moved into the viscosity coefficient.

source
ShallowWaters.∇²Method

∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2 with grid spacing Δ (default 1).

source
+init_interpolation::Bool=true # Interpolate the initial conditions in case grids don't match?
source
ShallowWaters.SSPRK3coeffType

Coefficients 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

source
Base.convertMethod

Convert function for two arrays, X1, X2, in case their eltypes differ. Convert every element from X1 and store it in X2.

source
Base.convertMethod

Convert 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.

source
ShallowWaters.AHα!Method

Linear combination α of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHβ!Method

Linear combination δ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHγ!Method

Linear combination γ of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.AHδ!Method

Linear combination β of potential voriticity q according to the energy and enstrophy conserving scheme of Arakawa and Hsu, 1990

source
ShallowWaters.ChannelWindMethod

Returns 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.

source
ShallowWaters.DoubleGyreWindMethod

Returns 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.

source
ShallowWaters.Ix!Method

Linear interpolation of a variable u in the x-direction. m,n = size(ux) must be m+1,n = size(u).

source
ShallowWaters.Ixy!Method

Bilinear interpolation a variable u in x and y-direction. m,n = size(uxy) must be m+1,n+1 = size(u).

source
ShallowWaters.Iy!Method

Linear interpolation a variable u in the y-direction. m,n = size(uy) must be m,n+1 = size(u).

source
ShallowWaters.PV_ArakawaHsu!Method

Advection 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.

source
ShallowWaters.RidgeMethod

Returns 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.

source
ShallowWaters.SeamountMethod

Returns 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.

source
ShallowWaters.ShearWindMethod

Returns the constant forcing matrices Fx,Fy that vary only meriodionally/zonally as a hyperbolic tangent with strongest shear in the middle.

source
ShallowWaters.adv_sst!Method

Advection 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.

source
ShallowWaters.backtraj!Method

Solves 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.

source
ShallowWaters.bilinMethod

Bilinear 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.

source
ShallowWaters.clipMethod

Clips 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).

source
ShallowWaters.departure!Method

Computes 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.

source
ShallowWaters.diffusion_constant!Method

Biharmonic diffusion operator with constant viscosity coefficient Viscosity = ν∇⁴ ⃗u. Although constant, the coefficient is actually inside Viscosity = ∇⋅ν∇∇² ⃗u.

source
ShallowWaters.diffusion_smagorinsky!Method

Smagorinsky-like biharmonic viscosity Viscosity = ∇ ⋅ (cSmag Δ⁴ |D| ∇∇² ⃗u) The Δ⁴-scaling is omitted as gradient operators are dimensionless.

source
ShallowWaters.interp_uv!Method

Interpolates 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.

source
ShallowWaters.meshgridMethod

Similar 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.

source
ShallowWaters.rhs_linear!Method

Tendencies du,dv of

    ∂u/∂t = fv - g∂η/∂x + Fx
+    ∂v/∂t = -fu - g∂η/∂y + Fy

the linear shallow water equations.

source
ShallowWaters.rhs_nonlinear!Method

Tendencies 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.

source
ShallowWaters.run_modelMethod
u,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)
source
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.

source
ShallowWaters.wavesMethod

Create 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.

source
ShallowWaters.wrapMethod

Clips 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.

source
ShallowWaters.β_at_latMethod

Coriolis parameter's derivative β wrt latitude [(ms)^-1] at latitude ϕ, given Earth's rotation ω [1/s] and radius R [m].

source
ShallowWaters.∂x!Method

Calculates 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)

source
ShallowWaters.∂xMethod

∂x is the 2nd order centred Gradient-operator ∂/∂x with grid spacing Δ (default 1).

source
ShallowWaters.∂y!Method

Calculates 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).

source
ShallowWaters.∂yMethod

∂y is the 2nd order centred Gradient-operator ∂/∂y with grid spacing Δ (default 1).

source
ShallowWaters.∇²!Method

∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2. The 1/Δ²-factor is omitted and moved into the viscosity coefficient.

source
ShallowWaters.∇²Method

∇² is the 2nd order centred Laplace-operator ∂/∂x^2 + ∂/∂y^2 with grid spacing Δ (default 1).

source