Skip to content

Commit

Permalink
Merge pull request #660 from pascal-sauer/develop
Browse files Browse the repository at this point in the history
MAgPIE release 4.7.3
  • Loading branch information
pascal-sauer authored Apr 12, 2024
2 parents 9612ea1 + b5c17e5 commit a233ab7
Show file tree
Hide file tree
Showing 41 changed files with 1,539 additions and 269 deletions.
9 changes: 7 additions & 2 deletions .Rprofile
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@ if (!"https://rse.pik-potsdam.de/r/packages" %in% getOption("repos")) {
# bootstrapping, will only run once after this repo is freshly cloned
if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) {
message("R package dependencies are not installed in this renv, installing now...")
renv::hydrate() # auto-detect and install all dependencies
renv::hydrate(prompt = FALSE, report = FALSE) # auto-detect and install all dependencies
message("Finished installing R package dependencies.")
if (!("upstream" %in% gert::git_remote_list()$name)) {
gert::git_remote_add("https://github.com/magpiemodel/magpie.git", "upstream")
message("Added upstream git remote pointing to magpiemodel/magpie.")
}
}

# in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing
if (!requireNamespace("piamenv", quietly = TRUE)) {
if (tryCatch(packageVersion("piamenv"),
error = function(e) package_version("0.0")) < package_version("0.3.4")) {
renv::install("piamenv", prompt = FALSE)
}
4 changes: 2 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.7.2",
"version": "4.7.3",
"creators": [
{
"name": "Dietrich, Jan Philipp",
Expand Down Expand Up @@ -114,5 +114,5 @@
"license": {
"id": "AGPL-3.0-or-later"
},
"publication_date": "2024-04-02"
"publication_date": "2024-04-12"
}
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,33 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).


## [4.7.3] - 2024-04-12

### changed
- **21_trade** Revision of trade module. Replaced `cfg$gms$s21_trade_bal_damper` in favour of `cfg$gms$k_import21`, which allows for additional imports to maintain feasibility
- **21_trade** v21_import_for_feasibility now available for all countries, not just for importers
- **70_livestock** if `c70_fac_req_regr` is set to `reg`: use of USDA/FAO values for historic factor requirements for livestock instead of using regression values and change of calibration year from 2005 to 2010 for regional factor requirements regression
- **config** updated FSEC scenario config for revision and included new calibration file (after cost fix in preprocessing)
- **default.cfg** updated inputdata revision to 4.104 to have NDC scenarios included
- **scripts** cfg$gms$s35_secdf_distribution <- 2 for FSEC
- **scripts** modified output reporting for SEALS to account for forestry plantations
- **scripts/calibration/landconversion_cost.R** Revised calibration approach for conversion costs for cropland. Information from all calibration time steps in combination with a lowpass filter is now used for deriving the calibration factors, which avoids the previous zickzack pattern. The previous option `cfg$damping_factor_landconversion_cost` has been removed in favor of `cfg$lowpass_filter_landconversion_cost`.

### added
- **14_yields** added minimum threshold for wood yields. Below this threshold, wood yields are set to zero.
- **config** added switch for minimum timber yields
- **56_ghg_policy** added NDC scenarios
- **60_bioenergy** added NDC scenarios
- **scripts** start script for EAT2p0 Deep Dive project
### fixed
- **15_food** Small number rather 0 in condition checking calorie balancing
- **34_urban** `static` realization was not working because `vm_carbon_stock` was referenced without the set `stockType`
- **52_carbon** removing jump of carbon content into fully grown forest when a forest changes from second-last age class to last age-class.
- **58_peatland** Equation `q58_scalingFactorExp` revised to avoid division by zero.
- **80_optimization** duplicated solve statement in all instances to avoid non-matchting left- and right-hand sides of equations


## [4.7.2] - 2024-04-02

### changed
Expand Down Expand Up @@ -844,7 +871,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.7.2...develop
[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.7.3...develop
[4.7.3]: https://github.com/magpiemodel/magpie/compare/v4.7.2...v4.7.3
[4.7.2]: https://github.com/magpiemodel/magpie/compare/v4.7.1...v4.7.2
[4.7.1]: https://github.com/magpiemodel/magpie/compare/v4.7.0...v4.7.1
[4.7.0]: https://github.com/magpiemodel/magpie/compare/v4.6.11...v4.7.0
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.7.2
date-released: 2024-04-02
version: 4.7.3
date-released: 2024-04-12
repository-code: https://github.com/magpiemodel/magpie
keywords:
- landuse
Expand Down
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ Imports:
Suggests:
goxygen,
languageserver,
qgraph
qgraph,
shinyresults,
XML
Encoding: UTF-8
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.7.2 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.7.2/
The model documentation for version 4.7.3 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.7.3/

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 @@ -226,7 +226,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.7.2/#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.3/#how-to-cite) in the model documentation for information how to cite the model.

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

# which input data sets should be used?
cfg$input <- c(regional = "rev4.101_h12_magpie.tgz",
cellular = "rev4.101_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz",
validation = "rev4.101_h12_validation.tgz",
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_per_ton_fao_may22_glo_13Mar24.tgz")
calibration = "calibration_H12_26Mar24.tgz")

# 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 @@ -85,9 +85,9 @@ cfg$crop_calib_max <- 1.5 # def= 1.5
cfg$best_calib <- TRUE # def = TRUE

# Settings for land conversion cost calibration (cropland)
# The calibration routine derives regional calibration factors for
# The calibration routine derives a time-series of regional calibration factors for
# costs of cropland expansion and rewards for cropland reduction,
# with the goal to match historical regional cropland in 2015.
# with the goal to match historical regional cropland in the period 1995-2015.
# * (TRUE): Land conversion cost calibration will be performed
# * (ifneeded): Land conversion cost calibration will only be executed if the input file "f39_calib.csv" is missing
# * (FALSE): Land conversion cost calibration will not be performed
Expand All @@ -98,9 +98,9 @@ cfg$calib_accuracy_landconversion_cost <- 0.05 # def = 0.05
cfg$calib_maxiter_landconversion_cost <- 40 # def = 40
# Restart from existing calibration factors (TRUE or FALSE)
cfg$restart_landconversion_cost <- FALSE # def = FALSE
# Factor determining how much the divergence infuences the new
# calibration factor in each calibration iteration (0-1)
cfg$damping_factor_landconversion_cost <- 0.96 # def= 0.96
# Number of lowpass filter iterations applied on calibration factors
# for time steps 1995-2015
cfg$lowpass_filter_landconversion_cost <- 1 # def= 1
# Set upper limit for cropland calibration factor
cfg$cost_calib_max_landconversion_cost <- 3 # def= 3
# Set lower limit for cropland calibration factor
Expand Down Expand Up @@ -198,7 +198,6 @@ cfg$gms$sm_fix_SSP2 <- 2020
cfg$gms$sm_fix_cc <- 2020

# ***--------------------- 10_land ----------------------------------------
# * (feb15): default land realization
# * (landmatrix_dec18): includes a land transition matrix
cfg$gms$land <- "landmatrix_dec18" # def = landmatrix_dec18

Expand Down Expand Up @@ -331,6 +330,10 @@ cfg$gms$s14_degradation <- 0 # def = 0
# For other realizations, it is recommended not to use this yield calibration.
cfg$gms$s14_use_yield_calib <- 0 # def = 0

# Include a minimum yield for wood harvest in secondary vegetation (tDM per ha per yr).
# Age classes with wood yields below this threshold have a production of zero.
cfg$gms$s14_minimum_wood_yield <- 20 #def = 20

# ***--------------------- 15_food ---------------------------------------
# * (anthropometrics_jan18): estimates food using scenario dependent regression
# * and demography drivers
Expand Down Expand Up @@ -1402,12 +1405,13 @@ cfg$gms$s56_cprice_red_factor <- 1 # def = 1
# * 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
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
# * 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
# * 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,
# * R21M42-SDP-NPi, R21M42-SDP-NDC, R21M42-SDP-PkBudg1000, R21M42-SDP-PkBudg1100, R21M42-SDP-PkBudg900,
# * R21M42-SSP1-NPi, R21M42-SSP1-NDC, R21M42-SSP1-PkBudg1100, R21M42-SSP1-PkBudg1300, R21M42-SSP1-PkBudg900,
# * R21M42-SSP2-NPi, R21M42-SSP2-NDC, R21M42-SSP2-PkBudg1100, R21M42-SSP2-PkBudg1300, R21M42-SSP2-PkBudg900,
# * R21M42-SSP5-NPi, R21M42-SSP5-NDC, 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
Expand Down Expand Up @@ -1663,12 +1667,13 @@ cfg$gms$c60_1stgen_biodem <- "const2020" # def = const2020
# * 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
# * NDC: Nationally determined contributions; limit peak warming to 2.5°C
# * 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
# * 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,
# * R21M42-SDP-NPi, R21M42-SDP-NDC, R21M42-SDP-PkBudg1000, R21M42-SDP-PkBudg1100, R21M42-SDP-PkBudg900,
# * R21M42-SSP1-NPi, R21M42-SSP1-NDC, R21M42-SSP1-PkBudg1100, R21M42-SSP1-PkBudg1300, R21M42-SSP1-PkBudg900,
# * R21M42-SSP2-NPi, R21M42-SSP2-NDC, R21M42-SSP2-PkBudg1100, R21M42-SSP2-PkBudg1300, R21M42-SSP2-PkBudg900,
# * R21M42-SSP5-NPi, R21M42-SSP5-NDC, 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
Expand Down Expand Up @@ -1887,7 +1892,7 @@ cfg$gms$c80_nlp_solver <- "conopt4" # def = conopt4

# * 1: using optfile for specified solver settings
# * 0: default settings (optfile will be ignored)
cfg$gms$s80_optfile <- 1
cfg$gms$s80_optfile <- 0 # def = 0


#*******************************END MODULE SETUP********************************
Expand Down
Loading

0 comments on commit a233ab7

Please sign in to comment.