diff --git a/R/model_componet.R b/R/model_componet.R index ed3cfd9..965795a 100644 --- a/R/model_componet.R +++ b/R/model_componet.R @@ -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 @@ -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))) diff --git a/README.md b/README.md index e8fdb5c..c4aced3 100644 --- a/README.md +++ b/README.md @@ -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 @@ -115,8 +114,7 @@ print(MEND_model) #> 16 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 diff --git a/data-raw/default_params.csv b/data-raw/default_params.csv index d5ecace..073625b 100644 --- a/data-raw/default_params.csv +++ b/data-raw/default_params.csv @@ -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 \ No newline at end of file diff --git a/data/BAMS_model.rda b/data/BAMS_model.rda index ce884eb..53de116 100644 Binary files a/data/BAMS_model.rda and b/data/BAMS_model.rda differ diff --git a/data/COMISSION_model.rda b/data/COMISSION_model.rda index 6012d83..1d79fbe 100644 Binary files a/data/COMISSION_model.rda and b/data/COMISSION_model.rda differ diff --git a/data/CORPSE_model.rda b/data/CORPSE_model.rda index 5cb5007..5c4eafb 100644 Binary files a/data/CORPSE_model.rda and b/data/CORPSE_model.rda differ diff --git a/data/MEMS_model.rda b/data/MEMS_model.rda index bf94272..ab32e10 100644 Binary files a/data/MEMS_model.rda and b/data/MEMS_model.rda differ diff --git a/data/MEND_model.rda b/data/MEND_model.rda index 5d2db63..1fd44e1 100644 Binary files a/data/MEND_model.rda and b/data/MEND_model.rda differ diff --git a/data/MIMCS_model.rda b/data/MIMCS_model.rda index e9e1857..756c055 100644 Binary files a/data/MIMCS_model.rda and b/data/MIMCS_model.rda differ diff --git a/data/default_initial.rda b/data/default_initial.rda index d573a1a..6ea9078 100644 Binary files a/data/default_initial.rda and b/data/default_initial.rda differ diff --git a/data/default_params.rda b/data/default_params.rda index e0409b7..dd82a71 100644 Binary files a/data/default_params.rda and b/data/default_params.rda differ diff --git a/data/model_configs.rda b/data/model_configs.rda index 514154b..3f1d027 100644 Binary files a/data/model_configs.rda and b/data/model_configs.rda differ diff --git a/legacy/recreating_MEMC_Dec7.R b/legacy/recreating_MEMC_Dec7.R index de2ea53..ff90f43 100644 --- a/legacy/recreating_MEMC_Dec7.R +++ b/legacy/recreating_MEMC_Dec7.R @@ -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", "") diff --git a/man/figures/README-unnamed-chunk-6-1.png b/man/figures/README-unnamed-chunk-6-1.png index de9a4ec..15125b8 100644 Binary files a/man/figures/README-unnamed-chunk-6-1.png and b/man/figures/README-unnamed-chunk-6-1.png differ diff --git a/man/figures/README-unnamed-chunk-9-1.png b/man/figures/README-unnamed-chunk-9-1.png index d51dcef..9bc6731 100644 Binary files a/man/figures/README-unnamed-chunk-9-1.png and b/man/figures/README-unnamed-chunk-9-1.png differ diff --git a/tests/testthat/test-argument.R b/tests/testthat/test-argument.R index 243ec6b..a5b5279 100644 --- a/tests/testthat/test-argument.R +++ b/tests/testthat/test-argument.R @@ -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 ) diff --git a/tests/testthat/test-helper.R b/tests/testthat/test-helper.R index 5001c2e..c227f2d 100644 --- a/tests/testthat/test-helper.R +++ b/tests/testthat/test-helper.R @@ -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( diff --git a/tests/testthat/test-jz.R b/tests/testthat/test-jz.R index f536aad..d82be0d 100644 --- a/tests/testthat/test-jz.R +++ b/tests/testthat/test-jz.R @@ -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", @@ -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",