Skip to content

Commit

Permalink
Rename couple of initialize functions Sediment
Browse files Browse the repository at this point in the history
For structs `SoilLoss`, `LandSediment` and `RiverSediment`.
  • Loading branch information
vers-w committed Nov 26, 2024
1 parent c53fa36 commit b2ff488
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/erosion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/sediment_flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions src/sediment_model.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b2ff488

Please sign in to comment.