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

bugfix negative values in p35_forest_recovery_area #682

Merged
merged 21 commits into from
Jun 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/35_natveg/pot_forest_may24/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ p35_forest_recovery_area(t,j,ac_est)$(sum(ac_est2, p35_forest_recovery_area(t,j,
* The proportion of secondary forest recovery in total natveg
* recovery is derived from the remaining forest recovery area
pc35_forest_recovery_shr(j) = 0;
pc35_forest_recovery_shr(j)$((sum(land_ag, pcm_land(j,land_ag))+pcm_land(j,"urban")) > +1e-10) =
pc35_forest_recovery_shr(j)$((sum(land_ag, pcm_land(j,land_ag))+pcm_land(j,"urban")) > 0) =
(pc35_max_forest_recovery(j) - sum(ac_est, p35_forest_recovery_area(t,j,ac_est)))
/ (sum(land_ag, pcm_land(j,land_ag))+pcm_land(j,"urban"));
pc35_forest_recovery_shr(j)$(pc35_forest_recovery_shr(j) < 0) = 0;
Expand All @@ -67,6 +67,8 @@ p35_forest_recovery_area(t,j,ac_est) = p35_forest_recovery_area(t,j,ac_est)
+ (pc35_land_other(j,"othernat",ac_est) - p35_forest_recovery_area(t,j,ac_est))
* pc35_forest_recovery_shr(j);
p35_forest_recovery_area(t,j,ac_est)$(sum(ac_est2, p35_forest_recovery_area(t,j,ac_est2)) > pc35_max_forest_recovery(j)) = pc35_max_forest_recovery(j)/card(ac_est2);
p35_forest_recovery_area(t,j,ac_est)$(p35_forest_recovery_area(t,j,ac_est) > pc35_land_other(j,"othernat",ac_est)) = pc35_land_other(j,"othernat",ac_est);
p35_forest_recovery_area(t,j,ac_est)$(p35_forest_recovery_area(t,j,ac_est) < 0) = 0;
pc35_land_other(j,"othernat",ac_est) = pc35_land_other(j,"othernat",ac_est) - p35_forest_recovery_area(t,j,ac_est);
pc35_land_other(j,"youngsecdf",ac_est) = pc35_land_other(j,"youngsecdf",ac_est) + p35_forest_recovery_area(t,j,ac_est);

Expand Down
Loading