Skip to content

Commit

Permalink
bug fix & remove unused parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenwu0728 committed May 14, 2024
1 parent 548136e commit a188468
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
10 changes: 2 additions & 8 deletions src/Parameters/param_default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Plankton/MacroMolecularMode/plankton_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
15 changes: 8 additions & 7 deletions src/Plankton/QuotaMode/plankton_generation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit a188468

Please sign in to comment.