Skip to content

Commit

Permalink
Merge pull request #28 from open-AIMS/zero-growth
Browse files Browse the repository at this point in the history
allow for zero growth
  • Loading branch information
Zapiano authored Aug 22, 2024
2 parents 4ec5920 + a7ed0e1 commit 689cc9b
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions src/timestep.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ function transfer_and_grow!(
prev_growth_rate::Float64,
next_growth_rate::Float64,
)::Nothing
if prev_growth_rate == 0.0
return nothing
end

transfer_blocks!(
prev_class,
Expand All @@ -479,6 +482,9 @@ function transfer_and_grow!(
terminal::TerminalClass,
growth_rate::Float64,
)::Nothing
if growth_rate == 0.0
return nothing
end

transfer_blocks!(
prev_class,
Expand Down Expand Up @@ -579,14 +585,16 @@ function timestep!(
)
end

merge_transfer!(
functional_group.size_classes[1],
functional_group.size_classes[2],
growth_rate[1],
growth_rate[2]
)
_apply_internal_growth!(functional_group.size_classes[1], growth_rate[1])
remove_outgrown!(functional_group.size_classes[1])
if growth_rate[1] != 0.0
merge_transfer!(
functional_group.size_classes[1],
functional_group.size_classes[2],
growth_rate[1],
growth_rate[2]
)
_apply_internal_growth!(functional_group.size_classes[1], growth_rate[1])
remove_outgrown!(functional_group.size_classes[1])
end

# Add recruits cover block only when there are recruits
if recruits > 0.0
Expand Down

0 comments on commit 689cc9b

Please sign in to comment.