From 11a568021ddff79fe588ba9061103a01a833aca4 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 4 Jun 2024 18:46:33 +0200 Subject: [PATCH 1/2] bugfix max forest recovery --- modules/35_natveg/pot_forest_may24/declarations.gms | 2 +- modules/35_natveg/pot_forest_may24/equations.gms | 2 +- modules/35_natveg/pot_forest_may24/postsolve.gms | 10 +++++++--- modules/35_natveg/pot_forest_may24/preloop.gms | 13 +++++++++++-- modules/35_natveg/pot_forest_may24/presolve.gms | 2 +- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/declarations.gms b/modules/35_natveg/pot_forest_may24/declarations.gms index e440e3a27..5caf9dd1a 100644 --- a/modules/35_natveg/pot_forest_may24/declarations.gms +++ b/modules/35_natveg/pot_forest_may24/declarations.gms @@ -22,7 +22,7 @@ parameters pc35_forest_recovery_shr(j) Forest share in natveg recovery (1) p35_forest_recovery_area(t,j,ac) Recovered forest (mio. ha) p35_maturesecdf(t,j,ac) Matured secondary forest (mio. ha) - pcm_max_forest_est(j) Overall forest establishment potential in current time step (mio. ha) + pcm_max_forest_est(t,j) Overall forest establishment potential in current time step (mio. ha) pc35_max_forest_recovery(j) Maximum forest recovery potential after land abandonement (mio. ha) p35_carbon_density_other(t,j,othertype35,ac,ag_pools) Carbon density other land (tC per ha) p35_disturbance_loss_secdf(t,j,ac) Loss due to disturbances in secondary forest (mio. ha) diff --git a/modules/35_natveg/pot_forest_may24/equations.gms b/modules/35_natveg/pot_forest_may24/equations.gms index 5052d648f..662fbd914 100644 --- a/modules/35_natveg/pot_forest_may24/equations.gms +++ b/modules/35_natveg/pot_forest_may24/equations.gms @@ -190,7 +190,7 @@ q35_hvarea_other(j2,othertype35,ac_sub).. q35_max_forest_establishment(j2).. sum(land_forest, vm_landexpansion(j2,land_forest)) =l= - pcm_max_forest_est(j2) + sum(ct, pcm_max_forest_est(ct,j2)) - sum(ac, vm_land_other(j2,"youngsecdf",ac) ) ; diff --git a/modules/35_natveg/pot_forest_may24/postsolve.gms b/modules/35_natveg/pot_forest_may24/postsolve.gms index d92c17f22..73a02e8bc 100644 --- a/modules/35_natveg/pot_forest_may24/postsolve.gms +++ b/modules/35_natveg/pot_forest_may24/postsolve.gms @@ -12,9 +12,13 @@ pc35_secdforest(j,ac) = v35_secdforest.l(j,ac); pc35_land_other(j,othertype35,ac) = vm_land_other.l(j,othertype35,ac); * Reset forest establishment bound -pcm_max_forest_est(j) = f35_pot_forest_area(j) - sum(land_forest, vm_land.l(j,land_forest)); -pcm_max_forest_est(j)$(pcm_max_forest_est(j) < 0) = 0; - +if(m_year(t) <= sm_fix_SSP2, + pcm_max_forest_est(t,j) = 0; + pcm_max_forest_est(t,j)$(fm_carbon_density(t,j,"secdforest","vegc") > 20) = sum(land, vm_land.l(j,land)) - sum(land_forest, vm_land.l(j,land_forest)); +else + pcm_max_forest_est(t,j) = f35_pot_forest_area(j) - sum(land_forest, vm_land.l(j,land_forest)); + pcm_max_forest_est(t,j)$(pcm_max_forest_est(t,j) < 0) = 0; +); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### ov35_secdforest(t,j,ac,"marginal") = v35_secdforest.m(j,ac); ov_land_other(t,j,othertype35,ac,"marginal") = vm_land_other.m(j,othertype35,ac); diff --git a/modules/35_natveg/pot_forest_may24/preloop.gms b/modules/35_natveg/pot_forest_may24/preloop.gms index 3f4750017..62aa874c0 100644 --- a/modules/35_natveg/pot_forest_may24/preloop.gms +++ b/modules/35_natveg/pot_forest_may24/preloop.gms @@ -47,8 +47,17 @@ p35_disturbance_loss_primf(t,j) = 0; * Forest establishment is constrained by the potential forest area in each cluster. * Hence, the area for forest establishments is given by the potential forest * area minus all forest areas in the previous time step. -pcm_max_forest_est(j) = f35_pot_forest_area(j) - sum(land_forest, pcm_land(j,land_forest)); -pcm_max_forest_est(j)$(pcm_max_forest_est(j) < 0) = 0; + +loop(t, + if(m_year(t) <= sm_fix_SSP2, + pcm_max_forest_est(t,j) = 0; + pcm_max_forest_est(t,j)$(fm_carbon_density(t,j,"secdforest","vegc") > 20) = sum(land, pcm_land(j,land)) - sum(land_forest, pcm_land(j,land_forest)); + else + pcm_max_forest_est(t,j) = f35_pot_forest_area(j) - sum(land_forest, pcm_land(j,land_forest)); + pcm_max_forest_est(t,j)$(pcm_max_forest_est(t,j) < 0) = 0; + ); +); + * ----------------------------------------- * Land conservation for climate mitigation diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index abad4f86b..e2f42a501 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -45,7 +45,7 @@ vm_land.l(j,"primforest") = pcm_land(j,"primforest"); * ------------------------------------------------- *** Calculate the upper boundary for secondary forest recovery -pc35_max_forest_recovery(j) = pcm_max_forest_est(j) - sum(ac, pc35_land_other(j,"youngsecdf",ac)); +pc35_max_forest_recovery(j) = pcm_max_forest_est(t,j) - sum(ac, pc35_land_other(j,"youngsecdf",ac)); *** Distribute forestry abandonement * Abandoned forestry is directly shifted into p35_forest_recovery_area(t,j,ac_est) because it is From 48c12080ec62d9c39540e85d81b6ec7098fde651 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 4 Jun 2024 19:09:42 +0200 Subject: [PATCH 2/2] bugfix --- modules/32_forestry/dynamic_may24/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/32_forestry/dynamic_may24/presolve.gms b/modules/32_forestry/dynamic_may24/presolve.gms index 65d4e7337..74f6cb5d2 100644 --- a/modules/32_forestry/dynamic_may24/presolve.gms +++ b/modules/32_forestry/dynamic_may24/presolve.gms @@ -23,7 +23,7 @@ v32_land_reduction.fx(j,type32,ac_est) = 0; * Suitable area (`p32_aff_pot`) for NPI/NDC afforestation p32_aff_pot(t,j) = sum((kcr,w),vm_area.l(j,kcr,w) - vm_area.lo(j,kcr,w)) + (vm_land.l(j,"past") - vm_land.lo(j,"past")) - pm_land_conservation(t,j,"other","restore"); *** NDC/NPI re/afforesation is further constrained by the remaining forest establishment potential - p32_aff_pot(t,j)$(p32_aff_pot(t,j) > pcm_max_forest_est(j)) = pcm_max_forest_est(j); + p32_aff_pot(t,j)$(p32_aff_pot(t,j) > pcm_max_forest_est(t,j)) = pcm_max_forest_est(t,j); * suitable area `p32_aff_pot` can be negative, if land restoration is switched on (level smaller than lower bound), therefore set negative values to 0 p32_aff_pot(t,j)$(p32_aff_pot(t,j) < 0) = 0; * Limit prescribed NPI/NDC afforestation in `p32_aff_pol_timestep` if not enough suitable area (`p32_aff_pot`) for afforestation is available