Skip to content

Commit

Permalink
Merge pull request #611 from flohump/f_peatland6
Browse files Browse the repository at this point in the history
Revision peatland module v2 realisation + bugfix output/extra/disaggregation.R related to 67k
  • Loading branch information
flohump authored Dec 5, 2023
2 parents 96c23d4 + 4f5a175 commit 2ad2d02
Show file tree
Hide file tree
Showing 32 changed files with 505 additions and 979 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,18 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- **scripts** For the emulator scripts select a different bioenergy demand variable that excludes bioenergy sources other than second generation bioenergy crops. Set the minimal bioenergy demand to zero. Both avoid artificial clustering of data points and allow for better fits.
- **31_past** in grasslands_apr22 realization: changed structure of f31_pastr_suitability to align with ssp-rcp specific input data formulation. Changed input filename from cs3 to cs2. Added `cc`, `nocc` and `nocc_hist` options for `i31_manpast_suit` and changed input gams code from table to parameter. Climate scenario assignment moved from preloop.gms to input.gms. Removed pastSuit set in sets.gms as not needed anymore. Adjusted not_used.txt in both grasslands_apr22 and static realizations.
- **36_employment** regression between hourly labor regression and GDP pc changed from linear to log-log
- **default.cfg** Default for cfg$gms$peatland changed from `on` to `v2`

### added
- **18_residues** Included cluster-level residue realization, for cluster-level production of residues (but balancing of recycling and burning budgets remains at region-level, for computational lightness)
- **14_yields/config** Added option for considering impacts of land degradation on yields. If `s14_degradation` is switched to 1, MAgPIE will include cluster-specific information on the state of nature's contributions to people relevant for yields `./modules/14_yields/input/f14_yld_ncp_report.cs3`.
- **58_peatland** added realization "v2" with updated peatland map and GHG emission factors
- **32_forestry** new interface `vm_land_forestry`
- **32_forestry** new interfaces `vm_forestry`, `pcm_land_forestry` `vm_landexpansion_forestry` and `vm_landreduction_forestry`
- **scripts** added peatland to output/extra/disaggregation.R

### removed
- **default.cfg** Removed description of cfg$gms$c31_past_suit_scen since no longer needed due to changes in 31_past described below. Its function is now done by cfg$gms$c31_grassl_yld_scenario.
- **58_peatland** removed realization "on"

### fixed
- **inputdata** There was another bug (terra default na.rm changed) in the inputdata that was fixed with rev4.93
Expand Down
37 changes: 14 additions & 23 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -1532,15 +1532,12 @@ cfg$gms$s57_maxmac_ch4_awms <- -1 # def = -1

# ***--------------------- 58_peatland ------------------------------------
# * (off): Peatland area and associated GHG emissions are assumed zero
# * (on): Peatland area is initialized with degraded and intact peatland for the year 2015,
# * and projected into the future based on changes in managed land.
# * GHG emissions are calculated using IPCC Tier 1 emission factors (2013 Wetland supplement).
# * (v2): Peatland area is initialized with degraded and intact peatland area for the year 2020,
# * (v2): Peatland area is initialized with degraded and intact peatland area for the year 2022,
# * and projected into the future based on changes in managed land.
# * For boreal and tropical climates, GHG emissions are calculated using emission
# * factors from the IPCC 2013 Wetland supplement. For temperate climates, more recent
# * estimates from Tiemeyer et al 2020 are used.
cfg$gms$peatland <- "on" # def = on
cfg$gms$peatland <- "v2" # def = v2

# * peatland rewetting
# * options: 0 (off)
Expand All @@ -1551,27 +1548,20 @@ cfg$gms$s58_rewetting_switch <- Inf # def = Inf
cfg$gms$s58_cost_rewet_onetime <- 7000 # def = 7000
cfg$gms$s58_cost_rewet_recur <- 200 # def = 200

# * One-time and recurring costs for peatland degradation (USD05MER per ha)
# * Can be used to test area-based incentives for peatland protection and restoration,
# * complementary or in addition to pricing GHG emissions from degraded peatlands (see s56_peatland_policy).
# * One-time costs apply on the conversion of intact (and rewetted) peatland to degraded peatland.
# * Therefore, one-time costs can used to incentivize the protection of intact peatlands.
# * Recurring costs apply on the level of degraded peatland. Therefore, recurring costs,
# * in combination with one-time costs, can be used to incentivize peatland restoration.
cfg$gms$s58_cost_degrad_onetime <- 0 # def = 0
cfg$gms$s58_cost_degrad_recur <- 0 # def = 0
# * One-time and recurring costs for peatland drainage (USD05MER per ha)
# * One-time costs apply on the drainage of intact and rewetted peatland
# * Recurring costs apply on the level of drained and managed peatland
cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0
cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0
cfg$gms$s58_cost_drain_recur <- 0 # def = 0

# * Artificial cost for balance variables (USD05MER per ha)
# * The balance variables in the peatland 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$s58_cost_balance <- 1e+06 # def = 1e+06

# * Switch for fixing peatland area between 1995 and the year given by s58_fix_peatland
# * Note: Depending on the realisation, the initial peatland area is only available for the year 2015 (`on`) or 2020 (`v2`).
# * Switch for fixing peatland area until the year given by s58_fix_peatland to historic levels (not available in `off`).
# * Note: In the realisation `v2`, historic peatland area is only available for the year 2022.
# * Due to the 5-year time step limitation in MAgPIE, the suggested default is 2020.
# * Fixing peatland area in previous time steps provides a better
# * proxy for GHG emissions from peatlands than assuming no peatland area.
cfg$gms$s58_fix_peatland <- 2015 # def = 2015
cfg$gms$s58_fix_peatland <- 2020 # def = 2020

# ***------------------------- 59_som -------------------------------------
# * (static_jan19): static soil carbon loss for cropland
Expand Down Expand Up @@ -1928,7 +1918,8 @@ cfg$files2export$start <- c("input/info.txt",
"land_conversion_cost_calib_*.cs3",
"input/spamplot_*.pdf",
"input/regionmapping*.csv",
"input/kba_land_0.5.mz")
"input/kba_land_0.5.mz",
"input/f58_peatland_area_0.5.mz")

# Files that should be copied after the MAgPIE run is finished
cfg$files2export$end <- NULL
Expand Down
1 change: 0 additions & 1 deletion config/scenario_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;a
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$c31_past_suit_scen;;nocc;nocc_hist;ssp126;ssp245;ssp245;ssp370;ssp460;ssp585;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ssp126;ssp126;ssp245;ssp460;ssp370;ssp585;
gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$s32_aff_plantation;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;
gms$s32_aff_bii_coeff;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
1 change: 0 additions & 1 deletion config/scenario_fsec.csv
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ gms$c30_bioen_water;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;
gms$s30_snv_scenario_target;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;
gms$s30_snv_shr;;;;;;;;;;;;;;;;;;;;;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;
gms$past;endo_jun13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c31_past_suit_scen;ssp245;ssp126;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ssp126;ssp126;ssp126;ssp245;ssp370;ssp460;ssp585;ssp126;ssp126;ssp245;ssp245;ssp460;ssp370;ssp585;
gms$c32_aff_policy;;;;;;;;;;;;;;;;;;;;;;;;;ndc;;;;;;;;;;;;;;;;;;;;;;;;
gms$c32_aff_mask;;;;;;;;;;;;;;;;;;;;;;;;;onlytropical;;;;;;;;;;;;;;;;;;;;;;;;
gms$s32_max_aff_area;;;;;;;;;;;;;;;;;;;;;;;;;500;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down
11 changes: 11 additions & 0 deletions core/macros.gms
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,14 @@ $macro m_carbon_stock(land,carbon_density,item) \
$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"));

* macros for peatland module
$macro m58_LandMerge(land,landForestry,set) \
land(&&set,"crop")$(sameas(manPeat58,"crop")) \
+ land(&&set,"past")$(sameas(manPeat58,"past")) \
+ landForestry(&&set,"plant")$(sameas(manPeat58,"forestry"))

$macro m58_LandLeft(pclandFull,setFull,vland,pcland) \
(sum(&&setFull,pclandFull(j2,&&setFull)) \
- sum(manPeat58_alias$(not sameas(manPeat58_alias,manPeat58)),vland(j2,manPeat58_alias)) \
- sum(manPeat58_alias$(sameas(manPeat58_alias,manPeat58)),pcland(j2,manPeat58_alias)))
2 changes: 1 addition & 1 deletion main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ $setglobal phosphorus off
$setglobal awms ipcc2006_aug16
$setglobal ghg_policy price_aug22
$setglobal maccs on_aug22
$setglobal peatland on
$setglobal peatland v2
$setglobal som static_jan19

$setglobal bioenergy 1stgen_priced_dec18
Expand Down
Loading

0 comments on commit 2ad2d02

Please sign in to comment.