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

AgroForestry: treecover on cropland and betr #644

Open
wants to merge 115 commits into
base: develop
Choose a base branch
from

Conversation

flohump
Copy link
Contributor

@flohump flohump commented Mar 11, 2024

🐦 Description of this PR 🐦

This PR adds tree cover on cropland and bioenergy trees as two different AgroForestry systems to MAgPIE
To intergrate cropland tree cover properly into the existing model, the following changes are applied:

  • new module 29_cropland, accouting for crop area, fallow cropland and tree cover on cropland
  • module 30_crop renamed to 30_croparea, which now only accounts for crop area.
  • module 29_ageclass has been renamed to 28_ageclass
  • SNV has been moved from 30_crop to 29_cropland
  • 30_crop/penalty and 30_crop/rotation realizations have been merged into a singe 30_croparea/detail_apr24 realization
  • the previous 30_crop/endo_apr21 crop realization has been renamed to 30_croparea/simple_apr24
  • The new module 29_cropland has two realizations: detail_apr24 and simple_apr24 (default)
  • 29_cropland/detail_apr24 includes all tree cover (includign age-classes) and fallow land calculations
  • 29_cropland/simple_apr24 assumes zero tree cover and fallow land.

todo: include input files for 30_croparea in additional_data.tgz.

todo: emisCO2 in magpie4 reporting

Changelog

changed

  • 29_ageclass module 29_ageclass has been renamed to 28_ageclass to make space for 29_cropland just before 30_croparea
  • 30_crop module 30_crop renamed to 30_croparea, which now only accounts for crop area.
  • 30_crop SNV implementation has been moved from 30_crop to 29_cropland/detail_apr24
  • 30_crop the two realizations penalty_apr22 and rotation_apr22 have been merged into a single 30_croparea/detail_apr24 realization
  • 30_crop the previous 30_crop/endo_apr21 realization has been moved to 30_croparea/simple_apr24
  • 80_optimization Simplifed cycling through CONOPT4, CONOPT4 with OPTFILE, CONOPT4 without preprocessing and CONOPT3.

added

  • 29_cropland new module 29_cropland accounting for crop area, fallow cropland and tree cover on cropland with two realizations: detail_apr24 and simple_apr24 (default) .
  • 10_land added interface pm_land_hist with historic land use patterns
  • 32_forestry added technical balance term v32_land_missing_ndc
  • default.cfg cfg$gms$s80_secondsolve option for second solve statement with 0=off as default

fixed

  • 80_optimization bugfix in nlp_par. Double solve statement was not working

🔧 Checklist for PR creator 🔧

  • Label pull request from the label list.

    • Low risk: Simple bugfixes (missing files, updated documentation, typos) or changes in start or output scripts
    • Medium risk: Uncritical changes in the model core (e.g. moderate modifications in non-default realizations)
    • High risk: Critical changes in model core or default settings (e.g. changing a model default or adjusting a core mechanic in the model)
  • Self-review own code

    • No hard coded numbers and cluster/country/region names.
    • The new code doesn't contain declared but unused parameters or variables.
    • magpie4 R library has been updated accordingly and backwards compatible where necessary.
    • scenario_config.csv has been updated accordingly (important if default.cfg has been updated)
  • Document changes

    • Add changes to CHANGELOG.md
    • Where relevant, put In-code documentation comments
    • Properly address updates in interfaces in the module documentations
    • run goxygen::goxygen() and verify the modified code is properly documented
  • Perform test runs

    • Low risk:
      • Run a compilation check via Rscript start.R --> "compilation check"
    • Medium risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
    • High risk:
      • Run test runs via Rscript start.R --> "test runs"
      • Check logs for errors/warnings
      • Default run from the PR target branch for comparison
      • Provide relevant comparison plots (land-use, emissions, food prices, land-use intensity,...)

Resources_Land_Cover_Cropland-100
Resources_Land_Cover_Cropland_Tree_Cover
Productivity_Landuse_Intensity_Indicator_Tau-87
Emissions_CO2_Land_Land_use_Change-86
Prices_Index2020_Agriculture_Food_products-2

📉 Performance changes 📈

  • Current develop branch default : 27 mins
  • This PR's default : 27 mins

🚨 Checklist for reviewer 🚨

  • PR is labeled correctly
  • Code changes look reasonable
    • No hard coded numbers and cluster/country/region names.
    • No unnecessary increase in module interfaces
    • model behavior/performance is satisfactory.
  • Changes are properly documented
    • CHANGELOG is updated correctly
    • Updates in interfaces have been properly addressed in the module documentations
    • In-code documentation looks appropriate
  • content review done (at least 1)
  • RSE review done (at least 1)

@flohump flohump changed the title treecover on cropland AgroForestry: treecover on cropland and betr Mar 11, 2024
Copy link
Member

@bodirsky bodirsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few documentation changes.
Seems good to me, but should be done analogous for all 3 realizations.
Please let me know if you need help with understanding the penalty implementation!


* macro for carbon stocks with age classes
$macro m_carbon_stock_ac(land,carbon_density,sets,sets_sub) \
sum((&&sets), land(j2,&&sets) * sum(ct, carbon_density(ct,j2,&&sets,ag_pools)))$(sameas(stockType,"actual")) + \
sum((&&sets_sub), land(j2,&&sets_sub) * sum(ct, carbon_density(ct,j2,&&sets_sub,ag_pools)))$(sameas(stockType,"actualNoAcEst"));
sum((&&sets_sub), land(j2,&&sets_sub) * sum(ct, carbon_density(ct,j2,&&sets_sub,ag_pools)))$(sameas(stockType,"actualNoAcEst"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was ist mit den semicolons? warum werden die nicht mehr benötigt?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add the result of two macros. Therefore, the semicolon is put in the equation.
So far, there are acutally two semicolons in many cases where macros are used. One from the macro itself and another one in the code.
I would argue that it makes more sense to define macros without final semicolon.
@tscheypidi What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree

modules/30_crop/endo_apr21/declarations.gms Outdated Show resolved Hide resolved
@@ -29,6 +29,17 @@ s30_snv_relocation_data_x1 First reference value in SNV target cropland dat
s30_snv_relocation_data_x2 Second reference value in SNV target cropland data (1) / 0.5 /
s30_rotation_scenario_start Rotation scenario start year / 2020 /
s30_rotation_scenario_target Rotation scenario target year / 2050 /
s30_treecover_plantation Growth curve switch for tree cover on cropland 0=natveg 1=plantations (1) / 0 /
s30_treecover_bii_coeff BII coefficent to be used for tree cover on cropland 0=natural vegetation 1=plantation (1) / 0 /
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this value may be a bit high, no? do we have a justification?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the value for secondary vegetation until we found something better?
On the other hand, a tree on a field probably has a positive externality on the surrounding crops, that would justify a high BII

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s30_treecover_bii_coeff = 0 is actually secondary vegetation. Will be revised.

@@ -10,7 +10,7 @@
*' the sum of crop and water supply type specific land requirements:

q30_cropland(j2) ..
sum((kcr,w), vm_area(j2,kcr,w)) =e= vm_land(j2,"crop");
sum((kcr,w), vm_area(j2,kcr,w)) + vm_fallow(j2) + sum(ac, v30_treecover(j2,ac)) =e= vm_land(j2,"crop");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now you introduced fallow into the endo_apr realization. Was that on purpose?
As long as it is fixed to 0, probably doesnt matter...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for consistency because fallow land and treecover will show up in this equation in the other realizations.

modules/30_crop/endo_apr21/equations.gms Outdated Show resolved Hide resolved

** set bii coefficients
p30_treecover_bii_coeff(bii_class_secd,potnatveg) = 0;
if(s30_treecover_bii_coeff = 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, now i see, this is just a switch!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it can be choosen flexibly. In analogy to re-/afforestation.

@@ -79,3 +93,8 @@
=e=
(vm_land(j2,"crop") - sum((crop_ann30,w), vm_area(j2,crop_ann30,w)))
* fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j2,potnatveg);

q30_bv_treecover(j2,potnatveg) .. vm_bv(j2,"crop_tree",potnatveg)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the set potnatveg doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bii coefficients are defined for two layers: forested and non-forested biomes.

@@ -50,3 +50,43 @@ p30_snv_relocation(t,j)$(p30_snv_relocation(t, j) > p30_max_snv_relocation(t,j))
*' Area potentially available for cropping
p30_avl_cropland(t,j) = f30_avl_cropland(j,"%c30_marginal_land%") * (1 - p30_snv_shr(t,j));
*' @stop

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess this is copy paste from a previous implementation, right? only reviewing it shortly

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Adapted from 35_natveg.

modules/30_crop/endo_apr21/declarations.gms Outdated Show resolved Hide resolved
@flohump
Copy link
Contributor Author

flohump commented Mar 12, 2024

A few documentation changes. Seems good to me, but should be done analogous for all 3 realizations. Please let me know if you need help with understanding the penalty implementation!

Sure. This will be included in all 3 realizations once we agreed that the overall approach is fine.

p30_treecover(t,j,"acx") = p30_treecover(t,j,"acx")
+ sum(ac$(ord(ac) > card(ac)-s30_shift), pc30_treecover(j,ac));

pc30_treecover(j,ac) = p30_treecover(t,j,ac);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just double checking. Here we go from 3 dimensions (t,j,ac) to 2 dimensions (j,ac). Is this right?

Copy link
Member

@tscheypidi tscheypidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks overall good to me. Please have a look at the specific comments to see my requests for modifications


* macro for carbon stocks with age classes
$macro m_carbon_stock_ac(land,carbon_density,sets,sets_sub) \
sum((&&sets), land(j2,&&sets) * sum(ct, carbon_density(ct,j2,&&sets,ag_pools)))$(sameas(stockType,"actual")) + \
sum((&&sets_sub), land(j2,&&sets_sub) * sum(ct, carbon_density(ct,j2,&&sets_sub,ag_pools)))$(sameas(stockType,"actualNoAcEst"));
sum((&&sets_sub), land(j2,&&sets_sub) * sum(ct, carbon_density(ct,j2,&&sets_sub,ag_pools)))$(sameas(stockType,"actualNoAcEst"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tend to agree


pcm_land(j,land) = pm_land_start(j,land);
vm_land.l(j,land) = pcm_land(j,land);

pm_treecover_shr(j) = 0;
pm_treecover_shr(j)$(f10_land("y2015",j,"crop") > 1e-10) =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be more consistent to compute the treecover share in the agroforestry module. I think the existing interface pcm_land could be used for it (instead of making f10_land a new interface).

ac_est(ac) = yes$(ord(ac) <= (m_yeardiff_forestry(t)/5));

ac_sub(ac) = no;
ac_sub(ac) = yes$(ord(ac) > (m_yeardiff_forestry(t)/5));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens here and why? A new set but no other changes in the module?

@@ -10,7 +10,7 @@
*' the sum of crop and water supply type specific land requirements:

q30_cropland(j2) ..
sum((kcr,w), vm_area(j2,kcr,w)) =e= vm_land(j2,"crop");
sum((kcr,w), vm_area(j2,kcr,w)) + vm_fallow(j2) + vm_treecover_area(j2) =e= vm_land(j2,"crop");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is now fallow coming in here? this will change the default behavior of the realization, right? If so, it should be also labelled differently I think

*' @equations

*' Total agroforestry cost.
*' Cost for bioenergy trees are accounted for in the [30_crop] module.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at the resulting documenation. I would at least use full sentences to describe the methodology. The documentation page should read as a real documentation of the realization

@k4rst3ns k4rst3ns self-requested a review March 26, 2024 15:05
Copy link
Member

@k4rst3ns k4rst3ns left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Florian for this major effort.

I added some comments and I also spotted some things that have to be fixed (see comments on the som module). I think in general it looks very good. I guess I normally would comment the code more excessively and added some comments there I would find it really helpful to have more guidance through the code ^^'

@@ -26,7 +26,7 @@ cfg$input <- c(regional = "rev4.104_h12_magpie.tgz",
cellular = "rev4.104_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.104_h12_validation.tgz",
additional = "additional_data_rev4.48.tgz",
calibration = "calibration_H12_26Mar24.tgz")
calibration = "calibration_H12_default_30Apr24.tgz")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still produce new calibration files?

We know that the fallow land does not perfectly work together without calibration (due to area mismatches). Did you test the tree cover with and without calibration run?

# * Tree cover recurring cost (USD05MER per ha)
cfg$gms$s29_cost_treecover_recur <- 500 # def = 500
# * Penalty for violation of treecover target (USD05MER per ha)
cfg$gms$s29_treecover_penalty <- 2000 # def = 2000
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should penalty terms be part of the config?
I guess in development stage this is good for testing, but this might be removed for the final commit?

# * Target year (year when full implementation is reached):
cfg$gms$s30_betr_scenario_target <- 2050 # def = 2050
# * Penalty for violation of fallow target (USD05MER per ha)
cfg$gms$s30_betr_penalty <- 500 # def = 500
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add here, that this setting are used for an agroforestry setup (or at least are interpreted as agroforestry in a way?)

@@ -3,3 +3,5 @@ avl_land_t.cs3
avl_land_t_0.5.mz
luh2_side_layers.cs3
avl_land_t_iso.cs3
CroplandTreecover.cs2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should these files be read in in module 29_cropland?

@@ -14,6 +14,11 @@ $ondelim
$include "./modules/10_land/input/avl_land_t.cs3"
$offdelim
;
*due to some rounding errors the input data currently may contain in some cases
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really? - than this should be rather tackled than bugfixes here?

+ v30_betr_missing(j2) * sum(ct, i30_betr_penalty(ct))
);

q30_rotation_max(j2,rotamax_red30)$(i30_implementation = 1) ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here comments are missing?
Could you add these: https://github.com/magpiemodel/magpie/blob/a233ab7cbe6fbfadebca49676f8993e101f3fb9d/modules/30_crop/rotation_apr22/equations.gms#L45C4-L48C17

I know bringing the two realizations together is kind of very messy work. But it also makes it harder to understand the module as well. Maybe there is also a way to structure the code a bit more with some sub-headings? Indicating where the rule-based and the incentive base party starts?

@@ -21,7 +14,7 @@ v32_land_reduction.fx(j,type32,ac_est) = 0;
p32_aff_pol_timestep("y1995",j) = 0;
p32_aff_pol_timestep(t,j)$(ord(t)>1) = p32_aff_pol(t,j) - p32_aff_pol(t-1,j);
* Suitable area (`p32_aff_pot`) for NPI/NDC afforestation
p32_aff_pot(t,j) = (vm_land.l(j,"crop") - vm_land.lo(j,"crop")) + (vm_land.l(j,"past") - vm_land.lo(j,"past")) - pm_land_conservation(t,j,"other","restore");
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");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why fallow can't be used here?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 good point!

+ vm_fallow(j2) * i59_cratio_fallow(j2)
+ vm_treecover(j2) * i59_cratio_treecover)
* sum(ct,f59_topsoilc_density(ct,j2));

*' as well as for all non cropland given by

q59_som_target_noncropland(j2,noncropland59) ..
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the new cellpool_jan23 the changes in declarations and preloop are missing.
I know it is a bit messy that we have two almost identical reliaztions in magpie,
At some point the old one should be depreciated.
But since the new one is the one with the missing code, please add it :)

@@ -130,7 +127,7 @@ $batinclude "./modules/include.gms" nl_relax
*' the nonlinear optimization of the model in its full complexity.

solve magpie USING nlp MINIMIZING vm_cost_glo;
solve magpie USING nlp MINIMIZING vm_cost_glo;
if(s80_secondsolve = 1, solve magpie USING nlp MINIMIZING vm_cost_glo; );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that has to be reviewed by somebody else.
@tscheypidi

@@ -79,6 +79,16 @@ cfg <- fsecScenario(scenario = "c_BAU")
cfg$results_folder_highres <- "output"
start_run(cfg = cfg, codeCheck = codeCheck)

### NatureSparing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the test_run script is intentionally? Please just check ones

# Conflicts:
#	CHANGELOG.md
#	config/default.cfg
#	config/scenario_config.csv
#	modules/30_crop/endo_apr21/declarations.gms
#	modules/30_crop/endo_apr21/equations.gms
#	modules/30_crop/endo_apr21/input.gms
#	modules/30_crop/endo_apr21/postsolve.gms
#	modules/30_crop/endo_apr21/presolve.gms
#	modules/30_crop/penalty_apr22/equations.gms
#	modules/30_crop/penalty_apr22/input.gms
#	modules/30_crop/penalty_apr22/presolve.gms
#	modules/30_crop/rotation_apr22/declarations.gms
#	modules/30_crop/rotation_apr22/equations.gms
#	modules/30_crop/rotation_apr22/input.gms
#	modules/30_crop/rotation_apr22/postsolve.gms
#	modules/30_crop/rotation_apr22/presolve.gms
#	modules/30_croparea/detail_apr24/declarations.gms
#	modules/30_croparea/detail_apr24/postsolve.gms
#	scripts/start/test_runs.R
# Conflicts:
#	CHANGELOG.md
#	config/default.cfg
#	config/scenario_fsec.csv
Copy link
Member

@tscheypidi tscheypidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added some comments, but looks good to me overall

@@ -40,7 +48,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **scenario_config.csv** same revision for input files as in default.cfg
- **scenario_fsec.csv** scenario settings
- **start/projects/fsec.R** scenario settings
- **80_optimization** fixed a bug in nlp_apr17; cycling through CONOPT4, CONOPT4 without preprocessing and CONOPT3 was not working
- **80_optimization** bugfix in nlp_par. Double solve statement was not working
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this part has been moved to another PR, right?

@@ -7,17 +7,25 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### changed
- **29_ageclass** module 29_ageclass has been renamed to 28_ageclass to make space for `29_cropland` just before `30_croparea`
- **30_crop** module `30_crop` renamed to `30_croparea`, which now only accounts for crop area.
- **30_crop** SNV implementation has been moved from `30_crop` to `29_cropland`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would favor to have SNV written out as this abbreviation is from my perspective not established enough to be used without explanation

*' Cropland tree cover establishment rules.

q29_treecover_est(j2,ac_est) ..
v29_treecover(j2,ac_est) =e= sum(ac_est2, v29_treecover(j2,ac_est2))/card(ac_est2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree

Copy link
Contributor

@pvjeetze pvjeetze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some minor questions, looks otherwise good to me!

# * Target year (year when full implementation is reached):
cfg$gms$s30_snv_scenario_target <- 2030 # def = 2030
cfg$gms$s29_snv_scenario_target <- 2029 # def = 2029
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 2029?


vm_fallow.lo(j) = 0;
vm_fallow.up(j) = p29_avl_cropland(t,j);
m_boundfix(vm_fallow,(j),l,1e-6);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

i30_rotation_incentives(t_all,rota30) =
f30_rotation_incentives(rota30,"default") * (1-i30_rotation_scenario_fader(t_all)) +
f30_rotation_incentives(rota30,"%c30_rotation_incentives%") * (i30_rotation_scenario_fader(t_all));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@@ -21,7 +14,7 @@ v32_land_reduction.fx(j,type32,ac_est) = 0;
p32_aff_pol_timestep("y1995",j) = 0;
p32_aff_pol_timestep(t,j)$(ord(t)>1) = p32_aff_pol(t,j) - p32_aff_pol(t-1,j);
* Suitable area (`p32_aff_pot`) for NPI/NDC afforestation
p32_aff_pot(t,j) = (vm_land.l(j,"crop") - vm_land.lo(j,"crop")) + (vm_land.l(j,"past") - vm_land.lo(j,"past")) - pm_land_conservation(t,j,"other","restore");
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");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 good point!

@@ -24,6 +24,8 @@ q50_nr_inputs(i2) ..
vm_res_recycling(i2,"nr")
+ sum((cell(i2,j2),kcr,w), vm_area(j2,kcr,w) * f50_nr_fix_area(kcr))
+ sum(cell(i2,j2),vm_fallow(j2) * f50_nr_fix_area("tece"))
* Commented out for consistency with q50_nr_surplus_nonagland
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commented code should be removed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request High risk Higher risk Major Substantial modifications
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants