Repository: Deltares/Wflow.jl (language: python)

Issue:
consistent naming of "bankfull_depth" parameter 
The same parameter is named "h_bankfull" for kin wave routing. I suggest to change "h_bankfull" to "bankfull_depth".
consistent naming of "bankfull_depth" parameter 
The same parameter is named "h_bankfull" for kin wave routing. I suggest to change "h_bankfull" to "bankfull_depth".


Discussion / hints:

Fix patch:
diff --git a/docs/src/changelog.md b/docs/src/changelog.md
index fefe895e7..ba998e25d 100644
--- a/docs/src/changelog.md
+++ b/docs/src/changelog.md
@@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Changed
 - Model types `sbm_gwf` and `hbv` use the same approach for the calculation of the drain
   width `dw` as model type `sbm`.
+- Renamed `h_bankfull` parameter to `bankfull_depth` for consistency between 
+  kinematic-wave and local-inertial river routing. Note that this may require 
+  updating the `[input.lateral.river]` section of the TOML file!
 
 ### Added
 - Additional log messages and log file as output, see also [Logging](@ref).
diff --git a/docs/src/lateral/kinwave.md b/docs/src/lateral/kinwave.md
index 0461c4ef1..3a8f2d643 100644
--- a/docs/src/lateral/kinwave.md
+++ b/docs/src/lateral/kinwave.md
@@ -35,15 +35,15 @@ kw_land_tstep = 3600
 ```
 
 The ``\alpha`` parameter of the kinematic wave is fixed. To estimate the wetted perimeter
-for the calculation of the ``\alpha`` parameter a bankfull height map (default value is 1.0
-m) for the river can be provided as follows: 
+for the calculation of the ``\alpha`` parameter a bankfull river depth map (default value 
+is 1.0 m) for the river can be provided as follows: 
 
 ```toml
 [input.lateral.river]
-h_bankfull = "river_bankfullheight"
+bankfull_depth = "wflow_riverdepth"
 ```
 
-The wetted perimeter of the river is based on half bankfull height. For the land part the
+The wetted perimeter of the river is based on half bankfull river depth. For the land part the
 wetted perimeter is based on the flow width.
 
 ## Inflow
@@ -119,7 +119,7 @@ The kinematic wave approach for channel, overland and lateral subsurface flow, a
 the topography controls water flow mostly. This assumption holds for steep terrain, but in
 less steep terrain the hydraulic gradient is likely not equal to the surface slope
 (subsurface flow), or pressure differences and inertial momentum cannot be neglected
-(channel and overland flow). In addition, while the kinemative wave equations are solved
+(channel and overland flow). In addition, while the kinematic wave equations are solved
 with a nonlinear scheme using Newton's method (Chow, 1988), other model equations are solved
 through a simple explicit scheme. In summary the following limitations apply:
 
@@ -197,7 +197,7 @@ Approach from Maniak (Burek et al., 2013). Storage curves in wflow can either:
 + Come from the interpolation of field data linking volume and lake height,
 + Be computed from the simple relationship ``S = A H``.
 
-Rating curves in wlow can either:
+Rating curves in wflow can either:
 
 + Come from the interpolation of field data linking lake outflow and water height,
 + Be computed from a rating curve of the form ``Q_{out} = \alpha {(H-H_{0})}^{\beta}``,
diff --git a/docs/src/lateral/kinwave_params.md b/docs/src/lateral/kinwave_params.md
index cf03aebee..9f02ef96f 100644
--- a/docs/src/lateral/kinwave_params.md
+++ b/docs/src/lateral/kinwave_params.md
@@ -6,13 +6,13 @@ be set through static input data (netCDF), and can be listed in the TOML configu
 under `[input.lateral.river]` and `[input.lateral.land]`, for river and overland flow
 respectively, to map the internal model parameter to the external netCDF variable. For river
 flow three additionally parameters can be set, `dl` (river length), `width` (river width)
-and bankfull water height `h_bankfull` as follows, through the TOML file:
+and bankfull river depth `bankfull_depth` as follows, through the TOML file:
 
 ```toml
 [input.lateral.river]
 length = "wflow_riverlength"
 width = "wflow_riverwidth"
-h_bankfull = "river_bankfullheight"
+bankfull_depth = "wflow_riverdepth"
 ```
 [^1]: default value for Manning's roughness `n`, river = 0.036; land = 0.072
 [^2]: only applicable for river domain
@@ -33,7 +33,7 @@ h_bankfull = "river_bankfullheight"
 | `volume`        | kinematic wave volume |m``^3``| - |
 | `h`             | water level | m | - |
 | `h_av`             | average water level | m | - |
-| `h_bankfull`     | bankfull water level  | m | 1.0 | 
+| `bankfull_depth`   | bankfull river depth  | m | 1.0 | 
 | `Δt`             | model time step | s | - |
 | `its`             | number of fixed iterations | - | - |
 | `alpha_pow`             | used in the power part of ``\alpha`` | - | - |
diff --git a/src/flow.jl b/src/flow.jl
index bec8b7173..c77632348 100644
--- a/src/flow.jl
+++ b/src/flow.jl
@@ -12,7 +12,7 @@
     volume::Vector{T} | "m3"                # Kinematic wave volume [m³] (based on water level h)
     h::Vector{T} | "m"                      # Water level [m]
     h_av::Vector{T} | "m"                   # Average water level [m]
-    h_bankfull::Vector{T} | "m"             # Bankfull water level [m]
+    bankfull_depth::Vector{T} | "m"         # Bankfull water level [m]
     Δt::T | "s"                             # Model time step [s]
     its::Int | "-"                          # Number of fixed iterations
     width::Vector{T} | "m"                  # Flow width [m]
@@ -77,7 +77,7 @@ function initialize_surfaceflow_land(
         volume = zeros(Float, n),
         h = zeros(Float, n),
         h_av = zeros(Float, n),
-        h_bankfull = zeros(Float, n),
+        bankfull_depth = zeros(Float, n),
         Δt = Float(tosecond(Δt)),
         its = tstep > 0 ? Int(cld(tosecond(Δt), tstep)) : tstep,
         width = width,
@@ -127,10 +127,10 @@ function initialize_surfaceflow_river(
         defaults = 0.036,
         type = Float,
     )
-    h_bankfull = ncread(
+    bankfull_depth = ncread(
         nc,
         config.input,
-        "lateral.river.h_bankfull";
+        "lateral.river.bankfull_depth";
         sel = inds,
         defaults = 1.0,
         type = Float,
@@ -161,7 +161,7 @@ function initialize_surfaceflow_river(
         volume = zeros(Float, n),
         h = zeros(Float, n),
         h_av = zeros(Float, n),
-        h_bankfull = h_bankfull,
+        bankfull_depth = bankfull_depth,
         Δt = Float(tosecond(Δt)),
         its = tstep > 0 ? Int(cld(tosecond(Δt), tstep)) : tstep,
         width = width,
@@ -202,8 +202,8 @@ function update(
     ns = length(subdomain_order)
 
     @. sf.alpha_term = pow(sf.n / sqrt(sf.sl), sf.β)
-    # use fixed alpha value based on 0.5 * h_bankfull
-    @. sf.α = sf.alpha_term * pow(sf.width + sf.h_bankfull, sf.alpha_pow)
+    # use fixed alpha value based on 0.5 * bankfull_depth
+    @. sf.α = sf.alpha_term * pow(sf.width + sf.bankfull_depth, sf.alpha_pow)
 
     @. sf.qlat = sf.inwater / sf.dl
 


Test patch:
diff --git a/test/run_sbm.jl b/test/run_sbm.jl
index d9e23505d..b57eeb92a 100644
--- a/test/run_sbm.jl
+++ b/test/run_sbm.jl
@@ -19,13 +19,13 @@ flush(model.writer.csv_io)  # ensure the buffer is written fully to disk
     @test row.volume ≈ 2.7535003939625636f7
     @test row.temp_bycoord ≈ 2.390000104904175f0
     @test row.temp_byindex ≈ 2.390000104904175f0
-    @test row.Q_6336050 ≈ 0.00617203548227466f0
+    @test row.Q_6336050 ≈ 0.006160282939850074f0
     @test row.Q_6336510 ≈ 0.029177309556712334f0
     @test row.Q_6836100 ≈ 0.19621282450614713f0
-    @test row.Q_6336500 ≈ 0.006104510105954231f0
+    @test row.Q_6336500 ≈ 0.006089112638001381f0
     @test row.Q_6836190 ≈ 0.0031262850749354237f0
-    @test row.Q_6336800 ≈ 0.007782650672703859f0
-    @test row.Q_6336900 ≈ 0.006413552125666774f0
+    @test row.Q_6336800 ≈ 0.007770868657277307f0
+    @test row.Q_6336900 ≈ 0.006403194169947582f0
     @test row.Q_6336930 ≈ 0.08888787154163148f0
     @test row.Q_6336910 ≈ 0.007071851236520184f0
     @test row.Q_6136500 ≈ 0.0016367337487926633f0
@@ -116,7 +116,7 @@ end
     @test sum(q) ≈ 3615.2084127447865f0
     @test q[1622] ≈ 0.0005986272622329333f0
     @test q[43] ≈ 12.036342425160155f0
-    @test q[network.river.order[end]] ≈ 0.038439025755223954f0
+    @test q[network.river.order[end]] ≈ 0.03835913312643948f0
 end
 
 @testset "reservoir simple" begin
@@ -158,8 +158,8 @@ end
     q = model.lateral.river.q_av
     @test q[4009] ≈ 8.60480399680283f0 # pit/ outlet, CartesianIndex(141, 228)
     @test q[4020] ≈ 0.006779014715290862f0 # downstream of pit 4009, CartesianIndex(141, 229)
-    @test q[2508] ≈ 150.25451437462465f0 # pit/ outlet
-    @test q[5808] ≈ 0.1264630353304674f0 # pit/ outlet
+    @test q[2508] ≈ 150.15321264134985f0 # pit/ outlet
+    @test q[5808] ≈ 0.12625654862968252f0 # pit/ outlet
 end
 
 # test changing forcing and cyclic LAI parameter