From b705d37dc32d528b2923356ee21e1e30413ce283 Mon Sep 17 00:00:00 2001 From: Stephanie Pennington Date: Mon, 3 Jun 2024 17:56:16 -0400 Subject: [PATCH] Remove old functions in documentation --- DESCRIPTION | 2 +- NAMESPACE | 16 - R/set_globals.R | 666 ------------------ .../shinyApp/components/layout/global-lists.r | 107 --- .../components/modules/module_choices.r | 66 -- inst/shinyApp/global.r | 109 ++- man/get_globalCapabilities.Rd | 11 - man/get_globalColorScales.Rd | 11 - man/get_globalParameters.Rd | 11 - man/get_globalParamsCESM1BGC.Rd | 11 - man/get_globalParamsCanESM2.Rd | 11 - man/get_globalParamsDefault.Rd | 11 - man/get_globalParamsGFDLESM2G.Rd | 11 - man/get_globalParamsMIROCESM.Rd | 11 - man/get_globalParamsMPIESMLR.Rd | 11 - man/get_globalParamsMRIESM1.Rd | 11 - man/get_globalPrecipPatterns.Rd | 11 - man/get_globalScenarioColors.Rd | 11 - man/get_globalScenarios.Rd | 11 - man/get_globalTempPatterns.Rd | 11 - man/get_globalVars.Rd | 11 - man/get_rcps.Rd | 11 - tests/testthat/test-globals.R | 122 ---- 23 files changed, 109 insertions(+), 1155 deletions(-) delete mode 100644 R/set_globals.R delete mode 100644 inst/shinyApp/components/layout/global-lists.r delete mode 100644 inst/shinyApp/components/modules/module_choices.r delete mode 100644 man/get_globalCapabilities.Rd delete mode 100644 man/get_globalColorScales.Rd delete mode 100644 man/get_globalParameters.Rd delete mode 100644 man/get_globalParamsCESM1BGC.Rd delete mode 100644 man/get_globalParamsCanESM2.Rd delete mode 100644 man/get_globalParamsDefault.Rd delete mode 100644 man/get_globalParamsGFDLESM2G.Rd delete mode 100644 man/get_globalParamsMIROCESM.Rd delete mode 100644 man/get_globalParamsMPIESMLR.Rd delete mode 100644 man/get_globalParamsMRIESM1.Rd delete mode 100644 man/get_globalPrecipPatterns.Rd delete mode 100644 man/get_globalScenarioColors.Rd delete mode 100644 man/get_globalScenarios.Rd delete mode 100644 man/get_globalTempPatterns.Rd delete mode 100644 man/get_globalVars.Rd delete mode 100644 man/get_rcps.Rd diff --git a/DESCRIPTION b/DESCRIPTION index eff18c9..f52cf27 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -37,5 +37,5 @@ Suggests: Remotes: github::JGCRI/hector@v3.2.0, github::JGCRI/fldgen@v2.0.0 -RoxygenNote: 7.1.1 +RoxygenNote: 7.3.1 VignetteBuilder: knitr diff --git a/NAMESPACE b/NAMESPACE index 2c86655..6ae9268 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,18 +1,2 @@ # Generated by roxygen2: do not edit by hand -export(get_globalCapabilities) -export(get_globalColorScales) -export(get_globalParameters) -export(get_globalParamsCESM1BGC) -export(get_globalParamsCanESM2) -export(get_globalParamsDefault) -export(get_globalParamsGFDLESM2G) -export(get_globalParamsMIROCESM) -export(get_globalParamsMPIESMLR) -export(get_globalParamsMRIESM1) -export(get_globalPrecipPatterns) -export(get_globalScenarioColors) -export(get_globalScenarios) -export(get_globalTempPatterns) -export(get_globalVars) -export(get_rcps) diff --git a/R/set_globals.R b/R/set_globals.R deleted file mode 100644 index ab68a62..0000000 --- a/R/set_globals.R +++ /dev/null @@ -1,666 +0,0 @@ -#' Global vars for misc items such as the run date end year (2100) -#' @export -get_globalVars <- function() { - - globalVars <- list() - globalVars['startDate'] <- 1900 - globalVars['endDate'] <- 2100 - globalVars['writeDirectory'] <- "temp" - - return(globalVars) -} - - -#' Global vars for scale colors -#' @export -get_globalColorScales <- function() { - - globalColorScales <- vector() - globalColorScales <- c("RCP 2.6" = "#5DBFDE", "RCP 4.5" = "#5CB95C", "RCP 6.0" = "#FBAB33", "RCP 8.5" ="#D7534E") - - - return(globalColorScales) -} - - -#' RCP list by number -#' @export -get_rcps <- function() { - - return(c(26,45,60,85)) -} - - -#' Global file paths vector -#' @export -get_globalScenarios <- function() { - - rcps <- get_rcps() - - globalScenarios <- list() - globalScenarios[['RCP-2.6']] <- file.path('input',paste0('hector_rcp',rcps[1],'.ini')) - globalScenarios[['RCP-4.5']] <- file.path('input',paste0('hector_rcp',rcps[2],'.ini')) - globalScenarios[['RCP-6.0']] <- file.path('input',paste0('hector_rcp',rcps[3],'.ini')) - globalScenarios[['RCP-8.5']] <- file.path('input',paste0('hector_rcp',rcps[4],'.ini')) - - return(globalScenarios) -} - - -#' Global scenario color schemes -#' @export -get_globalScenarioColors <- function() { - - return(c("RCP 2.6" = "#5DBFDE", "RCP 4.5" = "#5CB95C", "RCP 6.0" = "#FBAB33", "RCP 8.5" = "#D7534E")) -} - - -#' Global temperature patterns -#' @export -get_globalTempPatterns <- function() { - - return(c("CanESM2" = "www/maps/tas_Amon_CanESM2_esmrcp85_r1i1p1_200601-210012_pattern.rds", - "CESM1-BGC" = "www/maps/tas_Amon_CESM1-BGC_rcp85_r1i1p1_200601-210012_pattern.rds", - "GFDL-ESM2G" = "www/maps/tas_Amon_GFDL-ESM2G_rcp85_r1i1p1_200601-210012_pattern.rds", - "MIROC-ESM" = "www/maps/tas_Amon_MIROC-ESM_esmrcp85_r1i1p1_200601-210012_pattern.rds", - "MPI-ESM-LR" = "www/maps/tas_Amon_MPI-ESM-LR_esmrcp85_r1i1p1_200601-210012_pattern.rds", - "MRI-ESM1" = "www/maps/tas_Amon_MRI-ESM1_esmrcp85_r1i1p1_200601-210012_pattern.rds")) -} - - -#' Global precipitation patterns list -#' @export -get_globalPrecipPatterns <- function() { - - return(c("CanESM2" = "www/maps/pr_Amon_CanESM2_rcp85_r1i1p1_200601-210012_pattern.rds", - "CESM1-BGC" = "www/maps/pr_Amon_CESM1-BGC_rcp85_r1i1p1_200601-210012_pattern.rds", - "GFDL-ESM2G" = "www/maps/pr_Amon_GFDL-ESM2G_rcp85_r1i1p1_200601-210012_pattern.rds", - "MIROC-ESM" = "www/maps/pr_Amon_MIROC-ESM_rcp85_r1i1p1_200601-210012_pattern.rds", - "MPI-ESM-LR" = "www/maps/pr_Amon_MPI-ESM-LR_rcp85_r1i1p1_200601-210012_pattern.rds", - "MRI-ESM1" = "www/maps/pr_Amon_MRI-ESM1_rcp85_r1i1p1_200601-210012_pattern.rds")) -} - - -#' Create master list of parameter lookup strings -#' @export -get_globalParameters <- function() { - - globalParameters <- vector() - globalParameters['pco2'] <- hector::PREINDUSTRIAL_CO2() - globalParameters['q10'] <- hector::Q10_RH() #2.0 - globalParameters['beta'] <- hector::BETA() #0.36 - globalParameters['ecs'] <- hector::ECS() #3.0 - globalParameters['aero'] <- hector::AERO_SCALE() #1.0 - globalParameters['volc'] <- hector::VOLCANIC_SCALE() #1.0 - globalParameters['diff'] <- hector::DIFFUSIVITY() #2.3 - - return(globalParameters) -} - - - -#' Default Hector parameters -#' @export -get_globalParamsDefault <- function() { - - return(c('alpha' = 1, 'beta' = 0.36, 'diff' = 2.3, 'S' = 3, 'C' = 276.09, 'q10_rh' = 2, 'volscl' = 1)) - -} - -#' CanESM2 Parameter Sets -#' @export -get_globalParamsCanESM2 <- function() { - - return(c('alpha' = 1.87, 'beta' = 0.08, 'diff' = 0.98, 'S' = 3.88, 'C' = 282.35, 'q10_rh' = 1.75, 'volscl' = 1.81)) - -} - - -#' CESM1-BGC Parameter Set -#' @export -get_globalParamsCESM1BGC <- function() { - - return(c('alpha' = -0.43, 'beta' = 0.0, 'diff' = 8, 'S' = 2.4, 'C' = 280.31, 'q10_rh' = 1.78, 'volscl' = 3.94)) - -} - - - -#' GFDL-ESM2G Parameter Set -#' @export -get_globalParamsGFDLESM2G <- function() { - - return(c('alpha' = 0.46, 'beta' = 0.07, 'diff' = 12.01, 'S' = 2.03, 'C' = 289.24, 'q10_rh' = 1.76, 'volscl' = 2.12)) - -} - - - -#' MIROC-ESM Parameter Set -#' @export -get_globalParamsMIROCESM <- function() { - - return(c('alpha' = 1.05, 'beta' = 0.02, 'diff' = 6.39, 'S' = 5.83, 'C' = 283.31, 'q10_rh' = 1.77, 'volscl' = 2.02)) - -} - - - -#' MPI-ESM-LR Parameter Set -#' @export -get_globalParamsMPIESMLR <- function() { - - return(c('alpha' = 1.22, 'beta' = 0.28, 'diff' = 2.93, 'S' = 3.66, 'C' = 289.13, 'q10_rh' = 1.75, 'volscl' = 0.70)) - -} - - - -#' MRI-ESM1 Parameter Set -#' @export -get_globalParamsMRIESM1 <- function() { - - return(c('alpha' = 1.42, 'beta' = 0.66, 'diff' = 4.21, 'S' = 2.04, 'C' = 289.49, 'q10_rh' = 1.76, 'volscl' = 0.27)) - -} - - -#' Create master list of variable lookups for "capabilities" (output variables for graphing) -#' @export -get_globalCapabilities <- function() { - - globalCapabilities <- list() - - # CARBON CYCLE - # "Land Carbon Flux" - globalCapabilities[['cc_lcf']] <- hector::LAND_CFLUX() - attr(globalCapabilities[['cc_lcf']], 'longName') <- "Land Carbon Flux" - - # "Atmospheric CO2" - globalCapabilities[['cc_co2']] <- hector::ATMOSPHERIC_CO2() - attr(globalCapabilities[['cc_co2']], 'longName') <- "Atmospheric CO2" - - # "Atmospheric Carbon Pool" - globalCapabilities[['cc_acp']] <- hector::ATMOSPHERIC_C() - attr(globalCapabilities[['cc_acp']], 'longName') <- "Atmospheric Carbon Pool" - - # "Fossil Fuel and Industrial Emissions" - globalCapabilities[['cc_ffi']] <- hector::FFI_EMISSIONS() - attr(globalCapabilities[['cc_ffi']], 'longName') <- "FFI Emissions" - attr(globalCapabilities[['cc_ffi']], 'unit') <- "GtC/yr" - - # "Land Use Change Emissions" - globalCapabilities[['cc_luc']] <- hector::LUC_EMISSIONS() - attr(globalCapabilities[['cc_luc']], 'longName') <- "LUC Emissions" - - # CONCENTRATIONS - # "Amospheric N2O" - globalCapabilities[['c_an20']] <- hector::ATMOSPHERIC_N2O() - attr(globalCapabilities[['c_an20']], 'longName') <- "Amospheric N2O" - - # "Preindustrial Atmospheric CO2" - globalCapabilities[['c_paco2']] <- hector::PREINDUSTRIAL_CO2() - attr(globalCapabilities[['c_paco2']], 'longName') <- "Preindustrial Atmospheric CO2" - - # "Preindustrial Ozone Concentration" - globalCapabilities[['c_po']] <- hector::PREINDUSTRIAL_O3() - attr(globalCapabilities[['c_po']], 'longName') <- "Preindustrial Ozone Concentration" - - - # EMISSIONS - # "Black Carbon Emissions" - globalCapabilities[['e_bc']] <- hector::EMISSIONS_BC() - attr(globalCapabilities[['e_bc']], 'longName') <- "Black Carbon Emissions" - attr(globalCapabilities[['e_bc']], 'unit') <- "Tg" - - # "N20 Emissions" - globalCapabilities[['e_n2o']] <- hector::EMISSIONS_N2O() - attr(globalCapabilities[['e_n2o']], 'longName') <- "N20 Emissions" - - # "NOx Emissions" - globalCapabilities[['e_nox']] <- hector::EMISSIONS_NOX() - attr(globalCapabilities[['e_nox']], 'longName') <- "NOx Emissions" - - # "CO Emissions" - globalCapabilities[['e_co']] <- hector::EMISSIONS_CO() - attr(globalCapabilities[['e_co']], 'longName') <- "CO Emissions" - - # "NMVOC Emissions" - globalCapabilities[['e_nmvoc']] <- hector::EMISSIONS_NMVOC() - attr(globalCapabilities[['e_nmvoc']], 'longName') <- "NMVOC Emissions" - - # "Organic Carbon Emissions" - globalCapabilities[['e_oc']] <- hector::EMISSIONS_OC() - attr(globalCapabilities[['e_oc']], 'longName') <- "Organic Carbon Emissions" - attr(globalCapabilities[['e_oc']], 'unit') <- "Tg" - - # FORCINGS - # "RF - Total" - globalCapabilities[['f_rft']] <- hector::RF_TOTAL() - attr(globalCapabilities[['f_rft']], 'longName') <- "RF - Total" - - # "RF - Albedo" - globalCapabilities[['f_alb']] <- hector::RF_T_ALBEDO() - attr(globalCapabilities[['f_alb']], 'longName') <- "RF - Albedo" - - # "RF - CO2" - globalCapabilities[['f_co2']] <- hector::RF_CO2() - attr(globalCapabilities[['f_co2']], 'longName') <- "RF - CO2" - - # "RF - N2O" - globalCapabilities[['f_n2o']] <- hector::RF_N2O() - attr(globalCapabilities[['f_n2o']], 'longName') <- "RF - N2O" - - # "RF - H2O" - # globalCapabilities[['f_h2o']] <- hector::RF_H2O() - # attr(globalCapabilities[['f_h2o']], 'longName') <- "RF - H2O" - - # "RF - Ozone" - # globalCapabilities[['f_oz']] <- hector::RF_O3() - # attr(globalCapabilities[['f_oz']], 'longName') <- "RF - Ozone" - - # "RF - Black Carbon" - globalCapabilities[['f_bc']] <- hector::RF_BC() - attr(globalCapabilities[['f_bc']], 'longName') <- "RF - Black Carbon" - - # "RF - Organic Carbon" - globalCapabilities[['f_oc']] <- hector::RF_OC() - attr(globalCapabilities[['f_oc']], 'longName') <- "RF - Organic Carbon" - - # "RF - SO2 Direct" - globalCapabilities[['f_so2d']] <- hector::RF_SO2D() - attr(globalCapabilities[['f_so2d']], 'longName') <- "RF - SO2 Direct" - - # "RF - SO2 Indirect" - globalCapabilities[['f_so2i']] <- hector::RF_SO2I() - attr(globalCapabilities[['f_so2i']], 'longName') <- "RF - SO2 Indirect" - - # "RF - SO2 Total" - globalCapabilities[['f_so2t']] <- hector::RF_SO2() - attr(globalCapabilities[['f_so2t']], 'longName') <- "RF - SO2 Total" - - # "RF - Volcanic Activity" - globalCapabilities[['f_va']] <- hector::RF_VOL() - attr(globalCapabilities[['f_va']], 'longName') <- "RF - Volcanic Activity" - - # "RF - CH4" - globalCapabilities[['f_ch4']] <- hector::RF_CH4() - attr(globalCapabilities[['f_ch4']], 'longName') <- "RF - CH4" - - # HALOCARBON EMISSIONS - # "CF4 Emissions" - globalCapabilities[['he_cf4']] <- hector::EMISSIONS_CF4() - attr(globalCapabilities[['he_cf4']], 'longName') <- "CF4 Emissions" - - # "C2F6 Emissions" - globalCapabilities[['he_c2f6']] <- hector::EMISSIONS_C2F6() - attr(globalCapabilities[['he_c2f6']], 'longName') <- "C2F6 Emissions" - - # "HFC-23 Emissions" - globalCapabilities[['he_hfc23']] <- hector::EMISSIONS_HFC23() - attr(globalCapabilities[['he_hfc23']], 'longName') <- "HFC-23 Emissions" - - # "HFC-32 Emissions" - globalCapabilities[['he_hfc32']] <- hector::EMISSIONS_HFC32() - attr(globalCapabilities[['he_hfc32']], 'longName') <- "HFC-32 Emissions" - - # "HFC-4310 Emissions" - globalCapabilities[['he_hfc4310']] <- hector::EMISSIONS_HFC4310() - attr(globalCapabilities[['he_hfc4310']], 'longName') <- "HFC-4310 Emissions" - - # "HFC-125 Emissions" - globalCapabilities[['he_hfc125']] <- hector::EMISSIONS_HFC125() - attr(globalCapabilities[['he_hfc125']], 'longName') <- "HFC-125 Emissions" - - # "HFC-134a Emissions" - globalCapabilities[['he_hfc134a']] <- hector::EMISSIONS_HFC134A() - attr(globalCapabilities[['he_hfc134a']], 'longName') <- "HFC-134a Emissions" - - # "HFC-143a Emissions" - globalCapabilities[['he_hfc143a']] <- hector::EMISSIONS_HFC143A() - attr(globalCapabilities[['he_hfc143a']], 'longName') <- "HFC-143a Emissions" - - # "HFC-227ea Emissions" - globalCapabilities[['he_hfc227ea']] <- hector::EMISSIONS_HFC227EA() - attr(globalCapabilities[['he_hfc227ea']], 'longName') <- "HFC-227ea Emissions" - - # "HFC-254fa Emissions" - globalCapabilities[['he_245fa']] <- hector::EMISSIONS_HFC245FA() - attr(globalCapabilities[['he_245fa']], 'longName') <- "HFC-254fa Emissions" - - # "SF6 Emissions"' - globalCapabilities[['he_sf6']] <- hector::EMISSIONS_SF6() - attr(globalCapabilities[['he_sf6']], 'longName') <- "SF6 Emissions" - - # "CFC-11 Emissions" - globalCapabilities[['he_cfc11']] <- hector::EMISSIONS_CFC11() - attr(globalCapabilities[['he_cfc11']], 'longName') <- "CFC-11 Emissions" - - # "CFC-12 Emissions" - globalCapabilities[['he_cfc12']] <- hector::EMISSIONS_CFC12() - attr(globalCapabilities[['he_cfc12']], 'longName') <-"CFC-12 Emissions" - - # "CFC-113 Emissions" - globalCapabilities[['he_cfc113']] <- hector::EMISSIONS_CFC113() - attr(globalCapabilities[['he_cfc113']], 'longName') <-"CFC-113 Emissions" - - # "CFC-114 Emissions" - globalCapabilities[['he_cfc114']] <- hector::EMISSIONS_CFC114() - attr(globalCapabilities[['he_cfc114']], 'longName') <-"CFC-114 Emissions" - - # "CFC-115 Emissions" - globalCapabilities[['he_cfc115']] <- hector::EMISSIONS_CFC115() - attr(globalCapabilities[['he_cfc115']], 'longName') <-"CFC-115 Emissions" - - # "CCl4 Emissions" - globalCapabilities[['he_ccl4']] <- hector::EMISSIONS_CCL4() - attr(globalCapabilities[['he_ccl4']], 'longName') <-"CCl4 Emissions" - - # "CH3CCl3 Emissions" - globalCapabilities[['he_ch3ccl3']] <- hector::EMISSIONS_CH3CCL3() - attr(globalCapabilities[['he_ch3ccl3']], 'longName') <- "CH3CCl3 Emissions" - - # "HCFC-22 Emissions" - # globalCapabilities[['he_hcfc22']] <- hector::EMISSIONS_HCF22() - # attr(globalCapabilities[['he_hcfc22']], 'longName') <- "HCFC-22 Emissions" - - # "HCFC-141b Emissions" - # globalCapabilities[['he_hcfc141b']] <- hector::EMISSIONS_HCF141B() - # attr(globalCapabilities[['he_hcfc141b']], 'longName') <- "HCFC-141b Emissions" - - # "HCFC-142b Emissions" - # globalCapabilities[['he_hcfc142b']] <- hector::EMISSIONS_HCF142B() - # attr(globalCapabilities[['he_hcfc142b']], 'longName') <- "HCFC-142b Emissions" - - # "Halon-1211 Emissions" - globalCapabilities[['he_halon1211']] <- hector::EMISSIONS_HALON1211() - attr(globalCapabilities[['he_halon1211']], 'longName') <- "Halon-1211 Emissions" - - # "Halon-1301 Emissions" - globalCapabilities[['he_halon1301']] <- hector::EMISSIONS_HALON1301() - attr(globalCapabilities[['he_halon1301']], 'longName') <- "Halon-1301 Emissions" - - # "Halon-2402 Emissions" - globalCapabilities[['he_halon2402']] <- hector::EMISSIONS_HALON2402() - attr(globalCapabilities[['he_halon2402']], 'longName') <- "Halon-2402 Emissions" - - # "CH3Cl Emissions" - globalCapabilities[['he_ch3cl']] <- hector::EMISSIONS_CH3CL() - attr(globalCapabilities[['he_ch3cl']], 'longName') <- "CH3Cl Emissions" - - # "CH3Br Emissions" - globalCapabilities[['he_ch3br']] <- hector::EMISSIONS_CH3BR() - attr(globalCapabilities[['he_ch3br']], 'longName') <- "CH3Br Emissions" - - # HALOCARBON FORCINGS - # "CF4 Forcing" - globalCapabilities[['hf_cf4']] <- hector::RF_CF4() - attr(globalCapabilities[['hf_cf4']], 'longName') <- "CF4 Forcing" - - # "C2F6 Forcing" - globalCapabilities[['hf_c2f6']] <- hector::RF_C2F6() - attr(globalCapabilities[['hf_c2f6']], 'longName') <- "C2F6 Forcing" - - # "HFC-23 Forcing" - globalCapabilities[['hf_hfc23']] <- hector::RF_HFC23() - attr(globalCapabilities[['hf_hfc23']], 'longName') <- "HFC-23 Forcing" - - # "HFC-32 Forcing" - globalCapabilities[['hf_hfc32']] <- hector::RF_HFC32() - attr(globalCapabilities[['hf_hfc32']], 'longName') <- "HFC-32 Forcing" - - # "HFC-4310 Forcing" - globalCapabilities[['hf_hfc4310']] <- hector::RF_HFC4310() - attr(globalCapabilities[['hf_hfc4310']], 'longName') <- "HFC-4310 Forcing" - - # "HFC-125 Forcing" - globalCapabilities[['hf_hfc125']] <- hector::RF_HFC125() - attr(globalCapabilities[['hf_hfc125']], 'longName') <- "HFC-125 Forcing" - - # "HFC-134a Forcing" - globalCapabilities[['hf_hfc134a']] <- hector::RF_HFC134A() - attr(globalCapabilities[['hf_hfc134a']], 'longName') <- "HFC-134a Forcing" - - # "HFC-143a Forcing" - globalCapabilities[['hf_hfc143a']] <- hector::RF_HFC143A() - attr(globalCapabilities[['hf_hfc143a']], 'longName') <- "HFC-143a Forcing" - - # "HFC-227ea Forcing" - globalCapabilities[['hf_hfc227ea']] <- hector::RF_HFC227EA() - attr(globalCapabilities[['hf_hfc227ea']], 'longName') <- "HFC-227ea Forcing" - - # "HFC-245fa Forcing" - globalCapabilities[['hf_hfc245fa']] <- hector::RF_HFC245FA() - attr(globalCapabilities[['hf_hfc245fa']], 'longName') <- "HFC-245fa Forcing" - - # "SF6 Forcing" - globalCapabilities[['hf_hfcsf6']] <- hector::RF_SF6() - attr(globalCapabilities[['hf_hfcsf6']], 'longName') <- "SF6 Forcing" - - # "CFC-11 Forcing" - globalCapabilities[['hf_cfc11']] <- hector::RF_CFC11() - attr(globalCapabilities[['hf_cfc11']], 'longName') <- "CFC-11 Forcing" - - # "CFC-12 Forcing" - globalCapabilities[['hf_cfc12']] <- hector::RF_CFC12() - attr(globalCapabilities[['hf_cfc12']], 'longName') <- "CFC-12 Forcing" - - # "CFC-113 Forcing" - globalCapabilities[['hf_cfc113']] <- hector::RF_CFC113() - attr(globalCapabilities[['hf_cfc113']], 'longName') <- "CFC-113 Forcing" - - # "CFC-114 Forcing" - globalCapabilities[['hf_cfc114']] <- hector::RF_CFC114() - attr(globalCapabilities[['hf_cfc114']], 'longName') <- "CFC-114 Forcing" - - # "CFC-115 Forcing" - globalCapabilities[['hf_cfc115']] <- hector::RF_CFC115() - attr(globalCapabilities[['hf_cfc115']], 'longName') <- "CFC-115 Forcing" - - # "CCl4 Forcing" - globalCapabilities[['hf_ccl4']] <- hector::RF_CCL4() - attr(globalCapabilities[['hf_ccl4']], 'longName') <- "CCl4 Forcing" - - # "CH3CCl3 Forcing" - globalCapabilities[['hf_ch3ccl3']] <- hector::RF_CH3CCL3() - attr(globalCapabilities[['hf_ch3ccl3']], 'longName') <- "CH3CCl3 Forcing" - - # "HCFC-22 Forcing" - # globalCapabilities[['hf_hcfc22']] <- hector::RF_HCF22() - # attr(globalCapabilities[['hf_hcfc22']], 'longName') <- "HCFC-22 Forcing" - - # "HCFC-141b Forcing" - # globalCapabilities[['hf_hcfc141b']] <- hector::RF_HCFC141B() - # attr(globalCapabilities[['hf_hcfc141b']], 'longName') <- "HCFC-141b Forcing" - - # "HCFC-142b Forcing" - # globalCapabilities[['hf_hcfc142b']] <- hector::RF_HCFC142B() - # attr(globalCapabilities[['hf_hcfc142b']], 'longName') <- "HCFC-142b Forcing" - - # "Halon-1211 Forcing" - globalCapabilities[['hf_halon1211']] <- hector::RF_HALON1211() - attr(globalCapabilities[['hf_halon1211']], 'longName') <- "Halon-1211 Forcing" - - # "Halon-1301 Forcing" - globalCapabilities[['hf_halon1301']] <- hector::RF_HALON1301() - attr(globalCapabilities[['hf_halon1301']], 'longName') <- "Halon-1301 Forcing" - - # "Halon-2402 Forcing" - globalCapabilities[['hf_halon2402']] <- hector::RF_HALON2402() - attr(globalCapabilities[['hf_halon2402']], 'longName') <- "Halon-2402 Forcing" - - # "CH3Cl Forcing" - globalCapabilities[['hf_ch3cl']] <- hector::RF_CH3CL() - attr(globalCapabilities[['hf_ch3cl']], 'longName') <- "CH3Cl Forcing" - - # "CH3Br Forcing" - globalCapabilities[['hf_ch3br']] <- hector::RF_CH3BR() - attr(globalCapabilities[['hf_ch3br']], 'longName') <- "CH3Br Forcing" - - # METHANE - # "Atmospheric CH4" - globalCapabilities[['m_a_ch4']] <- hector::ATMOSPHERIC_CH4() - attr(globalCapabilities[['m_a_ch4']], 'longName') <- "Atmospheric CH4" - - # "Preindustrial Atmospheric CH4" - globalCapabilities[['m_pa_ch4']] <- hector::PREINDUSTRIAL_CH4() - attr(globalCapabilities[['m_pa_ch4']], 'longName') <- "Preindustrial Atmospheric CH4" - - # "Emissions CH4" - globalCapabilities[['m_e_ch4']] <- hector::EMISSIONS_CH4() - attr(globalCapabilities[['m_e_ch4']], 'longName') <- "Emissions CH4" - - # "Natural CH4 Emissions" - globalCapabilities[['m_n_ch4']] <- hector::NATURAL_CH4() - attr(globalCapabilities[['m_n_ch4']], 'longName') <- "Natural CH4 Emissions" - - # "Methane Loss - Soil" - globalCapabilities[['m_soil_loss']] <- hector::LIFETIME_SOIL() - attr(globalCapabilities[['m_soil_loss']], 'longName') <- "Methane Loss - Soil" - - # "Methane Loss - Straosphere" - globalCapabilities[['m_strat_loss']] <- hector::LIFETIME_STRAT() - attr(globalCapabilities[['m_strat_loss']], 'longName') <- "Methane Loss - Straosphere" - - # OCEAN - # "Ocean Carbon Flux" - globalCapabilities[['o_cf']] <- hector::OCEAN_CFLUX() - attr(globalCapabilities[['o_cf']], 'longName') <- "Ocean Carbon Flux" - - # "Ocean Total Carbon" - globalCapabilities[['o_tc']] <- hector::OCEAN_C() - attr(globalCapabilities[['o_tc']], 'longName') <- "Ocean Total Carbon" - - # "Ocean Surface High-Lat Carbon" - globalCapabilities[['o_os_hlc']] <- hector::OCEAN_C_HL() - attr(globalCapabilities[['o_os_hlc']], 'longName') <- "Ocean Surface High-Lat Carbon" - - # "Ocean Surface Low-Lat Carbon" - globalCapabilities[['o_os_llc']] <- hector::OCEAN_C_LL() - attr(globalCapabilities[['o_os_llc']], 'longName') <- "Ocean Surface Low-Lat Carbon" - - # "Ocean Intermediate Carbon" - globalCapabilities[['o_ic']] <- hector::OCEAN_C_IO() - attr(globalCapabilities[['o_ic']], 'longName') <- "Ocean Intermediate Carbon" - - # "Ocean Deep Carbon" - globalCapabilities[['o_dc']] <- hector::OCEAN_C_DO() - attr(globalCapabilities[['o_dc']], 'longName') <- "Ocean Deep Carbon" - - # "Thermohaline Overturning" - globalCapabilities[['o_to']] <- hector::TT() - attr(globalCapabilities[['o_to']], 'longName') <- "Thermohaline Overturning" - - # "High-Lat Overturning" - globalCapabilities[['o_hl_o']] <- hector::TU() - attr(globalCapabilities[['o_hl_o']], 'longName') <- "High-Lat Overturning" - - # "Warm-Intermediate Exchange" - globalCapabilities[['o_wie']] <- hector::TWI() - attr(globalCapabilities[['o_wie']], 'longName') <- "Warm-Intermediate Exchange" - - # "Intermediate-Deep Exchange" - globalCapabilities[['o_ide']] <- hector::TID() - attr(globalCapabilities[['o_ide']], 'longName') <- "Intermediate-Deep Exchange" - - # "High Latitude Ph" - globalCapabilities[['o_hl_ph']] <- hector::PH_HL() - attr(globalCapabilities[['o_hl_ph']], 'longName') <- "High Latitude Ph" - - # "Low Latitude Ph" - globalCapabilities[['o_ll_ph']] <- hector::PH_LL() - attr(globalCapabilities[['o_ll_ph']], 'longName') <- "Low Latitude Ph" - - # "Atmosphere-Ocean Flux - High Lat" - globalCapabilities[['o_hl_aof']] <- hector::ATM_OCEAN_FLUX_HL() - attr(globalCapabilities[['o_hl_aof']], 'longName') <- "Atmosphere-Ocean Flux - High Lat" - - # "Atmosphere-Ocean Flux - Low Lat" - globalCapabilities[['o_ll_aof']] <- hector::ATM_OCEAN_FLUX_LL() - attr(globalCapabilities[['o_ll_aof']], 'longName') <- "Atmosphere-Ocean Flux - Low Lat" - - # "Partial Pressure CO2 - High Lat" - globalCapabilities[['o_hl_pp_co2']] <- hector::PCO2_HL() - attr(globalCapabilities[['o_hl_pp_co2']], 'longName') <- "Partial Pressure CO2 - High Lat" - - # "Partial Pressure CO2 - Low Lat" - globalCapabilities[['o_ll_pp_co2']] <- hector::PCO2_LL() - attr(globalCapabilities[['o_ll_pp_co2']], 'longName') <- "Partial Pressure CO2 - Low Lat" - - # "Dissolved Inorganic C - High Lat" - globalCapabilities[['o_hl_dic']] <- hector::DIC_HL() - attr(globalCapabilities[['o_hl_dic']], 'longName') <- "Dissolved Inorganic C - High Lat" - - # "Dissolved Inorganic C - Low Lat"' - globalCapabilities[['o_ll_dic']] <- hector::DIC_LL() - attr(globalCapabilities[['o_ll_dic']], 'longName') <- "Dissolved Inorganic C - Low Lat" - - # "Ocean Temperature - High Lat" - globalCapabilities[['o_hl_t']] <- hector::TEMP_HL() - attr(globalCapabilities[['o_hl_t']], 'longName') <- "Ocean Temperature - High Lat" - - # "Ocean Temperature - Low Lat" - globalCapabilities[['o_ll_t']] <- hector::TEMP_LL() - attr(globalCapabilities[['o_ll_t']], 'longName') <- "Ocean Temperature - Low Lat" - - # "Carbonate Concentration - High Lat" - globalCapabilities[['o_hl_cc']] <- hector::CO3_HL() - attr(globalCapabilities[['o_hl_cc']], 'longName') <- "Carbonate Concentration - High Lat" - - # "Carbonate Concentration - Low Lat" - globalCapabilities[['o_ll_cc']] <- hector::CO3_LL() - attr(globalCapabilities[['o_ll_cc']], 'longName') <- "Carbonate Concentration - Low Lat" - - # SO2 - # "Natural SO2" - globalCapabilities[['so2_n']] <- hector::NATURAL_SO2() - attr(globalCapabilities[['so2_n']], 'longName') <- "Natural SO2" - - # "Year 2000 SO2" - globalCapabilities[['so2_y2k']] <- hector::Y2000_SO2() - attr(globalCapabilities[['so2_y2k']], 'longName') <- "Year 2000 SO2" - - # "Anthropogenic SO2" - globalCapabilities[['so2_a']] <- hector::EMISSIONS_SO2() - attr(globalCapabilities[['so2_a']], 'longName') <- "Anthropogenic SO2" - - # "Volcanic SO2" - globalCapabilities[['so2_v']] <- hector::VOLCANIC_SO2() - attr(globalCapabilities[['so2_v']], 'longName') <- "Volcanic SO2" - - # TEMPERATURE - # "Global Mean Temp" - globalCapabilities[['t_gmt']] <- hector::GLOBAL_TEMP() - attr(globalCapabilities[['t_gmt']], 'longName') <- "Global Mean Temperature" - - # "Equilibrium Global Temp" - globalCapabilities[['t_egt']] <- hector::GLOBAL_TEMPEQ() - attr(globalCapabilities[['t_egt']], 'longName') <- "Equilibrium Global Temperature" - - # "Ocean Surface Temp" - globalCapabilities[['t_ost']] <- hector::OCEAN_SURFACE_TEMP() - attr(globalCapabilities[['t_ost']], 'longName') <- "Ocean Surface Temperature" - - # "Ocean Air Temp" - globalCapabilities[['t_oat']] <- hector::OCEAN_AIR_TEMP() - attr(globalCapabilities[['t_oat']], 'longName') <- "Ocean Air Temperature" - - # "Land Temp Anomaly" - # globalCapabilities[['t_lta']] <- hector::LAND_TEMP() - # attr(globalCapabilities[['t_lta']], 'longName') <- "Land Temperature Anomaly" - - # "Heat Flux - Mixed Layer Ocean" - globalCapabilities[['t_hf_mlo']] <- hector::FLUX_MIXED() - attr(globalCapabilities[['t_hf_mlo']], 'longName') <- "Heat Flux - Mixed Layer Ocean" - - # "Heat Flux - Interior Layer Ocean" - globalCapabilities[['t_hf_ilo']] <- hector::FLUX_INTERIOR() - attr(globalCapabilities[['t_hf_ilo']], 'longName') <- "Heat Flux - Interior Layer Ocean" - - # "Total Heat Flux - Ocean" - globalCapabilities[['t_hf_t']] <- hector::HEAT_FLUX() - attr(globalCapabilities[['t_hf_t']], 'longName') <- "Total Heat Flux - Ocean" - - - return(globalCapabilities) -} diff --git a/inst/shinyApp/components/layout/global-lists.r b/inst/shinyApp/components/layout/global-lists.r deleted file mode 100644 index 4942e87..0000000 --- a/inst/shinyApp/components/layout/global-lists.r +++ /dev/null @@ -1,107 +0,0 @@ - -scenarios <- 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") - -title <- list("CO2_concentration" = "Atmospheric CO2", - "atmos_co2" = "Atmospheric Carbon Pool", - "ffi_emissions" = "FFI Emissions", - "luc_emissions" = "LUC Emissions", - "N2O_concentration" = "N2O Concentration", - "BC_emissions" = "Black Carbon Emissions", - "OC_emissions" = "Organic Carbon Emissions", - "RF_tot" = "RF - Total", - "RF_albedo" = "RF - Albedo", - "RF_CO2" = "RF - CO2", - "RF_N2O" = "RF - N2O", - "RF_BC" = "RF - Black Carbon", - "RF_OC" = "RF - Organic Carbon", - "RF_SO2" = "RF - Total SO2", - "RF_VOL" = "RF - Volcanic Activity", - "RF_CH4" = "RF - CH4", - "RF_CF4" = "CF4 Forcing", - "RF_C2F6" = "C2F6 Forcing", - "RF_HFC23" = "HFC-23 Forcing", - "RF_HFC4310" = "HFC-4310 Forcing", - "RF_HFC125" = "HFC-125 Forcing", - "RF_HFC143a" = "HFC-143a Forcing", - "RF_HFC245fa" = "HFC-245fa Forcing", - "RF_SF6" = "SF6 Forcing", - "RF_CFC11" = "CFC-11 Forcing", - "RF_CFC12" = "CFC-12 Forcing", - "RF_CFC113" = "CFC-113 Forcing", - "RF_CFC114" = "CFC-114 Forcing", - "RF_CFC115" = "CFC-115 Forcing", - "RF_CCl4" = "CCl4 Forcing", - "RF_CH3CCl3" = "CH3CCl3 Forcing", - "RF_halon1211" = "Halon-1211 Forcing", - "RF_halon1301" = "Halon-1301 Forcing", - "RF_halon2402" = "Halon-2402 Forcing", - "RF_CH3Cl" = "CH3Cl Forcing", - "RF_CH3Br" = "CH3Br Forcing", - "CH4_concentration" = "Atmospheric CH4", - "CH4_emissions" = "CH4 Emissions", - "SO2_emissions" = "Anthropogenic SO2", - "SV" = "Volcanic SO2", - "global_tas" = "Global Mean Temperature", - "gmst" = "Equilibrium Global Temperature", - "sst" = "Ocean Surface Temperature", - "ocean_tas" = "Ocean Air Temperature", - "heatflux_mixed" = "Heat Flux - Mixed Layer Ocean", - "heatflux_interior" = "Heat Flux - Interior Layer Ocean", - "heatflux" = "Total Heat Flux - Ocean" -) - -units <- list("CO2_concentration" = "DegC", - "atmos_co2" = "Pg C", - "ffi_emissions" = "Pg C/yr", - "luc_emissions" = "Pg C/yr", - "N2O_concentration" = "ppbv N2O", - "BC_emissions" = "Tg", - "OC_emissions" = "Tg", - "RF_tot" = "RF - Total", - "RF_albedo" = "W/m2", - "RF_CO2" = "W/m2", - "RF_N2O" = "W/m2", - "RF_BC" = "W/m2", - "RF_OC" = "W/m2", - "RF_SO2" = "W/m2", - "RF_VOL" = "W/m2", - "RF_CH4" = "W/m2", - "RF_CF4" = "W/m2", - "RF_C2F6" = "W/m2", - "RF_HFC23" = "W/m2", - "RF_HFC4310" = "W/m2", - "RF_HFC125" = "W/m2", - "RF_HFC143a" = "W/m2", - "RF_HFC245fa" = "W/m2", - "RF_SF6" = "W/m2", - "RF_CFC11" = "W/m2", - "RF_CFC12" = "W/m2", - "RF_CFC113" = "W/m2", - "RF_CFC114" = "W/m2", - "RF_CFC115" = "W/m2", - "RF_CCl4" = "W/m2", - "RF_CH3CCl3" = "W/m2", - "RF_halon1211" = "W/m2", - "RF_halon1301" = "W/m2", - "RF_halon2402" = "W/m2", - "RF_CH3Cl" = "W/m2", - "RF_CH3Br" = "W/m2", - "CH4_concentration" = "ppbv CH4", - "CH4_emissions" = "Tg CH4", - "SO2_emissions" = "Gg SO2", - "SV" = "W/m2", - "global_tas" = "DegC", - "gmst" = "DegC", - "sst" = "DegC", - "ocean_tas" = "DegC", - "heatflux_mixed" = "W/m2", - "heatflux_interior" = "W/m2", - "heatflux" = "W/m2" -) diff --git a/inst/shinyApp/components/modules/module_choices.r b/inst/shinyApp/components/modules/module_choices.r deleted file mode 100644 index 55a7285..0000000 --- a/inst/shinyApp/components/modules/module_choices.r +++ /dev/null @@ -1,66 +0,0 @@ - -choices_ui <- function(x) { - - tabsetPanel( - tabPanel(class = "params", - "Standard Scenarios", - h5("Representative Concentration Pathways (RCPs)"), - shinyWidgets::awesomeCheckboxGroup(inputId = "input_RCP", label = "", - choices = c("2.6", "4.5", "6.0", "8.5"), inline = TRUE, status = "info"), - # shinyWidgets::prettyCheckbox(inputId = (NS(x,"input_RCP_2.6")), label = "2.6", value = FALSE, width = 45, - # inline = TRUE, icon = icon("check"), animation = "jelly", status = "info"), - # shinyWidgets::prettyCheckbox(inputId = (NS(x,"input_RCP_4.5")), label = "4.5", value = TRUE, width = 45, - # inline = TRUE, icon = icon("check"), animation = "jelly", status = "success"), - # shinyWidgets::prettyCheckbox(inputId = (NS(x,"input_RCP_6.0")), label = "6.0", value = FALSE, width = 45, - # inline = TRUE, icon = icon("check"), animation = "jelly", status = "warning"), - # shinyWidgets::prettyCheckbox(inputId = (NS(x,"input_RCP_8.5")), label = "8.5", value = FALSE, width = 45, - # inline = TRUE, icon = icon("check"), animation = "jelly", status = "danger"), - h5("Model Parameters"), - fluidRow( - column(6, - selectInput("input_paramToggle", label = NULL, - choices = list("Hector Default" = "default", "CanESM2" = "canesm2", - "CESM1-BGC" = "cesm1-bgc", "GFDL-ESM2G" = "gfdl-esm2g", - "MIROC-ESM" = "miroc-esm", "MPI-ESM-LR" = "mpi-esm-lr", - "MRI-ESM1" = "mri-esm1")) - ), - ), - fluidRow( - column(12, - sliderInput(NS(x, "input_aero"), "Aerosol forcing scaling factor", min = 0, max = 1, value = 1, width = "90%"), - sliderInput(NS(x,"input_beta"), "CO2 fertilization factor", min = 0, max = 4, value = 0.36, step = 0.01, width = "90%"), - sliderInput(NS(x,"input_diff"), "Ocean heat diffusivity", min = 0, max = 5, value = 2.3, step = 0.1, post = " cm2/s", width = "90%"), - sliderInput(NS(x,"input_ecs"), "Equilibrium climate sensitivity", min = 1, max = 6, value = 3, step = 0.1, post = " °C", width = "90%"), - sliderInput(NS(x,"input_q10"), "Heterotrophic Temperature Sensitivity", min = 1, max = 5, value = 2, step = 0.1, width = "90%"), - sliderInput(NS(x,"input_volc"),"Volcanic forcing scaling factor", min = 0, max = 1, value = 1, width = "90%"), - - # Add hover popups with parameter descriptions - bsPopover("input_aero", "Increasing this means aerosols exert a stronger radiative forcing", - placement = "top", trigger = "hover", options = NULL), - bsPopover("input_beta", "Increasing this means vegetation grows faster as CO2 increases", - placement = "top", trigger = "hover", options = NULL), - bsPopover("input_diff", "Increasing this means heat moves deeper into the ocean quicker", - placement = "top", trigger = "hover", options = NULL), - bsPopover("input_ecs", "Increasing this means a larger temperature rise as CO2 increases", - placement = "top", trigger = "hover", options = NULL), - bsPopover("input_q10", "Increasing this means soil microbes respire faster as temperature rises", - placement = "top", trigger = "hover", options = NULL), - bsPopover("input_volc", "Increasing this means that volcanic eruptions exert a stronger radiative forcing", - placement = "top", trigger = "hover", options = NULL) - ) - ), - chooseSliderSkin(skin = "Flat", color = "#375a7f") - ) - ) -} - -choices_server <- function(x) { - moduleServer(x, function(input, output, session) { - - paramsList <- list() - observeEvent(input$input_aero, print(input$input_aero)) - - #updateSliderInput(session, "input_aero", value=paramsList[['alpha']]) - - }) -} diff --git a/inst/shinyApp/global.r b/inst/shinyApp/global.r index cde1fd2..937f2a9 100644 --- a/inst/shinyApp/global.r +++ b/inst/shinyApp/global.r @@ -21,7 +21,6 @@ source("components/modules/mod_download.R", local = TRUE) source("components/modules/mod_tracking.R", local = TRUE) source("components/functions/func_graph_plots.R", local = TRUE) source("components/functions/func_custom_emissions.R", local = TRUE) -source("components/layout/global-lists.r", local = TRUE) theme_set(theme_minimal()) @@ -48,3 +47,111 @@ HectorInputs <- R6Class( # } ) ) + +scenarios <- 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") + +title <- list("CO2_concentration" = "Atmospheric CO2", + "atmos_co2" = "Atmospheric Carbon Pool", + "ffi_emissions" = "FFI Emissions", + "luc_emissions" = "LUC Emissions", + "N2O_concentration" = "N2O Concentration", + "BC_emissions" = "Black Carbon Emissions", + "OC_emissions" = "Organic Carbon Emissions", + "RF_tot" = "RF - Total", + "RF_albedo" = "RF - Albedo", + "RF_CO2" = "RF - CO2", + "RF_N2O" = "RF - N2O", + "RF_BC" = "RF - Black Carbon", + "RF_OC" = "RF - Organic Carbon", + "RF_SO2" = "RF - Total SO2", + "RF_VOL" = "RF - Volcanic Activity", + "RF_CH4" = "RF - CH4", + "RF_CF4" = "CF4 Forcing", + "RF_C2F6" = "C2F6 Forcing", + "RF_HFC23" = "HFC-23 Forcing", + "RF_HFC4310" = "HFC-4310 Forcing", + "RF_HFC125" = "HFC-125 Forcing", + "RF_HFC143a" = "HFC-143a Forcing", + "RF_HFC245fa" = "HFC-245fa Forcing", + "RF_SF6" = "SF6 Forcing", + "RF_CFC11" = "CFC-11 Forcing", + "RF_CFC12" = "CFC-12 Forcing", + "RF_CFC113" = "CFC-113 Forcing", + "RF_CFC114" = "CFC-114 Forcing", + "RF_CFC115" = "CFC-115 Forcing", + "RF_CCl4" = "CCl4 Forcing", + "RF_CH3CCl3" = "CH3CCl3 Forcing", + "RF_halon1211" = "Halon-1211 Forcing", + "RF_halon1301" = "Halon-1301 Forcing", + "RF_halon2402" = "Halon-2402 Forcing", + "RF_CH3Cl" = "CH3Cl Forcing", + "RF_CH3Br" = "CH3Br Forcing", + "CH4_concentration" = "Atmospheric CH4", + "CH4_emissions" = "CH4 Emissions", + "SO2_emissions" = "Anthropogenic SO2", + "SV" = "Volcanic SO2", + "global_tas" = "Global Mean Temperature", + "gmst" = "Equilibrium Global Temperature", + "sst" = "Ocean Surface Temperature", + "ocean_tas" = "Ocean Air Temperature", + "heatflux_mixed" = "Heat Flux - Mixed Layer Ocean", + "heatflux_interior" = "Heat Flux - Interior Layer Ocean", + "heatflux" = "Total Heat Flux - Ocean" +) + +units <- list("CO2_concentration" = "DegC", + "atmos_co2" = "Pg C", + "ffi_emissions" = "Pg C/yr", + "luc_emissions" = "Pg C/yr", + "N2O_concentration" = "ppbv N2O", + "BC_emissions" = "Tg", + "OC_emissions" = "Tg", + "RF_tot" = "RF - Total", + "RF_albedo" = "W/m2", + "RF_CO2" = "W/m2", + "RF_N2O" = "W/m2", + "RF_BC" = "W/m2", + "RF_OC" = "W/m2", + "RF_SO2" = "W/m2", + "RF_VOL" = "W/m2", + "RF_CH4" = "W/m2", + "RF_CF4" = "W/m2", + "RF_C2F6" = "W/m2", + "RF_HFC23" = "W/m2", + "RF_HFC4310" = "W/m2", + "RF_HFC125" = "W/m2", + "RF_HFC143a" = "W/m2", + "RF_HFC245fa" = "W/m2", + "RF_SF6" = "W/m2", + "RF_CFC11" = "W/m2", + "RF_CFC12" = "W/m2", + "RF_CFC113" = "W/m2", + "RF_CFC114" = "W/m2", + "RF_CFC115" = "W/m2", + "RF_CCl4" = "W/m2", + "RF_CH3CCl3" = "W/m2", + "RF_halon1211" = "W/m2", + "RF_halon1301" = "W/m2", + "RF_halon2402" = "W/m2", + "RF_CH3Cl" = "W/m2", + "RF_CH3Br" = "W/m2", + "CH4_concentration" = "ppbv CH4", + "CH4_emissions" = "Tg CH4", + "SO2_emissions" = "Gg SO2", + "SV" = "W/m2", + "global_tas" = "DegC", + "gmst" = "DegC", + "sst" = "DegC", + "ocean_tas" = "DegC", + "heatflux_mixed" = "W/m2", + "heatflux_interior" = "W/m2", + "heatflux" = "W/m2" +) + diff --git a/man/get_globalCapabilities.Rd b/man/get_globalCapabilities.Rd deleted file mode 100644 index 19c53b1..0000000 --- a/man/get_globalCapabilities.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalCapabilities} -\alias{get_globalCapabilities} -\title{Create master list of variable lookups for "capabilities" (output variables for graphing)} -\usage{ -get_globalCapabilities() -} -\description{ -Create master list of variable lookups for "capabilities" (output variables for graphing) -} diff --git a/man/get_globalColorScales.Rd b/man/get_globalColorScales.Rd deleted file mode 100644 index 5a30079..0000000 --- a/man/get_globalColorScales.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalColorScales} -\alias{get_globalColorScales} -\title{Global vars for scale colors} -\usage{ -get_globalColorScales() -} -\description{ -Global vars for scale colors -} diff --git a/man/get_globalParameters.Rd b/man/get_globalParameters.Rd deleted file mode 100644 index 22e1c90..0000000 --- a/man/get_globalParameters.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParameters} -\alias{get_globalParameters} -\title{Create master list of parameter lookup strings} -\usage{ -get_globalParameters() -} -\description{ -Create master list of parameter lookup strings -} diff --git a/man/get_globalParamsCESM1BGC.Rd b/man/get_globalParamsCESM1BGC.Rd deleted file mode 100644 index cf6d4ed..0000000 --- a/man/get_globalParamsCESM1BGC.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsCESM1BGC} -\alias{get_globalParamsCESM1BGC} -\title{CESM1-BGC Parameter Set} -\usage{ -get_globalParamsCESM1BGC() -} -\description{ -CESM1-BGC Parameter Set -} diff --git a/man/get_globalParamsCanESM2.Rd b/man/get_globalParamsCanESM2.Rd deleted file mode 100644 index 5940a14..0000000 --- a/man/get_globalParamsCanESM2.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsCanESM2} -\alias{get_globalParamsCanESM2} -\title{CanESM2 Parameter Sets} -\usage{ -get_globalParamsCanESM2() -} -\description{ -CanESM2 Parameter Sets -} diff --git a/man/get_globalParamsDefault.Rd b/man/get_globalParamsDefault.Rd deleted file mode 100644 index 9a32d3b..0000000 --- a/man/get_globalParamsDefault.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsDefault} -\alias{get_globalParamsDefault} -\title{Default Hector parameters} -\usage{ -get_globalParamsDefault() -} -\description{ -Default Hector parameters -} diff --git a/man/get_globalParamsGFDLESM2G.Rd b/man/get_globalParamsGFDLESM2G.Rd deleted file mode 100644 index f4862e8..0000000 --- a/man/get_globalParamsGFDLESM2G.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsGFDLESM2G} -\alias{get_globalParamsGFDLESM2G} -\title{GFDL-ESM2G Parameter Set} -\usage{ -get_globalParamsGFDLESM2G() -} -\description{ -GFDL-ESM2G Parameter Set -} diff --git a/man/get_globalParamsMIROCESM.Rd b/man/get_globalParamsMIROCESM.Rd deleted file mode 100644 index 6128073..0000000 --- a/man/get_globalParamsMIROCESM.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsMIROCESM} -\alias{get_globalParamsMIROCESM} -\title{MIROC-ESM Parameter Set} -\usage{ -get_globalParamsMIROCESM() -} -\description{ -MIROC-ESM Parameter Set -} diff --git a/man/get_globalParamsMPIESMLR.Rd b/man/get_globalParamsMPIESMLR.Rd deleted file mode 100644 index 607e9bd..0000000 --- a/man/get_globalParamsMPIESMLR.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsMPIESMLR} -\alias{get_globalParamsMPIESMLR} -\title{MPI-ESM-LR Parameter Set} -\usage{ -get_globalParamsMPIESMLR() -} -\description{ -MPI-ESM-LR Parameter Set -} diff --git a/man/get_globalParamsMRIESM1.Rd b/man/get_globalParamsMRIESM1.Rd deleted file mode 100644 index a3fc540..0000000 --- a/man/get_globalParamsMRIESM1.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalParamsMRIESM1} -\alias{get_globalParamsMRIESM1} -\title{MRI-ESM1 Parameter Set} -\usage{ -get_globalParamsMRIESM1() -} -\description{ -MRI-ESM1 Parameter Set -} diff --git a/man/get_globalPrecipPatterns.Rd b/man/get_globalPrecipPatterns.Rd deleted file mode 100644 index d6ca541..0000000 --- a/man/get_globalPrecipPatterns.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalPrecipPatterns} -\alias{get_globalPrecipPatterns} -\title{Global precipitation patterns list} -\usage{ -get_globalPrecipPatterns() -} -\description{ -Global precipitation patterns list -} diff --git a/man/get_globalScenarioColors.Rd b/man/get_globalScenarioColors.Rd deleted file mode 100644 index 43695e4..0000000 --- a/man/get_globalScenarioColors.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalScenarioColors} -\alias{get_globalScenarioColors} -\title{Global scenario color schemes} -\usage{ -get_globalScenarioColors() -} -\description{ -Global scenario color schemes -} diff --git a/man/get_globalScenarios.Rd b/man/get_globalScenarios.Rd deleted file mode 100644 index fbfb6da..0000000 --- a/man/get_globalScenarios.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalScenarios} -\alias{get_globalScenarios} -\title{Global file paths vector} -\usage{ -get_globalScenarios() -} -\description{ -Global file paths vector -} diff --git a/man/get_globalTempPatterns.Rd b/man/get_globalTempPatterns.Rd deleted file mode 100644 index 8b7f8da..0000000 --- a/man/get_globalTempPatterns.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalTempPatterns} -\alias{get_globalTempPatterns} -\title{Global temperature patterns} -\usage{ -get_globalTempPatterns() -} -\description{ -Global temperature patterns -} diff --git a/man/get_globalVars.Rd b/man/get_globalVars.Rd deleted file mode 100644 index dcf5659..0000000 --- a/man/get_globalVars.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_globalVars} -\alias{get_globalVars} -\title{Global vars for misc items such as the run date end year (2100)} -\usage{ -get_globalVars() -} -\description{ -Global vars for misc items such as the run date end year (2100) -} diff --git a/man/get_rcps.Rd b/man/get_rcps.Rd deleted file mode 100644 index fe4d875..0000000 --- a/man/get_rcps.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/set_globals.R -\name{get_rcps} -\alias{get_rcps} -\title{RCP list by number} -\usage{ -get_rcps() -} -\description{ -RCP list by number -} diff --git a/tests/testthat/test-globals.R b/tests/testthat/test-globals.R index b42fea2..eec4224 100644 --- a/tests/testthat/test-globals.R +++ b/tests/testthat/test-globals.R @@ -1,123 +1 @@ library(hector) -source("components/layout/global-lists.r", local = TRUE) - -context("globals") - -test_that("globals: scenarios", { - - expect_equal(scenarios, 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")) - -}) - - -test_that("globals: titles", { - - expect_equal(title, list("CO2_concentration" = "Atmospheric CO2", - "atmos_co2" = "Atmospheric Carbon Pool", - "ffi_emissions" = "FFI Emissions", - "luc_emissions" = "LUC Emissions", - "N2O_concentration" = "N2O Concentration", - "BC_emissions" = "Black Carbon Emissions", - "OC_emissions" = "Organic Carbon Emissions", - "RF_tot" = "RF - Total", - "RF_albedo" = "RF - Albedo", - "RF_CO2" = "RF - CO2", - "RF_N2O" = "RF - N2O", - "RF_BC" = "RF - Black Carbon", - "RF_OC" = "RF - Organic Carbon", - "RF_SO2" = "RF - Total SO2", - "RF_VOL" = "RF - Volcanic Activity", - "RF_CH4" = "RF - CH4", - "RF_CF4" = "CF4 Forcing", - "RF_C2F6" = "C2F6 Forcing", - "RF_HFC23" = "HFC-23 Forcing", - "RF_HFC4310" = "HFC-4310 Forcing", - "RF_HFC125" = "HFC-125 Forcing", - "RF_HFC143a" = "HFC-143a Forcing", - "RF_HFC245fa" = "HFC-245fa Forcing", - "RF_SF6" = "SF6 Forcing", - "RF_CFC11" = "CFC-11 Forcing", - "RF_CFC12" = "CFC-12 Forcing", - "RF_CFC113" = "CFC-113 Forcing", - "RF_CFC114" = "CFC-114 Forcing", - "RF_CFC115" = "CFC-115 Forcing", - "RF_CCl4" = "CCl4 Forcing", - "RF_CH3CCl3" = "CH3CCl3 Forcing", - "RF_halon1211" = "Halon-1211 Forcing", - "RF_halon1301" = "Halon-1301 Forcing", - "RF_halon2402" = "Halon-2402 Forcing", - "RF_CH3Cl" = "CH3Cl Forcing", - "RF_CH3Br" = "CH3Br Forcing", - "CH4_concentration" = "Atmospheric CH4", - "CH4_emissions" = "CH4 Emissions", - "SO2_emissions" = "Anthropogenic SO2", - "SV" = "Volcanic SO2", - "global_tas" = "Global Mean Temperature", - "gmst" = "Equilibrium Global Temperature", - "sst" = "Ocean Surface Temperature", - "ocean_tas" = "Ocean Air Temperature", - "heatflux_mixed" = "Heat Flux - Mixed Layer Ocean", - "heatflux_interior" = "Heat Flux - Interior Layer Ocean", - "heatflux" = "Total Heat Flux - Ocean")) - -}) - - -test_that("globals: units", { - - expect_equal(units, list("CO2_concentration" = "DegC", - "atmos_co2" = "Pg C", - "ffi_emissions" = "Pg C/yr", - "luc_emissions" = "Pg C/yr", - "N2O_concentration" = "ppbv N2O", - "BC_emissions" = "Tg", - "OC_emissions" = "Tg", - "RF_tot" = "RF - Total", - "RF_albedo" = "W/m2", - "RF_CO2" = "W/m2", - "RF_N2O" = "W/m2", - "RF_BC" = "W/m2", - "RF_OC" = "W/m2", - "RF_SO2" = "W/m2", - "RF_VOL" = "W/m2", - "RF_CH4" = "W/m2", - "RF_CF4" = "W/m2", - "RF_C2F6" = "W/m2", - "RF_HFC23" = "W/m2", - "RF_HFC4310" = "W/m2", - "RF_HFC125" = "W/m2", - "RF_HFC143a" = "W/m2", - "RF_HFC245fa" = "W/m2", - "RF_SF6" = "W/m2", - "RF_CFC11" = "W/m2", - "RF_CFC12" = "W/m2", - "RF_CFC113" = "W/m2", - "RF_CFC114" = "W/m2", - "RF_CFC115" = "W/m2", - "RF_CCl4" = "W/m2", - "RF_CH3CCl3" = "W/m2", - "RF_halon1211" = "W/m2", - "RF_halon1301" = "W/m2", - "RF_halon2402" = "W/m2", - "RF_CH3Cl" = "W/m2", - "RF_CH3Br" = "W/m2", - "CH4_concentration" = "ppbv CH4", - "CH4_emissions" = "Tg CH4", - "SO2_emissions" = "Gg SO2", - "SV" = "W/m2", - "global_tas" = "DegC", - "gmst" = "DegC", - "sst" = "DegC", - "ocean_tas" = "DegC", - "heatflux_mixed" = "W/m2", - "heatflux_interior" = "W/m2", - "heatflux" = "W/m2")) - -})