Skip to content

Commit

Permalink
remove the Input MOM
Browse files Browse the repository at this point in the history
  • Loading branch information
kdorheim committed Aug 31, 2023
1 parent 31fe0bf commit 05259ce
Show file tree
Hide file tree
Showing 18 changed files with 28 additions and 31 deletions.
4 changes: 2 additions & 2 deletions R/model_componet.R
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ carbon_pool_derivs <-
# POM = particulate organic carbon
dPOM <- (1 - p[["g_d"]]) * F6 - F2 + p[["Input_POM"]]
# MOM = mineral-associated organic carbon (MOC)
dMOM <- (1 - p[["f_d"]]) * F2 - F3 + p[["Input_MOM"]]
dMOM <- (1 - p[["f_d"]]) * F2 - F3
# QOMO = active layer of MOC
dQOM <- F4 - F5
# MB = microbial biomass carbon
Expand All @@ -145,7 +145,7 @@ carbon_pool_derivs <-
# IC = inorganic carbon (CO2)
dIC <- F1 * (1 - p[["CUE"]])
# Tot = the total carbon pool
dTot <- -F1 * (1 - p[["CUE"]]) + (p[["Input_POM"]] + p[["Input_DOM"]] + p[["Input_MOM"]])
dTot <- -F1 * (1 - p[["CUE"]]) + (p[["Input_POM"]] + p[["Input_DOM"]])

# Return outputs
return(list(c(dPOM, dMOM, dQOM, dMB, dDOM, dEP, dEM, dIC, dTot)))
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ print(MEND_model)
#> 16 dd_beta strength of density dependent microbial decay
#> 17 Input_POM POM input
#> 18 Input_DOM DOM input
#> 19 Input_MOM MOM input
#> 20 CUE carbon use efficiency
#> 19 CUE carbon use efficiency
#> units value
#> 1 mgC mgC^-1 h^-1 14.000
#> 2 mgC / g soil 50.000
Expand All @@ -115,8 +114,7 @@ print(MEND_model)
#> 16 <NA> 1.000
#> 17 mg C 0.000
#> 18 mg C 0.000
#> 19 mg C 0.000
#> 20 0.400
#> 19 0.400
#>
#> $state
#> POM MOM QOM MB DOM EP EM IC
Expand Down
39 changes: 19 additions & 20 deletions data-raw/default_params.csv
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
parameter,description,units,value
V_p,maximum specific decomposition rate for POM by EP,mgC mgC^-1 h^-1,14
K_p,half-saturation constant for decomposition of POM,mgC / g soil,50
V_m,maximum specific decomposition rate for MOM by EM,mgC mgC^-1 h^-1,0.25
K_m,half-saturation constant for decomposition of MOM,mg C/g soil,250
V_d,maximum specific uptake rate of D for growth of MB,mgC mgC^-1 h^-1,3.00E+00
K_d,half-saturation constant of uptake of D for growth of MB,mg C/g soil,0.25
f_d,fraction of decomposed P allocated to DOM,NA,0.5
g_d,fraction of dead B allocated to DOM,NA,0.5
p_ep,fraction of mR for production of EP,NA,0.01
p_em,fraction of mR for production of EM,NA,0.01
r_ep,turnover rate of EP,mgC mgC^-1 h^-1,0.001
r_em,turnover rate of EM,mgC mgC^-1 h^-1,0.001
Q_max,maximum DOC sorption capacity,mgC / g soil,3.4
K_ads,specific adsorption rate,mgC mgC^-1 h^-1,0.006
K_des,desorption rate,mgC mgC^-1 h^-1,0.001
dd_beta,strength of density dependent microbial decay,NA,1
Input_POM,POM input ,mg C,0
Input_DOM,DOM input,mg C,0
Input_MOM,MOM input ,mg C,0
parameter,description,units,value
V_p,maximum specific decomposition rate for POM by EP,mgC mgC^-1 h^-1,14
K_p,half-saturation constant for decomposition of POM,mgC / g soil,50
V_m,maximum specific decomposition rate for MOM by EM,mgC mgC^-1 h^-1,0.25
K_m,half-saturation constant for decomposition of MOM,mg C/g soil,250
V_d,maximum specific uptake rate of D for growth of MB,mgC mgC^-1 h^-1,3.00E+00
K_d,half-saturation constant of uptake of D for growth of MB,mg C/g soil,0.25
f_d,fraction of decomposed P allocated to DOM,NA,0.5
g_d,fraction of dead B allocated to DOM,NA,0.5
p_ep,fraction of mR for production of EP,NA,0.01
p_em,fraction of mR for production of EM,NA,0.01
r_ep,turnover rate of EP,mgC mgC^-1 h^-1,0.001
r_em,turnover rate of EM,mgC mgC^-1 h^-1,0.001
Q_max,maximum DOC sorption capacity,mgC / g soil,3.4
K_ads,specific adsorption rate,mgC mgC^-1 h^-1,0.006
K_des,desorption rate,mgC mgC^-1 h^-1,0.001
dd_beta,strength of density dependent microbial decay,NA,1
Input_POM,POM input ,mg C,0
Input_DOM,DOM input,mg C,0
CUE,carbon use efficiency,,0.4
Binary file modified data/BAMS_model.rda
Binary file not shown.
Binary file modified data/COMISSION_model.rda
Binary file not shown.
Binary file modified data/CORPSE_model.rda
Binary file not shown.
Binary file modified data/MEMS_model.rda
Binary file not shown.
Binary file modified data/MEND_model.rda
Binary file not shown.
Binary file modified data/MIMCS_model.rda
Binary file not shown.
Binary file modified data/default_initial.rda
Binary file not shown.
Binary file modified data/default_params.rda
Binary file not shown.
Binary file modified data/model_configs.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion legacy/recreating_MEMC_Dec7.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ desc <- c("maximum specific decomposition rate for P by EP", "half-saturation co
"turnover rate of EP", "turnover rate of EM", "maximum DOC sorption capacity", "specific adsorption rate", "desorption rate", "strength of density dependent microbial decay",
"POM input", "DOM input", "M input", "carbon use efficiency")
value <- c("V_p"=14, "K_p"=50, "V_m"=0.25, "K_m"=250, "V_d"=3, "K_d"=0.25, "f_d"=0.5, "g_d"=0.5, "p_ep"=0.01, "p_em"=0.01, "r_ep"=1e-3, "r_em"=1e-3 , "Q_max"=3.4, "K_ads"=0.006,
"K_des"= 0.001, "dd_beta" = 2, "Input_POM" = 0, "Input_DOM"=0, "Input_MOM"=0, "CUE"=0.4)
"K_des"= 0.001, "dd_beta" = 2, "Input_POM" = 0, "Input_DOM"=0, "CUE"=0.4)
units <- c("mgC mgC^-1 h^-1", "mgC / g soil", "mgC mgC^-1 h^-1", "mg C/g soil", "mgC mgC^-1 h^-1", "mg C/g soil", NA,
NA, NA, NA, "mgC mgC^-1 h^-1", "mgC mgC^-1 h^-1", "mgC / g soil", "mgC mgC^-1 h^-1", "mgC mgC^-1 h^-1", NA,
"mg C", "mg C", "mg C", "")
Expand Down
Binary file modified man/figures/README-unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-9-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/testthat/test-argument.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test_that("is_param_table works", {
# A number of errors should be thrown if the the parameter table does not meet the correct conditions.
expect_error(
is_param_table(params[1:10, ]),
"param_table is missing a parameter value(s) for: r_ep, r_em, Q_max, K_ads, K_des, dd_beta, Input_POM, Input_DOM, Input_MOM, CUE",
"param_table is missing a parameter value(s) for: r_ep, r_em, Q_max, K_ads, K_des, dd_beta, Input_POM, Input_DOM, CUE",
fixed = TRUE
)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-helper.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ test_that("bad model configuration will fail", {
# Errors should be thrown
expect_error(
configure_model(ptable[1:9,], state),
"param_table is missing a parameter value(s) for: p_em, r_ep, r_em, Q_max, K_ads, K_des, dd_beta, Input_POM, Input_DOM, Input_MOM, CUE",
"param_table is missing a parameter value(s) for: p_em, r_ep, r_em, Q_max, K_ads, K_des, dd_beta, Input_POM, Input_DOM, CUE",
fixed = TRUE
)
expect_error(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-jz.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#
# params <- c("V_p", "K_p", "V_m", "K_m", "V_d", "K_d", "f_d", "g_d", "p_ep",
# "p_em", "r_ep", "r_em", "Q_max", "K_ads",
# "K_des", "dd_beta", "Input_POM", "Input_DOM", "Input_MOM", "CUE")
# "K_des", "dd_beta", "Input_POM", "Input_DOM", "CUE")
# desc <- c("maximum specific decomposition rate for P by EP", "half-saturation constant for decomposition of P",
# "maximum specific decomposition rate for M by EM",
# "half-saturation constant for decomposition of M",
Expand All @@ -26,7 +26,7 @@
# value <- c("V_p" = 14, "K_p" = 50, "V_m" = 0.25, "K_m" = 250, "V_d" = 3, "K_d"= 0.25,
# "f_d" = 0.5, "g_d" = 0.5, "p_ep" = 0.01, "p_em" = 0.01, "r_ep" = 1e-3,
# "r_em" = 1e-3 , "Q_max" = 3.4, "K_ads" = 0.006, "K_des"= 0.001, "dd_beta" = 2,
# "Input_POM" = 0, "Input_DOM" = 0, "Input_MOM" = 0, "CUE" = 0.4)
# "Input_POM" = 0, "Input_DOM" = 0, "CUE" = 0.4)
# units <- c("mgC mgC^-1 h^-1", "mgC / g soil", "mgC mgC^-1 h^-1", "mg C/g soil",
# "mgC mgC^-1 h^-1", "mg C/g soil", NA,
# NA, NA, NA, "mgC mgC^-1 h^-1", "mgC mgC^-1 h^-1", "mgC / g soil",
Expand Down

0 comments on commit 05259ce

Please sign in to comment.