Skip to content

Commit

Permalink
Run module presets changed
Browse files Browse the repository at this point in the history
Run presets changed, plus minor visual change to custom module
  • Loading branch information
ciara-donegan committed May 29, 2024
1 parent 31bc65f commit 0d6690c
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 95 deletions.
178 changes: 86 additions & 92 deletions h2/components/modules/mod_custom.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,98 +3,92 @@ custom_ui <- function(id) {
ns <- NS(id)
fluidRow(
sidebarPanel(
tabsetPanel(
tabPanel(class = "params", "Custom Scenarios",
div
(
h5("Custom Emissions Pathway"),
tags$hr(class="hrNav"),
p("Steps to run your own scenario with custom emissions:"),
tags$ol(
tags$li("Choose a baseline SSP scenario as your starting point"),
tags$li("Give your new custom scenario a name"),
tags$li("Download the emissions file template for that scenario and enter your own emissions"),
tags$li("Upload the new customized emissions file")
),
p(tags$strong("Do not edit any field names or change the CSV file in any way other than changing the data")),
tags$table(
tags$tr(width = "100%",
tags$td(width = "145", "Baseline Scenario:"),
tags$td(width = "155", selectInput(ns("input_custom_SSP"), label = NULL,
choices = list("SSP 1-1.9"="input/hector_ssp119.ini",
"SSP 1-2.6"="input/hector_ssp126.ini",
"SSP 2-4.5"="input/hector_ssp245.ini",
"SSP 3-7.0"="input/hector_ssp370.ini",
"SSP 4-3.4"="input/hector_ssp434.ini",
"SSP 4-6.0"="input/hector_ssp460.ini",
"SSP 5-3.4OS"="input/hector_ssp534-over.ini",
"SSP 5-8.5"="input/hector_ssp585.ini"),
width=150, selected = "SSP 2-4.5"))
),
tags$tr(width = "100%",
tags$td(width = "145", "Your Scenario Name:"),
tags$td(width = "200", textInput(ns("input_custom_scenarioName"), label = NULL, width=195, value = ""))
)
),
div(
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp119.ini'",
a(h6("Download SSP 1-1.9 Emissions File Template"),
href="inputs/ssp119_emiss-constraints_rf.csv"),
ns=NS(id)
),
# conditionalPanel(
# condition = "input.input_custom_SSP == 'input/hector_ssp119.ini'",
# downloadButton(ns("download_file"), label = "Download SSP 1-1.9 Emissions File Template")
# ),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp126.ini'",
a(h6("Download SSP 1-2.6 Emissions File Template"),
href="inputs/ssp126_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp245.ini'",
a(h6("Download SSP 2-4.5 Emissions File Template"),
href="inputs/ssp245_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp370.ini'",
a(h6("Download SSP 3-7.0 Emissions File Template"),
href="inputs/ssp370_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp434.ini'",
a(h6("Download SSP 4-3.4 Emissions File Template"),
href="inputs/ssp434_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp460.ini'",
a(h6("Download SSP 4-6.0 Emissions File Template"),
href="inputs/ssp460_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp534-over.ini'",
a(h6("Download SSP 5-3.4OS Emissions File Template"),
href="inputs/ssp534-over_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp585.ini'",
a(h6("Download SSP 5-8.5 Emissions File Template"),
href="inputs/ssp585_emiss-constraints_rf.csv"),
ns=NS(id)
),
fileInput(ns("input_custom_emissions_file"), "Upload Custom Emissions File:", width=275, buttonLabel = "Choose File", accept = c("text/csv", ".csv", "text/comma-separated-values,text/plain")),
div(
class="paramDivs", actionButton(ns("input_load_emissions"), label="Create Scenario"))
)
) # End Div
) # End Custom Scenarios Tab Panel
h5("Custom Emissions Pathway"),
tags$hr(class="hrNav"),
p("Steps to run your own scenario with custom emissions:"),
tags$ol(
tags$li("Choose a baseline SSP scenario as your starting point"),
tags$li("Give your new custom scenario a name"),
tags$li("Download the emissions file template for that scenario and enter your own emissions"),
tags$li("Upload the new customized emissions file")
),
p(tags$strong("Do not edit any field names or change the CSV file in any way other than changing the data")),
tags$table(
tags$tr(width = "100%",
tags$td(width = "145", "Baseline Scenario:"),
tags$td(width = "155", selectInput(ns("input_custom_SSP"), label = NULL,
choices = list("SSP 1-1.9"="input/hector_ssp119.ini",
"SSP 1-2.6"="input/hector_ssp126.ini",
"SSP 2-4.5"="input/hector_ssp245.ini",
"SSP 3-7.0"="input/hector_ssp370.ini",
"SSP 4-3.4"="input/hector_ssp434.ini",
"SSP 4-6.0"="input/hector_ssp460.ini",
"SSP 5-3.4OS"="input/hector_ssp534-over.ini",
"SSP 5-8.5"="input/hector_ssp585.ini"),
width=150, selected = "SSP 2-4.5"))
),
tags$tr(width = "100%",
tags$td(width = "145", "Your Scenario Name:"),
tags$td(width = "200", textInput(ns("input_custom_scenarioName"), label = NULL, width=195, value = ""))
)
),
div(
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp119.ini'",
a(h6("Download SSP 1-1.9 Emissions File Template"),
href="inputs/ssp119_emiss-constraints_rf.csv"),
ns=NS(id)
),
# conditionalPanel(
# condition = "input.input_custom_SSP == 'input/hector_ssp119.ini'",
# downloadButton(ns("download_file"), label = "Download SSP 1-1.9 Emissions File Template")
# ),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp126.ini'",
a(h6("Download SSP 1-2.6 Emissions File Template"),
href="inputs/ssp126_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp245.ini'",
a(h6("Download SSP 2-4.5 Emissions File Template"),
href="inputs/ssp245_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp370.ini'",
a(h6("Download SSP 3-7.0 Emissions File Template"),
href="inputs/ssp370_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp434.ini'",
a(h6("Download SSP 4-3.4 Emissions File Template"),
href="inputs/ssp434_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp460.ini'",
a(h6("Download SSP 4-6.0 Emissions File Template"),
href="inputs/ssp460_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp534-over.ini'",
a(h6("Download SSP 5-3.4OS Emissions File Template"),
href="inputs/ssp534-over_emiss-constraints_rf.csv"),
ns=NS(id)
),
conditionalPanel(
condition = "input.input_custom_SSP == 'input/hector_ssp585.ini'",
a(h6("Download SSP 5-8.5 Emissions File Template"),
href="inputs/ssp585_emiss-constraints_rf.csv"),
ns=NS(id)
),
fileInput(ns("input_custom_emissions_file"), "Upload Custom Emissions File:", width=275,
buttonLabel = "Choose File", accept = c("text/csv", ".csv", "text/comma-separated-values,text/plain")),
div(
class="paramDivs", actionButton(ns("input_load_emissions"), label="Create Scenario"))
)
),
mainPanel(
Expand Down
6 changes: 3 additions & 3 deletions h2/components/modules/mod_run.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ run_ui <- function(id) {
sliderInput(ns("alpha"), label="Aerosol forcing scaling factor", # AERO_SCALE()
min = 0.01, max = 1, value = 1, width = "90%"),
sliderInput(ns("beta"), label="CO2 fertilization factor", # BETA()
min = 0.01, max = 4, value = 0.36, step=0.01, width = "90%"),
min = 0.01, max = 4, value = 0.55, step=0.01, width = "90%"),
sliderInput(ns("diff"), label="Ocean heat diffusivity", # DIFFUSIVITY()
min = 0, max = 5, value = 2.3, step=0.1, post = " cm2/s", width = "90%"),
min = 0, max = 5, value = 1.16, step=0.1, post = " cm2/s", width = "90%"),
sliderInput(ns("S"), label="Equilibrium climate sensitivity", # ECS()
min = 1, max = 6, value = 3, step=0.1, post = " °C", width = "90%"),
sliderInput(ns("q10_rh"), label="Heterotrophic temperature sensitivity", # Q10_RH()
min = 1, max = 5, value = 2, step=0.1, width = "90%"),
min = 1, max = 5, value = 2.1, step=0.1, width = "90%"),
sliderInput(ns("volscl"), label="Volcanic forcing scaling factor", # VOLCANIC_SCALE()
min = 0, max = 1, value = 1, width = "90%")
)
Expand Down

0 comments on commit 0d6690c

Please sign in to comment.