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

Merged
merged 147 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from 75 commits
Commits
Show all changes
147 commits
Select commit Hold shift + click to select a range
367222a
tree cover cropland
flohump Mar 9, 2024
aecdaff
treecover and betr scenario
flohump Mar 11, 2024
3ea3246
code revisions
flohump Mar 12, 2024
aa676cf
new module 61_agroforestry. reverted code in 30_crop
flohump Mar 13, 2024
39738df
missing code
flohump Mar 13, 2024
41cdffe
bugfix
flohump Mar 13, 2024
6725072
bugfix
flohump Mar 15, 2024
9c34926
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Mar 15, 2024
f8c5e21
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 10, 2024
d2e21ce
partial commit to save work
flohump Apr 11, 2024
afb8831
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 12, 2024
ed34c5e
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 15, 2024
531ffad
partial commit to save work
flohump Apr 16, 2024
cc47972
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 16, 2024
9467984
partial commit to save work
flohump Apr 19, 2024
20e42a2
partial commit to save work
flohump Apr 19, 2024
f96fbb0
partial commit to save work
flohump Apr 19, 2024
9b4b009
partial commit to save work
flohump Apr 20, 2024
3845262
partial commit to save work
flohump Apr 20, 2024
e7f8e40
partial commit to save work
flohump Apr 20, 2024
3923e34
partial commit to save work
flohump Apr 21, 2024
350667a
partial commit to save work
flohump Apr 21, 2024
abdc8c8
partial commit to save work
flohump Apr 21, 2024
67b57fc
partial commit to save work
flohump Apr 21, 2024
495bf03
Merge branch 'f_fix' of github.com:flohump/magpie into f_AFS
flohump Apr 21, 2024
a0b0e15
bugfix
flohump Apr 21, 2024
43fd4fd
bugfix
flohump Apr 21, 2024
8333584
balance variable NPI NDC reforestation
flohump Apr 22, 2024
1014226
bugfixes
flohump Apr 22, 2024
ec92cc6
bugfix
flohump Apr 22, 2024
876fc9d
bugfix
flohump Apr 22, 2024
8063487
bugfix
flohump Apr 22, 2024
a26ece2
bugfixes
flohump Apr 22, 2024
3feb873
partial commit to save work
flohump Apr 22, 2024
629a809
bugfix
flohump Apr 22, 2024
670e825
bugfixes
flohump Apr 23, 2024
6b48d9e
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 23, 2024
eea0d5f
bugfix
flohump Apr 23, 2024
b44171c
bugfixes
flohump Apr 23, 2024
abd5d8a
bugfixes
flohump Apr 23, 2024
500c08f
bugfix
flohump Apr 23, 2024
4f4fbf4
bugfixes
flohump Apr 23, 2024
c082921
bugfixes
flohump Apr 23, 2024
5c455ed
bugfixes
flohump Apr 24, 2024
34e0c6b
bugfixes
flohump Apr 24, 2024
6279d34
test without boundfix
flohump Apr 24, 2024
274542d
bugfixes
flohump Apr 24, 2024
a3eb576
reverting back
flohump Apr 24, 2024
34b830b
check again with other bounds
flohump Apr 24, 2024
41d1deb
test different boundfix values
flohump Apr 24, 2024
a179129
revert q29_avl_cropland
flohump Apr 24, 2024
9d3b74a
additional test runs
flohump Apr 24, 2024
960767e
scaling for age-class variables
flohump Apr 24, 2024
5b89eee
scaling for age-class variables
flohump Apr 24, 2024
0bdde4d
bugfixes
flohump Apr 25, 2024
37a8b37
bugfixes
flohump Apr 25, 2024
65f8202
move of shifting from other land to secondary before age-class growth…
flohump Apr 25, 2024
560b736
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Apr 25, 2024
a755ee5
bugfixes
flohump Apr 26, 2024
b6fb489
bugfix
flohump Apr 27, 2024
c6c4756
bugfix
flohump Apr 28, 2024
f22f736
bugfix
flohump Apr 28, 2024
14eea42
bugfix
flohump Apr 28, 2024
a723bd9
bugfix
flohump Apr 28, 2024
f80ee75
scaling
flohump Apr 28, 2024
ea597be
scaleopt
flohump Apr 28, 2024
d0c8388
revert
flohump Apr 29, 2024
2143ba2
updates
flohump Apr 29, 2024
0b74f68
lines
flohump Apr 29, 2024
8d3df52
bugfix
flohump Apr 29, 2024
b406498
bugfix
flohump Apr 29, 2024
29ec05a
bugfix
flohump Apr 30, 2024
176fa1c
bugfix
flohump Apr 30, 2024
ccaf380
bugfix
flohump Apr 30, 2024
1745fcd
update calibration
flohump Apr 30, 2024
4d2b2e3
highres
flohump May 1, 2024
584aac5
nlp par update
flohump May 2, 2024
6c23a00
update
flohump May 2, 2024
444eaaf
update
flohump May 2, 2024
d4f25ff
update
flohump May 2, 2024
8e61949
bugfix
flohump May 2, 2024
518c25d
bugfix
flohump May 2, 2024
9d7befc
update
flohump May 2, 2024
d8eb4e9
bugfix
flohump May 2, 2024
9f2acf4
bugfix
flohump May 2, 2024
f7125ac
bugfix
flohump May 2, 2024
46e2285
update
flohump May 3, 2024
286d9c5
bugfix
flohump May 3, 2024
ac4c249
update
flohump May 3, 2024
bc4c3cf
bugfix
flohump May 3, 2024
4ff9834
bugfix
flohump May 3, 2024
09535ff
updates
flohump May 4, 2024
4e94659
update
flohump May 4, 2024
2f79c13
bugfix
flohump May 4, 2024
8fa3217
test
flohump May 4, 2024
fdbbc1c
test
flohump May 4, 2024
47256b8
bugfix
flohump May 4, 2024
ce923a3
update
flohump May 4, 2024
3747457
update
flohump May 4, 2024
b4a596d
update
flohump May 5, 2024
9e175b4
bugfix
flohump May 6, 2024
72ce77e
updates
flohump May 7, 2024
2ce5f4b
bugfix
flohump May 7, 2024
7be483e
update optfile
flohump May 7, 2024
1d7b333
update additional data
flohump May 7, 2024
574f54d
bugfix
flohump May 8, 2024
95c0f43
reverting back faders
flohump May 9, 2024
893cbfd
bugfix
flohump May 9, 2024
d1ca47d
start script peatlandTax
flohump May 10, 2024
2c61aa6
update
flohump May 11, 2024
02af343
adde s30_betr_start
flohump May 13, 2024
be4d767
sync
flohump May 16, 2024
40b7ddf
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump May 16, 2024
a11c5ea
bugfix
flohump May 16, 2024
2beac3f
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump May 17, 2024
47b3982
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump May 29, 2024
404be5c
bugfix
flohump May 29, 2024
f9be6ac
revisions
flohump May 29, 2024
f56a0c1
bugfix carbon density
flohump May 30, 2024
85e6fe5
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump May 30, 2024
dce8e0d
cleanup and consistency 32_forestry
flohump May 30, 2024
6119e52
revision 59_som
flohump Jun 1, 2024
442a7ab
bugfix disaggregation
flohump Jun 2, 2024
a9904f0
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Jun 9, 2024
1774fcf
Merge branch 'f_pForest' of github.com:pvjeetze/magpie into f_AFS
flohump Jun 9, 2024
cb0294f
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Jun 10, 2024
604baa6
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Jun 11, 2024
07b187b
fix
flohump Jun 11, 2024
6496d8f
fix changelog
flohump Jun 11, 2024
b42d809
fix changelog
flohump Jun 11, 2024
58d5ef8
test
flohump Jun 12, 2024
6db3dcb
accuracy in conditions changed to avoid very small numbers
flohump Jun 14, 2024
1d64e11
bugfix land restoration and country switches for agroforestry
flohump Jun 14, 2024
4b703be
added EUR
flohump Jun 14, 2024
560138b
magpie4 version + peatland input files
flohump Jun 15, 2024
4ac78c6
Changelog
flohump Jun 15, 2024
1050681
changelog
flohump Jun 15, 2024
7c47023
bugfix
flohump Jun 15, 2024
d789ea6
update main.gms
flohump Jun 15, 2024
e807eb5
update default.cfg
flohump Jun 17, 2024
6f55c1d
code cleanup
flohump Jun 17, 2024
2924193
bugfix fixing 2025 44_biodiverstiy
flohump Jun 17, 2024
25cbd4f
update input data
flohump Jun 17, 2024
96b833e
update input data revision
flohump Jun 17, 2024
38d34ea
update input data
flohump Jun 17, 2024
57638fc
changelog
flohump Jun 18, 2024
8334590
Merge branch 'develop' of github.com:magpiemodel/magpie into f_AFS
flohump Jun 18, 2024
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
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ 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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

- **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`
- **default.cfg** cfg$gms$s80_maxiter reduced from 30 to 10

### 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`

### removed
- **scripts/output/extra** removed scripts disaggregation_cropsplit and disaggregation_transitions
Expand Down
148 changes: 108 additions & 40 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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?

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 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,
Expand Down Expand Up @@ -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 ------ --------------------------------
Expand Down Expand Up @@ -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:
Expand All @@ -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
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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Prescribing a certain share of treecover on cropland in all cells could increase costs considerably in case of limited land resources. In these cases, land owners can lower the share of tree cover on cropland by paying the penalty.


# * 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
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?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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
Expand All @@ -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, ...): ####
Expand Down
6 changes: 3 additions & 3 deletions config/scenario_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l90
gms$c22_protect_scenario;;;;none;none;none;none;none;none;BH;none;BH_IFL;BH;;;;;;;BH;;;;;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL;;;;;;;;;;;;;;;;;;;
gms$c22_protect_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none;BH_IFL;;;;;;;;;;;;;;;;;;;
gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;rainfed;all;;;;;;;;;;;;;;;;;;;;;;;;
gms$s30_snv_shr;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;;;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;;
gms$s30_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;
gms$s30_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;
gms$s29_snv_shr;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;;;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;;
gms$s29_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;
gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;
gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$s32_aff_plantation;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;0;1;;;;;;;;;;;;;;;;;;;;;;;;
gms$s32_aff_bii_coeff;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
12 changes: 7 additions & 5 deletions config/scenario_fsec.csv
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ gms$c15_food_scenario;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c21_trade_liberalization;;;;;;;;;;;;;;;;;;;;;;;l908080r807070;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$s21_trade_bal_damper;0.65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c22_protect_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;BH_IFL;;;;;;;;;;;;;;;;;;;;;;
gms$crop;penalty_apr22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c30_rotation_scenario;default;;;;;;;;;;;;;;;;;;;;;;;;;;;agroecology;;;;;;;;;;;;;;;;;;;;;;;
gms$croparea;detail_apr24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c30_rotation_rules;FSEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c30_rotation_incentives;default;;;;;;;;;;;;;;;;;;;;;;;;;;;agroecology;;;;;;;;;;;;;;;;;;;;;;;
gms$s30_implementation;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$s30_rotation_scenario_target;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;
gms$c30_marginal_land;q33_marginal;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c29_marginal_land;q33_marginal;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c30_bioen_water;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;;;
gms$s30_snv_scenario_target;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;
gms$s30_snv_shr;;;;;;;;;;;;;;;;;;;;;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;;
gms$s29_snv_scenario_target;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;
gms$s29_snv_shr;;;;;;;;;;;;;;;;;;;;;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;;
gms$past;endo_jun13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c32_aff_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c32_aff_mask;;;;;;;;;;;;;;;;;;;;;;;;;onlytropical;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
6 changes: 3 additions & 3 deletions core/macros.gms
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Copy link
Member

Choose a reason for hiding this comment

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

all arguments should be clarified (arg and sufx are missing and I cannot really follow here, evenso this looks and sounds very useful ^^')

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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);
Expand Down Expand Up @@ -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) \
Expand Down
3 changes: 2 additions & 1 deletion main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ $setglobal land_conservation area_based_apr22

$setglobal ageclass feb21

$setglobal crop endo_apr21
$setglobal cropland simple_apr24
$setglobal croparea simple_apr24
$setglobal past endo_jun13

$setglobal forestry dynamic_feb21
Expand Down
2 changes: 2 additions & 0 deletions modules/10_land/input/files
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for spotting. removed.

CroplandTreecover_0.5.mz
1 change: 1 addition & 0 deletions modules/10_land/landmatrix_dec18/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

parameters
pm_land_start(j,land) Land initialization area (mio. ha)
pm_land_hist(t_ini10,j,land) Land area for historial time steps (mio. ha)
pcm_land(j,land) Land area in previous time step including possible changes after optimization (mio. ha)
;

Expand Down
5 changes: 5 additions & 0 deletions modules/10_land/landmatrix_dec18/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
I fully agree that the problem should be adressed (if still persistent) but in a different stream of work.

*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
Expand Down
2 changes: 1 addition & 1 deletion modules/10_land/landmatrix_dec18/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ vm_lu_transitions.up(j,"primforest","primforest") = Inf;

*' @stop

m_boundfix(vm_land,(j,land),up,10e-5);
m_boundfix(vm_land,(j,land),up,1e-6);
5 changes: 1 addition & 4 deletions modules/10_land/landmatrix_dec18/start.gms
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading
Loading