Skip to content

Commit

Permalink
Merge branch 'magpiemodel:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
jansteinhauser authored Feb 23, 2024
2 parents 1fa708a + 8028dff commit e15220b
Show file tree
Hide file tree
Showing 36 changed files with 281 additions and 266 deletions.
9 changes: 7 additions & 2 deletions .zenodo.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "MAgPIE - An Open Source land-use modeling framework",
"version": "4.6.11dev",
"version": "4.7.0dev",
"creators": [
{
"name": "Dietrich, Jan Philipp",
Expand Down Expand Up @@ -94,6 +94,11 @@
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0002-6856-8239"
},
{
"name": "Köberle, Alexandre",
"affiliation": "Potsdam Institute for Climate Impact Research",
"orcid": "0000-0003-0328-4750"
},
{
"name": "Lotze-Campen, Hermann",
"affiliation": "Potsdam Institute for Climate Impact Research",
Expand All @@ -109,5 +114,5 @@
"license": {
"id": "AGPL-3.0-or-later"
},
"publication_date": "2023-09-05"
"publication_date": "2023-12-11"
}
54 changes: 42 additions & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,59 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### changed
- **inputdata** Now using inputdata rev4.94 which is based on 67420 cells (67k, previously 59k)
- **14_yields_and_config** The new default is to not use yield calibration factors from a calibration run. The switch s14_use_yield_calib can optionally reenable the use of yield calibration factors.
- **scripts** LUH2_disaggregation output script was modified. Specifically, flooded area was made compatible with the LUH definition, cropland and grazing land were added to the states.nc file, and specific naming/details (datatype, zname, xname, and yname) were added when creating the .nc files.
- **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.
- **start_functions** Check if cfg$recalibrate is consistent with cfg$gms$s14_use_yield_calib
- **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`
- **default.cfg and scenario_config.csv** Default for cfg$gms$c56_emis_policy changed from `redd+natveg_nosoil` to `reddnatveg_nosoil`,i.e. timber plantations are excluded from carbon pricing by default
- **default.cfg** Default for cfg$gms$c56_cprice_aff changed from `forestry_vegc` to `secdforest_vegc`
- **scenario_config.csv** settings for cfg$gms$s35_secdf_distribution in `ForestryEndo` and `ForestryExo` changed from `2` to `0`
- **scenario_config.csv** removed erroneous setting `cc` from column `input`
- **default.cfg** update default `cfg$gms$c56_pollutant_prices` and `cfg$gms$c60_2ndgen_biodem` to `R32M46-SSP2EU-NPi`
- **default.cfg** update input data to rev 4.96
- **default.cfg** changed default for `cfg$gms$s56_buffer_aff` from 0.2 to 0.5
- **default.cfg** changed default for `cfg$gms$s32_aff_prot` from 0 to 1
- **21_trade** s21_trade_bal_damper for roundwood changed from 0.75 to 0.65

### 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 interfaces `vm_forestry`, `pcm_land_forestry` `vm_landexpansion_forestry` and `vm_landreduction_forestry`
- **32_forestry** new interfaces `vm_land_forestry`, `pcm_land_forestry` `vm_landexpansion_forestry` and `vm_landreduction_forestry`
- **scripts** added peatland to output/extra/disaggregation.R
- **56_ghg_policy_** added new trajectories for R32M46
- **60_bioenergy** added new trajectories for R32M46

### 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
- **scripts** Fixed writing of NetCDF files in output/reportMAgPIE2SEALS.R
- **scripts** Fixed disaggregation.R and disaggregation_LUH2.R to be used with 67k
- **scripts** bugfix highres.R for bioenergy demand and GHG prices in coupled runs
- **35_natveg** bugfixes ac_est
- **35_natveg** removed scaling of pm_carbon_density_ac
- **52_carbon** bugfix acx long-term carbon density
- **32_forestry** keep c-density for timber plantations constant after rotation length to avoid unrealistic carbon sequestration in unharvested timber plantation
- **32_forestry** bugfix unit p32_observed_gs_reg

## [4.7.0] - 2023-12-11

### changed
- **14_yields_and_config** The new default is to not use yield calibration factors from a calibration run. The switch s14_use_yield_calib can optionally reenable the use of yield calibration factors.
- **36_employment** regression between hourly labor regression and GDP pc changed from linear to log-log
- **inputdata** Now using inputdata rev4.94 which is based on 67420 cells (67k, previously 59k)
- **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.
- **scripts** LUH2_disaggregation output script was modified. Specifically, flooded area was made compatible with the LUH definition, cropland and grazing land were added to the states.nc file, and specific naming/details (datatype, zname, xname, and yname) were added when creating the .nc files.

### added
- **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`.
- **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)
- **32_forestry** new interface `vm_land_forestry`
- **58_peatland** added realization "v2" with updated peatland map and GHG emission factors

### fixed
- **inputdata** There was a major bug (related to proj/terra) in the rev4.91 inputdata that was fixed with rev4.92
- **inputdata** There was another bug (terra default na.rm changed) in the inputdata that was fixed with rev4.93
- **scripts** Fixed a bug in NPI/NDC calculations leading to missing AD policies when run with 67k
- **scripts** Fixed disaggregation.R and disaggregation_LUH2.R to be used with 67k


## [4.6.11] - 2023-09-05

Expand Down Expand Up @@ -788,7 +817,8 @@ This release version is focussed on consistency between the MAgPIE setup and the
First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information.


[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.11...develop
[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.7.0...develop
[4.7.0]: https://github.com/magpiemodel/magpie/compare/v4.6.11...v4.7.0
[4.6.11]: https://github.com/magpiemodel/magpie/compare/v4.6.10...v4.6.11
[4.6.10]: https://github.com/magpiemodel/magpie/compare/v4.6.9...v4.6.10
[4.6.9]: https://github.com/magpiemodel/magpie/compare/v4.6.8...v4.6.9
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ authors:
email: [email protected]

title: MAgPIE - An Open Source land-use modeling framework
version: 4.6.11dev
date-released: 2023-09-05
version: 4.7.0dev
date-released: 2023-12-11
repository-code: https://github.com/magpiemodel/magpie
keywords:
- landuse
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi
A framework description paper has been published in
Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019

The model documentation for version 4.6.11 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.6.11/
The model documentation for version 4.7.0 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.7.0/

A most recent version of the documentation can also be extracted from the
model source code via the R package goxygen
Expand Down Expand Up @@ -188,7 +188,7 @@ [email protected]
Please contact [email protected]

## CITATION
See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.11/#how-to-cite) in the model documentation for information how to cite the model.
See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.7.0/#how-to-cite) in the model documentation for information how to cite the model.

## AUTHORS
See list of authors in CITATION.cff
Expand Down
79 changes: 52 additions & 27 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ cfg$model <- "main.gms" #def = "main.gms"
#### input settings ####

# which input data sets should be used?
cfg$input <- c(regional = "rev4.95_h12_magpie.tgz",
cellular = "rev4.95_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.95_h12_validation.tgz",
additional = "additional_data_rev4.46.tgz",
cfg$input <- c(regional = "rev4.96_h12_magpie.tgz",
cellular = "rev4.96_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.96_h12_validation.tgz",
additional = "additional_data_rev4.47.tgz",
calibration = "calibration_H12_per_ton_fao_may22_glo_08Aug23.tgz")

# NOTE: It is recommended to recalibrate the model when changing cellular input data
Expand Down Expand Up @@ -775,7 +775,12 @@ cfg$gms$s32_max_aff_area <- Inf # def = Inf
# Protection of afforested areas (endogenous CO2 price driven)
# 0=until end of planning horizon (see s32_planing_horizon)
# 1=forever
cfg$gms$s32_aff_prot <- 0 # def = 0
# Note: Without a price on CO2 emissions from land-use change in module 32_forestry,
# which is the current default (c56_emis_policy <- "reddnatveg_nosoil"),
# the recommended setting for s32_aff_prot is 1.
# Otherwise, the model can do re/afforestation on existing re/afforestation areas
# after the end of planning horizon without penalty for CO2 emissions.
cfg$gms$s32_aff_prot <- 1 # def = 1

# Type of afforestation constraint
cfg$gms$s32_max_aff_area_glo <- 1 # def = 1
Expand Down Expand Up @@ -1360,18 +1365,27 @@ cfg$gms$s56_cprice_red_factor <- 1 # def = 1

# * GHG emission price scenario
# * Note: For best consistency it is recommended to use trajectories from the most recent
# * coupled REMIND-MAgPIE runs. Currently, this is R21M42.
# * Note on available scenarios from coupled REMIND-MAgPIE runs
# * NPi: Current policies; above 3.0°C in 2100
# * coupled REMIND-MAgPIE runs. Currently, this is R32M46.
# * Available options:
# * none: no 2nd generation bioenergy demand
# * R32M46: Coupled REMIND-MAgPIE runs with REMIND 3.2.1.dev412 and MAgPIE 4.6.11
# * NPi: Current policies; limit peak warming to 3.0°C
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
# * PkBudg650: Peak Budget with 650 GtCO2 until net-zero CO2 emissions; well-below 1.5°C in 2100
# * PkBudg1050: Peak Budget with 1050 GtCO2 until net-zero CO2 emissions; well-below 2.0°C in 2100
# * R32M46-SDP_MC-NPi, R32M46-SDP_MC-NDC, R32M46-SDP_MC-PkBudg650,
# * R32M46-SSP1-NPi, R32M46-SSP1-NDC, R32M46-SSP1-PkBudg1050, R32M46-SSP1-PkBudg650,
# * R32M46-SSP2EU-NPi, R32M46-SSP2EU-NDC, R32M46-SSP2EU-PkBudg1050, R32M46-SSP2EU-PkBudg650,
# * R32M46-SSP5-NPi, R32M46-SSP5-NDC, R32M46-SSP5-PkBudg1050, R32M46-SSP5-PkBudg650,
# * R21M42: Coupled REMIND-MAgPIE runs with REMIND 2.1 and MAgPIE 4.2
# * NPi: Current policies; above 3.0°C in 2100
# * PkBudg900: Budget with 900 GtCO2; well-below 1.5°C in 2100 (PkBudg1000 for SDP)
# * PkBudg1300: Budget with 1300 GtCO2; well-below 2.0°C in 2100
# *
# * Available scenarios:
# * Coupled REMIND-MAgPIE runs
# * R21M42-SDP-NPi, R21M42-SDP-PkBudg1000, R21M42-SDP-PkBudg1100, R21M42-SDP-PkBudg900,
# * R21M42-SSP1-NPi, R21M42-SSP1-PkBudg1100, R21M42-SSP1-PkBudg1300, R21M42-SSP1-PkBudg900,
# * R21M42-SSP2-NPi, R21M42-SSP2-PkBudg1100, R21M42-SSP2-PkBudg1300, R21M42-SSP2-PkBudg900,
# * R21M42-SSP5-NPi, R21M42-SSP5-PkBudg1100, R21M42-SSP5-PkBudg1300, R21M42-SSP5-PkBudg900,
# * R2M41: Coupled REMIND-MAgPIE runs with REMIND 2.0 and MAgPIE 4.1
# * R2M41-SSP2-NPi, R2M41-SSP2-NDC, R2M41-SSP2-Budg1300, R2M41-SSP2-Budg600, R2M41-SSP2-Budg950
# * Standalone REMIND runs from Strefler et al 2021; well-below 2.0°C in 2100
# * https://www.nature.com/articles/s41467-021-22211-2
Expand Down Expand Up @@ -1408,8 +1422,8 @@ cfg$gms$s56_cprice_red_factor <- 1 # def = 1
# * c56_pollutant_prices_noselect applies to all other countries.
# * Available scenarios for c56_pollutant_prices_noselect are identical to c56_pollutant_prices
# * (see above) except for emulator and coupling (which can only be chosen for c56_pollutant_prices)
cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # def = R21M42-SSP2-NPi
cfg$gms$c56_pollutant_prices_noselect <- "R21M42-SSP2-NPi" # def = R21M42-SSP2-NPi
cfg$gms$c56_pollutant_prices <- "R32M46-SSP2EU-NPi" # def = R32M46-SSP2EU-NPi
cfg$gms$c56_pollutant_prices_noselect <- "R32M46-SSP2EU-NPi" # def = R32M46-SSP2EU-NPi

# * The following two settings can be used to provide exogenous ghg prices
# * via a file that is not part of the input data. This is currently used
Expand Down Expand Up @@ -1444,18 +1458,20 @@ cfg$gms$s56_c_price_induced_aff <- 1 # def = on
# * Options: forestry_vegc, primforest_vegc, secdforest_vegc
# * This setting interacts with `c56_emis_policy`.
# * If "forestry" is not included in `c56_emis_policy` (e.g. reddnatveg_nosoil), there will be no C-price driven afforestation unless `c56_cprice_aff` is changed to primforest_vegc or secdforest_vegc.
cfg$gms$c56_cprice_aff <- "forestry_vegc" # def = forestry_vegc
cfg$gms$c56_cprice_aff <- "secdforest_vegc" # def = secdforest_vegc

# * C price expectation for afforestation decision-making in years
# * 0 is myopic behaviour (only C price of current time step)
# * reflects perfect-foresight if equal to s32_planing_horizon
# * should not be higher than s32_planing_horizon
cfg$gms$s56_c_price_exp_aff <- 50 # def = 50

# * share of carbon credits for afforestation projects pooled in a buffer
# * Values > 0 will reduced the incentive for c price induced afforestation
# * a plausible value is 0.2, based on the Gold Standard for afforestation projects
cfg$gms$s56_buffer_aff <- 0.2 # def = 0.2
# * Share of carbon credits for re/afforestation projects set aside in a buffer to
# * account for potential failure of permanent carbon storage.
# * Alternatively, this parameter can be interpreted as a reduction factor
# * of the carbon price for non-permanent CDR.
# * Values > 0 will reduce the incentive for c-price-induced re/afforestation
cfg$gms$s56_buffer_aff <- 0.5 # def = 0.5

# * Upper limit for CH4 and N2O GHG price (USD05MER per tC)
# * Limits GHG prices selected in c56_pollutant_prices to the chosen value.
Expand Down Expand Up @@ -1497,7 +1513,7 @@ cfg$gms$s56_limit_ch4_n2o_price <- 4000 # def = 4000
# * ecoSysProtAll_agMgmtExclN2O: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; All CH4 emis, no further N2O emis)
# * ecoSysProtAll_agMgmtExclCH4: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; All N2O emis, no further CH4 emis)
# * ecoSysProtAll_agMgmtOff: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management)
cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # def = redd+natveg_nosoil
cfg$gms$c56_emis_policy <- "reddnatveg_nosoil" # def = reddnatveg_nosoil

# * CO2 emissions subject to carbon pricing
# * options: actual, actualNoAcEst
Expand Down Expand Up @@ -1610,18 +1626,27 @@ cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020

# * 2nd generation bioenergy demand scenario
# * Note: For best consistency it is recommended to use trajectories from the most recent
# * coupled REMIND-MAgPIE runs. Currently, this is R21M42.
# * Note on available scenarios from coupled REMIND-MAgPIE runs
# * NPi: Current policies; above 3.0°C in 2100
# * coupled REMIND-MAgPIE runs. Currently, this is R32M46.
# * Available options:
# * none: no 2nd generation bioenergy demand
# * R32M46: Coupled REMIND-MAgPIE runs with REMIND 3.2.1.dev412 and MAgPIE 4.6.11
# * NPi: Current policies; limit peak warming to 3.0°C
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
# * PkBudg650: Peak Budget with 650 GtCO2 until net-zero CO2 emissions; well-below 1.5°C in 2100
# * PkBudg1050: Peak Budget with 1050 GtCO2 until net-zero CO2 emissions; well-below 2.0°C in 2100
# * R32M46-SDP_MC-NPi, R32M46-SDP_MC-NDC, R32M46-SDP_MC-PkBudg650,
# * R32M46-SSP1-NPi, R32M46-SSP1-NDC, R32M46-SSP1-PkBudg1050, R32M46-SSP1-PkBudg650,
# * R32M46-SSP2EU-NPi, R32M46-SSP2EU-NDC, R32M46-SSP2EU-PkBudg1050, R32M46-SSP2EU-PkBudg650,
# * R32M46-SSP5-NPi, R32M46-SSP5-NDC, R32M46-SSP5-PkBudg1050, R32M46-SSP5-PkBudg650,
# * R21M42: Coupled REMIND-MAgPIE runs with REMIND 2.1 and MAgPIE 4.2
# * NPi: Current policies; above 3.0°C in 2100
# * PkBudg900: Budget with 900 GtCO2; well-below 1.5°C in 2100 (PkBudg1000 for SDP)
# * PkBudg1300: Budget with 1300 GtCO2; well-below 2.0°C in 2100
# *
# * Available scenarios:
# * Coupled REMIND-MAgPIE runs
# * R21M42-SDP-NPi, R21M42-SDP-PkBudg1000, R21M42-SDP-PkBudg1100, R21M42-SDP-PkBudg900,
# * R21M42-SSP1-NPi, R21M42-SSP1-PkBudg1100, R21M42-SSP1-PkBudg1300, R21M42-SSP1-PkBudg900,
# * R21M42-SSP2-NPi, R21M42-SSP2-PkBudg1100, R21M42-SSP2-PkBudg1300, R21M42-SSP2-PkBudg900,
# * R21M42-SSP5-NPi, R21M42-SSP5-PkBudg1100, R21M42-SSP5-PkBudg1300, R21M42-SSP5-PkBudg900,
# * R2M41: Coupled REMIND-MAgPIE runs with REMIND 2.0 and MAgPIE 4.1
# * R2M41-SSP2-NPi, R2M41-SSP2-NDC, R2M41-SSP2-Budg1300, R2M41-SSP2-Budg600, R2M41-SSP2-Budg950
# * Standalone REMIND runs from Strefler et al 2021; well-below 2.0°C in 2100
# * https://www.nature.com/articles/s41467-021-22211-2
Expand Down Expand Up @@ -1656,8 +1681,8 @@ cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020
# * coupling
# * Note: c60_2ndgen_biodem applies to countries selected in scen_countries60
# * c60_2ndgen_biodem_noselect applies to all other countries.
cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # def = R21M42-SSP2-NPi
cfg$gms$c60_2ndgen_biodem_noselect <- "R21M42-SSP2-NPi" # def = R21M42-SSP2-NPi
cfg$gms$c60_2ndgen_biodem <- "R32M46-SSP2EU-NPi" # def = R32M46-SSP2EU-NPi
cfg$gms$c60_2ndgen_biodem_noselect <- "R32M46-SSP2EU-NPi" # def = R32M46-SSP2EU-NPi

# * The following setting can be used to provide exogenous bioenergy demand
# * via a .mif file that is not part of the input data. This is currently used
Expand Down
Loading

0 comments on commit e15220b

Please sign in to comment.