Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace magpie with magpie4, bugfix #390

Merged
merged 3 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **scripts** Added script to folder projects paper_grassland.R
- **44_biodiversity** Improved documentation, simplification of equations and flexible options for price on biodiversity loss
- **config** changed default setting for s56_reward_neg_emis from 0 to -Inf
- **scripts** scripts/output/extra/emulator.R Remove dependency on deprecated R package "magpie"

### added
- **scripts** output/projects/FSEC_dietaryIndicators.R to create output datasets for the FSEC project
Expand Down Expand Up @@ -60,6 +61,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **scripts** calibration; set NA values to 1
- **scripts** fixed misleading warning in check_config
- **scripts** fixed configuration error in FSEC output scripts, FSEC_dietaryIndicators.R and FSEC_environmentalPollutants.R
- **scripts** scripts/start/extra/emulator.R Throw an error if no file can be found to take the GHG prices from

## [4.4.0] - 2021-12-13

Expand Down
2 changes: 1 addition & 1 deletion scripts/output/extra/emulator.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
library(magclass)
library(lucode2)
library(lusweave)
library(magpie)
library(magpie4)
library(luplot)
library(ggplot2)
library(remulator)
Expand Down
5 changes: 4 additions & 1 deletion scripts/start/extra/emulator.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
library(gms)
library(magpie4)
library(txtplot)
library(lucode2)

source("scripts/start_functions.R")
source("config/default.cfg")
Expand Down Expand Up @@ -59,7 +60,7 @@ scenarios <- subset(scenarios, subset=(start == "1"))
# calculate expoLinear tax with transition in 2060
write.ghgtax <- function(co2tax_2025=NULL,regions=NULL,out="./modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3") {

fname <- paste0("REMIND_generic_",scenarios[scen,"co2tax_2025"],".mif")
fname <- paste0(scenarios[scen,"co2tax_2025"],".mif")

if (file.exists(fname)) {

Expand Down Expand Up @@ -88,6 +89,8 @@ write.ghgtax <- function(co2tax_2025=NULL,regions=NULL,out="./modules/56_ghg_pol
ghgtax[,,"n2o_n_indirect"] <- tmp[,,"Price|N2O (US$2005/t N2O)"] * 44/28 # US$2005/tN2O -> US$2005/tN

} else {

stop("Could not find ", fname)

# Calculate expo-linear tax

Expand Down