-
Notifications
You must be signed in to change notification settings - Fork 174
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
bugfixes ac_est #624
bugfixes ac_est #624
Conversation
+ v35_primforest_reduction(j2)); | ||
|
||
q35_other_expansion(j2,ac_est) .. | ||
v35_other_expansion(j2,ac_est) =e= | ||
v35_other(j2,ac_est) - pc35_other(j2,ac_est); |
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.
To me it's not clear, why it is no longer necessary to subtract pc35_other here.
Now expansion is just equal to the stock?
Is the pc35_other parameter still used somewhere or not necessary anymore?
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.
And I have the same question for: q32_land_expansion(j2,type32) and q35_secdforest_expansion(j2,ac_est)
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.
pc35_other(j2,ac_est) is always zero because other land added in the previous time step has been shifted to higher age-classes in-between the iterations. The same holds true for q32_land_expansion and q35_secdforest_expansion. pc35_other(j2,ac_sub) is the other part of the full ac set, which in the optimization can only decrease.
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.
In that case, should the name of the variables and equations change to something pointing towards "aggregated forestry land pools"? The expansion part is confusing (or is the naming related to specific jargon used in the forestry field?). I thought pc32_land and pc35_other were related to the information from the previous step.
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.
To which variables and equations are you referring regarding the naming?
Expansion refers to land gross land expansion and can be directly linked to the ac_est subset. Reduction refers to gross land reduction and can be direclty linked to the ac_sub subset.
Yes, pc32_land and pc35_other hold information from the previous time step, but in the case of forestry and natveg the shifting for regrowth happens between the time steps. This has to be accounted for.
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.
I refer to q32_land_expansion(j2,type32), q35_secdforest_expansion(j2,ac_est), v35_other_expansion(j2,ac_est), and v32_land_expansion(j2,ac_est). So, is the difference between the previous and current steps (expansion) handled with the ac_sub dynamic set?
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.
No. In the optimization, expansion can only happen in v35_other(j2,ac_est)
and reduction can only happen in v35_other(j2,ac_sub)
. ac_est and ac_sub are dynamic sets, depeding on the time step lengths. Because of the age-class shifting ac_est
will always be zero in p35_other(j2,ac_est)
. Therefore, for expansion only v35_other(j2,ac_est) is needed. For the reduction, both v35_other(j2,ac_sub) and p35_other(j2,ac_sub)
are needed. The areas added in the previous time step are included in p35_other(j2,ac_sub)
. Same holds true for v32_land
and v35_secdforest
.
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 emissions and tau behavior in CAZ is quite extreme. Where does it come from? Was it like this before and we just return to previous behavior or what explains the change?
This is a known issue. We have seen this in recent test runs. There is no content-wise connection to the changes of this PR. For full transparency, I added the figures for CAZ and Global. |
So it is back to previous behavior and it just looked better in-between because of bugs / by chance? |
@@ -101,7 +101,7 @@ sum(ac_est, v32_land(j2,"aff",ac_est)) =l= sum(ac, v32_land(j2,"aff",ac)) - sum( | |||
|
|||
q32_land_expansion(j2,type32) .. | |||
v32_land_expansion(j2,type32) =e= | |||
sum(ac_est, v32_land(j2,type32,ac_est)) - sum(ac_est, pc32_land(j2,type32,ac_est)); | |||
sum(ac_est, v32_land(j2,type32,ac_est)); | |||
|
|||
q32_land_reduction(j2,type32,ac_sub) .. | |||
v32_land_reduction(j2,type32,ac_sub) =e= pc32_land(j2,type32,ac_sub) - v32_land(j2,type32,ac_sub); |
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.
Just to make sure: the pc32_lanc(j2,type32,ac_est) is no longer needed in q32_land_expansion, but in q32_land_reduction it still enters?
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.
No. But ac_est and ac_sub are dynamic sets of ac, depending on the time step length. It is not possible to define parameters, variables and equations for dynamics sets. Therefore, pc32_land is defined over ac.
It looks a bit like a bi-stability where the model sometimes runs in one local optimum and the other time in the other one. Not nice, but most likely also not related to this PR |
Actually, CAZ is now (green line) closer to FAO, which is what we expect. However, as indicated by @tscheypidi this is only by chance. |
For me it looks like it would be sensible to also recalibrate the land conversion costs here and update the calibration tgz. The cropland trajectory seems a bit off from the historical trend. |
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.
From this PR alone it does not become clear yet, why the switch from (sum(cell(i2,j2), f44_biome(j2,biome44)) > 0) to (sum(cell(i2,j2), f44_biome(j2,biome44)) > 1e-10) became necessary. Could you add a brief explanation PR?
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 cleaning up the calibration scripts! :)
I ran the calibration for land conversion costs. It does not change anything. The results for |
Changed condition from 0 to 1e-10 to avoid division by zero. We use 1e-10 and 1e-6 in multiple other places in the model to avoid division by zero. |
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 fine for me!
After further discussion with @pvjeetze including an final test, we agreed that the change in the biodiversity module is not needed. |
🐦 Description of this PR 🐦
🔧 Checklist for PR creator 🔧
Label pull request from the label list.
Self-review own code
magpie4
R library has been updated accordingly and backwards compatible where necessary.scenario_config.csv
has been updated accordingly (important ifdefault.cfg
has been updated)Document changes
CHANGELOG.md
goxygen::goxygen()
and verify the modified code is properly documentedRscript start.R --> "compilation check"
Rscript start.R --> "test runs"
Rscript start.R --> "test runs"
📉 Performance changes 📈
🚨 Checklist for reviewer 🚨
CHANGELOG
is updated correctly