diff --git a/.buildlibrary b/.buildlibrary index 1d81d8a3..bbf52269 100644 --- a/.buildlibrary +++ b/.buildlibrary @@ -1,4 +1,4 @@ -ValidationKey: '1002400' +ValidationKey: '1002450' AutocreateReadme: yes AcceptedWarnings: - 'Warning: package ''.*'' was built under R version' diff --git a/CITATION.cff b/CITATION.cff index ef0ac55a..34799ebf 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f type: software title: 'mrindustry: input data generation for the REMIND industry module' version: 0.5.0 -date-released: '2024-11-21' +date-released: '2024-11-22' abstract: The mrindustry packages contains data preprocessing for the REMIND model. authors: - family-names: Benke diff --git a/DESCRIPTION b/DESCRIPTION index 6670d597..8faf0ac7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Type: Package Package: mrindustry Title: input data generation for the REMIND industry module Version: 0.5.0 -Date: 2024-11-21 +Date: 2024-11-22 Authors@R: c( person(given = "Falk", family = "Benke", email = "benke@pik-potsdam.de", role = c("aut", "cre")), diff --git a/R/calcFeDemandIndustry.R b/R/calcFeDemandIndustry.R index 62c446a9..773ab70b 100644 --- a/R/calcFeDemandIndustry.R +++ b/R/calcFeDemandIndustry.R @@ -1,5 +1,6 @@ #' Calculates FE demand in industry as REMIND variables #' +#' @md #' @param use_ODYM_RECC per-capita pathways for `SDP_xx` scenarios? (Defaults #' to `FALSE`.) #' @param last_empirical_year Last year for which empirical data is available. @@ -1049,6 +1050,49 @@ calcFeDemandIndustry <- function(use_ODYM_RECC = FALSE, ungroup() %>% select(-"value") + ### modify subsector FE share targets ---- + # Default data with no modification will reduce the solids share of other + # industry in the Non-OECD region by ten percentage points, and increase the + # electricity share by as much. The changes are phased in over the time + # horizon of IEA ETP data (2025–60). + IEA_ETP_Ind_FE_shares_delta <- tribble( + ~region, ~subsector, ~fety, ~share.delta, + 'Non-OECD', 'otherInd', 'feel', 0.1, + 'Non-OECD', 'otherInd', 'feso', -0.1) + + # verify modification sums + IEA_ETP_Ind_FE_shares_delta %>% + group_by(.data$region, .data$subsector) %>% + summarise(share.delta.sum = sum(.data$share.delta), .groups = 'drop') %>% + verify(0 == .data$share.delta.sum) %>% + invisible() + + IEA_ETP_Ind_FE_shares <- IEA_ETP_Ind_FE_shares %>% + left_join( + # expand modifications to phase in from 0 to full over the time horizon of + # IEA_ETP_Ind_FE_shares + IEA_ETP_Ind_FE_shares_delta %>% + left_join( + IEA_ETP_Ind_FE_shares %>% + select(-'share') %>% + filter(.data$year %in% range(.data$year)), + + c('region', 'subsector', 'fety') + ) %>% + mutate(share.delta = ifelse(min(.data$year) == .data$year, + 0, + .data$share.delta)) %>% + interpolate_missing_periods(year = unique(IEA_ETP_Ind_FE_shares$year), + value = 'share.delta'), + + c('region', 'subsector', 'fety', 'year'), + + ) %>% + replace_na(list(share.delta = 0)) %>% + # add share modifications + mutate(share = .data$share + .data$share.delta) %>% + select(-'share.delta') + ### split feel shares and extend to SSP scenarios ---- IEA_ETP_Ind_FE_shares <- bind_rows( # all pf that don't need splitting diff --git a/man/calcFeDemandIndustry.Rd b/man/calcFeDemandIndustry.Rd index 416d4517..6625a916 100644 --- a/man/calcFeDemandIndustry.Rd +++ b/man/calcFeDemandIndustry.Rd @@ -7,8 +7,8 @@ calcFeDemandIndustry(use_ODYM_RECC = FALSE, last_empirical_year = 2020) } \arguments{ -\item{use_ODYM_RECC}{per-capita pathways for `SDP_xx` scenarios? (Defaults -to `FALSE`.)} +\item{use_ODYM_RECC}{per-capita pathways for \code{SDP_xx} scenarios? (Defaults +to \code{FALSE}.)} \item{last_empirical_year}{Last year for which empirical data is available. Defaults to 2020.}