Skip to content

Commit

Permalink
Replace subscripts and superscripts with ASCII
Browse files Browse the repository at this point in the history
  • Loading branch information
CFBaptista committed Apr 10, 2024
1 parent 78cf660 commit dcb536f
Show file tree
Hide file tree
Showing 15 changed files with 188 additions and 188 deletions.
20 changes: 10 additions & 10 deletions docs/src/model_docs/params_lateral.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ set through the TOML file as follows:
slope = "Slope"
```

The parameter `kh₀` is computed by multiplying the vertical hydraulic conductivity at the
soil surface `kv₀` (including unit conversion) of the vertical `SBM` concept with the
The parameter `kh_0` is computed by multiplying the vertical hydraulic conductivity at the
soil surface `kv_0` (including unit conversion) of the vertical `SBM` concept with the
internal parameter `khfrac` \[-\] (default value of 1.0). The internal model parameter
`khfrac` is set through the TOML file as follows:

Expand All @@ -176,23 +176,23 @@ internal parameter `khfrac` \[-\] (default value of 1.0). The internal model par
ksathorfrac = "KsatHorFrac"
```

The `khfrac` parameter compensates for anisotropy, small scale `kv₀` measurements (soil
The `khfrac` parameter compensates for anisotropy, small scale `kv_0` measurements (soil
core) that do not represent larger scale hydraulic conductivity, and smaller flow length
scales (hillslope) in reality, not represented by the model resolution.

For the vertical [SBM](@ref params_sbm) concept different vertical hydraulic conductivity
depth profiles are possible, and these also determine which `LateralSSF` parameters are used
including the input requirements for the computation of lateral subsurface flow. For the
`exponential` profile the model parameters `kh₀` and `f` are used. For the
`exponential_constant` profile `kh₀` and `f` are used, and `z_exp` is required as part of
`exponential` profile the model parameters `kh_0` and `f` are used. For the
`exponential_constant` profile `kh_0` and `f` are used, and `z_exp` is required as part of
`[input.vertical]`. For the `layered` profile, `SBM` model parameter `kv` is used, and for
the `layered_exponential` profile `kv` is used and `z_exp` is required as part of
`[input.vertical]`.

| parameter | description | unit | default |
|:---------------| --------------- | ---------------------- | ----- |
| `kh₀` | horizontal hydraulic conductivity at soil surface | m d``^{-1}`` | 3.0 |
| **`f`** | a scaling parameter (controls exponential decline of `kh₀`) | m``^{-1}`` | 1.0 |
| `kh_0` | horizontal hydraulic conductivity at soil surface | m d``^{-1}`` | 3.0 |
| **`f`** | a scaling parameter (controls exponential decline of `kh_0`) | m``^{-1}`` | 1.0 |
| `kh` | horizontal hydraulic conductivity | m d``^{-1}`` | - |
| **`khfrac`** (`ksathorfrac`) | a muliplication factor applied to vertical hydraulic conductivity `kv` | - | 100.0 |
| **`soilthickness`** | soil thickness | m | 2.0 |
Expand All @@ -203,7 +203,7 @@ the `layered_exponential` profile `kv` is used and `z_exp` is required as part o
| `dl` | drain length | m | - |
| `dw` | drain width | m | - |
| `zi` | pseudo-water table depth (top of the saturated zone) | m | - |
| **`z_exp`** | depth from soil surface for which exponential decline of `kh₀` is valid | m | - |
| **`z_exp`** | depth from soil surface for which exponential decline of `kh_0` is valid | m | - |
| `exfiltwater` | exfiltration (groundwater above surface level, saturated excess conditions) | m Δt⁻¹ | - |
| `recharge` | net recharge to saturated store | m``^2`` Δt⁻¹ | - |
| `ssf` | subsurface flow | m``^3`` d``{-1}`` | - |
Expand Down Expand Up @@ -412,11 +412,11 @@ altitude = "wflow_dem"
```

The input parameter `conductivity` (listed under `[input.lateral.subsurface]`) is not equal
to the internal model parameter `kh₀`, and is listed in the Table below between parentheses.
to the internal model parameter `kh_0`, and is listed in the Table below between parentheses.

| parameter | description | unit | default |
|:--------------- | ------------------| ----- | -------|
| **`kh₀`** (`conductivity`) | horizontal conductivity | m d``^{-1}``s | - |
| **`kh_0`** (`conductivity`) | horizontal conductivity | m d``^{-1}``s | - |
| **`specific_yield`** | specific yield | m m``^{-1}`` | - |
| **`top`** (`altitude`) | top groundwater layer | m | - |
| `bottom` | bottom groundwater layer | m | - |
Expand Down
10 changes: 5 additions & 5 deletions docs/src/model_docs/params_vertical.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ through the TOML file. Below an example for the `exponential_constant` profile:
ksat_profile = "exponential_constant"
```

For the `exponential` profile the input parameters `kv₀` and `f` are used. For the
`exponential_constant` profile `kv₀` and `f` are used, and `z_exp` is required as input. For
For the `exponential` profile the input parameters `kv_0` and `f` are used. For the
`exponential_constant` profile `kv_0` and `f` are used, and `z_exp` is required as input. For
the `layered` profile, input parameter `kv` is used, and for the `layered_exponential`
profile `kv` is used and `z_layered` is required as input.

Expand All @@ -46,10 +46,10 @@ profile `kv` is used and `z_layered` is required as input.
| **`glacierstore`** | water within the glacier | mm | 5500.0 |
| **`theta_s`** | saturated water content (porosity) | - | 0.6 |
| **`theta_r`** | residual water content | - | 0.01 |
| **`kv₀`** (`kv_0`) | Vertical hydraulic conductivity at soil surface | mm Δt``^{-1}`` | 3000.0 mm day``^{-1}``|
| **`kv_0`** (`kv_0`) | Vertical hydraulic conductivity at soil surface | mm Δt``^{-1}`` | 3000.0 mm day``^{-1}``|
| **`kv`** | Vertical hydraulic conductivity per soil layer | mm Δt``^{-1}`` | 1000.0 mm day``^{-1}``|
| **`f`** | scaling parameter (controls exponential decline of `kv₀`) | mm``^{-1}`` | 0.001 |
| **`z_exp`** | Depth from soil surface for which exponential decline of `kv₀` is valid | mm | - |
| **`f`** | scaling parameter (controls exponential decline of `kv_0`) | mm``^{-1}`` | 0.001 |
| **`z_exp`** | Depth from soil surface for which exponential decline of `kv_0` is valid | mm | - |
| **`z_layered`** | Depth from soil surface for which layered profile (of `layered_exponential`) is valid | mm | - |
| **`hb`** | air entry pressure of soil (Brooks-Corey) | cm | 10.0 |
| **`soilthickness`** | soil thickness | mm | 2000.0 |
Expand Down
2 changes: 1 addition & 1 deletion docs/src/model_docs/structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ example with a part of the `SBM` struct:
# Residual water content [mm mm⁻¹]
theta_r::Vector{T} | "mm mm-1"
# Vertical hydraulic conductivity [mm Δt⁻¹] at soil surface
kv₀::Vector{T} | "mm dt-1"
kv_0::Vector{T} | "mm dt-1"
# Muliplication factor [-] applied to kv_z (vertical flow)
kvfrac::Vector{SVector{N,T}} | "-"
```
Expand Down
4 changes: 2 additions & 2 deletions docs/src/user_guide/model-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ routing](@ref) and parameters that are part of this component are described in t
subsurface flow](@ref) section of Model parameters. Input parameters for this component of
the SBM + Kinematic wave model are derived from the SBM vertical concept and the land slope.
One external parameter [`ksathorfrac`](@ref params_ssf) is used to calculate the horizontal
hydraulic conductivity at the soil surface `kh₀`.
hydraulic conductivity at the soil surface `kh_0`.

There is also the option to use the local inertial model as part of the `sbm` model type:
+ for river flow, see also [SBM + Local inertial river](@ref) model.
Expand Down Expand Up @@ -131,4 +131,4 @@ map stack.
+ Eilander, D., van Verseveld, W., Yamazaki, D., Weerts, A., Winsemius, H. C., and Ward, P.
J.: A hydrography upscaling method for scale-invariant parametrization of distributed
hydrological models, Hydrol. Earth Syst. Sci., 25, 5287–5313,
<https://doi.org/10.5194/hess-25-5287-2021>, 2021.
<https://doi.org/10.5194/hess-25-5287-2021>, 2021.
4 changes: 2 additions & 2 deletions docs/src/user_guide/step2_settings_file.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ e_r = "EoverR"
infiltcappath = "InfiltCapPath"
infiltcapsoil = "InfiltCapSoil"
kext = "Kext"
"kv₀" = "KsatVer"
"kv_0" = "KsatVer"
leaf_area_index = "LAI" # Cyclic variable
m = "M"
maxleakage = "MaxLeakage"
Expand Down Expand Up @@ -430,4 +430,4 @@ Note that the mapping to the external netCDF variable listed under the section
potential_evaporation = "PET" # forcing
# temperature = "TEMP" # forcing
precipitation = "P" # forcing
```
```
24 changes: 12 additions & 12 deletions src/flow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ function stable_timestep(sf::S) where {S<:SurfaceFlow}
end

@get_units @exchange @grid_type @grid_location @with_kw struct LateralSSF{T}
kh₀::Vector{T} | "m d-1" # Horizontal hydraulic conductivity at soil surface [m d⁻¹]
f::Vector{T} | "m-1" # A scaling parameter [m⁻¹] (controls exponential decline of kh₀)
kh_0::Vector{T} | "m d-1" # Horizontal hydraulic conductivity at soil surface [m d⁻¹]
f::Vector{T} | "m-1" # A scaling parameter [m⁻¹] (controls exponential decline of kh_0)
kh::Vector{T} | "m d-1" # Horizontal hydraulic conductivity [m d⁻¹]
khfrac::Vector{T} | "-" # A muliplication factor applied to vertical hydraulic conductivity `kv` [-]
soilthickness::Vector{T} | "m" # Soil thickness [m]
Expand All @@ -401,7 +401,7 @@ end
dl::Vector{T} | "m" # Drain length [m]
dw::Vector{T} | "m" # Flow width [m]
zi::Vector{T} | "m" # Pseudo-water table depth [m] (top of the saturated zone)
z_exp::Vector{T} | "m" # Depth [m] from soil surface for which exponential decline of kv₀ is valid
z_exp::Vector{T} | "m" # Depth [m] from soil surface for which exponential decline of kv_0 is valid
exfiltwater::Vector{T} | "m dt-1" # Exfiltration [m dt⁻¹] (groundwater above surface level, saturated excess conditions)
recharge::Vector{T} | "m2 dt-1" # Net recharge to saturated store [m² dt⁻¹]
ssf::Vector{T} | "m3 d-1" # Subsurface flow [m³ d⁻¹]
Expand Down Expand Up @@ -445,7 +445,7 @@ function update(ssf::LateralSSF, network, frac_toriver, ksat_profile)
ssf.ssf[v],
ssf.zi[v],
ssf.recharge[v],
ssf.kh₀[v],
ssf.kh_0[v],
ssf.beta_l[v],
ssf.theta_s[v] - ssf.theta_r[v],
ssf.f[v],
Expand Down Expand Up @@ -1140,27 +1140,27 @@ Compute a stable timestep size for the local inertial approach, based on Bates e
dt = alpha * (Δx / sqrt(g max(h))
"""
function stable_timestep(sw::ShallowWaterRiver{T})::T where {T}
dtₘᵢₙ = T(Inf)
dt_min = T(Inf)
@tturbo for i = 1:sw.n
dt = sw.alpha * sw.dl[i] / sqrt(sw.g * sw.h[i])
dtₘᵢₙ = dt < dtₘᵢₙ ? dt : dtₘᵢₙ
dt_min = dt < dt_min ? dt : dt_min
end
dtₘᵢₙ = isinf(dtₘᵢₙ) ? T(10.0) : dtₘᵢₙ
return dtₘᵢₙ
dt_min = isinf(dt_min) ? T(10.0) : dt_min
return dt_min
end

function stable_timestep(sw::ShallowWaterLand{T})::T where {T}
dtₘᵢₙ = T(Inf)
dt_min = T(Inf)
@tturbo for i = 1:sw.n
dt = IfElse.ifelse(
sw.rivercells[i] == 0,
sw.alpha * min(sw.xl[i], sw.yl[i]) / sqrt(sw.g * sw.h[i]),
T(Inf),
)
dtₘᵢₙ = dt < dtₘᵢₙ ? dt : dtₘᵢₙ
dt_min = dt < dt_min ? dt : dt_min
end
dtₘᵢₙ = isinf(dtₘᵢₙ) ? T(10.0) : dtₘᵢₙ
return dtₘᵢₙ
dt_min = isinf(dt_min) ? T(10.0) : dt_min
return dt_min
end

function update(
Expand Down
6 changes: 3 additions & 3 deletions src/groundwater/aquifer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ The following criterion can be found in Chu & Willis (1984)
Δt * k * H / (Δx * Δy * S) <= 1/4
"""
function stable_timestep(aquifer, conductivity_profile::String)
dtₘᵢₙ = Inf
dt_min = Inf
for i in eachindex(aquifer.head)
if conductivity_profile == "exponential"
zi = aquifer.top[i] - aquifer.head[i]
Expand All @@ -335,9 +335,9 @@ function stable_timestep(aquifer, conductivity_profile::String)
end

dt = aquifer.area[i] * storativity(aquifer)[i] / value
dtₘᵢₙ = dt < dtₘᵢₙ ? dt : dtₘᵢₙ
dt_min = dt < dt_min ? dt : dt_min
end
return 0.25 * dtₘᵢₙ
return 0.25 * dt_min
end

minimum_head(aquifer::ConfinedAquifer) = aquifer.head
Expand Down
Loading

0 comments on commit dcb536f

Please sign in to comment.