Skip to content

Fix summation errors in CO2 land use also for coupled runs#2403

Merged
dklein-pik merged 3 commits into
remindmodel:developfrom
dklein-pik:develop
Jul 13, 2026
Merged

Fix summation errors in CO2 land use also for coupled runs#2403
dklein-pik merged 3 commits into
remindmodel:developfrom
dklein-pik:develop

Conversation

@dklein-pik

Copy link
Copy Markdown
Contributor

Purpose of this PR

This is a follow-up to #2389 that corrected the fixing to a reference runs for p_co2lucSub. However, the fix only worked for standalone runs. This PR corrects the fixing also for coupled runs.

Important note: this fix is only about p_co2lucSub, which is a parameter that is only passed through REMIND to the reporting. The wrong fixing did not have any impact on the optimization.

Type of change

Parts concerned

  • ☑️ GAMS Code
  • ◻️ R-scripts
  • ◻️ Documentation (GAMS incode documentation, comments, tutorials)
  • ◻️ Input data / CES parameters
  • ◻️ Tests, CI/CD (continuous integration/deployment)
  • ◻️ Configuration (switches in main.gms, default.cfg, and scenario_config*.csv files)
  • ◻️ Other (please give a description)

Impact

  • ☑️ Bug fix
  • ◻️ Refactoring
  • ◻️ New feature
  • ◻️ Change of parameter values or input data (including CES parameters)
  • ◻️ Minor change (default scenarios show only small differences)
  • ◻️ Fundamental change of results of default scenarios

Checklist

  • I executed the automated model tests (make test) after my final commit and all tests pass (FAIL 0)
  • I adjusted the reporting in remind2 if and where it was needed
  • I adjusted the madrat packages (mrremind and other packages involved) for input data generation if and where it was needed
  • My code follows the coding etiquette
  • I explained my changes within the PR, particularly in hard-to-understand areas
  • I checked that the in-code documentation is up-to-date
  • I adjusted forbiddenColumnNames in readCheckScenarioConfig.R in case the PR leads to deprecated switches
  • I updated the CHANGELOG.md correctly (added, changed, fixed, removed, input data/calibration)

…ndalone runs.

This commit adds the same correction also for coupled runs. This is necessary because in coupled runs the values are updated and the correction needs to be applied to this update mechanism as well.
Copilot AI review requested due to automatic review settings July 13, 2026 09:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts how p_co2lucSub (CO2 land-use subcategories passed through for reporting) is populated in coupled REMIND–MAgPIE runs so that values for years before cm_startyear remain consistent with the fixing/reference mechanism (as already implemented for standalone runs in #2389).

Changes:

  • Restrict the coupled-run overwrite of p_co2lucSub in core/presolve.gms to only affect years ≥ cm_startyear.
  • Clarify comments in core/datainput.gms around when p_co2lucSub is loaded from input_ref.gdx vs. overwritten from lookup/coupling sources.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/presolve.gms Limits coupled-run overwrite of p_co2lucSub to years ≥ cm_startyear (to avoid breaking fixing for earlier years).
core/datainput.gms Comment clarification about p_co2lucSub being loaded from input_ref.gdx and overwritten for years ≥ cm_startyear.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/presolve.gms
@dklein-pik
dklein-pik requested a review from Copilot July 13, 2026 10:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@LaviniaBaumstark LaviniaBaumstark left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thanks

@dklein-pik
dklein-pik merged commit 6b1a523 into remindmodel:develop Jul 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants