Skip to content

Commit

Permalink
Merge pull request #703 from flohump/f_fix
Browse files Browse the repository at this point in the history
bugfix start_functions.R and 80_optimization
  • Loading branch information
flohump authored Jul 19, 2024
2 parents 4596f3a + a016d26 commit a0246e9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
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)
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

0 comments on commit a0246e9

Please sign in to comment.