Library

Types

Sad.DingmanType

Dingman river channel cross section.

Uses generalized expressions for cross-section geometry based on at-a-station hydraulic geometry relations.

  • Wb: bankfull width
  • Yb: bankfull depth
  • Ym: flow depth
  • r: geometry exponent
  • S0: bed slope
  • n: Manning roughness coefficient

See also: Rectangular

source
Sad.RectangularType

Rectangular river channel cross section.

  • Wb: bankfull width
  • Yb: bankfull depth
  • Ym: flow depth
  • S0: bed slope
  • n: Manning roughness coefficient

See also: Dingman

source

Functions

Cross sections

Sad.widthFunction
width(xs)

Calculate water surface width of cross section.

Arguments

  • xs: cross section
source
Sad.depthFunction
depth(xs)

Calculate average depth of cross section.

Arguments

  • xs: cross section
source

Priors

Sad.get_samplesFunction
get_samples(p, samples)

Get quantiles from p according to weights provided by Latin Hypercube Sampling samples.

source
Sad.lhs_ensembleFunction
lhs_ensemble(nens, args...)

Generate an ensemble of size nens using Latin Hypercube Sampling of the list of distributions or collections provided as args.

source
Sad.prior_ensembleFunction
prior_ensemble(x, Qp, np, rp, zp, nens)

Generate a prior ensemble of discharge, roughness coefficient, channel shape parameter, and downstream bed elevation from provided distributions or sample data.

Arguments

  • x: distances between cross sections
  • Qp: discharge prior distribution
  • np: roughness coefficient distribution
  • rp: channel shape parameter distribution
  • zp: downstream bathymetry distribution
  • nens: ensemble size
source
Sad.gvf_ensemble!Function
gvf_ensemble!(H, S, x, hbf, wbf, Qe, ne, re, ze)

Generate an ensemble of water height profiles from Gradually-Varied-Flow simulations and associated profiles of bed elevation.

Arguments

  • H: water surface elevation
  • S: bed slope
  • x: channel chainage
  • hbf: bankfull water surface elevation
  • wbf: bankfull width
  • Qe: ensemble discharge
  • ne: ensemble roughness coefficient
  • re: ensemble channel shape parameter
  • ze: ensemble bed elevation profiles
source
Sad.rejection_samplingFunction
rejection_sampling(Qp, np, rp, zp, x, H, S0, hbc, wbf, hbf, nens, nsamples)

Use rejection sampling to select a subset of the prior ensemble.

Arguments

  • Qp: prior discharge distribution
  • np: prior roughness coefficient distribution
  • rp: prior channel shape parameter distribution
  • zp: prior distribution for downstream bed elevation
  • x: channel chainage
  • H: time series of observed water surface elevation profiles
  • S0: prior estimate of channel bed slope
  • hbc: mean downstream flow depth used as boundary condition
  • wbf: bankfull width
  • hbf: bankfull water surface elevation
  • nens: ensemble size
  • nsamples: number of samples
source
Sad.priorsFunction
priors(ncfile, hmin, id)

Derive prior distributions for discharge, roughness coefficient, channel shape parameter, and bed elevation by reading the SWORD a-priori database.

Arguments

  • ncfile: NetCDF file of SWORD database
  • hmin: minimum observed downstream water surface elevation
  • id: Reach ID in SWORD database
source
priors(qwbm, hmin)

Derive distributions for discharge, roughness coefficient, channel shape parameter, and bed elevation using uninformative priors.

Arguments

  • qwbm: mean discharge
  • hmin: minimum downstream water surface elevation
source

Kalman filters

Sad.letkfFunction
letkf(A, d, HA, E, xs, ys, ρ, diagR)

Apply the Local Ensemble Transform Kalman Filter algorithm.

Arguments

  • A: state variable ensemble matrix
  • d: observation vector
  • HA: model-predicted observation ensemble matrix
  • E: observation error ensemble matrix
  • xs: indices of state vector that map to observation local patches
  • ys: indices of observation local patches
  • ρ: covariance inflation parameter (optional, default value of 1.05)
  • diagR: force observation error covariance to be diagonal, i.e. no spatial correlation (optional, default is false)
source

Gradually Varied Flow

Sad.froudeFunction
froude(Q::Float64, xs::CrossSection)

Calculate the Froude number.

Arguments

  • Q: discharge
  • xs: cross section
source
Sad.interpolate_hbcFunction
interpolate_hbc(x, H, S)

Interpolate water surface elevation boundary condition by assuming uniform flow, i.e., energy slope is equal to bed slope.

Arguments

  • x: channel chainage
  • H: water surface elevation profile
  • S: bed slope
source
Sad.dydxFunction
dydx(y, p, x)

Ordinary differential equation describing the Gradually-Varied-Flow model.

source
Sad.gvfFunction

Calculate a water surface profile by solving the Gradually-Varied-Flow equation.

  • Q: discharge
  • ybc: downstream boundary condition for depth
  • S0: bed slope for reach
  • n: roughness coefficient
  • x: downstream distance for each cross section
  • wbf: bankfull width for each cross section
  • ybf: bankfull depth for each cross section
  • r: channel geometry coefficient for each cross section
source

Sad

Sad.drop_unobservedFunction
drop_unobserved(x, H, W, S)

Remove cross sections with no valid observations.

Arguments

  • x: channel chainage
  • H: time series of water surface elevation profiles
  • W: time series of width profiles
  • S: time series of water surface slope profiles
source
Sad.assimilateFunction
assimilate(H, W, S, x, wbf, hbf, S0, Qp, np, rp, zp, nens, constrain)

Assimilate SWOT observations for river reach.

Arguments

  • H: time series of water surface elevation profiles
  • W: time series of water surface width profiles
  • S: time series of water surface slope profiles
  • x: downstream distance for each cross section
  • wbf: bankfull width
  • hbf: bankfull depth
  • Qₚ: prior probability distribution for discharge
  • nₚ: prior probability distribution for roughness coefficient
  • rₚ: prior probability distribution for channel shape parameter
  • zₚ: prior distribution for downstream bed elevation
  • nens: ensemble size
  • constrain: switch for applying AHG constraint
source
Sad.bathymetry!Function
bathymetry!(ze, S, S0, Qe, ne, re, x, hbf, wbf, H, ϵₒ)

Estimate channel bed slope and thalweg (elevation) by assimilating SWOT water surface elevation observations.

Arguments

  • ze: ensemble of bed elevations
  • S: time series of water surface slope profiles
  • S0: bed slope
  • Qe: ensemble of discharge
  • ne: ensemble of roughness coefficient
  • re: ensemble of channel shape parameters
  • x: channel chainage
  • hbf: bankfull water surface elevation
  • wbf: bankfull width
  • H: time-averaged water surface elevation observed
  • ϵₒ: observation error (default value of 10 cm)
source
Sad.ahg_constrain!Function
ahg_constrain!(Qa, hbc, hbf, wbf, S0, x, ne, re, ze, tol=1e-3)

Constrain assimilated discharge with At-a-Station hydraulic geometry (AHG) relationships.

Arguments

  • Qa: assimilated ensemble discharge
  • hbc: downstream boundary water surface elevation
  • hbf: bankfull water surface elevation
  • wbf: bankfull width
  • S0: bed slope
  • x: channel chainage
  • ne: ensemble roughness coefficient
  • re: ensemble channel shape parameter
  • ze: ensemble bed elevation
  • tol: numeric tolerance for closing the AHG relationships
source
Sad.calc_bed_slopeFunction
calc_bed_slope(x, S)

Estimate initial channel bed slope.

Arguments

  • x: channel chainage
  • S: time series of water surface slope profiles
source
Sad.calc_dAFunction
calc_dA(Qa, na, W, S)

Calculate changes in cross-sectional area.

Arguments

  • Qa: time series of estimated discharge
  • na: time series of estimated roughness coefficient
  • W: time series of width profiles
  • S: time series of water surface slope profiles
source
Sad.flow_parametersFunction
flow_parameters(Qa, na, W, S, dA)

Estimate flow parameters (roughness coefficient and baseflow cross-sectional area) from assimilated discharge.

Arguments

  • Qa: time series of estimated discharge
  • na: time series of estimate roughness coefficient
  • W: time series of observed width (reach)
  • S: time series of observed slope (reach)
  • dA: time series of changes in reach-averaged cross-sectional area (from minimum observed)
source
Sad.estimateFunction
estimate(x, H, W, S, Qp, np, rp, zp, nens)

Estimate discharge and flow parameters from SWOT observations.

Arguments

  • x: channel chainage
  • H: time series of water surface elevation profiles
  • W:time series of width profiles
  • S: time series of water surface slope profiles
  • Qp: discharge prior distribution
  • np: roughness coefficient prior distribution
  • rp: channel shape parameter prior distribution
  • zp: downstream bed elevation prior distribution
  • nens: ensemble size
  • nsamples: sample size for rejection sampling
source