Skip to content

Commit e2b0d05

Browse files
authored
add Bacteria in CarbonMode (#85)
Add bacteria in CarbonMode, which light is not required for growth.
1 parent 387033f commit e2b0d05

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/Parameters/param_default.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ function phyt_params_default(N::Int64, mode::CarbonMode)
300300
"grazFracC" => [0.7], # Fraction goes into dissolved organic pool
301301
"mortFracC" => [0.5], # Fraction goes into dissolved organic pool
302302
"thermal" => [1.0], # thermal damage, 1 for on, 0 for off
303+
"is_bact" => [0.0], # is this specis bacteria or not, 1 for bacteria, 0 for phytoplankton
303304
)
304305

305306
if N == 1

src/Plankton/CarbonMode/growth_kernels.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,9 @@ end
2828
##### calculate photosynthesis rate (mmolC/individual/second)
2929
@inline function calc_photosynthesis(par, T, Chl, Bm, Bd, p)
3030
αI = par * p.α * p.Φ
31-
if p.thermal == 1.0f0
32-
PCm = p.PCmax * tempFunc(T, p)
33-
else
34-
PCm = p.PCmax * tempFunc_PS(T, p)
35-
end
36-
PS = PCm * (1.0f0 - exp(-αI / max(1.0f-30, PCm) * Chl / max(1.0f-30, Bm))) * max(0.0f0, Bm - Bd)
31+
PCm = p.PCmax * (tempFunc(temp, p) * p.thermal + tempFunc_PS(temp, p) * (1.0f0 - p.thermal))
32+
light_limit = 1.0f0 - exp(-αI / max(1.0f-30, PCm) * Chl / max(1.0f-30, Bm))
33+
PS = PCm * max(0.0f0, Bm - Bd) * (light_limit * (1.0f0 - p.is_bact) + p.is_bact)
3734
return PS
3835
end
3936

src/Plankton/CarbonMode/plankton_generation.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ function construct_plankton(arch::Architecture, sp::Int, params::Dict, maxN::Int
1212
data = replace_storage(array_type(arch), rawdata)
1313

1414
param_names=(:Nsuper, :Cquota, :mean, :var, , , :Topt, :Tmax, :Ea, :PCmax, :Chl2C, :respir, :f_T2B,
15-
:grz_P, :dvid_type, :dvid_P, :dvid_reg, :dvid_reg2, :mort_P, :mort_reg, :grazFracC, :mortFracC, :thermal)
15+
:grz_P, :dvid_type, :dvid_P, :dvid_reg, :dvid_reg2, :mort_P, :mort_reg, :grazFracC, :mortFracC,
16+
:thermal, :is_bact)
1617

1718
pkeys = collect(keys(params))
1819
tmp = zeros(length(param_names))

0 commit comments

Comments
 (0)