Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into ng-el-OAE
Browse files Browse the repository at this point in the history
  • Loading branch information
katarkow committed Aug 21, 2024
2 parents 573be95 + 3b1e83a commit f97ea7b
Show file tree
Hide file tree
Showing 9 changed files with 12,417 additions and 115 deletions.
2 changes: 1 addition & 1 deletion .buildlibrary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ValidationKey: '229367500'
ValidationKey: '229425000'
AcceptedWarnings:
- 'Warning: package ''.*'' was built under R version'
- 'Warning: namespace ''.*'' is not available and has been replaced'
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ message: If you use this software, please cite it using the metadata from this f
type: software
title: 'remind2: The REMIND R package (2nd generation)'
version: 1.150.0
date-released: '2024-08-10'
date-released: '2024-08-15'
abstract: Contains the REMIND-specific routines for data and model output manipulation.
authors:
- family-names: Rodrigues
Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: remind2
Title: The REMIND R package (2nd generation)
Version: 1.150.0
Date: 2024-08-10
Date: 2024-08-15
Authors@R: c(
person("Renato", "Rodrigues", , "[email protected]", role = c("aut", "cre")),
person("Lavinia", "Baumstark", role = "aut"),
Expand Down Expand Up @@ -75,7 +75,8 @@ Imports:
tidyr,
tidyselect,
withr,
yaml
yaml,
digest
Suggests:
covr,
gridExtra,
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ importFrom(data.table,fwrite)
importFrom(data.table,rbindlist)
importFrom(data.table,setDT)
importFrom(data.table,setnames)
importFrom(digest,digest)
importFrom(dplyr,"%>%")
importFrom(dplyr,across)
importFrom(dplyr,arrange)
Expand Down
368 changes: 264 additions & 104 deletions R/reportEmi.R

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions R/reportSE.R
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,13 @@ reportSE <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq

vm_demFeSector <- readGDX(gdx, "vm_demFeSector", field = "l", restore_zeros = F)[, y, ] * pm_conv_TWa_EJ
vm_demFeSector[is.na(vm_demFeSector)] <- 0

# SE demand
vm_demSe <- readGDX(gdx, "vm_demSe", field = "l", restore_zeros = F)[, y, ] * pm_conv_TWa_EJ

# SE demand of specific energy system technologies (ensure that all regions have a value)
v_demSeOth <- readGDX(gdx, c("v_demSeOth", "vm_demSeOth"), field = "l", restore_zeros = FALSE)[, y, ] * pm_conv_TWa_EJ
matrixRegionsYears <- new.magpie(cells_and_regions = getRegions(dataoc), years = y, fill = 0, sets = getSets(v_demSeOth, fulldim = FALSE))
v_demSeOth <- matchDim(v_demSeOth, matrixRegionsYears, dim=1, fill=0)

# conversion efficiency
pm_eta_conv <- readGDX(gdx, "pm_eta_conv", field = "l", restore_zeros = F)[, y, ]

Expand All @@ -392,12 +393,13 @@ reportSE <- function(gdx, regionSubsetList = NULL, t = c(seq(2005, 2060, 5), seq
setNames(dimSums(mselect(vm_demSe, all_enty = "seh2", all_enty1 = "seliqsyn", all_te = "MeOH"), dim = 3), "SE|Input|Hydrogen|Synthetic Fuels|+|Liquids (EJ/yr)"),
setNames(dimSums(mselect(vm_demSe, all_enty = "seh2", all_enty1 = "segasyn", all_te = "h22ch4"), dim = 3), "SE|Input|Hydrogen|Synthetic Fuels|+|Gases (EJ/yr)")
)

# hydrogen used for other energy system technologies subsumed in v_demSeOth
# e.g. co-firing of h2 in csp
tmp1 <- mbind(tmp1,
setNames(dimSums(mselect(v_demSeOth, all_enty = "seh2"), dim = 3),
"SE|Input|Hydrogen|Other Energy System Consumption (EJ/yr)"))

seh2 <- setNames(dimSums(mselect(v_demSeOth, all_enty = "seh2"), dim = 3),
"SE|Input|Hydrogen|Other Energy System Consumption (EJ/yr)")
seh2 <- magclass::matchDim(seh2, tmp1, dim = 1, fill = NA)
tmp1 <- mbind(tmp1, seh2)

# SE electricity use

Expand Down
54 changes: 53 additions & 1 deletion inst/compareScenarios/cs_03_emissions.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,58 @@ showLinePlots(
showLinePlots(data, "Emi|CO2|Industry")
```

### Waste Emissions

#### Total Waste Emissions

```{r total waste CO2}
tot <- "Emi|CO2|Energy|Waste"
items <- c(
"Emi|CO2|Energy|Waste|Feedstocks unknown fate",
"Emi|CO2|Energy|Waste|Plastics Incineration"
)
showAreaAndBarPlots(data, items, tot, scales = "fixed")
```

#### Waste Emissions from Plastics-Incineration
```{r CO2 waste plastics incineration}
showLinePlots(data, "Emi|CO2|Energy|Waste|Plastics Incineration")
```

#### Waste Emissions from Non-plastic Materials
```{r CO2 waste non-plastic Materials}
showLinePlots(data, "Emi|CO2|Energy|Waste|Feedstocks unknown fate")
```

#### Waste Emissions Attributed to Electricity
```{r CO2 waste attributed to electricity}
showLinePlots(data, "Emi|CO2|Energy|Supply|Electricity|Waste")
```

#### Waste Emissions Attributed to Heat
```{r CO2 waste attributed to heat}
showLinePlots(data, "Emi|CO2|Energy|Supply|Heat|Waste")
```

#### Waste Emissions Attributed to Industry
```{r CO2 waste attributed to industry}
showLinePlots(data, "Emi|CO2|Energy|Demand|Industry|Waste")
```

#### Waste Emissions Attributed to Buildings
```{r CO2 waste attributed to buildings}
showLinePlots(data, "Emi|CO2|Energy|Demand|Buildings|Waste")
```


### Transport

Expand All @@ -223,7 +275,7 @@ showLinePlots(data, "Emi|CO2|Energy|Demand|Transport|International Bunkers")
showLinePlots(data, "Emi|CO2|Industrial Processes")
```

```{r CO2 Process Emissions}
```{r CO2 Process Emissions by Sector}
tot <- c("Emi|CO2|Industrial Processes")
items <- c(
"Emi|CO2|Industrial Processes|Chemicals",
Expand Down
Loading

0 comments on commit f97ea7b

Please sign in to comment.