Skip to content

Commit

Permalink
Rename ksatprofile
Browse files Browse the repository at this point in the history
to `saturated_hydraulic_conductivity_profile`. Move this key from `config.vertical` to `config.model`.
  • Loading branch information
vers-w committed Dec 10, 2024
1 parent 26d80ab commit ef64378
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/routing/subsurface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ function LateralSsfParameters(
(; theta_s, theta_r, soilthickness) = soil
soilthickness = soilthickness .* 0.001

kh_profile_type = get(config.input, "ksat_profile", "exponential")::String
kh_profile_type = get(config.model, "saturated_hydraulic_conductivity_profile", "exponential")::String
dt = Second(config.timestepsecs) / basetimestep
if kh_profile_type == "exponential"
(; kv_0, f) = soil.kv_profile
Expand Down
2 changes: 1 addition & 1 deletion src/sbm_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ function initialize_sbm_model(config::Config)
y_length,
)
# update variables `ssf`, `ssfmax` and `kh` (layered profile) based on ksat_profile
kh_profile_type = get(config.input, "ksat_profile", "exponential")::String
kh_profile_type = get(config.model, "saturated_hydraulic_conductivity_profile", "exponential")::String
if kh_profile_type == "exponential" || kh_profile_type == "exponential_constant"
initialize_lateralssf!(subsurface_flow, subsurface_flow.parameters.kh_profile)
elseif kh_profile_type == "layered" || kh_profile_type == "layered_exponential"
Expand Down
8 changes: 4 additions & 4 deletions src/soil/soil.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function sbm_kv_profiles(
sumlayers,
dt,
)
kv_profile_type = get(config.input, "ksat_profile", "exponential")::String
kv_profile_type = get(config.model, "saturated_hydraulic_conductivity_profile", "exponential")::String
n = length(indices)
if kv_profile_type == "exponential"
kv_profile = KvExponential(kv_0, f)
Expand Down Expand Up @@ -268,9 +268,9 @@ function sbm_kv_profiles(
)
end
else
error("""An unknown "ksat_profile" is specified in the TOML file ($ksat_profile).
This should be "exponential", "exponential_constant", "layered" or
"layered_exponential".
error("""An unknown "saturated_hydraulic_conductivity_profile" is specified in the
TOML file ($ksat_profile). This should be "exponential",
"exponential_constant", "layered" or "layered_exponential".
""")
end
return kv_profile
Expand Down
6 changes: 3 additions & 3 deletions test/run_sbm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ Wflow.close_files(model; delete_output = false)
end

@testset "exponential constant profile" begin
config.input.ksat_profile = "exponential_constant"
config.model.saturated_hydraulic_conductivity_profile = "exponential_constant"
model = Wflow.initialize_sbm_model(config)
(; soil) = model.vertical
(; kv_profile) = soil.parameters
Expand All @@ -497,7 +497,7 @@ Wflow.close_files(model; delete_output = false)
end

@testset "layered profile" begin
config.input.ksat_profile = "layered"
config.model.saturated_hydraulic_conductivity_profile = "layered"
model = Wflow.initialize_sbm_model(config)
(; soil) = model.vertical
(; kv_profile) = soil.parameters
Expand All @@ -513,7 +513,7 @@ Wflow.close_files(model; delete_output = false)
end

@testset "layered exponential profile" begin
config.input.ksat_profile = "layered_exponential"
config.model.saturated_hydraulic_conductivity_profile = "layered_exponential"
model = Wflow.initialize_sbm_model(config)
(; soil) = model.vertical
(; kv_profile) = soil.parameters
Expand Down

0 comments on commit ef64378

Please sign in to comment.