Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hmw ct jsw/pisces #198

Merged
merged 11 commits into from
Aug 6, 2024
1 change: 1 addition & 0 deletions src/BoxModel/boxmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ using Oceananigans.Biogeochemistry:

using Oceananigans.Fields: CenterField
using Oceananigans.TimeSteppers: tick!, TimeStepper
using Oceananigans: UpdateStateCallsite, TendencyCallsite

using OceanBioME: BoxModelGrid
using StructArrays, JLD2
Expand Down
13 changes: 7 additions & 6 deletions src/Models/AdvectedPopulations/PISCES/DOC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
eₘₐₓᴹ = bgc.max_growth_efficiency_of_zooplankton.M
mᴹ = bgc.zooplankton_quadratic_mortality.M
bₘ = bgc.temperature_sensitivity_term.M
return (1 - σᴹ - eₘₐₓᴹ)*(1/(1-eₘₐₓᴹ + eps(0.0)))*mᴹ*(bₘ^T)*M^2 #30b
return (1 - σᴹ)*mᴹ*(bₘ^T)*M^2 #30b
end

@inline function Pᵤₚ(M, T, bgc)
σᴹ = bgc.non_assimilated_fraction.M
eₘₐₓᴹ = bgc.max_growth_efficiency_of_zooplankton.M
mᴹ = bgc.zooplankton_quadratic_mortality.M
bₘ = bgc.temperature_sensitivity_term.M
return σᴹ*(1)/(1-eₘₐₓᴹ + eps(0.0))*mᴹ*bₘ^T*M^2 #30a
return σᴹ*mᴹ*(bₘ^T)*M^2 #30a
end


Expand Down Expand Up @@ -84,7 +84,7 @@ end
end


@inline function (bgc::PISCES)(::Val{:DOC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω)
@inline function (bgc::PISCES)(::Val{:DOC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³)
γᶻ = bgc.excretion_as_DOM.Z
γᴹ = bgc.excretion_as_DOM.M
σᶻ = bgc.non_assimilated_fraction.Z
Expand All @@ -95,6 +95,7 @@ end
eₘₐₓᴹ = bgc.max_growth_efficiency_of_zooplankton.M
αᴾ= bgc.initial_slope_of_PI_curve.P
αᴰ = bgc.initial_slope_of_PI_curve.D
wₚₒ = bgc.sinking_speed_of_POC

ϕ₀ = bgc.latitude
L_day_param = bgc.length_of_day
Expand All @@ -112,6 +113,7 @@ end
zₘₐₓ = max(zₑᵤ, zₘₓₗ) #41a
w_GOC = w_GOCᵐⁱⁿ + (200 - w_GOCᵐⁱⁿ)*(max(0, z-zₘₐₓ))/(5000) #41b
g_GOC_FFᴹ = g_FF*bₘ^T*w_GOC*GOC #29b
gₚₒ_FFᴹ = g_FF*bₘ^T*wₚₒ*POC

t_darkᴾ = bgc.mean_residence_time_of_phytoplankton_in_unlit_mixed_layer.P
t_darkᴰ = bgc.mean_residence_time_of_phytoplankton_in_unlit_mixed_layer.D
Expand All @@ -129,7 +131,6 @@ end
λₚₒ¹ = λ¹(T, O₂, bgc)
Rᵤₚᴹ = Rᵤₚ(M, T, bgc)

zₘₐₓ = max(zₑᵤ, zₘₓₗ) #35a
Bact = get_Bact(zₘₐₓ, z, Z, M)

bFe = Fe #defined in previous PISCES model
Expand All @@ -140,5 +141,5 @@ end

Φ₁ᴰᴼᶜ, Φ₂ᴰᴼᶜ, Φ₃ᴰᴼᶜ = Φᴰᴼᶜ(DOC, POC, GOC, sh, bgc)

return (1 - γᶻ)*(1 - eᶻ - σᶻ)*∑ᵢgᵢᶻ*Z + (1 - γᴹ)*(1 - eᴹ - σᴹ)*(∑ᵢgᵢᴹ + g_GOC_FFᴹ)*M + δᴰ*μᴰ*D + δᴾ*μᴾ*P + λₚₒ¹*POC + (1 - γᴹ)*Rᵤₚᴹ - Remin - Denit - Φ₁ᴰᴼᶜ - Φ₂ᴰᴼᶜ - Φ₃ᴰᴼᶜ #32
end
return (1 - γᶻ)*(1 - eᶻ - σᶻ)*∑ᵢgᵢᶻ*Z + (1 - γᴹ)*(1 - eᴹ - σᴹ)*(∑ᵢgᵢᴹ + g_GOC_FFᴹ + gₚₒ_FFᴹ)*M + δᴰ*μᴰ*D + δᴾ*μᴾ*P + λₚₒ¹*POC + (1 - γᴹ)*Rᵤₚᴹ - Remin - Denit - Φ₁ᴰᴼᶜ - Φ₂ᴰᴼᶜ - Φ₃ᴰᴼᶜ #32
end #changed this to include gₚₒ_FF
28 changes: 14 additions & 14 deletions src/Models/AdvectedPopulations/PISCES/PISCES.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@ Tracers
* Mesozooplankton: M (μmolC/L)
* Chlorophyll in nano-phytoplankton: Pᶜʰˡ (μgChl/L)
* Chlorophyll in diatoms: Dᶜʰˡ (μgChl/L)
* Iron in nano-phytoplanktons: Pᶠᵉ (pmolFe/L)
* Iron in diatoms: Dᶠᵉ (pmolFe/L)
* Iron in nano-phytoplanktons: Pᶠᵉ (nmolFe/L)
* Iron in diatoms: Dᶠᵉ (nmolFe/L)
* Silicon in diatoms: Dˢⁱ (μmolSi/L)

* Dissolved organic carbon: DOC (μmolC/L)
* Small sinking particles : POC (μmolC/L)
* Large sinking particles: GOC (μmolC/L)
* Iron in small particles: SFe (pmolFe/L)
* Iron in large particles: BFe (pmolFe/L)
* Iron in small particles: SFe (nmolFe/L)
* Iron in large particles: BFe (nmolFe/L)
* Silicate in large particles : PSi (μmolSi/L)
* Nitrates: NO₃ (μmolN/L)
* Ammonium: NH₄ (μmolN/L)
* Phosphate: PO₄ (μmolP/L)
* Dissolved iron: Fe (pmolFe/L)
* Dissolved iron: Fe (nmolFe/L)
* Silicate: Si (μmolSi/L)
* Calcite: CaCO₃ (μmolC/L)
* Dissolved oxygen: O₂ (μmolO₂/L)
Expand Down Expand Up @@ -474,7 +474,7 @@ end
non_assimilated_fraction :: ZM = (Z = 0.3, M = 0.3),
excretion_as_DOM :: ZM = (Z = 0.6, M = 0.6),
max_grazing_rate :: ZM = (Z = 3.0/day, M = 0.75/day), #1/d
flux_feeding_rate :: FT = 2.0e3, #(m mol L⁻¹)⁻¹
flux_feeding_rate :: FT = 2.0e-3, #(m mol L⁻¹)⁻¹
half_saturation_const_for_grazing :: ZM = (Z = 20.0, M = 20.0), #μmolCL⁻¹
preference_for_nanophytoplankton :: ZM = (Z = 1.0, M = 0.3),
preference_for_diatoms :: ZM = (Z = 0.5, M = 1.0),
Expand Down Expand Up @@ -625,8 +625,8 @@ function PISCES(; grid, # finally the function
min_half_saturation_const_for_iron_uptake :: PD = (P = 1.0, D = 3.0), #nmolFeL⁻¹
size_ratio_of_phytoplankton :: PD = (P = 3.0, D = 3.0),
optimal_SiC_uptake_ratio_of_diatoms :: FT = 0.159, #molSi/(mol C)
optimal_iron_quota :: PD = (P = 7.0, D = 7.0), #μmolFe/(mol C)
max_iron_quota :: PD = (P = 40.0, D = 40.0), #μmolFe/(mol C)
optimal_iron_quota :: PD = (P = 7.0, D = 7.0), #mmolFe/(mol C)
max_iron_quota :: PD = (P = 40.0, D = 40.0), #molFe/(mol C)
phytoplankton_mortality_rate :: PD = (P = 0.01/day, D = 0.01/day),
min_quadratic_mortality_of_phytoplankton :: FT = 0.01 / day, #1/(d mol C)
max_quadratic_mortality_of_diatoms :: FT = 0.03 / day, #1/(d mol C)
Expand All @@ -643,7 +643,7 @@ function PISCES(; grid, # finally the function
non_assimilated_fraction :: ZM = (Z = 0.3, M = 0.3),
excretion_as_DOM :: ZM = (Z = 0.6, M = 0.6),
max_grazing_rate :: ZM = (Z = 3.0/day, M = 0.75/day), #1/d
flux_feeding_rate :: FT = 2.0e3, #(m mol L⁻¹)⁻¹
flux_feeding_rate :: FT = 2.0e-3, #(m mol L⁻¹)⁻¹
half_saturation_const_for_grazing :: ZM = (Z = 20.0, M = 20.0), #μmolCL⁻¹
preference_for_nanophytoplankton :: ZM = (Z = 1.0, M = 0.3),
preference_for_diatoms :: ZM = (Z = 0.5, M = 1.0),
Expand All @@ -656,8 +656,8 @@ function PISCES(; grid, # finally the function
zooplankton_linear_mortality :: ZM = (Z = 0.03/day, M = 0.005/day), #1/d
half_saturation_const_for_mortality :: FT = 0.2, #μmolCL⁻¹
fraction_of_calcite_not_dissolving_in_guts :: ZM = (Z = 0.5, M = 0.75),
FeC_ratio_of_zooplankton :: FT = 10.0, #μmolFe molC⁻¹
FeZ_redfield_ratio :: FT = 3.0, #μmolFe molC⁻¹
FeC_ratio_of_zooplankton :: FT = 10.0e-3, #mmolFe molC⁻¹
FeZ_redfield_ratio :: FT = 3.0e-3, #mmolFe molC⁻¹, remove this, is actually FeC_ratio_of_zooplankton


remineralisation_rate_of_DOC :: FT = 0.3 / day, #1/d
Expand All @@ -678,7 +678,7 @@ function PISCES(; grid, # finally the function
min_sinking_speed_of_GOC :: FT = 30.0 / day, #md⁻¹
sinking_speed_of_dust :: FT = 2.0, #ms⁻¹
aggregation_rate_of_POC_to_GOC_6 :: FT = 25.9 / day, #(μmolCL⁻¹)⁻¹d⁻¹
aggregation_rate_of_POC_to_GOC_7 :: FT = 4452 / day, #(μmolCL⁻¹)⁻¹d⁻¹
aggregation_rate_of_POC_to_GOC_7 :: FT = 4452.0 / day, #(μmolCL⁻¹)⁻¹d⁻¹
aggregation_rate_of_POC_to_GOC_8 :: FT = 3.3 / day, #(μmolCL⁻¹)⁻¹d⁻¹
aggregation_rate_of_POC_to_GOC_9 :: FT = 47.1 / day, #(μmolCL⁻¹)⁻¹d⁻¹
min_scavenging_rate_of_iron :: FT = 3.0e-5 / day, #1/d
Expand Down Expand Up @@ -892,11 +892,11 @@ function PISCES(; grid, # finally the function
modifiers)
end

@inline biogeochemical_auxiliary_fields(bgc::PISCES) = (zₘₓₗ = bgc.mixed_layer_depth, zₑᵤ = bgc.euphotic_layer_depth, Si̅ = bgc.yearly_maximum_silicate, D_dust = bgc.dust_deposition, PAR¹ = ConstantField(100), PAR² = ConstantField(100), PAR³ = ConstantField(100), Ω = bgc.carbonate_sat_ratio)
@inline biogeochemical_auxiliary_fields(bgc::PISCES) = (zₘₓₗ = bgc.mixed_layer_depth, zₑᵤ = bgc.euphotic_layer_depth, Si̅ = bgc.yearly_maximum_silicate, D_dust = bgc.dust_deposition, Ω = bgc.carbonate_sat_ratio)

@inline required_biogeochemical_tracers(::PISCES) = (:P, :D, :Z, :M, :Pᶜʰˡ, :Dᶜʰˡ, :Pᶠᵉ, :Dᶠᵉ, :Dˢⁱ, :DOC, :POC, :GOC, :SFe, :BFe, :PSi, :NO₃, :NH₄, :PO₄, :Fe, :Si, :CaCO₃, :DIC, :Alk, :O₂, :T) # list all the parameters here, also if you need T and S put them here too

@inline required_biogeochemical_auxiliary_fields(::PISCES) = (:PAR, :PAR¹, :PAR², :PAR³, :zₘₓₗ, :zₑᵤ, :Si̅, :D_dust, :Ω)
@inline required_biogeochemical_auxiliary_fields(::PISCES) = (:zₘₓₗ, :zₑᵤ, :Si̅, :D_dust, :Ω, :PAR, :PAR¹, :PAR², :PAR³, )

# for sinking things like POM this is how we tell oceananigans ther sinking speed
@inline function biogeochemical_drift_velocity(bgc::PISCES, ::Val{tracer_name}) where tracer_name
Expand Down
17 changes: 10 additions & 7 deletions src/Models/AdvectedPopulations/PISCES/POC_and_GOC.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@

# This documeent contains functions for:
# Φ, POC, GOC

@inline function get_Φ(POC, GOC, sh, bgc)
a₆ = bgc.aggregation_rate_of_POC_to_GOC_6
a₇ = bgc.aggregation_rate_of_POC_to_GOC_7
Expand All @@ -7,11 +11,10 @@
return sh*a₆*POC^2 + sh*a₇*POC*GOC + a₈*POC*GOC + a₉*POC^2 #39
end

@inline function (bgc::PISCES)(::Val{:POC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω)
@inline function (bgc::PISCES)(::Val{:POC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³)
σᶻ = bgc.non_assimilated_fraction.Z
mᴾ = bgc.phytoplankton_mortality_rate.P
mᴾ, mᴰ = bgc.phytoplankton_mortality_rate
mᶻ = bgc.zooplankton_quadratic_mortality.Z
mᴰ = bgc.phytoplankton_mortality_rate.D
wᴾ = bgc.min_quadratic_mortality_of_phytoplankton
wₚₒ = bgc.sinking_speed_of_POC
rᶻ = bgc.zooplankton_linear_mortality.Z
Expand All @@ -31,13 +34,13 @@ end
Φ₃ᴰᴼᶜ = Φᴰᴼᶜ(DOC, POC, GOC, sh, bgc)[3]

gₚₒᴹ = get_grazingᴹ(P, D, Z, POC, T, bgc)[4]
gₚₒ_FFᴹ = g_FF*bₘ^T*wₚₒ*POC #29a
gₚₒ_FFᴹ = g_FF*(bₘ^T)*wₚₒ*POC #29a
Φ = get_Φ(POC, GOC, sh, bgc)

return σᶻ*∑gᶻ*Z + 0.5*mᴰ*K_mondo(D, Kₘ) + rᶻ*b_Z^T*K_mondo(Z, Kₘ)*Z + mᶻ*b_Z^T*Z^2 + (1 - 0.5*R_CaCO₃)*(mᴾ*K_mondo(P, Kₘ)*P + wᴾ*P^2) + λₚₒ¹*GOC + Φ₁ᴰᴼᶜ + Φ₃ᴰᴼᶜ - (gₚₒᴹ + gₚₒ_FFᴹ)*M - gₚₒᶻ*Z - λₚₒ¹*POC - Φ #37
return σᶻ*∑gᶻ*Z + 0.5*mᴰ*K_mondo(D, Kₘ)*D + rᶻ*(b_Z^T)*(K_mondo(Z, Kₘ) + 3*ΔO₂(O₂, bgc))*Z + mᶻ*(b_Z^T)*Z^2 + (1 - 0.5*R_CaCO₃)*(mᴾ*K_mondo(P, Kₘ)*P + wᴾ*P^2) + λₚₒ¹*GOC + Φ₁ᴰᴼᶜ + Φ₃ᴰᴼᶜ - (gₚₒᴹ + gₚₒ_FFᴹ)*M - gₚₒᶻ*Z - λₚₒ¹*POC - Φ #37
end

@inline function (bgc::PISCES)(::Val{:GOC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω)
@inline function (bgc::PISCES)(::Val{:GOC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³)
σᴹ = bgc.non_assimilated_fraction.M
mᴾ = bgc.phytoplankton_mortality_rate.P
mᴰ = bgc.phytoplankton_mortality_rate.D
Expand Down Expand Up @@ -74,5 +77,5 @@ end
#println("Total change is ", σᴹ*(∑gᴹ + ∑g_FFᴹ)*M + rᴹ*bₘ^T*K_mondo(M, Kₘ)*M + Pᵤₚᴹ + 0.5*R_CaCO₃*(mᴾ*K_mondo(P, Kₘ)*P + wᴾ*P^2) + 0.5*mᴰ*K_mondo(D, Kₘ)*D^2*wᴰ + Φ + Φ₂ᴰᴼᶜ - g_GOC_FFᴹ*M - λₚₒ¹*GOC )
#println("-------------------------------------")

return σᴹ*(∑gᴹ + ∑g_FFᴹ)*M + rᴹ*bₘ^T*K_mondo(M, Kₘ)*M + Pᵤₚᴹ + 0.5*R_CaCO₃*(mᴾ*K_mondo(P, Kₘ)*P + wᴾ*P^2) + 0.5*mᴰ*K_mondo(D, Kₘ)*D + D^2*wᴰ + Φ + Φ₂ᴰᴼᶜ - g_GOC_FFᴹ*M - λₚₒ¹*GOC #40 assumed that there is a typo in the D^2 instead of D^3
return σᴹ*(∑gᴹ + ∑g_FFᴹ)*M + rᴹ*bₘ^T*(K_mondo(M, Kₘ) + 3*ΔO₂(O₂, bgc))*M + Pᵤₚᴹ + 0.5*R_CaCO₃*(mᴾ*K_mondo(P, Kₘ)*P + wᴾ*P^2) + 0.5*mᴰ*K_mondo(D, Kₘ)*D + D^2*wᴰ + Φ + Φ₂ᴰᴼᶜ - g_GOC_FFᴹ*M - λₚₒ¹*GOC #40 assumed that there is a typo in the D^2 instead of D^3
end
4 changes: 2 additions & 2 deletions src/Models/AdvectedPopulations/PISCES/calcite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
Lₙᴾ = Lᴾ(P, PO₄, NO₃, NH₄, Pᶜʰˡ, Pᶠᵉ, bgc)[5]
Kₙₕ₄ᴾ = Kᵢᴶ(Kₙₕ₄ᴾᵐⁱⁿ, P₁, P₂, Sᵣₐₜᴾ)
Lₗᵢₘᶜᵃᶜᵒ³ = min(Lₙᴾ, K_mondo(Fe, 6e-11), K_mondo(PO₄, Kₙₕ₄ᴾ))
return r_CaCO₃*Lₗᵢₘᶜᵃᶜᵒ³*T*max(1, P/2)*max(0, PAR - 1)*30*(1 + exp((-(T-10)^2)/25))*min(1, 50/zₘₓₗ + eps(0.0))/((0.1 + T)*(4 + PAR)*(30 + PAR)) #eq77
return r_CaCO₃*Lₗᵢₘᶜᵃᶜᵒ³*T*max(1, P/2)*max(0, PAR - 1)*30*(1 + exp((-(T-10)^2)/25))*min(1, 50/(zₘₓₗ + eps(0.0)))/((0.1 + T)*(4 + PAR)*(30 + PAR)) #eq77
end

@inline function P_CaCO₃(P, PO₄, NO₃, NH₄, Pᶜʰˡ, Pᶠᵉ, Fe, D, Z, M, POC, T, PAR, zₘₓₗ, z, bgc)
Expand All @@ -38,7 +38,7 @@ end
return get_R_CaCO₃(P, PO₄, NO₃, NH₄, Pᶜʰˡ, Pᶠᵉ, Fe, T, PAR, zₘₓₗ, bgc)*(ηᶻ*get_grazingᶻ(P, D, POC, T, bgc)[2]*Z+ηᴹ*get_grazingᴹ(P, D, Z, POC, T, bgc)[2]*M + 0.5*(mᴾ*K_mondo(P, Kₘ)*P + sh*wᴾ*P^2)) #eq76
end

@inline function (bgc::PISCES)(::Val{:CaCO₃}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω)
@inline function (bgc::PISCES)(::Val{:CaCO₃}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³)

return P_CaCO₃(P, PO₄, NO₃, NH₄, Pᶜʰˡ, Pᶠᵉ, Fe, D, Z, M, POC, T, PAR, zₘₓₗ, z, bgc) - λ_CaCO₃¹(CaCO₃, bgc, Ω)*CaCO₃ #partial derivative omitted as sinking is accounted for in other parts of model
end
4 changes: 2 additions & 2 deletions src/Models/AdvectedPopulations/PISCES/carbonate_system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#Forcing for DIC.
#Forcing for Alk.

@inline function (bgc::PISCES)(::Val{:DIC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω)
@inline function (bgc::PISCES)(::Val{:DIC}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³)
#Parameters
γᶻ = bgc.excretion_as_DOM.Z
σᶻ = bgc.non_assimilated_fraction.Z
Expand Down Expand Up @@ -48,7 +48,7 @@
return γᶻ*(1 - eᶻ - σᶻ)*∑gᶻ*Z + γᴹ*(1 - eᴹ - σᴹ)*(∑gᴹ + ∑g_FFᴹ)*M + γᴹ*Rᵤₚ(M, T, bgc) + get_Remin(O₂, NO₃, PO₄, NH₄, DOC, T, bFe, Bact, bgc) + get_Denit(NO₃, PO₄, NH₄, DOC, O₂, T, bFe, Bact, bgc) + λ_CaCO₃¹(CaCO₃, bgc, Ω)*CaCO₃ - P_CaCO₃(P, PO₄, NO₃, NH₄, Pᶜʰˡ, Pᶠᵉ, Fe, D, Z, M, POC, T, PAR, zₘₓₗ, z, bgc) - μᴰ*D - μᴾ*P #eq59
end

@inline function (bgc::PISCES)(::Val{:Alk}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, PAR, PAR¹, PAR², PAR³, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω) # eq59
@inline function (bgc::PISCES)(::Val{:Alk}, x, y, z, t, P, D, Z, M, Pᶜʰˡ, Dᶜʰˡ, Pᶠᵉ, Dᶠᵉ, Dˢⁱ, DOC, POC, GOC, SFe, BFe, PSi, NO₃, NH₄, PO₄, Fe, Si, CaCO₃, DIC, Alk, O₂, T, zₘₓₗ, zₑᵤ, Si̅, D_dust, Ω, PAR, PAR¹, PAR², PAR³) # eq59
#Parameters
θᴺᶜ = bgc.NC_redfield_ratio
rₙₒ₃¹ = bgc. CN_ratio_of_denitrification
Expand Down
Loading
Loading