Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
3 changes: 2 additions & 1 deletion .githooks/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@ if (any(endsWith(stagedFiles, ".gms"))) {

# make sure that files are not too big
maxFilesize <- 250 # kB
exemptFromLimit <- "^renv/archive/[0-9\\.]+_renv\\.lock$"

files <- union(system("git ls-tree -r HEAD --name-only", intern = TRUE), stagedFiles)
out <- data.frame(files = files, size = round(file.size(files) / 1024, 2))
out <- out[!is.na(out$size), ]
out <- out[out$size > maxFilesize, ]
out <- out[out$size > maxFilesize & !grepl(exemptFromLimit, out$files), ]
if (nrow(out) > 0) {
stop(nrow(out), " files with size > ", maxFilesize, "kB detected: \n",
paste0(out$files, " (", out$size, "kB)", collapse = "\n"))
Expand Down
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.12.0dev",
"version": "4.13.0dev",
"creators": [
{
"name": "Dietrich, Jan Philipp",
Expand Down Expand Up @@ -127,5 +127,5 @@
"license": {
"id": "AGPL-3.0-or-later"
},
"publication_date": "2025-09-08"
"publication_date": "2025-10-23"
}
28 changes: 22 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,36 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]

### changed
- **inputdata** updated input data to rev4.124, which includes two fixes, one with nitrogen emissions being to low and one about accounting for starches in FAO processing data
- **inputdata** updated input data to rev4.123, which uses LUH3 instead of LUH2v2
- **config** input data upgraded from rev4.121 to rev4.122, incorporating new bioenergy demand and GHG price trajectories from REMIND standalone runs with biochar (R34BC).
- **56_ghg_policy** extended set of available ghg price scenarios
- **60_bioenergy** extended set of available second generation bioenergy scenarios
-

### added
-

### removed
-

### fixed
-


## [4.13.0] - 2025-10-23

### changed
- **56_ghg_policy** extended set of available ghg price scenarios
- **60_bioenergy** extended set of available second generation bioenergy scenarios
- **config** input data upgraded from rev4.121 to rev4.122, incorporating new bioenergy demand and GHG price trajectories from REMIND standalone runs with biochar (R34BC).
- **inputdata** updated input data to rev4.123, which uses LUH3 instead of LUH2v2

### added
- **renv/archive** store `renv.lock` for release versions

### fixed
- **14_yield** avoid division by zero for special cases
- **14_yield** avoid too high yields in edge cases (in case of data mismatches between FAO/LUH croparea and LPJmL yield data avoid zero references yields that lead to overestimated yields)
- **60_bioenergy** Harmonize 2nd gen bioenergy demand for historic period based on default trajectory "R34M410-SSP2-NPi2025"
- **inputdata** updated input data to rev4.124, which includes two fixes, one with nitrogen emissions being to low and one about accounting for starches in FAO processing data
- **inputdata** updated input data to rev4.126, including fixes related to inconsistencies as part of LUH3 update and growing primary forest
- **scripts/output** removed deprecated `dir` option from `disaggBII` in `disaggregation.R`


## [4.12.0] - 2025-09-08
Expand Down Expand Up @@ -1216,7 +1231,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.12.0...develop
[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.13.0...develop
[4.13.0]: https://github.com/magpiemodel/magpie/compare/v4.12.0...v4.13.0
[4.12.0]: https://github.com/magpiemodel/magpie/compare/v4.11.0...v4.12.0
[4.11.0]: https://github.com/magpiemodel/magpie/compare/v4.10.1...v4.11.0
[4.10.1]: https://github.com/magpiemodel/magpie/compare/v4.10.0...v4.10.1
Expand Down
4 changes: 2 additions & 2 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ abstract: The *Model of Agricultural Production and its Impact on the Environmen
exogenously given population in 10 food energy categories, based on regional diets.
Future trends in food demand are derived from a cross-country regression analysis,
based on future scenarios on GDP and population growth.
version: 4.12.0dev
date-released: 2025-09-08
version: 4.13.0dev
date-released: 2025-10-23
repository-code: https://github.com/magpiemodel/magpie
keywords:
- landuse
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Imports:
m4fsdp,
madrat,
magclass (>= 6.14.0),
magpie4 (>= 2.39.1),
magpie4 (>= 2.42.3),
MagpieNCGains,
magpiesets (>= 0.46.1),
mip,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,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.12.0 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.12.0/
The model documentation for version 4.13.0 can be found at
https://rse.pik-potsdam.de/doc/magpie/4.13.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 @@ -236,7 +236,7 @@ Please contact magpie@pik-potsdam.de if you're having troubles installing or run
- If you're using PowerShell, starting an interactive R session with `R` doesn't work, and you need to type `R.exe` (or `R.bat` if `R.exe` isn't found) instead. The reason behind this is that `r` is a reserved shortcut for repeating the previous command, which is why you'll be getting a cryptic `Invoke-History: Cannot locate most recent history.` error message when trying to start R in a fresh PowerShell session.

## CITATION
See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.12.0/#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.13.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
10 changes: 5 additions & 5 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ cfg <- list()
cfg$title <- "default"

# path to the submodel to be used relative to main model folder
cfg$model <- "main.gms" #def = "main.gms"
cfg$model <- "main.gms" # def = "main.gms"

#### input settings ####

# which input data sets should be used?
cfg$input <- c(regional = "rev4.124_h12_magpie.tgz",
cellular = "rev4.124_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz",
validation = "rev4.124_h12_validation.tgz",
cfg$input <- c(regional = "rev4.126_h12_magpie.tgz",
cellular = "rev4.126_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz",
validation = "rev4.126_h12_validation.tgz",
additional = "additional_data_rev4.63.tgz",
calibration = "calibration_H12_FAO_18Sep25.tgz")

Expand Down Expand Up @@ -2283,7 +2283,7 @@ cfg$files2export$start <- c("input/info.txt",
"input/kba_land_0.5.mz",
"input/f58_peatland_area_0.5.mz",
"input/MAPSPAM_croparea_0.5.mz",
"input/LUH2_croparea_0.5.mz")
"input/LUH3_croparea_0.5.mz")

# Files that should be copied after the MAgPIE run is finished
cfg$files2export$end <- NULL
Expand Down
2 changes: 1 addition & 1 deletion config/projects/scenario_config_el2.csv
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ gms$s15_alc_scen;0;0;0
gms$c30_bioen_water;all;all;all
gms$factor_costs;sticky_labor;sticky_labor;sticky_labor
gms$c70_feed_scen;ssp1;ssp2;ssp2
input['cellular'];rev4.124EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;;
input['cellular'];rev4.126EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;;
magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif
6 changes: 3 additions & 3 deletions config/projects/scenario_config_fsec.csv
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['cellular'];rev4.124_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.124_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.124_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.124_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.124_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.124_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.124_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;;
input['regional'];rev4.124_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['validation'];rev4.124_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['cellular'];rev4.126_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.126_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.126_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.126_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.126_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.126_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.126_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;;
input['regional'];rev4.126_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['validation'];rev4.126_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
input['calibration'];calibration_FSEC_FAO_14Aug25.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;;
2 changes: 1 addition & 1 deletion config/scenario_config.csv
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@ gms$c60_biodem_level;;;;;;;;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;;
gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;sdp;;;;;;;;;;;;;;;;;;;;;;;;
gms$c70_feed_scen;;;;ssp1;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;ssp2;;;;;;;;;;;;;;;;;;;;;;;;
gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;;
input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.124_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.124_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.124_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.124_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.124_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.124_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz
input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.126_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.126_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.126_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.126_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.126_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.126_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz
1 change: 1 addition & 0 deletions data-changelog.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version,lucEmisRaw2020,lucEmisRaw2050,lucEmisRaw2100,tau2020,tau2050,tau2100,cropland2020,cropland2050,cropland2100,irrigated2020,irrigated2050,irrigated2100,pasture2020,pasture2050,pasture2100,forest2020,forest2050,forest2100,other2020,other2050,other2100,production2020,production2050,production2100,costs2020,costs2050,costs2100,foodExp2020,foodExp2050,foodExp2100
4.13.0,1990.53,24.95,1285.68,1.28,1.64,1.89,1570.17,1662.21,1923.37,244.01,368.97,471.48,3256.53,3250.17,3171.2,4054.66,3987.36,3960.69,4032.77,3993.42,3828.39,17356.28,22558.33,25170.7,3443728.93,4567396.69,6824370.26,1623.95,2442.77,4916.26
4.12.0,2640.51,347.36,829.47,1.27,1.61,1.87,1579.89,1695.16,1962.52,245.57,376.49,459.4,3301.45,3295.75,3169.51,4064.46,3993.45,3933.02,3975.83,3902.13,3811.92,16961.85,22246.11,24761.81,3377362.03,4560650.58,6614375.19,1622.25,2443.32,4917.72
4.11.0,3955.61,609.99,1065.13,1.25,1.6,1.88,1558.03,1640.44,1891.94,242.12,365.49,494.44,3314.14,3324.15,3296.26,4066.85,4006.65,3900.61,3982.6,3915.24,3788.16,16434.28,21917.78,24491.06,3590863.74,4896810.04,6108842.8,1711.18,2540.35,5047.86
4.10.1,4029.35,937.76,811.98,1.24,1.58,1.86,1570.1,1641.16,1908.36,238.83,369.84,481.77,3312.71,3338.12,3286.4,4064.03,4009.22,3906.25,3974.78,3897.98,3775.96,16532.71,22332.48,24534.96,3595710.82,4904095.84,6267265.88,490.26,541.95,651.09
Expand Down
12 changes: 8 additions & 4 deletions modules/14_yields/managementcalib_aug19/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@ i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr));

i14_modeled_yields_hist(t_past,i,knbe14)
= (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * f14_yields(t_past,j,knbe14,w)) /
sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14))>0.00001)
sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14)) > 0.00001 AND
sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * f14_yields(t_past,j,knbe14,w)) > 0.00001)
+ (sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * f14_yields(t_past,j,knbe14,w)) /
sum((cell(i,j),w), i14_croparea_total(t_past,w,j)))$(sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14))<=0.00001);
sum((cell(i,j),w), i14_croparea_total(t_past,w,j)))$(sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14)) <= 0.00001 OR
sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * f14_yields(t_past,j,knbe14,w)) <= 0.00001);


*' The factor `i14_lambda_yields` is calculated for the initial time step depending
Expand Down Expand Up @@ -127,9 +129,11 @@ if ((s14_calib_ir2rf = 1),
* Calibrate newly calibrated yields to FAO yields
i14_modeled_yields_hist2(i,knbe14)
= (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) /
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))>0.00001 AND sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) > 0.00001)
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)) > 0.00001 AND
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) > 0.00001)
+ (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib("y1995",j,knbe14,w)) /
sum((cell(i,j),w), i14_croparea_total("y1995",w,j)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14))<=0.00001 OR sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) <= 0.00001);
sum((cell(i,j),w), i14_croparea_total("y1995",w,j)))$(sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14)) <= 0.00001 OR
sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) <= 0.00001);

i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) /
i14_modeled_yields_hist2(i,knbe14)) *
Expand Down
Loading