From b2ff488c696d55f2241715b998efe1ee55d548a3 Mon Sep 17 00:00:00 2001 From: Willem van Verseveld Date: Tue, 26 Nov 2024 09:43:33 +0100 Subject: [PATCH] Rename couple of initialize functions Sediment For structs `SoilLoss`, `LandSediment` and `RiverSediment`. --- src/erosion.jl | 2 +- src/sediment_flux.jl | 4 ++-- src/sediment_model.jl | 7 +++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/erosion.jl b/src/erosion.jl index e61d95559..c6951587c 100644 --- a/src/erosion.jl +++ b/src/erosion.jl @@ -6,7 +6,7 @@ soil_erosion::SE end -function initialize_soil_loss(nc, config, inds) +function SoilLoss(nc, config, inds) n = length(inds) hydrometeo_forcing = HydrometeoForcing(n) diff --git a/src/sediment_flux.jl b/src/sediment_flux.jl index d62321dd9..bcb710170 100644 --- a/src/sediment_flux.jl +++ b/src/sediment_flux.jl @@ -9,7 +9,7 @@ rivers::Vector{Bool} | "-" end -function initialize_overland_flow_sediment(nc, config, inds, waterbodies, rivers) +function OverlandFlowSediment(nc, config, inds, waterbodies, rivers) n = length(inds) hydrometeo_forcing = HydrometeoForcing(n) geometry = LandGeometry(nc, config, inds) @@ -88,7 +88,7 @@ end waterbodies::Vector{Bool} | "-" end -function initialize_river_flow_sediment(nc, config, inds, waterbodies) +function RiverSediment(nc, config, inds, waterbodies) n = length(inds) hydrometeo_forcing = HydrometeoForcing(n) geometry = RiverGeometry(nc, config, inds) diff --git a/src/sediment_model.jl b/src/sediment_model.jl index 0db933ef3..3143b190a 100644 --- a/src/sediment_model.jl +++ b/src/sediment_model.jl @@ -28,7 +28,7 @@ function initialize_sediment_model(config::Config) reservoir = () lake = () - soilloss = initialize_soil_loss(nc, config, inds) + soilloss = SoilLoss(nc, config, inds) # Get waterbodies mask do_reservoirs = get(config.model, "doreservoir", false)::Bool @@ -64,8 +64,7 @@ function initialize_sediment_model(config::Config) ldd = ldd_2d[inds] # # lateral part sediment in overland flow - overland_flow_sediment = - initialize_overland_flow_sediment(nc, config, inds, waterbodies, river) + overland_flow_sediment = OverlandFlowSediment(nc, config, inds, waterbodies, river) graph = flowgraph(ldd, inds, pcr_dir) @@ -93,7 +92,7 @@ function initialize_sediment_model(config::Config) index_river = filter(i -> !isequal(river[i], 0), 1:n) frac_toriver = fraction_runoff_toriver(graph, ldd, index_river, landslope, n) - river_sediment = initialize_river_flow_sediment(nc, config, inds_riv, waterbodies) + river_sediment = RiverSediment(nc, config, inds_riv, waterbodies) modelmap = ( vertical = soilloss,