Skip to content

Commit

Permalink
bug fix in cell division again
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenwu0728 committed Oct 19, 2024
1 parent 44814bb commit 6446c36
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/Plankton/CarbonMode/division_death.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,6 @@ function divide!(plank, nuts, deactive_ind, arch::Architecture)
get_tind!(plank.idx, plank.dvid, nuts.idc_int, deactive_ind, arch)
copy_daughter_individuals!(plank, plank.dvid, plank.idx, arch)
divide_to_half!(plank, arch)
plank.idx .= 0
return nothing
end
1 change: 0 additions & 1 deletion src/Plankton/CarbonMode/plankton_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ function plankton_update!(plank, nuts, rnd, p, plk, diags_spcs, ΔT, t, arch::Ar
throw(ArgumentError("number of individual exceeds the capacity at timestep $(t/86400.0) days"))
end
divide!(plank, nuts, deactive_ind, arch)
nuts.idc .= 0
end

##### diagnostic for individual distribution
Expand Down
3 changes: 2 additions & 1 deletion src/Plankton/IronEnergyMode/division_death.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function divide!(plank, nuts, deactive_ind, arch::Architecture)
nuts.idc_int .= unsafe_trunc.(Int, nuts.idc)
get_tind!(plank.idx, plank.dvid, nuts.idc_int, deactive_ind, arch)
copy_daughter_individuals!(plank, plank.dvid, plank.idx, arch)
divide_to_half!(plank, arch)
divide_to_half!(plank, arch)
plank.idx .= 0
return nothing
end
1 change: 0 additions & 1 deletion src/Plankton/IronEnergyMode/plankton_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function plankton_update!(plank, nuts, rnd, p, plk, diags_spcs, ΔT, t, arch::Ar
throw(ArgumentError("number of individual exceeds the capacity at timestep $(t/86400.0) days"))
end
divide!(plank, nuts, deactive_ind, arch)
nuts.idc .= 0
end

##### diagnostic for individual distribution
Expand Down
1 change: 1 addition & 0 deletions src/Plankton/MacroMolecularMode/division_death.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,6 @@ function divide!(plank, nuts, deactive_ind, arch::Architecture)
get_tind!(plank.idx, plank.dvid, nuts.idc_int, deactive_ind, arch)
copy_daughter_individuals!(plank, plank.dvid, plank.idx, arch)
divide_to_half!(plank, arch)
plank.idx .= 0
return nothing
end
1 change: 0 additions & 1 deletion src/Plankton/MacroMolecularMode/plankton_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function plankton_update!(plank, nuts, rnd, p, plk, diags_spcs, ΔT, t, arch::Ar
throw(ArgumentError("number of individual exceeds the capacity at timestep $(t/86400.0) days"))
end
divide!(plank, nuts, deactive_ind, arch)
nuts.idc .= 0
end

##### diagnostic for individual distribution
Expand Down
3 changes: 2 additions & 1 deletion src/Plankton/QuotaMode/division_death.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function divide!(plank, nuts, deactive_ind, arch::Architecture)
nuts.idc_int .= unsafe_trunc.(Int, nuts.idc)
get_tind!(plank.idx, plank.dvid, nuts.idc_int, deactive_ind, arch)
copy_daughter_individuals!(plank, plank.dvid, plank.idx, arch)
divide_to_half!(plank, arch)
divide_to_half!(plank, arch)
plank.idx .= 0
return nothing
end
1 change: 0 additions & 1 deletion src/Plankton/QuotaMode/plankton_update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function plankton_update!(plank, nuts, rnd, p, plk, diags_spcs, ΔT, t, arch::Ar
throw(ArgumentError("number of individual exceeds the capacity at timestep $(t/86400.0) days"))
end
divide!(plank, nuts, deactive_ind, arch)
nuts.idc .= 0
end

##### diagnostic for individual distribution
Expand Down

0 comments on commit 6446c36

Please sign in to comment.