-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add GDP share constraint for tech cost #391
Conversation
Expand tech cost upper bound to enable switching between fixed bound and a config-set GDP share
Remove former default upper bound and related switch as 0.002 gdp ppp share bound and level guidance via upper bound enable and produce similar results, making switching an unnecessary option.
It seems I can neither request reviews nor label the pull request (if I had to guess, it's because I am a first-time contributor), so if someone would be so kind to label this PR as medium risk (as it's changing a realization) and enhancement [Edit: actually, minor, seems like a better choice. Missed that earlier], that would be grand! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your first PR! (hooray)
Just 2 minor requests from my side.
CHANGELOG.md
Outdated
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 | |||
## [Unreleased] | |||
|
|||
### changed | |||
- **config** added s13_tech_cost_gdp_share setting for tech cost upper bound as share of GDP PPP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the scalar is a bit misleading. Would be good to make more clear that we are talking about an upper bound here. Perhaps you can write something like s13_max_gdp_shr
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
vm_tech_cost.up(i) = | ||
sum((i_to_iso(i,iso),ct), im_gdp_pc_ppp_iso(ct,iso) * im_pop_iso(ct,iso)) * s13_tech_cost_gdp_share; | ||
|
||
vm_tech_cost.L(i) = vm_tech_cost.up(i); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here explaining why the level is being used (and highlight that it is in fact necessary to help the solver finding a proper solution).
In addition: is that normally a capital "L" for level? I always thought it is a small "l".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added and changed both.
The capital L was just me being inconsistent.
Rename scalar to clarify its function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Change tech cost upper bound to a config-set GDP share
🐦 Purpose of this PR 🐦
🔧 Checklist for PR creator 🔧
📉 Performance loss/gain from current default behavior 📈
Added changes to
CHANGELOG.md
Compilation check (model starts without compilation errors - use
gams main.gms action=c
in model folder for testing).No hard coded numbers and cluster/country/region names.
The new code doesn't contain declared but unused parameters or variables.
Where relevant, In-code comments added including documentation comments.
Made sure that documentation created with
goxygen
is okay (usegoxygen::goxygen()
for testing).Changes to
magpie4
R library for post processing of model output (ideally backward compatible).Self-review of my own code.
For high risk runs: validation of major model indicators - Land-use, emissions, food prices, Tau. %Delete this line in case it is not a high risk run%
NA
🚨 Checklist for RSE reviewer 🚨
CHANGELOG
is updated correctly🚨 Checklist for MAgPIE reviewer 🚨
CHANGELOG
is updated correctly