Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
88264e1
gsadapt implementation
mscrawford Jul 4, 2025
84031ef
add version of gsadapt only calc factor
k4rst3ns Jul 7, 2025
432581c
change to time depending parameters
k4rst3ns Jul 9, 2025
aa6a8e9
gsadapt versio accounting for the incremental change due to gsadapt i…
k4rst3ns Jul 14, 2025
a91f5ef
fix order of time steps, and cummulative factor definition
k4rst3ns Jul 15, 2025
cc06e1d
Merge branch 'develop' into lpjml2magpie
FelicitasBeier Nov 11, 2025
6c80eca
changed naming of constgsadapt and added new realization for testing …
FelicitasBeier Nov 12, 2025
c27336c
added start script for testing
FelicitasBeier Nov 13, 2025
1b89ab3
get a clean i14_yields_calib (move gsadapt factor to equation)
k4rst3ns Nov 13, 2025
207ff52
Merge branch 'develop' into lpjml2magpie
FelicitasBeier Nov 28, 2025
5c4910d
changes in l2m start script
FelicitasBeier Jan 27, 2026
541827e
Merge branch 'develop' into lpjml2magpie
FelicitasBeier Feb 17, 2026
30a6279
updated start script
FelicitasBeier Feb 17, 2026
7c9f505
fix: gsadapt audit — critical bug fixes and cleanup
mscrawford Feb 18, 2026
b58c050
fix: use calibrated yields in gsadapt_nov25 preloop fallback proxy
mscrawford Feb 18, 2026
9525d02
fix: move EOF comment to bottom of presolve.gms
mscrawford Feb 18, 2026
a2cb101
updated start script
FelicitasBeier Feb 20, 2026
c530edd
fix: remove division-by-zero guards from gsadapt ratio calculations
mscrawford Feb 20, 2026
cccb7a6
Merge pull request #49 from mscrawford/lpjml2magpie
FelicitasBeier Feb 23, 2026
84fdb5a
updated endo_nov25 realization to include the changes by Pat from end…
FelicitasBeier Feb 23, 2026
976b12e
corrected set in equations of gsadapt yield realization
FelicitasBeier Feb 26, 2026
fe89ed8
correct set of vm_tau in nl_fix of gsadapt realization
FelicitasBeier Feb 26, 2026
6e98b32
correct set of vm_tau in nl_fix of mngt realization
FelicitasBeier Feb 26, 2026
f24c5a7
set default to new realizations with constgsadapt
FelicitasBeier Feb 27, 2026
dd48da2
Merge branch 'develop' into lpjml2magpie
FelicitasBeier Feb 27, 2026
f308eab
update input vector to lpjml5 data
FelicitasBeier Feb 27, 2026
5117130
update start script
FelicitasBeier Mar 3, 2026
5258489
BE yield calibration + testing script
k4rst3ns Apr 11, 2026
896eace
fix GLO dimension
k4rst3ns Apr 11, 2026
4432732
Merge remote-tracking branch 'origin/develop' into lpjml2magpie
k4rst3ns May 6, 2026
8b4dfb6
update gsadapt yield realization with updates of the timber yields in…
k4rst3ns May 6, 2026
2081ba3
update BE calibration to be included in the limit calibration approach
k4rst3ns May 6, 2026
fc43e14
update BE calib to new (timeless) format of input data + irrigation i…
k4rst3ns May 14, 2026
e98afee
update start script
FelicitasBeier May 21, 2026
79acb80
bugfixes and code clean up and documentation as part of L2M data update
FelicitasBeier May 29, 2026
a2beb57
Merge branch 'develop' into lpjml2magpie
FelicitasBeier May 29, 2026
6fcc96c
small bug fixes in gsadapt implementation
FelicitasBeier May 29, 2026
7ae5368
deleted f38_region_yield.csv from inputs since not used
FelicitasBeier Jun 1, 2026
91d4a54
remove BE yield calib but have preloop restructuring still in place
k4rst3ns Jul 27, 2026
56cc926
Merge remote-tracking branch 'origin/develop' into lpjml2magpie
k4rst3ns Jul 27, 2026
74d14d5
update yield realization and merge new dynamic regional pasture spill…
k4rst3ns Jul 28, 2026
162dd6b
remove old yield realizations
k4rst3ns Jul 28, 2026
17b5125
remove tabs
k4rst3ns Jul 28, 2026
0ee0af9
change pasture spillover to static
k4rst3ns Jul 28, 2026
739854e
include gsadapt presolve statement also in new merged yield realization
k4rst3ns Jul 28, 2026
5152e9f
Merge remote-tracking branch 'feli/lpjml2magpie' into lpjml2magpie
k4rst3ns Jul 28, 2026
9c410d8
also update nl_fix file
k4rst3ns Jul 28, 2026
961eca5
clean-up old realization and description text
k4rst3ns Jul 28, 2026
40f2185
rename tc realization
k4rst3ns Jul 28, 2026
ad82d0e
set new default to use gsadat yields and spillover
k4rst3ns Jul 28, 2026
12304f4
Update all files to default
k4rst3ns Jul 28, 2026
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
50 changes: 35 additions & 15 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.132_h12_magpie.tgz",
cellular = "rev4.132_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz",
validation = "rev4.132_h12_92e02314_validation.tgz",
additional = "additional_data_rev4.67.tgz",
calibration = "calibration_H12_FAO_01Apr26.tgz")
cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata2_h12_magpie.tgz",
cellular = "rev4.131l2m_v5-10-0m2_may2026+BEdata2_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz",
validation = "rev4.131l2m_v5-10-0m2_may2026+BEdata2_h12_92e02314_validation.tgz",
additional = "additional_data_rev4.65.tgz",
calibration = "calibration_H12_FAO_01Apr26.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 @@ -287,9 +287,10 @@ cfg$gms$s12_hist_interest_hic_noselect <- "0.04" # def = 0.04
# ***--------------------- 13_tc -----------------------------------------
# * (endo_jan22): endogenous technological change with full cost accounting and
# * stepwise updated crop and managed pastures area information
# * (exo): exogenous technological change (removes non-linearities from the model);
# * requires an existing model run with endo tc for generating the input file
# * f13_tau_scenario.csv
# * including account of growing period adaptation in yields and tau
# * (exo): exogenous technological change (removes non-linearities from the model);
# * requires an existing model run with endo tc for generating the input file
# * f13_tau_scenario.csv
cfg$gms$tc <- "endo_jan22" # def = endo_jan22

# * tc cost scenario crops: low, medium or high
Expand Down Expand Up @@ -348,20 +349,27 @@ cfg$gms$s13_croparea_consv_target <- 2030 # def = 2030


# ***--------------------- 14_yield --------------------------------------
# * (managementcalib_aug19): calibrate potential LPJmL-yields to FAO regional numbers,
# * pasture yields increase based on exogenous demand-side proxy
# * for growth rate of cattle stocks
# * (dynRegPastrTau_apr26): as managementcalib_aug19, but the pasture yield spillover
# * from crop-sector TC is a regional, time-varying parameter
# * f14_yld_past_switch(t_all,i) read from a CSV input file
cfg$gms$yields <- "managementcalib_aug19" # def = managementcalib_aug19
# * (gsadapt_dynPastrTau_jul26): calibrate potential LPJmL-yields to FAO regional numbers,
# * pasture yields increase based on exogenous demand-side proxy
# * for growth rate of cattle stocks yields. Optionally, include
# * future growing period adaptation based on LPJmL simulations.
# * Pasture yield spillover from crop-sector TC can be controlled
# * via regional, time-varying parameter (see `s14_past_spillover_mode`)
cfg$gms$yields <- "gsadapt_dynPastrTau_jul26" # def = gsadapt_dynPastrTau_jul26

# * yield scenario
# * options: cc (climate change)
# * nocc (no climate change)
# * nocc_hist (no climate change after year defined by sm_fix_cc)
cfg$gms$c14_yields_scenario <- "cc" # def = "cc"

# * Switch for pasture spillover mode in gsadapt_dynPastrTau_jul26 realization
# * (0): static scalar mode - uses s14_yld_past_switch for all regions and timesteps
# * (1): regional dynamic mode - uses f14_yld_past_switch(t_all,i) per region and timestep
# * This switch allows switching between a uniform spillover effect across all regions
# * and region-specific, time-varying spillover effects read from input data.
cfg$gms$s14_past_spillover_mode <- 0 # def = 1 (regional dynamic mode)

# * switch determing the effectivity of translating crop tc into pasture yield
# * increase. Value has to be in the range of 0 (no pasture yield growth)
# * and 1 (pasture yields increase linearily with tau). Only used in the realizations:
Expand Down Expand Up @@ -399,12 +407,24 @@ 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

# Growing period adaption for yield under climate change
# Options: 1 (growing period adaption is included in yield projections),
# 0 (growing period adaption is not included in yield projections; i.e. constant growing periods are assumed)
cfg$gms$s14_use_gsadapt <- 1 # def = 0

# Accounting for growing period adaption (gsadapt) in tau with consequences for tc costs
# Only relevant if s14_use_gsadapt is activated (1).
# Options: 1 (gsadapt is considered in tau, which leads to higher tc costs),
# 0 (gsadapt is not considered in tau, which implies that tau comes free of charge)
cfg$gms$s14_gsadapt2tau <- 1 # def = 0

# Minimum growing stock for timber harvest in natural vegetation (tDM per ha).
# Age classes below this threshold cannot be harvested.
# 5 tDM/ha ~ 10 m3/ha, i.e. very sparse woodland where commercial timber
# harvest would be unrealistic (expert guess).
cfg$gms$s14_minimum_growing_stock <- 5 # def = 5


# ***--------------------- 15_food ---------------------------------------
# * (anthropometrics_jan18): estimates food using scenario dependent regression
# * and demography drivers
Expand Down
48 changes: 24 additions & 24 deletions core/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -55,32 +55,32 @@ sets
VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE /

j number of LPJ cells
/ CAZ_1*CAZ_5,
CHA_6*CHA_24,
EUR_25*EUR_36,
IND_37*IND_48,
JPN_49*JPN_55,
LAM_56*LAM_88,
MEA_89*MEA_113,
NEU_114*NEU_121,
OAS_122*OAS_137,
REF_138*REF_149,
SSA_150*SSA_182,
USA_183*USA_200 /
/ CAZ_1*CAZ_14,
CHA_15*CHA_31,
EUR_32*EUR_43,
IND_44*IND_57,
JPN_58*JPN_65,
LAM_66*LAM_99,
MEA_100*MEA_117,
NEU_118*NEU_126,
OAS_127*OAS_153,
REF_154*REF_164,
SSA_165*SSA_186,
USA_187*USA_200 /

cell(i,j) number of LPJ cells per region i
/ CAZ . (CAZ_1*CAZ_5)
CHA . (CHA_6*CHA_24)
EUR . (EUR_25*EUR_36)
IND . (IND_37*IND_48)
JPN . (JPN_49*JPN_55)
LAM . (LAM_56*LAM_88)
MEA . (MEA_89*MEA_113)
NEU . (NEU_114*NEU_121)
OAS . (OAS_122*OAS_137)
REF . (REF_138*REF_149)
SSA . (SSA_150*SSA_182)
USA . (USA_183*USA_200) /
/ CAZ . (CAZ_1*CAZ_14)
CHA . (CHA_15*CHA_31)
EUR . (EUR_32*EUR_43)
IND . (IND_44*IND_57)
JPN . (JPN_58*JPN_65)
LAM . (LAM_66*LAM_99)
MEA . (MEA_100*MEA_117)
NEU . (NEU_118*NEU_126)
OAS . (OAS_127*OAS_153)
REF . (REF_154*REF_164)
SSA . (SSA_165*SSA_186)
USA . (USA_187*USA_200) /

i_to_iso(i,iso) mapping regions to iso countries
/ CAZ . (AUS, CAN, HMD, NZL, SPM)
Expand Down
20 changes: 20 additions & 0 deletions literature.bib
Original file line number Diff line number Diff line change
Expand Up @@ -1794,3 +1794,23 @@ @article{difulvio2016logging
year = {2016},
doi = {10.1080/02827581.2016.1221128}
}

@article{li_global_2018,
title = {A global yield dataset for major lignocellulosic bioenergy crops based on field measurements},
author = {Wei Li and Philippe Ciais and David Makowski and Shushi Peng},
journal = {Scientific Data},
volume = {5},
number = {1},
year = {2018},
doi = {10.1038/sdata.2018.169}
}

@article{li_mapping_2020,
title = {Mapping the yields of lignocellulosic bioenergy crops from observations at the global scale},
author = {Wei Li and Philippe Ciais and Elke Stehfest and Detlef van Vuuren and Alexander Popp and Almut Arneth and Fulvio Di Fulvio and Jonathan Doelmann and Florian Humpenöder and Anna B. Harper and Taejin Park and David Makowski and Petr Havlik and Michael Obersteiner and Jingmeng Wang and Andreas Krause and Wenfeng Liu},
journal = {Earth System Science Data},
number = {2},
pages = {789-804},
year = {2020},
doi = {10.5194/essd-12-789-2020}
}
4 changes: 2 additions & 2 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ $title magpie
*
* Number of cells per region:
* CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA
* 5 19 12 12 7 33 25 8 16 12 33 18
* 14 17 12 14 8 34 18 9 27 11 22 14
*
* Regionscode: 62eff8f7
*###################### R SECTION END (VERSION INFO) ###########################
Expand Down Expand Up @@ -195,7 +195,7 @@ $setglobal land landmatrix_dec18
$setglobal costs default
$setglobal interest_rate select_apr20
$setglobal tc endo_jan22
$setglobal yields managementcalib_aug19
$setglobal yields gsadapt_dynPastrTau_jul26

$setglobal food anthro_iso_jun22
$setglobal demand sector_may15
Expand Down
4 changes: 3 additions & 1 deletion modules/13_tc/endo_jan22/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*** | Contact: magpie@pik-potsdam.de

positive variable
v13_tau_core(h,tautype) Agricultural land use intensity tau for conventional cropland (1)
v13_tau_core(h,tautype) Agricultural land use intensity tau for conventional cropland (1)
vm_tech_cost(i) Total Annuitized costs of TC (mio. USD17MER per yr)
v13_cost_tc(i,tautype) Technical change costs per region (mio. USD17MER)
v13_tech_cost(i,tautype) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr)
Expand All @@ -20,6 +20,7 @@ equations
q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr)
q13_tau(j, tautype) Overall agricultural land use intensity tau (1)
q13_tau_consv(h, tautype) Tau for cropland within conservation priority areas (1)
q13_lower_bound_tau(j) Lower limit constraint for tau (1)
;

parameters
Expand Down Expand Up @@ -52,5 +53,6 @@ parameters
oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr)
oq13_tau(t,j,tautype,type) Overall agricultural land use intensity tau (1)
oq13_tau_consv(t,h,tautype,type) Tau for cropland within conservation priority areas (1)
oq13_lower_bound_tau(t,j,type) Lower limit constraint for tau (1)
;
*##################### R SECTION END (OUTPUT DECLARATIONS) #####################
3 changes: 3 additions & 0 deletions modules/13_tc/endo_jan22/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ q13_tech_cost(i2, tautype) ..
q13_tech_cost_sum(i2) ..
vm_tech_cost(i2) =e= sum(tautype, v13_tech_cost(i2, tautype));

*' Enforce gsadapt yield increases in tau, so that tc costs apply
q13_lower_bound_tau(j2) ..
vm_tau(j2,"crop") =g= pcm_tau(j2,"crop") * sum((ct, cell(i2,j2)), pm_yields_gsadapt_ratio_increment(ct,i2));

*' The overall land use intensity factor `vm_tau` is a linear combination between the
*' land use intensity factors `v13_tau_core` for regular cropland and `v13_tau_consv`
Expand Down
4 changes: 4 additions & 0 deletions modules/13_tc/endo_jan22/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype);
oq13_tech_cost_sum(t,i,"marginal") = q13_tech_cost_sum.m(i);
oq13_tau(t,j,tautype,"marginal") = q13_tau.m(j,tautype);
oq13_tau_consv(t,h,tautype,"marginal") = q13_tau_consv.m(h,tautype);
oq13_lower_bound_tau(t,j,"marginal") = q13_lower_bound_tau.m(j);
ov13_tau_core(t,h,tautype,"level") = v13_tau_core.l(h,tautype);
ov_tech_cost(t,i,"level") = vm_tech_cost.l(i);
ov13_cost_tc(t,i,tautype,"level") = v13_cost_tc.l(i,tautype);
Expand All @@ -39,6 +40,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype);
oq13_tech_cost_sum(t,i,"level") = q13_tech_cost_sum.l(i);
oq13_tau(t,j,tautype,"level") = q13_tau.l(j,tautype);
oq13_tau_consv(t,h,tautype,"level") = q13_tau_consv.l(h,tautype);
oq13_lower_bound_tau(t,j,"level") = q13_lower_bound_tau.l(j);
ov13_tau_core(t,h,tautype,"upper") = v13_tau_core.up(h,tautype);
ov_tech_cost(t,i,"upper") = vm_tech_cost.up(i);
ov13_cost_tc(t,i,tautype,"upper") = v13_cost_tc.up(i,tautype);
Expand All @@ -50,6 +52,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype);
oq13_tech_cost_sum(t,i,"upper") = q13_tech_cost_sum.up(i);
oq13_tau(t,j,tautype,"upper") = q13_tau.up(j,tautype);
oq13_tau_consv(t,h,tautype,"upper") = q13_tau_consv.up(h,tautype);
oq13_lower_bound_tau(t,j,"upper") = q13_lower_bound_tau.up(j);
ov13_tau_core(t,h,tautype,"lower") = v13_tau_core.lo(h,tautype);
ov_tech_cost(t,i,"lower") = vm_tech_cost.lo(i);
ov13_cost_tc(t,i,tautype,"lower") = v13_cost_tc.lo(i,tautype);
Expand All @@ -61,4 +64,5 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype);
oq13_tech_cost_sum(t,i,"lower") = q13_tech_cost_sum.lo(i);
oq13_tau(t,j,tautype,"lower") = q13_tau.lo(j,tautype);
oq13_tau_consv(t,h,tautype,"lower") = q13_tau_consv.lo(h,tautype);
oq13_lower_bound_tau(t,j,"lower") = q13_lower_bound_tau.lo(j);
*##################### R SECTION END (OUTPUT DEFINITIONS) ######################
6 changes: 3 additions & 3 deletions modules/13_tc/endo_jan22/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: magpie@pik-potsdam.de


pc13_land(i,"pastr") = sum(cell(i,j),pcm_land(j,"past"));
pc13_land(i,"crop") = sum(cell(i,j),pcm_land(j,"crop"));

Expand All @@ -20,8 +19,9 @@ else

if(m_year(t) > sm_fix_SSP2 AND s13_max_gdp_shr <> Inf,

* We constrain tech cost to a defined share of regional GDP to avoid unrealistically
* high endogenous tech investments
*' Technological change costs are constrainted to a
*' pre-defined share of regional GDP to avoid unrealistically
*' high endogenous tech investments
vm_tech_cost.up(i) =
sum((i_to_iso(i,iso),ct), im_gdp_pc_ppp_iso(ct,iso) * im_pop_iso(ct,iso)) * s13_max_gdp_shr;

Expand Down
2 changes: 1 addition & 1 deletion modules/13_tc/endo_jan22/realization.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: magpie@pik-potsdam.de

*' @description The endo realization stands for endogenous implementation of
*' @description The endo_jan22 realization stands for endogenous implementation of
*' technological change and land use intensification. The intensification rates
*' are calculated endogenously based on an interplay between land use intensity
*' $\tau$ and technological change costs (as shown schematically in the figure
Expand Down
7 changes: 3 additions & 4 deletions modules/13_tc/endo_jan22/scaling.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*** | MAgPIE License Exception, version 1.0 (see LICENSE file).
*** | Contact: magpie@pik-potsdam.de

vm_tech_cost.scale(i) = 1e3;
v13_cost_tc.scale(i,tautype) = 1e6;
v13_tech_cost.scale(i,tautype) = 1e3;
q13_cost_tc.scale(i,tautype) = 1e4;
vm_tech_cost.scale(i) = 10e3;
v13_cost_tc.scale(i,tautype) = 10e6;
v13_tech_cost.scale(i,tautype) = 10e3;
1 change: 1 addition & 0 deletions modules/13_tc/exo/not_used.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name,type,reason
im_pop_iso,input,questionnaire
im_gdp_pc_ppp_iso,input,questionnaire
pm_yields_gsadapt_ratio_increment,input,questionnaire
41 changes: 0 additions & 41 deletions modules/14_yields/dynRegPastrTau_apr26/declarations.gms

This file was deleted.

Loading