From a188468788a3fce961c1e65d6525b3cb0ced8875 Mon Sep 17 00:00:00 2001 From: Zhen Wu Date: Tue, 14 May 2024 15:19:59 -0400 Subject: [PATCH] bug fix & remove unused parameters --- src/Parameters/param_default.jl | 10 ++-------- .../MacroMolecularMode/plankton_generation.jl | 2 +- src/Plankton/QuotaMode/plankton_generation.jl | 15 ++++++++------- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/Parameters/param_default.jl b/src/Parameters/param_default.jl index 305a9fa2..52f17f7a 100644 --- a/src/Parameters/param_default.jl +++ b/src/Parameters/param_default.jl @@ -106,11 +106,8 @@ function phyt_params_default(N::Int64, mode::MacroMolecularMode) "KsatPO4" => [0.003], # Half-saturation coeff (mmol P/m³) "KsatDOC" => [0.0], # Half-saturation coeff (mmol C/m³) "NSTmax" => [0.12], # Maximum N reserve in total N (mmol N/mmol N) - "NSTmin" => [0.01], # Minimum N reserve in total N (mmol N/mmol N) "PSTmax" => [0.70], # Maximum P reserve in total P (mmol P/mmol P) - "PSTmin" => [0.40], # Minimum P reserve in total P (mmol P/mmol P) "CHmax" => [0.4], # Maximum Carbohydrate in cell (mmol C/mmol C) - "CHmin" => [0.1], # Minimum Carbohydrate in cell (mmol C/mmol C) "respir" => [1.2e-6], # Respiration rate(per second) "k_pro" => [6.0e-5], # Protein synthesis rate (mmol C/mmol C/second) "k_sat_pro"=> [4.5e-13], # Hafl saturation constent for protein synthesis (mmol C/cell) @@ -168,12 +165,9 @@ function phyt_params_default(N::Int64, mode::QuotaMode) "KsatNO3" => [0.010], # Half-saturation coeff (mmol N/m³) "KsatPO4" => [0.003], # Half-saturation coeff (mmol P/m³) "KsatDOC" => [0.0], # Half-saturation coeff (mmol C/m³) - "Nqmax" => [0.12], # Maximum N quota in cell (mmol N/mmol C) - "Nqmin" => [0.05], # Minimum N quota in cell (mmol N/mmol C) - "Pqmax" => [0.01], # Maximum P quota in cell (mmol P/mmol C) - "Pqmin" => [0.004], # Minimum P quota in cell (mmol P/mmol C) + "Nqmax" => [0.25], # Maximum N quota in cell (mmol N/mmol C) + "Pqmax" => [0.02], # Maximum P quota in cell (mmol P/mmol C) "Cqmax" => [0.4], # Maximum C quota in cell (mmol C/mmol C) - "Cqmin" => [0.1], # Minimum C quota in cell (mmol C/mmol C) "k_mtb" => [3.5e-5], # Metabolic rate (per second) "respir" => [1.2e-6], # Respiration rate(per second) "Chl2N" => [3.0], # Maximum Chla:N ratio in phytoplankton diff --git a/src/Plankton/MacroMolecularMode/plankton_generation.jl b/src/Plankton/MacroMolecularMode/plankton_generation.jl index 203be93c..a2d88c23 100644 --- a/src/Plankton/MacroMolecularMode/plankton_generation.jl +++ b/src/Plankton/MacroMolecularMode/plankton_generation.jl @@ -16,7 +16,7 @@ function construct_plankton(arch::Architecture, sp::Int, params::Dict, maxN::Int param_names=(:Nsuper, :C_DNA, :var, :PRO2DNA, :RNA2DNA, :CH2DNA, :Chl2DNA, :α, :Φ, :Topt, :Tmax, :Ea, :PCmax, :VDOCmax, :VNO3max, :VNH4max, :VPO4max, :KsatDOC, :KsatNH4, :KsatNO3, - :KsatPO4, :CHmax, :CHmin, :NSTmax, :NSTmin, :PSTmax, :PSTmin, + :KsatPO4, :CHmax, :NSTmax, :PSTmax, :Chl2N, :R_NC_PRO, :R_NC_DNA, :R_NC_RNA, :R_PC_DNA, :R_PC_RNA, :respir, :k_pro, :k_sat_pro, :k_rna, :k_sat_rna, :k_dna, :k_sat_dna, :dvid_P, :grz_P, :mort_P, :mort_reg, :grazFracC, :grazFracN, :grazFracP, diff --git a/src/Plankton/QuotaMode/plankton_generation.jl b/src/Plankton/QuotaMode/plankton_generation.jl index bb0c9ca8..a799394a 100644 --- a/src/Plankton/QuotaMode/plankton_generation.jl +++ b/src/Plankton/QuotaMode/plankton_generation.jl @@ -14,7 +14,7 @@ function construct_plankton(arch::Architecture, sp::Int, params::Dict, maxN::Int param_names=(:Nsuper, :Cquota, :mean, :var, :Chl2Cint, :α, :Φ, :Topt, :Tmax, :Ea, :PCmax, :VDOCmax, :VNO3max, :VNH4max, :VPO4max, - :KsatDOC, :KsatNH4, :KsatNO3, :KsatPO4, :Cqmax, :Cqmin, :Nqmax, :Nqmin, :Pqmax, :Pqmin, + :KsatDOC, :KsatNH4, :KsatNO3, :KsatPO4, :Cqmax, :Nqmax, :Pqmax, :Chl2N, :R_NC, :R_PC, :k_mtb, :respir, :grz_P, :dvid_type, :dvid_P, :dvid_reg, :dvid_reg2, :mort_P, :mort_reg, :grazFracC, :grazFracN, :grazFracP, :mortFracC, :mortFracN, :mortFracP, :ther_mort) @@ -37,11 +37,10 @@ function generate_plankton!(plank, N::Int, g::AbstractGrid, arch::Architecture) Cquota = plank.p.Cquota Nsuper = plank.p.Nsuper cqmax = plank.p.Cqmax - cqmin = plank.p.Cqmin nqmax = plank.p.Nqmax - nqmin = plank.p.Nqmin pqmax = plank.p.Pqmax - pqmin = plank.p.Pqmin + R_NC = plank.p.R_NC + R_PC = plank.p.R_PC Chl2Cint = plank.p.Chl2Cint plank.data.ac[1:N] .= 1.0f0 # activity @@ -62,9 +61,11 @@ function generate_plankton!(plank, N::Int, g::AbstractGrid, arch::Architecture) plank.data.iS .= max.(1.0f0, plank.data.iS .* var .+ mean) .* plank.data.ac # init_size plank.data.Sz .= copy(plank.data.iS) # size plank.data.Bm .= Cquota .* plank.data.Sz .* Nsuper # Bm - plank.data.Cq .=(plank.data.Cq .* (cqmax - cqmin) .+ cqmin) .* plank.data.Bm # Cq - plank.data.Nq .=(plank.data.Nq .* (nqmax - nqmin) .+ nqmin) .* plank.data.Bm # Nq - plank.data.Pq .=(plank.data.Pq .* (pqmax - pqmin) .+ pqmin) .* plank.data.Bm # Pq + plank.data.Cq .=plank.data.Cq .* cqmax .* plank.data.Bm # Cq + plank.data.Nq .=plank.data.Nq .* (nqmax .* (plank.data.Bm .+ plank.data.Cq) .- + plank.data.Bm .* R_NC) # Nq + plank.data.Pq .=plank.data.Pq .* (pqmax .* (plank.data.Bm .+ plank.data.Cq) .- + plank.data.Bm .* R_PC) # Nq plank.data.Chl .= plank.data.Bm .* Chl2Cint # Chl mask_individuals!(plank.data, g, N, arch)