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

bugfix start_functions.R and 80_optimization #703

Merged
merged 2 commits into from
Jul 19, 2024
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **21_trade** refactor equations for enhanced readablility and improve documentation
- **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files.
- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report.
- **80_optimization** abort GAMS in case of execution errors

### added
- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd`
Expand Down
4 changes: 4 additions & 0 deletions modules/80_optimization/nlp_apr17/solve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ $onecho > conopt4.op2
Flg_Prep = FALSE
$offecho

if(execerror > 0,
abort "Execution error. Check your .lst file.";
);

*' @code
solve magpie USING nlp MINIMIZING vm_cost_glo;
*' Optional second solve statement
Expand Down
1 change: 1 addition & 0 deletions scripts/start_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ getReportData <- function(path_to_report_bioenergy, path_to_report_ghgprices = N
}

.readAndPrepare <- function(mifPath) {
require(magclass)
FelicitasBeier marked this conversation as resolved.
Show resolved Hide resolved
rep <- read.report(mifPath, as.list = FALSE)
if (length(getNames(rep, dim = "scenario")) != 1) stop("getReportData: report contains more or less than 1 scenario.")
mag <- collapseNames(rep) # get rid of scenario and model dimension if they exist
Expand Down
Loading