Skip to content

Conversation

@tonnrueter
Copy link
Contributor

@tonnrueter tonnrueter commented Nov 5, 2025

Purpose of this PR

Using execute_load to load values from GDX risks replacing symbol data entirely. Use execute_load only iff you want a clean slate for all attributes of a variable. In all other cases use execute_loadpoint to merge new data from a GDX into existing symbols while preserving it's attributes (i.e. bounds, levels, ..).

  • Switch from execute_load to execute_loadpoint except for
  • Usage in core/datainput.gms (lines 1627-1632) since there are no pre-existing values to preserve

Overview of the changes made:

File Path Lines Action Reason
core/datainput.gms 1627-1632 Keep execute_load Fresh initialization of reference parameters (p_prodSeReference, pm_prodFEReference, p_prodUeReference, p_co2CCSReference, pm_macCost) from scratch for comparison purposes. No pre-existing values to preserve.
core/preloop.gms 170 Switch to Execute_Loadpoint Loading historical prices (t < cm_startyear) for pm_PEPrice, pm_SEPrice, pm_FEPrice. Future prices may already exist and should be preserved.
modules/21_tax/on/datainput.gms 153-154 Switch to Execute_Loadpoint Loading baseline tax revenue parameters (pm_taxrevCO2LUC0, pm_taxrevGHG0). Should merge with existing baseline data.
modules/24_trade/se_trade/datainput.gms 189-190 Switch to Execute_Loadpoint Loading reference demand values (p24_demFeForEsReference, p24_demFeIndSubReference). Should merge with existing reference data.
modules/29_CES_parameters/calibrate/datainput.gms 198 Switch to Execute_Loadpoint Loading CES calibration data p29_cesdata_load from input.gdx. Should merge with existing calibration data.
modules/29_CES_parameters/calibrate/preloop.gms 29, 38 Switch to Execute_Loadpoint Loading set mappings (ces2_29, regi_29_load) from input.gdx. Should merge with existing sets.
modules/30_biomass/magpie_40/datainput.gms 79 Switch to Execute_Loadpoint Loading biomass cost data pm_pebiolc_costs_emu_preloop. Should merge with existing data.
modules/36_buildings/simple/datainput.gms 61 Switch to Execute_Loadpoint Loading reference building demand p36_uedemand_build. Likely partial data that should be merged with existing data.
modules/37_industry/subsectors/datainput.gms 651 Switch to Execute_Loadpoint Loading variable vm_demFeSector_afterTax. Variable bounds (.lo, .hi) should be preserved.
modules/37_industry/subsectors/datainput.gms 872 Switch to Execute_Loadpoint Loading only .l attribute of v37_plasticWaste. Variable bounds should be preserved.

Please note that this might affect scenario results in unforeseen ways. Preliminary test runs:

  • No changes, baseline run: /p/tmp/tonnru/clean_remind/output/SMIPv08-M-SSP2-NPi2025-def_2025-11-04_14.37.55
  • Blanket replacement of execute_load, ✨ converged ✨: /p/tmp/tonnru/clean_remind/output/SMIPv08-M-SSP2-NPi2025-def_2025-11-04_18.02.35
  • Partial replacement. Converged, but had INFES: /p/tmp/tonnru/clean_remind/output/SMIPv08-M-SSP2-NPi2025-def_2025-11-05_17.57.57
  • Partial replacement, other scenario, ✨ converged ✨: /p/tmp/tonnru/clean_remind/output/SMIPv08-ML-SSP2-EcPrice300-def_2025-11-05_22.51.01

Please suggest further scenarios to be tested!

Type of change

Indicate the items relevant for your PR by replacing ◻️ with ☑️.
Do not delete any lines. This makes it easier to understand which areas are affected by your changes and which are not.

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

Do not delete any line. Leave unfinished elements unchecked so others know how far along you are.
In the end all checkboxes must be ticked before you can merge
.

  • 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)

Further information (optional)

  • Runs with these changes are here:
  • Comparison of results (what changes by this PR?):

..as it risks replacing the symbol data entirely, use `execute_load` only iff you want a clean slate for all attributes of a variable. In all other cases use `execute_loadpoint` to merge new data from a GDX into existing symbols while preserving it's attributes (i.e. bounds, levels, ..).

- Switch from `execute_load` to `execute_loadpoint` except for
- Usage in `core/datainput.gms` (lines 1627-1632) since there are no pre-existing values to preserve
Copy link
Member

@LaviniaBaumstark LaviniaBaumstark left a comment

Choose a reason for hiding this comment

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

looks good. Did I get it right, that not all testruns did work? Could you provide a link to a compareScenarios for before and after your changes?

@tonnrueter
Copy link
Contributor Author

looks good. Did I get it right, that not all testruns did work? Could you provide a link to a compareScenarios for before and after your changes?

Please find attached the compareScenario summary. Some observations
Uploading compScen-compScen-base_blanket_partial--2025-11-10_12.23.29-summary.pdf…

  • Some differences in the FE pCap variable after 2060 for the different runs (p.24ff)
  • Price|Carbon (p. 50) seem identical

@LaviniaBaumstark
Copy link
Member

sorry, where is the compareScenario.pdf file?

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.

2 participants