Skip to content

Commit

Permalink
update thermal regulation function
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenwu0728 committed Aug 6, 2024
1 parent 6505052 commit eaca239
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
4 changes: 3 additions & 1 deletion src/Plankton/CarbonMode/growth_kernels.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
##### temperature function for photosynthesis
@inline function tempFunc_PS(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))*(1.0f0-exp(temp - p.Tmax))
x = temp - p.Topt; xmax = p.Tmax - p.Topt
regT = shape_func_dec(x, xmax, 4.0f0e-2)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0))) * regT
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return min(1.0f0, k/OGT_rate)
Expand Down
8 changes: 5 additions & 3 deletions src/Plankton/IronEnergyMode/growth_kernels.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
##### temperature function for photosynthesis
@inline function tempFunc_PS(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))*(1.0f0-exp(temp - p.Tmax))
x = temp - p.Topt; xmax = p.Tmax - p.Topt
regT = shape_func_dec(x, xmax, 4.0f0e-2)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0))) * regT
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### temperature function for nutrient uptakes
@inline function tempFunc(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### intracellular iron allocation to photosynthesis
Expand Down
8 changes: 5 additions & 3 deletions src/Plankton/MacroMolecularMode/growth_kernels.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
##### temperature function for photosynthesis
@inline function tempFunc_PS(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))*(1.0f0-exp(temp - p.Tmax))
x = temp - p.Topt; xmax = p.Tmax - p.Topt
regT = shape_func_dec(x, xmax, 4.0f0e-2)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0))) * regT
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### temperature function for nutrient uptakes
@inline function tempFunc(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### calculate photosynthesis rate (mmolC/individual/second)
Expand Down
8 changes: 5 additions & 3 deletions src/Plankton/QuotaMode/growth_kernels.jl
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
##### temperature function for photosynthesis
@inline function tempFunc_PS(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))*(1.0f0-exp(temp - p.Tmax))
x = temp - p.Topt; xmax = p.Tmax - p.Topt
regT = shape_func_dec(x, xmax, 4.0f0e-2)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0))) * regT
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### temperature function for nutrient uptakes
@inline function tempFunc(temp, p)
k = exp(-p.Ea/(8.3145f0*(temp+273.15f0)))
k = max(0.0f0, k)
OGT_rate = exp(-p.Ea/(8.3145f0*(p.Topt+273.15f0)))
return k/OGT_rate
return min(1.0f0, k/OGT_rate)
end

##### calculate photosynthesis rate (mmolC/individual/second)
Expand Down

0 comments on commit eaca239

Please sign in to comment.