-
Notifications
You must be signed in to change notification settings - Fork 173
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
Changes from 75 commits
367222a
aecdaff
3ea3246
aa676cf
39738df
41cdffe
6725072
9c34926
f8c5e21
d2e21ce
afb8831
ed34c5e
531ffad
cc47972
9467984
20e42a2
f96fbb0
9b4b009
3845262
e7f8e40
3923e34
350667a
abdc8c8
67b57fc
495bf03
a0b0e15
43fd4fd
8333584
1014226
ec92cc6
876fc9d
8063487
a26ece2
3feb873
629a809
670e825
6b48d9e
eea0d5f
b44171c
abd5d8a
500c08f
4f4fbf4
c082921
5c455ed
34e0c6b
6279d34
274542d
a3eb576
34b830b
41d1deb
a179129
9d3b74a
960767e
5b89eee
0bdde4d
37a8b37
65f8202
560b736
a755ee5
b6fb489
c6c4756
f22f736
14eea42
a723bd9
f80ee75
ea597be
d0c8388
2143ba2
0b74f68
8d3df52
b406498
29ec05a
176fa1c
ccaf380
1745fcd
4d2b2e3
584aac5
6c23a00
444eaaf
d4f25ff
8e61949
518c25d
9d7befc
d8eb4e9
9f2acf4
f7125ac
46e2285
286d9c5
ac4c249
bc4c3cf
4ff9834
09535ff
4e94659
2f79c13
8fa3217
fdbbc1c
47256b8
ce923a3
3747457
b4a596d
9e175b4
72ce77e
2ce5f4b
7be483e
1d7b333
574f54d
95c0f43
893cbfd
d1ca47d
2c61aa6
02af343
be4d767
40b7ddf
a11c5ea
2beac3f
47b3982
404be5c
f9be6ac
f56a0c1
85e6fe5
dce8e0d
6119e52
442a7ab
a9904f0
1774fcf
cb0294f
604baa6
07b187b
6496d8f
b42d809
58d5ef8
6db3dcb
1d64e11
4b703be
560138b
4ac78c6
1050681
7c47023
d789ea6
e807eb5
6f55c1d
2924193
25cbd4f
96b833e
38d34ea
57638fc
8334590
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I re-calibrated both yields land conversion costs. But in the end only the land conversion cost calibration factors are used. |
||
|
||
# NOTE: It is recommended to recalibrate the model when changing cellular input data | ||
# as well as for any other setting that would affect initial values in the model, | ||
|
@@ -205,7 +205,7 @@ cfg$gms$land <- "landmatrix_dec18" # def = landmatrix_dec18 | |
# * The balance variables in the land module avoid infeasibilities due to | ||
# * differences in accuracy between parameters and variables in GAMS. | ||
# * High costs make sure that the balance variables are only used as a last resort. | ||
cfg$gms$s10_cost_balance <- 1000000 # def = 1000000 | ||
cfg$gms$s10_cost_balance <- 1e+06 # def = 1e+06 | ||
|
||
|
||
# ***--------------------- 11_costs ------ -------------------------------- | ||
|
@@ -664,37 +664,20 @@ cfg$gms$s22_conservation_start <- 2020 # def = 2020 | |
# * Target year (year when full protection is reached): | ||
cfg$gms$s22_conservation_target <- 2030 # def = 2030 | ||
|
||
# ***--------------------- 29_ageclass ----------------------------------- | ||
# ***--------------------- 28_ageclass ----------------------------------- | ||
# * (feb21): Distribution of age-classes according to Poulter et al 2018 | ||
cfg$gms$ageclass <- "feb21" # def = feb21 | ||
|
||
# ***--------------------- 30_crop --------------------------------------- | ||
# * (endo_apr21): Hard rotational constraints. Dynamic cropland and detailed cropland availability data at grid cell level. | ||
# * (rotation_apr22): hard rotational constraints and fallow constraints with the option of different future scenarios. Dynamic cropland and detailed cropland availability data at grid cell level. | ||
# * (penalty_apr22): rotational and fallow constraints are incentivized via penalty payments. Dynamic cropland and detailed cropland availability data at grid cell level. | ||
# ***--------------------- 29_cropland ----------------------------------- | ||
# * Cropland is defined as the sum of croparea, fallow land and tree cover | ||
# * Croparea is provided by 30_crop. | ||
# * Fallow land and tree cover are defined by 29_cropland, | ||
# * (simple_apr24): Fallow land and tree cover on cropland are fixed to zero | ||
# * (detail_apr24): Fallow land and tree cover based on rules or incentives | ||
# NOTE: It is recommended to recalibrate the model when changing this setting! | ||
cfg$gms$crop <- "endo_apr21" # def = endo_apr21 | ||
# * (c30_bioen_type): switch for type of bioenergy crops; options: begr, betr, all | ||
cfg$gms$c30_bioen_type <- "all" # def = "all" | ||
# * (c30_bioen_water): switch for irrigation of bioenergy crops; options: rainfed, irrigated, all | ||
cfg$gms$c30_bioen_water <- "rainfed" # def = "rainfed" | ||
# * (c30_rotation_constraints): switch for rotational constraints: on, off | ||
cfg$gms$c30_rotation_constraints <- "on" # def = "on" | ||
# * (c30_rotation_scenario): scenarios for constraints. | ||
# * In realization rotation_apr22: min (minimal constraints), default (best guess), good (good practice), | ||
# * good_20div (good practice - 20% for other crops), setaside (default plus fallow), | ||
# * legumes (minimum share of legumes), agroforestry (minimum share of perennials), sixfoldrotation | ||
# * (crops can only repeat after 6 years), agroecology (mix of previous scenarios) | ||
# * In realization penalty_apr22: none (no incentives), default (best guess), fallow (increased fallow incentives), | ||
# * legumes (increased incentives for legumes), agroforestry (increased incentives for perennials), agroecology (mix) | ||
# * In realization endo_apr21: no scenarios exist. | ||
cfg$gms$c30_rotation_scenario <- "default" # def = "default" | ||
# * Year by which rotation scenario is fully implemented: | ||
# * Start year: | ||
cfg$gms$s30_rotation_scenario_start <- 2020 # def = 2020 | ||
# * Target year (year when full implementation is reached): | ||
cfg$gms$s30_rotation_scenario_target <- 2050 # def = 2050 | ||
cfg$gms$cropland <- "simple_apr24" # def = simple_apr24 | ||
|
||
# *** Options for all cropland realizations *** | ||
|
||
# * Switch to determine whether marginal land (suitability index below 0.33) should be included | ||
# * in the total available cropland. Options are: | ||
|
@@ -703,35 +686,121 @@ cfg$gms$s30_rotation_scenario_target <- 2050 # def = 2050 | |
# * ("no_marginal"): Marginal land is completely excluded from crop cultivation | ||
# * Note: Option "q33_marginal" produces the highest spatial correlation | ||
# * with observed cropland patterns and is recommended for productive runs. | ||
cfg$gms$c30_marginal_land <- "q33_marginal" # def = "q33_marginal" | ||
cfg$gms$c29_marginal_land <- "q33_marginal" # def = "q33_marginal" | ||
|
||
# * Share of available cropland that is withheld for maintaining semi-natural vegetation (SNV) | ||
# * in each square km in cropland areas, including grassland, forest and other land. For example, | ||
# * a share of 0.2 corresponds to 20 % of SNV in terms of the available cropland. | ||
# * The amount of cropland relocation is estimated based on external high resolution | ||
# * land cover information from the Copernicus Global Land Service for the year 2019. | ||
# * Accepted sensible values are between 0 and 0.5 | ||
# Note: s30_snv_shr applies to countries selected in policy_countries30 | ||
# s30_snv_shr_noselect applies to all other countries. | ||
cfg$gms$s30_snv_shr <- 0 # def = 0 | ||
cfg$gms$s30_snv_shr_noselect <- 0 # def = 0 | ||
# * Year by which SNV policy ('s30_snv_shr') is fully implemented. | ||
# Note: s29_snv_shr applies to countries selected in policy_countries29 | ||
# s29_snv_shr_noselect applies to all other countries. | ||
cfg$gms$s29_snv_shr <- 0 # def = 0 | ||
cfg$gms$s29_snv_shr_noselect <- 0 # def = 0 | ||
# * Year by which SNV policy ('s29_snv_shr') is fully implemented. | ||
# * Start year (should be close to 2019): | ||
cfg$gms$s30_snv_scenario_start <- 2020 # def = 2020 | ||
cfg$gms$s29_snv_scenario_start <- 2020 # def = 2020 | ||
# * 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why 2029? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for spotting. was a mistake. reverted back |
||
# * Switch and specification of countries for which SNV policy in | ||
# * s30_snv_shr apply. | ||
# * s29_snv_shr apply. | ||
# * Options: list of iso-codes of countries where SNV policy should be applied | ||
# * Note: must be written in the format: "IND, BRA, DEU" | ||
# * Default: all iso countries | ||
cfg$gms$policy_countries30 <- all_iso_countries | ||
cfg$gms$policy_countries29 <- all_iso_countries | ||
# * Land types included in the SNV policy. This option allows for sensitivity analyses. | ||
# * plausible options: "secdforest, forestry, past, other", | ||
# * "secdforest, other", | ||
# * "secdforest, past, other" etc. | ||
cfg$gms$land_snv <- "secdforest, forestry, past, other" #def = "secdforest, forestry, past, other" | ||
|
||
# *** Options only available for `detail_apr24` realization *** | ||
|
||
# * Minimum cluster share of treecover on total cropland area (including croparea, fallow land and tree cover). | ||
# * s29_treecover_target is faded in linearly between s29_treecover_scenario_start and s29_treecover_scenario_target. | ||
cfg$gms$s29_treecover_target <- 0 # def = 0 | ||
# * Avoid loss of existing treecover (1=yes 0=no) | ||
cfg$gms$s29_treecover_keep <- 1 # def = 1 | ||
# * Maximum share of treecover on total cropland (1) | ||
cfg$gms$s29_treecover_max <- 0.4 # def = 0.4 | ||
# * Start year of tree cover share fade-in: | ||
cfg$gms$s29_treecover_scenario_start <- 2020 # def = 2020 | ||
# * Target year (year when full implementation is reached): | ||
cfg$gms$s29_treecover_scenario_target <- 2050 # def = 2050 | ||
# * Tree cover establishment cost (USD05MER per ha) | ||
cfg$gms$s29_cost_treecover_est <- 2000 # def = 2000 | ||
# * 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should penalty terms be part of the config? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this is by design and intention, and analogy to the crop rotation penalty implementation. |
||
|
||
# * Minimum cluster share of fallow land on total cropland area (including croparea, fallow land and tree cover). | ||
# * s29_fallow_target is faded in linearly between s29_fallow_scenario_start and s29_fallow_scenario_target. | ||
cfg$gms$s29_fallow_target <- 0 # def = 0 | ||
# * Maximum share of fallow land on total cropland (1) | ||
cfg$gms$s29_fallow_max <- 0.4 # def = 0.4 | ||
# * Start year of tree cover share fade-in: | ||
cfg$gms$s29_fallow_scenario_start <- 2020 # def = 2020 | ||
# * Target year (year when full implementation is reached): | ||
cfg$gms$s29_fallow_scenario_target <- 2050 # def = 2050 | ||
# * Penalty for violation of fallow target (USD05MER per ha) | ||
cfg$gms$s29_fallow_penalty <- 500 # def = 500 | ||
|
||
# ***--------------------- 30_croparea --------------------------------------- | ||
# * 30_croparea defines the croparea, which is a subcomponent of total cropland defined in 29_cropland. | ||
# * (simple_apr24): Dynamic croparea with simple rotational constraints | ||
# * (detail_apr24): Dynamic croparea with detailed rules and incentives for rotational constraints | ||
# NOTE: It is recommended to recalibrate the model when changing this setting! | ||
cfg$gms$croparea <- "simple_apr24" # def = simple_apr24 | ||
|
||
# *** Options for all croparea realizations *** | ||
|
||
# * (c30_bioen_type): switch for type of bioenergy crops; options: begr, betr, all | ||
cfg$gms$c30_bioen_type <- "all" # def = "all" | ||
# * (c30_bioen_water): switch for irrigation of bioenergy crops; options: rainfed, irrigated, all | ||
cfg$gms$c30_bioen_water <- "rainfed" # def = "rainfed" | ||
|
||
# * Minimum cluster share of bioenergy trees (betr) on total cropland area | ||
# * s30_betr_target is faded in linearly between s30_betr_scenario_start and s30_betr_scenario_target. | ||
cfg$gms$s30_betr_target <- 0 # def = 0 | ||
# * Start year of tree cover share fade-in: | ||
cfg$gms$s30_betr_scenario_start <- 2020 # def = 2020 | ||
# * 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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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?) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thanks for the comment. done. |
||
|
||
# *** Options only available for `simple_apr24` realization *** | ||
|
||
# * (c30_rotation_constraints): switch for rotational constraints: on, off | ||
cfg$gms$c30_rotation_constraints <- "on" # def = "on" | ||
|
||
# *** Options only available for `detail_apr24` realization *** | ||
|
||
# * Switch for rule-based (1) or penalty-based (0) implementation of rotation scenarios | ||
cfg$gms$s30_implementation <- 1 # def = 1 | ||
|
||
# * Rotation rules: | ||
# * min (minimal constraints), default (best guess), good (good practice), | ||
# * good_20div (good practice - 20% for other crops), setaside (default plus fallow), | ||
# * legumes (minimum share of legumes), sixfoldrotation (crops can only repeat after 6 years), | ||
# * agroecology (mix of previous scenarios), FSEC (similar to agroecology) | ||
# * betr0 (minimum share of short rotation agroforestry trees), betr10, betr20, betr25, betr30, betr40, betr50. | ||
cfg$gms$c30_rotation_rules <- "default" # def = "default" | ||
|
||
# * Rotation incentives: | ||
# * none (no incentives), default (best guess), | ||
# * legumes (increased incentives for legumes), agroecology (mix), | ||
# * betr500 and betr1000 (incentives for short rotation agroforestry trees) | ||
cfg$gms$c30_rotation_incentives <- "none" # def = "none" | ||
|
||
# * Year by which rotation scenario is fully implemented: | ||
# * Start year: | ||
cfg$gms$s30_rotation_scenario_start <- 2020 # def = 2020 | ||
# * Target year (year when full implementation is reached): | ||
cfg$gms$s30_rotation_scenario_target <- 2050 # def = 2050 | ||
|
||
# ***--------------------- 31_past --------------------------------------- | ||
# * (static): static pasture | ||
# * (endo_jun13): dynamic pasture | ||
|
@@ -1884,7 +1953,7 @@ cfg$gms$s73_expansion <- 0 # def = 0 | |
cfg$gms$optimization <- "nlp_apr17" # def = nlp_apr17 | ||
|
||
# maximal number of solve iterations | ||
cfg$gms$s80_maxiter <- 30 | ||
cfg$gms$s80_maxiter <- 10 # def = 10 | ||
|
||
# Solver settings only for realization `lp_nlp_apr17`. All other realizations use `conopt4`. | ||
# * (conopt4): conopt4 | ||
|
@@ -1896,7 +1965,6 @@ cfg$gms$c80_nlp_solver <- "conopt4" # def = conopt4 | |
# * 0: default settings (optfile will be ignored) | ||
cfg$gms$s80_optfile <- 0 # def = 0 | ||
|
||
|
||
#*******************************END MODULE SETUP******************************** | ||
|
||
#### Other settings (e.g. clustering, gdx files, ...): #### | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
|
||
* Macro for fixing a variable in the case that lower and upper bound are too | ||
* close to each other (closer than argument "sens") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. all arguments should be clarified ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is not new. But I added an explanation. |
||
* EXAMPLE: ma_boundfix(vm_land,(j,"ifft"),up,10e-5); | ||
* EXAMPLE: ma_boundfix(vm_land,(j,"ifft"),up,1e-6); | ||
$macro m_boundfix(x,arg,sufx,sens) x.fx arg$(x.up arg-x.lo arg<sens) = x.sufx arg; | ||
|
||
$macro m_weightedmean(x,w,s) (sum(s,x*w)/sum(s,w))$(sum(s,w)>0) + 0$(sum(s,w)<=0); | ||
|
@@ -97,12 +97,12 @@ $macro m_linear_cell_data_interpol(output,x,input_x1,input_x2,input_y1,input_y2) | |
* macro for simple carbon stocks | ||
$macro m_carbon_stock(land,carbon_density,item) \ | ||
(land(j2,item) * sum(ct,carbon_density(ct,j2,item,ag_pools)))$(sameas(stockType,"actual")) + \ | ||
(land(j2,item) * sum(ct,carbon_density(ct,j2,item,ag_pools)))$(sameas(stockType,"actualNoAcEst")); | ||
(land(j2,item) * sum(ct,carbon_density(ct,j2,item,ag_pools)))$(sameas(stockType,"actualNoAcEst")) | ||
|
||
* 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")) | ||
flohump marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
* macros for peatland module | ||
$macro m58_LandMerge(land,landForestry,set) \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should these files be read in in module 29_cropland? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for spotting. removed. |
||
CroplandTreecover_0.5.mz |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Really? - than this should be rather tackled than bugfixes here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not related to this PR. I just moved the code from preloop to input.gms. |
||
*very small, negative numbers. These numbers have to be set to 0 as area | ||
*cannot be smaller than 0! | ||
f10_land(t_ini10,j,land)$(f10_land(t_ini10,j,land)<0) = 0; | ||
|
||
|
||
table fm_luh2_side_layers(j,luh2_side_layers10) luh2 side layers (grid cell share) | ||
$ondelim | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,11 +5,8 @@ | |
*** | MAgPIE License Exception, version 1.0 (see LICENSE file). | ||
*** | Contact: [email protected] | ||
|
||
*due to some rounding errors the input data currently may contain in some cases | ||
*very small, negative numbers. These numbers have to be set to 0 as area | ||
*cannot be smaller than 0! | ||
pm_land_start(j,land) = f10_land("y1995",j,land); | ||
pm_land_start(j,land)$(pm_land_start(j,land)<0) = 0; | ||
pm_land_hist(t_ini10,j,land) = f10_land(t_ini10,j,land); | ||
|
||
pcm_land(j,land) = pm_land_start(j,land); | ||
vm_land.l(j,land) = pcm_land(j,land); | ||
|
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 would favor to have SNV written out as this abbreviation is from my perspective not established enough to be used without explanation
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.
Done.