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

Update GDP to 2017 base year #717

Merged
merged 50 commits into from
Oct 3, 2024
Merged

Conversation

caviddhen
Copy link
Contributor

@caviddhen caviddhen commented Sep 10, 2024

🐦 Description of this PR 🐦

  • Update documentation, scalar values, and module code (deflating food demand and livestock regression inputs) to be consistent with 2017 GDP base year.

🔧 Checklist for PR creator 🔧

  • Label pull request from the label list.

    • Low risk: Simple bugfixes (missing files, updated documentation, typos) or changes in start or output scripts
    • Medium risk: Uncritical changes in the model core (e.g. moderate modifications in non-default realizations)
    • High risk: Critical changes in model core or default settings (e.g. changing a model default or adjusting a core mechanic in the model)
  • Self-review own code

    • No hard coded numbers and cluster/country/region names.
    • The new code doesn't contain declared but unused parameters or variables.
    • magpie4 R library has been updated accordingly and backwards compatible where necessary.
    • scenario_config.csv has been updated accordingly (important if default.cfg has been updated)
  • Document changes

    • Add changes to CHANGELOG.md
    • Where relevant, put In-code documentation comments
    • Properly address updates in interfaces in the module documentations
    • run goxygen::goxygen() and verify the modified code is properly documented
  • Perform test runs

    • Low risk:
      • Run a compilation check via Rscript start.R --> "compilation check"
    • Medium risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
    • High risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
      • Default run from the PR target branch for comparison
      • Provide relevant comparison plots (land-use, emissions, food prices, land-use intensity,...)

Red = Develop from Aug 2024
Green = ThisPR with update to USD17MER

SSP2-Ref
Resources_Land_Cover_Cropland-109
Productivity_Landuse_Intensity_Indicator_Tau-97
Emissions_CO2_Land_Land_use_Change-102

SSP2-PkBud650
Resources_Land_Cover_Cropland-110
Productivity_Landuse_Intensity_Indicator_Tau-99
Emissions_CO2_Land_Land_use_Change-104

📉 Performance changes 📈

  • Current develop branch default : 25 min
  • This PR's default : 25 min

🚨 Checklist for reviewer 🚨

  • PR is labeled correctly
  • Code changes look reasonable
    • No hard coded numbers and cluster/country/region names.
    • No unnecessary increase in module interfaces
    • model behavior/performance is satisfactory.
  • Changes are properly documented
    • CHANGELOG is updated correctly
    • Updates in interfaces have been properly addressed in the module documentations
    • In-code documentation looks appropriate
  • content review done (at least 1)
  • RSE review done (at least 1)

@caviddhen caviddhen added the High risk Higher risk label Sep 10, 2024
@deleip deleip changed the base branch from master to develop September 11, 2024 11:58
# Conflicts:
#	CHANGELOG.md
#	config/default.cfg
#	modules/29_cropland/detail_apr24/input.gms
#	modules/58_peatland/v2/declarations.gms
#	modules/58_peatland/v2/input.gms
Copy link
Member

@tscheypidi tscheypidi left a comment

Choose a reason for hiding this comment

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

just three smaller comments

config/default.cfg Outdated Show resolved Hide resolved
modules/32_forestry/dynamic_may24/input.gms Outdated Show resolved Hide resolved
modules/73_timber/default/input.gms Outdated Show resolved Hide resolved
config/default.cfg Outdated Show resolved Hide resolved
config/default.cfg Outdated Show resolved Hide resolved
modules/29_cropland/detail_apr24/input.gms Outdated Show resolved Hide resolved
modules/39_landconversion/calib/input.gms Outdated Show resolved Hide resolved
@pascal-sauer
Copy link
Contributor

There are still quite a few places left where we have just USD and not USD17, you can find those on the cluster with rg '\bUSD\b'

@pascal-sauer
Copy link
Contributor

pascal-sauer commented Sep 25, 2024

Thanks for going through the whole magpie codebase to adapt to USD17!

@flohump flohump requested a review from deleip September 27, 2024 07:09
@flohump
Copy link
Contributor

flohump commented Sep 27, 2024

some more things I noticed while going through the files, but couldn't directly comment on as they had no changes:

  • in the food demand model we still have regression factors in USD05PPP, maybe adding a note about that inconsistency would be good? (same for the livestock regression that is in USD04)
  • in the declaration files of the urban module quite a lot of units are missing. as we changing so much anyway it might be a good moment to add those now? (I'll ask David to fix this once he's back)
  • in pot_forest_may24/declarations line 85 the unit is just USD. Probably also MER?
  • the declaration file of the employment module has not been updated (lots of USDMER05 still there)
  • in the maccs module, values are in USD95MER, is this on purpose? <- DONE. It's now USD17MER

Copy link
Member

@bodirsky bodirsky left a comment

Choose a reason for hiding this comment

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

food demand module seems fine.
In residues module, the link to the datasource is broken, I suggested a new one.
Cost calculations seem a bit off.
More generally, its unclear how the switch from 05 to 17 was done for values in additional data or hardcoded values. In my opinion, they should be inflated.

modules/18_residues/flexcluster_jul23/equations.gms Outdated Show resolved Hide resolved
@flohump flohump dismissed bodirsky’s stale review October 3, 2024 08:05

All issues have been resolved based on bilateral discussion

@flohump flohump merged commit 8ef5c64 into magpiemodel:develop Oct 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
High risk Higher risk
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants