From ab14cd4d962f22cc184b7f0d103c23dd326dde89 Mon Sep 17 00:00:00 2001 From: Ciara Donegan <82416895+ciara-donegan@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:35:56 -0500 Subject: [PATCH] Permafrost toggle Toggle to include permafrost carbon in run added; uses initial carbon amount from Woodard et al. (2021) (add slider to select amount?) --- h2/components/modules/mod_run.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/h2/components/modules/mod_run.R b/h2/components/modules/mod_run.R index 93d829e..3994f24 100644 --- a/h2/components/modules/mod_run.R +++ b/h2/components/modules/mod_run.R @@ -24,7 +24,8 @@ run_ui <- function(id) { sliderInput(ns("q10_rh"), label="Heterotrophic temperature sensitivity", # Q10_RH() min = 1, max = 5, value = 2, step=0.1, width = "90%"), sliderInput(ns("volscl"), label="Volcanic forcing scaling factor", # VOLCANIC_SCALE() - min = 0, max = 1, value = 1, width = "90%") + min = 0, max = 1, value = 1, width = "90%"), + materialSwitch(ns("permafrost"), "Include Permafrost Carbon", value = FALSE) ) ) @@ -101,6 +102,9 @@ run_server <- function(id, r6) { core <- reactive({newcore(r6$ini_file())}) # create core # Set parameters using inputs (function to only call setvar once in final version) + if (input$permafrost == TRUE) { + setvar(core(),0,PERMAFROST_C(),865,"Pg C") + } setvar(core(),NA,AERO_SCALE(),input$alpha,"(unitless)") setvar(core(),NA,BETA(),input$beta,"(unitless)") setvar(core(),NA,DIFFUSIVITY(),input$diff,"cm2/s")