Skip to content

Commit

Permalink
Merge pull request #729 from orichters/develop
Browse files Browse the repository at this point in the history
Adjust US$2005 -> 2017 for data read from REMIND
  • Loading branch information
orichters authored Oct 7, 2024
2 parents 8ef5c64 + bd5d8d3 commit 3d40b84
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **inputdata** changed GDP base year from 2005USD to 2017USD
- **config** changed default input data to use 2017USD
- **module_documentation** all references to USD05 changed to USD17
- **scripts** REMIND coupling reads data in US$2017, not US$2005

### added
-
Expand Down
18 changes: 9 additions & 9 deletions scripts/start/extra/emulator.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ write.ghgtax <- function(mifname, outfile) {
tmp <- read.report(fname, as.list = FALSE)

# Select variables from REMIND report
ghg_price_names <- c("Price|Carbon (US$2005/t CO2)",
"Price|N2O (US$2005/t N2O)",
"Price|CH4 (US$2005/t CH4)")
ghg_price_names <- c("Price|Carbon (US$2017/t CO2)",
"Price|N2O (US$2017/t N2O)",
"Price|CH4 (US$2017/t CH4)")
tmp <- collapseNames(tmp[,,ghg_price_names])
# remove global dimension
tmp <- tmp["GLO",,,invert=TRUE]
Expand All @@ -72,11 +72,11 @@ write.ghgtax <- function(mifname, outfile) {

ghgtax <- new.magpie(cells_and_regions = getRegions(tmp),years = time,fill = NA,sets = c("regions","years","gas"),names = c("n2o_n_direct","n2o_n_indirect","ch4","co2_c"))

# unit defined in modules/56_ghg_policy/input/f56_pollutant_prices.cs3: US$ 2005 per Mg N2O-N CH4 and CO2-C
ghgtax[,,"co2_c"] <- tmp[,,"Price|Carbon (US$2005/t CO2)"] * 44/12 # US$2005/tCO2 -> US$2005/tC
ghgtax[,,"ch4"] <- tmp[,,"Price|CH4 (US$2005/t CH4)"]
ghgtax[,,"n2o_n_direct"] <- tmp[,,"Price|N2O (US$2005/t N2O)"] * 44/28 # US$2005/tN2O -> US$2005/tN
ghgtax[,,"n2o_n_indirect"] <- tmp[,,"Price|N2O (US$2005/t N2O)"] * 44/28 # US$2005/tN2O -> US$2005/tN
# unit defined in modules/56_ghg_policy/input/f56_pollutant_prices.cs3: US$ 2017 per Mg N2O-N CH4 and CO2-C
ghgtax[,,"co2_c"] <- tmp[,,"Price|Carbon (US$2017/t CO2)"] * 44/12 # US$2017/tCO2 -> US$2017/tC
ghgtax[,,"ch4"] <- tmp[,,"Price|CH4 (US$2017/t CH4)"]
ghgtax[,,"n2o_n_direct"] <- tmp[,,"Price|N2O (US$2017/t N2O)"] * 44/28 # US$2017/tN2O -> US$2017/tN
ghgtax[,,"n2o_n_indirect"] <- tmp[,,"Price|N2O (US$2017/t N2O)"] * 44/28 # US$2017/tN2O -> US$2017/tN

# set ghg prices before and in 2020 to zero
ghgtax[,getYears(ghgtax)<="y2020",] <- 0
Expand All @@ -89,7 +89,7 @@ write.ghgtax <- function(mifname, outfile) {
cat("CO2 price in 2025:",ghgtax[,2025,"co2_c"],"\n")
for_plot <- ghgtax[1,,"co2_c"] * 12/44 # convert unit back just for plotting
#for_plot <- for_plot[,c("y1995","y2110","y2130","y2150"),,invert=TRUE]
txtplot(as.numeric(gsub("y","",getYears(for_plot))),for_plot,ylab="US$2005/tCO2")
txtplot(as.numeric(gsub("y","",getYears(for_plot))),for_plot,ylab="US$2017/tCO2")

cat("Writing GHG tax scenario",scenarios[scen,"ghgtax_name"],"\n\n")
write.magpie(ghgtax, file_name = outfile)
Expand Down
8 changes: 4 additions & 4 deletions scripts/start_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -555,16 +555,16 @@ getReportData <- function(path_to_report_bioenergy, path_to_report_ghgprices = N
}

.emissionPrices <- function(mag){
out_c <- mag[,,"Price|Carbon (US$2005/t CO2)"]*44/12 # US$2005/tCO2 -> US$2005/tC
out_c <- mag[,,"Price|Carbon (US$2017/t CO2)"]*44/12 # US$2017/tCO2 -> US$2017/tC
dimnames(out_c)[[3]] <- "co2_c"

out_n2o_direct <- mag[,,"Price|N2O (US$2005/t N2O)"]*44/28 # US$2005/tN2O -> US$2005/tN
out_n2o_direct <- mag[,,"Price|N2O (US$2017/t N2O)"]*44/28 # US$2017/tN2O -> US$2017/tN
dimnames(out_n2o_direct)[[3]] <- "n2o_n_direct"

out_n2o_indirect <- mag[,,"Price|N2O (US$2005/t N2O)"]*44/28 # US$2005/tN2O -> US$2005/tN
out_n2o_indirect <- mag[,,"Price|N2O (US$2017/t N2O)"]*44/28 # US$2017/tN2O -> US$2017/tN
dimnames(out_n2o_indirect)[[3]] <- "n2o_n_indirect"

out_ch4 <- mag[,,"Price|CH4 (US$2005/t CH4)"]
out_ch4 <- mag[,,"Price|CH4 (US$2017/t CH4)"]
dimnames(out_ch4)[[3]] <- "ch4"

out <- mbind(out_n2o_direct,out_n2o_indirect,out_ch4,out_c)
Expand Down

0 comments on commit 3d40b84

Please sign in to comment.