Skip to content

Commit

Permalink
Merge pull request #662 from open-AIMS/connectivity-issues
Browse files Browse the repository at this point in the history
Clean up settler cover function to reduce confusion
  • Loading branch information
Rosejoycrocker authored Jan 29, 2024
2 parents a4727e0 + 0eaa038 commit 5322d85
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/ecosystem/corals/growth.jl
Original file line number Diff line number Diff line change
Expand Up @@ -684,20 +684,15 @@ function settler_cover(
valid_sinks::BitVector = vec(sum(conn, dims=1) .> 0.0)

# Send larvae out into the world (reuse potential_settlers to reduce allocations)
@floop for src in findall(valid_sources)
@views potential_settlers[:, valid_sinks] .+= (
fec_scope[:, src] .* conn[src, valid_sinks]'
)
end

# Note, conn rows need not sum to 1.0 as this missing probability accounts for larvae
# which do not settle. Pers comm with C. Ani (2023-01-29 13:24 AEST).
# [Larval pool for each location in larvae/m²] * [survival rate]
# this is known as in-water mortality.
# Set to 0.0 as it is now taken care of by connectivity data.
# Mwater::Float64 = 0.0
# @views potential_settlers[:, valid_sinks] .= (
# fec_scope[:, valid_sources]
# * TP_data[valid_sources, valid_sinks]
# ) .* (1.0 .- Mwater)
@views potential_settlers[:, valid_sinks] .= (
fec_scope[:, valid_sources] * conn[valid_sources, valid_sinks]
)

# Larvae have landed, work out how many are recruited
# Determine area covered by recruited larvae (settler cover) per m^2
Expand Down

0 comments on commit 5322d85

Please sign in to comment.