Skip to content

Commit

Permalink
fix a bug in thermal damage
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenwu0728 committed Oct 22, 2023
1 parent cca9933 commit 635c227
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Plankton/CarbonMode/growth_kernels.jl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ end
##### calculate thermal damage rate (mmolC/individual/second)
@kernel function calc_thermal_damage_kernel!(plank, T, p)
i = @index(Global)
@inbounds plank.TD[i] = (T[i] - p.Topt) * p.f_T2B * isless(p.Topt, T[i]) * isless(0.0, p.thermal)
@inbounds plank.TD[i] = (T[i] - p.Topt) * p.f_T2B *
isless(p.Topt, T[i]) *
isless(plank.Bd[i], plank.Bm[i]) *
isless(0.0, p.thermal)
end
function calc_thermal_damage!(plank, T, p, arch)
kernel! = calc_thermal_damage_kernel!(device(arch), 256, (size(plank.ac, 1)))
Expand Down

0 comments on commit 635c227

Please sign in to comment.