From 30d8a5942be93d3d4fe4bf8c93ddc09b86ed28ce Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Thu, 10 Sep 2026 13:07:36 +0200 Subject: [PATCH 1/8] module 35: adopt the Sims driver classes for f35_forest_lost_share driver_source becomes the seven Sims et al. (2025) classes plus unknown and overall, matching the nine columns mrland now writes. A .cs3 column without a set element is a compile-time domain violation, so this moves with the mrland change. The operative element renames shifting_agriculture -> shifting_cultivation in the four presolve branches. combined_loss stays shifting cultivation plus wildfire. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FQU9MetaTSbqRJVrCypV9n --- modules/35_natveg/pot_forest_may24/presolve.gms | 10 +++++----- modules/35_natveg/pot_forest_may24/sets.gms | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index 74cfa4f9ca..b0622efb8c 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -6,19 +6,19 @@ *** | Contact: magpie@pik-potsdam.de * ---------------------------------------------------- -* Shift ageclasses due to shifting agriculture fires +* Shift ageclasses due to shifting cultivation and fires * ---------------------------------------------------- * first calculate damages if(s35_forest_damage=1, - p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * sum(cell(i,j),f35_forest_lost_share(i,"shifting_agriculture"))*m_timestep_length_forestry; - p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum(cell(i,j),f35_forest_lost_share(i,"shifting_agriculture"))*m_timestep_length_forestry; + p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * sum(cell(i,j),f35_forest_lost_share(i,"shifting_cultivation"))*m_timestep_length_forestry; + p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum(cell(i,j),f35_forest_lost_share(i,"shifting_cultivation"))*m_timestep_length_forestry; ); * shifting cultivation is faded out if(s35_forest_damage=2, - p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * sum(cell(i,j),f35_forest_lost_share(i,"shifting_agriculture"))*m_timestep_length_forestry*(1 - p35_damage_fader(t)); - p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum(cell(i,j),f35_forest_lost_share(i,"shifting_agriculture"))*m_timestep_length_forestry*(1 - p35_damage_fader(t)); + p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * sum(cell(i,j),f35_forest_lost_share(i,"shifting_cultivation"))*m_timestep_length_forestry*(1 - p35_damage_fader(t)); + p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum(cell(i,j),f35_forest_lost_share(i,"shifting_cultivation"))*m_timestep_length_forestry*(1 - p35_damage_fader(t)); ); if(s35_forest_damage=3, diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index ad7b29f0f1..aa9eef7b87 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -8,11 +8,12 @@ sets driver_source Source of deforestation drivers - / overall, deforestation, shifting_agriculture, - forestry, wildfire, urbanization / + / overall, permanent_agriculture, hard_commodities, shifting_cultivation, + logging, wildfire, settlements_infrastructure, other_natural_disturbances, + unknown / combined_loss(driver_source) Combined loss from fire plus agriculture - / shifting_agriculture,wildfire / + / shifting_cultivation,wildfire / pol35 Land protection policy / none, npi, ndc / From 46f5361442eb820ecebf040c283abf95a745b383 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Thu, 10 Sep 2026 13:59:15 +0200 Subject: [PATCH 2/8] module 35: driver_source carries only non-endogenous disturbances driver_source drops to overall, shifting_cultivation, wildfire and other_natural_disturbances; combined_loss becomes all three. The removed classes are the observational counterpart of vm_lu_transitions, v35_hvarea_* and the module 34 urban pool and now travel through mrvalidation. The f35_forest_lost_share description no longer says "damaged by forest fires". Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01FQU9MetaTSbqRJVrCypV9n --- modules/35_natveg/pot_forest_may24/input.gms | 2 +- modules/35_natveg/pot_forest_may24/sets.gms | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index e7aa7d7cfb..77dcc5fff7 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -29,7 +29,7 @@ s35_forest_damage_end Year of forest damage end (1) / 2050 / s35_npi_ndc_reversal Year in which NPI NDC reversal should take place (1) / Inf / ; -table f35_forest_lost_share(i,driver_source) Share of area damaged by forest fires (1) +table f35_forest_lost_share(i,driver_source) Share of forest area disturbed per year by driver (1) $ondelim $include "./modules/35_natveg/input/f35_forest_lost_share.cs3" $offdelim diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index aa9eef7b87..6d6b77ea57 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -7,13 +7,11 @@ sets - driver_source Source of deforestation drivers - / overall, permanent_agriculture, hard_commodities, shifting_cultivation, - logging, wildfire, settlements_infrastructure, other_natural_disturbances, - unknown / + driver_source Source of forest disturbance + / overall, shifting_cultivation, wildfire, other_natural_disturbances / - combined_loss(driver_source) Combined loss from fire plus agriculture - / shifting_cultivation,wildfire / + combined_loss(driver_source) Combined loss from disturbances not modelled endogenously + / shifting_cultivation,wildfire,other_natural_disturbances / pol35 Land protection policy / none, npi, ndc / From 042bad2b7fb4999df52c0750bd019cbe9960f63b Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Fri, 11 Sep 2026 09:28:07 +0200 Subject: [PATCH 3/8] module 35: drop natural disturbance from driver_source driver_source is now overall and shifting_cultivation; combined_loss holds shifting_cultivation alone, so s35_forest_damage = 3 equals 1 (stated at both sites, subset kept so re-admitting a class is one line). Wildfire and other natural disturbances are booked as land-use-change CO2 by module 52 and drive DEFO_largeFires in magpie4, and wildfire is already in the fire-enabled LPJmL run behind the carbon densities. No run changes: the shifting_cultivation and overall columns are bit-identical, and gams action=c compiles clean (the old four-column input fails with a domain violation). Errata: option (3) added to the s35_forest_damage description, c35_forest_damage_end -> s35_forest_damage_end. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_014XmKyZUQSGPk6rJna5eD62 Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01QBJaUn8DLgzgyZUc8CRunM --- config/default.cfg | 8 +++++--- modules/35_natveg/pot_forest_may24/input.gms | 2 +- modules/35_natveg/pot_forest_may24/presolve.gms | 2 +- modules/35_natveg/pot_forest_may24/sets.gms | 8 ++++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d282609a5a..9557216338 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1178,11 +1178,13 @@ cfg$gms$s35_secdf_distribution <- 2 # def = 2 # Damages in natural forests # * (0): No damage simulated -# * (1): Damage from shifting agriculture (constant) -# * (2): Damage from shifting agriculture is faded out by the year defined in 'cfg$gms$c35_forest_damage_end' +# * (1): Damage from shifting cultivation (constant) +# * (2): Damage from shifting cultivation is faded out by the year defined in 'cfg$gms$s35_forest_damage_end' +# * (3): Damage from every class in the `combined_loss` subset of `driver_source`, not faded. +# * That subset currently holds shifting cultivation alone, so (3) equals (1). # * (4): Generic forest disturbance scenarios defined in `f35_forest_shock.csv` cfg$gms$s35_forest_damage <- 2 # def = 2 -# * If option (2) above: Year by which damage from shifting agriculture has petered out +# * If option (2) above: Year by which damage from shifting cultivation has petered out cfg$gms$s35_forest_damage_end <- 2050 #def = 2050 # Harvesting switch for timber production diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index 77dcc5fff7..e5fd30370f 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -24,7 +24,7 @@ s35_timber_harvest_cost_other Cost for harvesting from other land (USD17M s35_timber_harvest_cost_primforest Cost for harvesting from primary forest (USD17MER per ha) / 3690/ s35_natveg_harvest_shr Constrains the allowed wood harvest from natural vegetation (1=unconstrained) (1) /1/ s35_secdf_distribution Flag for secdf initialization (0=all secondary forest in highest age class 1=Equal distribution among all age classes 2=Poulter distribution from MODIS satellite data) (1) / 2 / -s35_forest_damage Damage simulation in forests (0=none 1=shifting agriculture 2= Damage from shifting agriculture is faded out by c35_forest_damage_end 4= f35_forest_shock scenario) / 2 / +s35_forest_damage Damage simulation in forests (0=none 1=shifting cultivation 2=shifting cultivation faded out by s35_forest_damage_end 3=all combined_loss classes 4= f35_forest_shock scenario) / 2 / s35_forest_damage_end Year of forest damage end (1) / 2050 / s35_npi_ndc_reversal Year in which NPI NDC reversal should take place (1) / Inf / ; diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index b0622efb8c..b98198e7fd 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de * ---------------------------------------------------- -* Shift ageclasses due to shifting cultivation and fires +* Shift ageclasses due to forest disturbance * ---------------------------------------------------- * first calculate damages diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index 6d6b77ea57..4864d7a559 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -7,11 +7,15 @@ sets +* Disturbance classes in f35_forest_lost_share: those that leave the land as forest, are not +* decided endogenously, and are land use rather than natural disturbance (the flux is booked +* as land-use-change CO2). Selected in mrland::calcForestFireLoss. overall is never read. driver_source Source of forest disturbance - / overall, shifting_cultivation, wildfire, other_natural_disturbances / + / overall, shifting_cultivation / +* One element, so s35_forest_damage = 3 equals 1; kept so re-admitting a class is one line. combined_loss(driver_source) Combined loss from disturbances not modelled endogenously - / shifting_cultivation,wildfire,other_natural_disturbances / + / shifting_cultivation / pol35 Land protection policy / none, npi, ndc / From 167aefdc762bd5ee44e61548f42a9c1daf383160 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Sat, 12 Sep 2026 22:54:07 +0200 Subject: [PATCH 4/8] module 35: remove f35_forest_disturbance_share, never read Declared and included since December 2020 (55785b702), read by no equation in any revision; preprocessing generated it on every input build. Removed from input.gms and the input file list. mrland stops writing the .cs4 in the same change. Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01GaYsqSd2gZdixtjH8XWu2k --- modules/35_natveg/input/files | 1 - modules/35_natveg/pot_forest_may24/input.gms | 7 ------- 2 files changed, 8 deletions(-) diff --git a/modules/35_natveg/input/files b/modules/35_natveg/input/files index dc39074a1e..980da23c0f 100644 --- a/modules/35_natveg/input/files +++ b/modules/35_natveg/input/files @@ -1,6 +1,5 @@ * list of files that are required here npi_ndc_ad_aolc_pol.cs3 -f35_forest_disturbance_share.cs4 f35_forest_lost_share.cs3 f35_forest_shock.csv pot_forest_area.cs2 diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index e5fd30370f..df279b6e75 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -47,13 +47,6 @@ $include "./modules/35_natveg/input/f35_forest_shock.csv" $offdelim ; -parameter f35_forest_disturbance_share(i) Share of area damaged by forest disturbances (1) -/ -$ondelim -$include "./modules/35_natveg/input/f35_forest_disturbance_share.cs4" -$offdelim -/; - parameter f35_pot_forest_area(t_all,j) Potential forest area (mio. ha) / $ondelim From b5ff48dee4499db2e275688e6a6d1a5e50105fd7 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Mon, 14 Sep 2026 12:04:02 +0200 Subject: [PATCH 5/8] module 35: name the renamed mrland function in the driver_source comment mrland's calcForestFireLoss is now calcForestLossByDriver (pik-piam/mrland#78). Comment only. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01QBJaUn8DLgzgyZUc8CRunM --- modules/35_natveg/pot_forest_may24/sets.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index 4864d7a559..3e3ffed784 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -9,7 +9,7 @@ sets * Disturbance classes in f35_forest_lost_share: those that leave the land as forest, are not * decided endogenously, and are land use rather than natural disturbance (the flux is booked -* as land-use-change CO2). Selected in mrland::calcForestFireLoss. overall is never read. +* as land-use-change CO2). Selected in mrland::calcForestLossByDriver. overall is never read. driver_source Source of forest disturbance / overall, shifting_cultivation / From df67c2f549c61fbf144486237dc91dcffc130a36 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Tue, 22 Sep 2026 13:34:45 +0200 Subject: [PATCH 6/8] Shorten the driver_source comments in 35_natveg sets.gms Co-Authored-By: Claude Fable 5.1 --- modules/35_natveg/pot_forest_may24/sets.gms | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index 3e3ffed784..a80c14b750 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -7,13 +7,11 @@ sets -* Disturbance classes in f35_forest_lost_share: those that leave the land as forest, are not -* decided endogenously, and are land use rather than natural disturbance (the flux is booked -* as land-use-change CO2). Selected in mrland::calcForestLossByDriver. overall is never read. +* Columns of f35_forest_lost_share, as produced by mrland's calcForestLossByDriver driver_source Source of forest disturbance / overall, shifting_cultivation / -* One element, so s35_forest_damage = 3 equals 1; kept so re-admitting a class is one line. +* Classes summed under s35_forest_damage = 3 combined_loss(driver_source) Combined loss from disturbances not modelled endogenously / shifting_cultivation / From 9ed6a612ef76ce769e9d4fd9376ea182d5034deb Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Tue, 29 Sep 2026 15:58:37 +0200 Subject: [PATCH 7/8] Drop the unused overall column from driver_source Co-Authored-By: Claude Opus 5.5 (1M context) --- modules/35_natveg/pot_forest_may24/sets.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index a80c14b750..746b813ddb 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -9,7 +9,7 @@ sets * Columns of f35_forest_lost_share, as produced by mrland's calcForestLossByDriver driver_source Source of forest disturbance - / overall, shifting_cultivation / + / shifting_cultivation / * Classes summed under s35_forest_damage = 3 combined_loss(driver_source) Combined loss from disturbances not modelled endogenously From 9847180132eb26b3927ca5d601c01545c11140e4 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Tue, 6 Oct 2026 10:06:50 +0200 Subject: [PATCH 8/8] 35_natveg: remove combined_loss and s35_forest_damage option 3 Co-Authored-By: Claude Opus 5.5 (1M context) --- config/default.cfg | 2 -- modules/35_natveg/pot_forest_may24/input.gms | 2 +- modules/35_natveg/pot_forest_may24/presolve.gms | 5 ----- modules/35_natveg/pot_forest_may24/sets.gms | 4 ---- 4 files changed, 1 insertion(+), 12 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index ec1e1f2fed..210f71f644 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1227,8 +1227,6 @@ cfg$gms$s35_secdf_distribution <- 2 # def = 2 # * (0): No damage simulated # * (1): Damage from shifting cultivation (constant) # * (2): Damage from shifting cultivation is faded out by the year defined in 'cfg$gms$s35_forest_damage_end' -# * (3): Damage from every class in the `combined_loss` subset of `driver_source`, not faded. -# * That subset currently holds shifting cultivation alone, so (3) equals (1). # * (4): Generic forest disturbance scenarios defined in `f35_forest_shock.csv` cfg$gms$s35_forest_damage <- 2 # def = 2 # * If option (2) above: Year by which damage from shifting cultivation has petered out diff --git a/modules/35_natveg/pot_forest_may24/input.gms b/modules/35_natveg/pot_forest_may24/input.gms index f5b9a0a1fa..94ae85a9d6 100644 --- a/modules/35_natveg/pot_forest_may24/input.gms +++ b/modules/35_natveg/pot_forest_may24/input.gms @@ -28,7 +28,7 @@ s35_timber_harvest_cost_other Cost for harvesting from other land (USD17M s35_timber_harvest_cost_primforest Cost for harvesting from primary forest (USD17MER per ha) / 3690 / s35_natveg_harvest_shr Constrains the allowed wood harvest from natural vegetation (1=unconstrained) (1) /1/ s35_secdf_distribution Flag for secdf initialization (0=all secondary forest in highest age class 1=Equal distribution among all age classes 2=Poulter distribution from MODIS satellite data) (1) / 2 / -s35_forest_damage Damage simulation in forests (0=none 1=shifting cultivation 2=shifting cultivation faded out by s35_forest_damage_end 3=all combined_loss classes 4= f35_forest_shock scenario) / 2 / +s35_forest_damage Damage simulation in forests (0=none 1=shifting cultivation 2=shifting cultivation faded out by s35_forest_damage_end 4= f35_forest_shock scenario) / 2 / s35_forest_damage_end Year of forest damage end (1) / 2050 / s35_npi_ndc_reversal Year in which NPI NDC reversal should take place (1) / Inf / ; diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index e6475f9d15..6b4978632c 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -21,11 +21,6 @@ if(s35_forest_damage=2, p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum(cell(i,j),f35_forest_lost_share(i,"shifting_cultivation"))*m_timestep_length_forestry*(1 - p35_damage_fader(t)); ); -if(s35_forest_damage=3, - p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * sum((cell(i,j),combined_loss),f35_forest_lost_share(i,combined_loss))*m_timestep_length_forestry; - p35_disturbance_loss_primf(t,j) = pcm_land(j,"primforest") * sum((cell(i,j),combined_loss),f35_forest_lost_share(i,combined_loss))*m_timestep_length_forestry; - ); - * generic disturbance scenarios if(s35_forest_damage=4, p35_disturbance_loss_secdf(t,j,ac_sub) = pc35_secdforest(j,ac_sub) * f35_forest_shock(t,"%c35_shock_scenario%") * m_timestep_length; diff --git a/modules/35_natveg/pot_forest_may24/sets.gms b/modules/35_natveg/pot_forest_may24/sets.gms index 746b813ddb..5e22de3a53 100644 --- a/modules/35_natveg/pot_forest_may24/sets.gms +++ b/modules/35_natveg/pot_forest_may24/sets.gms @@ -11,10 +11,6 @@ sets driver_source Source of forest disturbance / shifting_cultivation / -* Classes summed under s35_forest_damage = 3 - combined_loss(driver_source) Combined loss from disturbances not modelled endogenously - / shifting_cultivation / - pol35 Land protection policy / none, npi, ndc /