From 88264e13db562877540a355272a114ee1bed751c Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Fri, 4 Jul 2025 11:36:17 +0200 Subject: [PATCH 01/42] gsadapt implementation --- modules/13_tc/endo_jan22/presolve.gms | 16 +++- modules/13_tc/exo/not_used.txt | 2 + modules/14_yields/input/files | 2 + .../managementcalib_aug19/declarations.gms | 6 +- .../14_yields/managementcalib_aug19/input.gms | 20 ++++- .../managementcalib_aug19/preloop.gms | 80 +++++++++++++------ .../14_yields/managementcalib_aug19/sets.gms | 3 + .../30_croparea/detail_apr24/declarations.gms | 3 +- .../30_croparea/detail_apr24/postsolve.gms | 4 +- modules/30_croparea/detail_apr24/preloop.gms | 3 + .../30_croparea/simple_apr24/declarations.gms | 1 + .../30_croparea/simple_apr24/postsolve.gms | 2 + modules/30_croparea/simple_apr24/preloop.gms | 3 + 13 files changed, 113 insertions(+), 32 deletions(-) diff --git a/modules/13_tc/endo_jan22/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms index 97f576a2e8..aa4a0877bb 100644 --- a/modules/13_tc/endo_jan22/presolve.gms +++ b/modules/13_tc/endo_jan22/presolve.gms @@ -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")); @@ -13,7 +12,20 @@ if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, vm_tau.lo(h,"pastr") = f13_pastr_tau_hist(t,h); vm_tau.lo(h,"crop") = f13_tau_historical(t,h); else - vm_tau.lo(h, tautype) = pcm_tau(h, tautype); + vm_tau.lo(h, "pastr") = pcm_tau(h,"pastr"); + +* Setting upper bound to 2 - Claude suggestion + vm_tau.lo(h,"crop") = min(2 * pcm_tau(h,"crop"), + pcm_tau(h,"crop") + * sum((i,j,kcr,w)$(supreg(h,i) AND cell(i,j)), + pm_yields_gsadapt_ratio(t,j,kcr,w) + * pcm_area(j,w,kcr) + ) + / sum((i,j,kcr,w)$(supreg(h,i) AND cell(i,j)), + pcm_area(j,w,kcr) + ) + ); + ); vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); diff --git a/modules/13_tc/exo/not_used.txt b/modules/13_tc/exo/not_used.txt index 0d06794292..08ea2635db 100644 --- a/modules/13_tc/exo/not_used.txt +++ b/modules/13_tc/exo/not_used.txt @@ -1,3 +1,5 @@ name,type,reason im_pop_iso,input,questionnaire im_gdp_pc_ppp_iso,input,questionnaire +pm_yields_gsadapt_ratio,internal,testing +pcm_area,internal,testing \ No newline at end of file diff --git a/modules/14_yields/input/files b/modules/14_yields/input/files index 984b93ee32..2d0893b571 100644 --- a/modules/14_yields/input/files +++ b/modules/14_yields/input/files @@ -1,7 +1,9 @@ * list of files that are required here lpj_yields.cs3 +lpj_yields_nogsadapt.cs3 f14_yld_calib.csv lpj_yields_0.5.mz +lpj_yields_nogsadapt_0.5.mz f14_pasture_yields_hist.csv f14_ipcc_bce.cs3 f14_aboveground_fraction.csv diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms index 7af3eb8597..352b919042 100644 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ b/modules/14_yields/managementcalib_aug19/declarations.gms @@ -6,7 +6,11 @@ *** | Contact: magpie@pik-potsdam.de parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields (excluding technological change) (tDM per ha per yr) + i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) + i14_yields_calib_gsadapt(t,j,kve,w) Calibrated biophysical input yields WITH growing period adapation (excluding technological change) (tDM per ha per yr) + i14_yields_combined(t,j,yldtype,kve,w) Blah blah blah (blah) + i14_yields_calib_combined(t,j,yldtype,kve,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) + pm_yields_gsadapt_ratio(t,j,kve,w) Ratio between gsadapt and nosadapt yields (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms index 9e5f7733f8..b3858663ed 100644 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ b/modules/14_yields/managementcalib_aug19/input.gms @@ -39,16 +39,32 @@ $offdelim ; $offEmpty -table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) +* LPJmL2MAGPIE In nocc runs, should one replace the i14_yields variable with the nogsadapt variant? +* Now that nogsadapt is the "default" this will actually be a different fix, I guess on the tau side? +* Also, some renaming will need to occur here. The gsadapt nogsadapt file names and variables are inconsistent. + +table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) $ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" +$include "./modules/14_yields/input/lpj_yields_nogsadapt.cs3" $offdelim ; + * set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used $if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); $if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); m_fillmissingyears(f14_yields,"j,kve,w"); +table f14_yields_gsadapt(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields.cs3" +$offdelim +; + +* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used +$if "%c14_yields_scenario%" == "nocc" f14_yields_gsadapt(t_all,j,kve,w) = f14_yields_gsadapt("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_gsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_gsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields_gsadapt,"j,kve,w"); + table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) $ondelim $include "./modules/14_yields/input/f14_pasture_yields_hist.csv" diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index 031bf5ed28..d7ce316a64 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -1,10 +1,12 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) *** | authors, and contributors see CITATION.cff file. This file is part *** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of *** | AGPL-3.0, you are granted additional permissions described in the *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +* ISN'T THIS BEING WRITTEN OVER LATER? + i14_yields_calib(t,j,kve,w) = f14_yields(t,j,kve,w); ***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* @@ -96,48 +98,76 @@ loop(t, *' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` *' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: -i14_managementcalib(t,j,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / - f14_yields(t,j,knbe14,w) * - (f14_yields(t,j,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(f14_yields(t,j,knbe14,w)>0); +* INSTRUCTIONS: +* Everywhere where previously f14_yields was used, use i14_yields_combined +* Everywhere where previously i14_yields_calib was used, replace with i14_yields_calib_combined +* what are temporary parameters that are being used in the loop that might be needed later on by other +* modules or within the equations or whatever that I don't want to have changed to some nonsense + +* Adding gsadapt/noadapt domain for loop in management calibration +i14_yields_combined(t,j,"nogsadapt",kve,w) = f14_yields(t,j,kve,w); +i14_yields_combined(t,j,"gsadapt",kve,w) = f14_yields_gsadapt(t,j,kve,w); + +i14_yields_calib_combined(t,j,yldtype,kve,w) = i14_yields_combined(t,j,yldtype,kve,w); +loop(yldtype, -i14_yields_calib(t,j,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * f14_yields(t,j,knbe14,w); -pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); + i14_managementcalib(t,j,knbe14,w) = + 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / + i14_yields_combined(t,j,yldtype,knbe14,w) * + (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); + +* LPJ2MAGPIE: We believe that we are writing over the same pm_yields_semi_calib with the same data twice. Kristine, is that true? Can we move this out of the loop? + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,yldtype,knbe14,w); *' Note that the calculation is split into two parts for better readability. *' Irrigated yields are calibrated to meet the country-level *' ratio between irrigated and rainfed yields reported by Aquastat. *' This can be de-activated with the switch `s14_calib_ir2rf`. -if ((s14_calib_ir2rf = 1), + if ((s14_calib_ir2rf = 1), * Weighted yields - i14_calib_yields_hist(i,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib("y1995",j,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); + i14_calib_yields_hist(i,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / + sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); * Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); - i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); - i14_yields_calib(t,j,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * - i14_yields_calib(t,j,knbe14,"irrigated"); + i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); + i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); * 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) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * f14_yields("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); + i14_modeled_yields_hist2(i,knbe14) + = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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) + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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); + +* LPJ2ML we replaced f14_yields with i14_yields_calib_combined. Could it be that this should be i14_yields_calib_combined - i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,knbe14)) * - i14_yields_calib(t,j,knbe14,w); + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / + i14_modeled_yields_hist2(i,knbe14)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,w); + +* LPJ2MAGPIE: We believe that we are writing over the same pm_yields_semi_calib with the same data twice. Kristine, is that true? Can we move this out of the loop? + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,yldtype,knbe14,w); + ); - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); ); +i14_yields_calib_gsadapt(t,j,kve,w) = i14_yields_calib_combined(t,j,"gsadapt",kve,w); +i14_yields_calib(t,j,kve,w) = i14_yields_calib_combined(t,j,"nogsadapt",kve,w); + +* Here we calculate the gsadapt ratio for tau calibration as a weighted mean using croparea as weight +pm_yields_gsadapt_ratio(t,j,kve,w) = i14_yields_calib_gsadapt(t,j,kve,w) / (i14_yields_calib(t,j,kve,w) + 1e-8); + +* Cap the ratio at 5 +pm_yields_gsadapt_ratio(t,j,kve,w) = min(pm_yields_gsadapt_ratio(t,j,kve,w), 2); + *' @stop diff --git a/modules/14_yields/managementcalib_aug19/sets.gms b/modules/14_yields/managementcalib_aug19/sets.gms index 894b3ac2f9..55ee9be34d 100644 --- a/modules/14_yields/managementcalib_aug19/sets.gms +++ b/modules/14_yields/managementcalib_aug19/sets.gms @@ -33,5 +33,8 @@ sets ncp_type14 natures contributions to people (NCP) relevant for agricultural yields / soil_intact, poll_suff / + yldtype Yield LPJmL run type with or without growing season adaptation + / gsadapt, nogsadapt / + ; diff --git a/modules/30_croparea/detail_apr24/declarations.gms b/modules/30_croparea/detail_apr24/declarations.gms index d60c7a369b..cdc2c8e988 100644 --- a/modules/30_croparea/detail_apr24/declarations.gms +++ b/modules/30_croparea/detail_apr24/declarations.gms @@ -14,7 +14,8 @@ parameters i30_betr_target(t,j) Target share for bioenergy land on total cropland (1) i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) - p30_country_switch(iso) Switch indicating whether country is affected by selected policy (1) + p30_country_switch(iso) Switch indicating whether country is affected by selected policy (1) + pcm_area(j,w,kcr) Croparea from previous time step (mio. ha) ; positive variables diff --git a/modules/30_croparea/detail_apr24/postsolve.gms b/modules/30_croparea/detail_apr24/postsolve.gms index e97dda0ca3..e679015950 100644 --- a/modules/30_croparea/detail_apr24/postsolve.gms +++ b/modules/30_croparea/detail_apr24/postsolve.gms @@ -4,7 +4,9 @@ *** | AGPL-3.0, you are granted additional permissions described in the *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de - +* +*** Are Patterns are transferred to next timestep +pcm_area(j,w,kcr) = vm_area.l(j,kcr,w); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### ov_area(t,j,kcr,w,"marginal") = vm_area.m(j,kcr,w); diff --git a/modules/30_croparea/detail_apr24/preloop.gms b/modules/30_croparea/detail_apr24/preloop.gms index 73a33fc871..5903307bb5 100644 --- a/modules/30_croparea/detail_apr24/preloop.gms +++ b/modules/30_croparea/detail_apr24/preloop.gms @@ -48,3 +48,6 @@ vm_bv.l(j,"crop_ann",potnatveg) = vm_bv.l(j,"crop_per",potnatveg) = sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +* Initialize pcm_area +pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); \ No newline at end of file diff --git a/modules/30_croparea/simple_apr24/declarations.gms b/modules/30_croparea/simple_apr24/declarations.gms index 3430df82f6..90af00c457 100644 --- a/modules/30_croparea/simple_apr24/declarations.gms +++ b/modules/30_croparea/simple_apr24/declarations.gms @@ -12,6 +12,7 @@ parameters i30_betr_penalty(t) Penalty for violation of betr target (USD17MER per ha) p30_country_weight(i) Policy country weight per region (1) p30_country_switch(iso) Switch indicating whether country is affected by selected policy (1) + pcm_area(j,w,kcr) Croparea from previous time step (mio. ha) ; positive variables diff --git a/modules/30_croparea/simple_apr24/postsolve.gms b/modules/30_croparea/simple_apr24/postsolve.gms index b402e3eca0..78fbbeda66 100644 --- a/modules/30_croparea/simple_apr24/postsolve.gms +++ b/modules/30_croparea/simple_apr24/postsolve.gms @@ -5,6 +5,8 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +*** Are Patterns are transferred to next timestep +pcm_area(j,w,kcr) = vm_area.l(j,kcr,w); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### ov_area(t,j,kcr,w,"marginal") = vm_area.m(j,kcr,w); diff --git a/modules/30_croparea/simple_apr24/preloop.gms b/modules/30_croparea/simple_apr24/preloop.gms index a20e9ccc86..1975db712d 100644 --- a/modules/30_croparea/simple_apr24/preloop.gms +++ b/modules/30_croparea/simple_apr24/preloop.gms @@ -32,3 +32,6 @@ vm_bv.l(j,"crop_ann",potnatveg) = vm_bv.l(j,"crop_per",potnatveg) = sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg); + +* Initialize pcm_land +pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); \ No newline at end of file From 84031ef9b5a9c726eaab943e737dac9b88a5f2ee Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Mon, 7 Jul 2025 22:42:17 +0200 Subject: [PATCH 02/42] add version of gsadapt only calc factor --- modules/13_tc/endo_jan22/presolve.gms | 15 +--- modules/13_tc/exo/not_used.txt | 2 - .../managementcalib_aug19/declarations.gms | 7 +- .../14_yields/managementcalib_aug19/input.gms | 38 ++++----- .../managementcalib_aug19/preloop.gms | 82 +++++++++---------- .../managementcalib_aug19/presolve.gms | 9 ++ 6 files changed, 65 insertions(+), 88 deletions(-) diff --git a/modules/13_tc/endo_jan22/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms index aa4a0877bb..7147262a5b 100644 --- a/modules/13_tc/endo_jan22/presolve.gms +++ b/modules/13_tc/endo_jan22/presolve.gms @@ -12,20 +12,7 @@ if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, vm_tau.lo(h,"pastr") = f13_pastr_tau_hist(t,h); vm_tau.lo(h,"crop") = f13_tau_historical(t,h); else - vm_tau.lo(h, "pastr") = pcm_tau(h,"pastr"); - -* Setting upper bound to 2 - Claude suggestion - vm_tau.lo(h,"crop") = min(2 * pcm_tau(h,"crop"), - pcm_tau(h,"crop") - * sum((i,j,kcr,w)$(supreg(h,i) AND cell(i,j)), - pm_yields_gsadapt_ratio(t,j,kcr,w) - * pcm_area(j,w,kcr) - ) - / sum((i,j,kcr,w)$(supreg(h,i) AND cell(i,j)), - pcm_area(j,w,kcr) - ) - ); - + vm_tau.lo(h, tautype) = pcm_tau(h, tautype); ); vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); diff --git a/modules/13_tc/exo/not_used.txt b/modules/13_tc/exo/not_used.txt index 08ea2635db..0d06794292 100644 --- a/modules/13_tc/exo/not_used.txt +++ b/modules/13_tc/exo/not_used.txt @@ -1,5 +1,3 @@ name,type,reason im_pop_iso,input,questionnaire im_gdp_pc_ppp_iso,input,questionnaire -pm_yields_gsadapt_ratio,internal,testing -pcm_area,internal,testing \ No newline at end of file diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms index 352b919042..05519a72f4 100644 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ b/modules/14_yields/managementcalib_aug19/declarations.gms @@ -7,10 +7,9 @@ parameters i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) - i14_yields_calib_gsadapt(t,j,kve,w) Calibrated biophysical input yields WITH growing period adapation (excluding technological change) (tDM per ha per yr) - i14_yields_combined(t,j,yldtype,kve,w) Blah blah blah (blah) - i14_yields_calib_combined(t,j,yldtype,kve,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) - pm_yields_gsadapt_ratio(t,j,kve,w) Ratio between gsadapt and nosadapt yields (1) + i14_yields_combined(t,j,yldtype,kcr,w) Blah blah blah (blah) + i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) + pm_yields_gsadapt_ratio(i) Ratio between gsadapt and nosadapt yields (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms index b3858663ed..dee7ad397f 100644 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ b/modules/14_yields/managementcalib_aug19/input.gms @@ -10,23 +10,15 @@ $setglobal c14_yields_scenario cc * nocc (no climate change) * nocc_hist (no climate change after year defined by sm_fix_cc) -scalar s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 /; - -scalar s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 /; - -scalar s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 /; - -scalar s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 /; - -scalar s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 /; - scalars - s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / + s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / + s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / + s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / -; - -scalars - s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ + s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / + s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 / + s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ ; @@ -43,27 +35,27 @@ $offEmpty * Now that nogsadapt is the "default" this will actually be a different fix, I guess on the tau side? * Also, some renaming will need to occur here. The gsadapt nogsadapt file names and variables are inconsistent. -table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) +table f14_yields_nogsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) $ondelim $include "./modules/14_yields/input/lpj_yields_nogsadapt.cs3" $offdelim ; * set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields,"j,kve,w"); +$if "%c14_yields_scenario%" == "nocc" f14_yields_nogsadapt(t_all,j,kve,w) = f14_yields_nogsadapt("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_nogsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_nogsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields_nogsadapt,"j,kve,w"); -table f14_yields_gsadapt(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) +table f14_yields(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) $ondelim $include "./modules/14_yields/input/lpj_yields.cs3" $offdelim ; * set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields_gsadapt(t_all,j,kve,w) = f14_yields_gsadapt("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_gsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_gsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields_gsadapt,"j,kve,w"); +$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields,"j,kve,w"); table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) $ondelim diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index d7ce316a64..4d34e7a537 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -5,21 +5,13 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -* ISN'T THIS BEING WRITTEN OVER LATER? - -i14_yields_calib(t,j,kve,w) = f14_yields(t,j,kve,w); - -***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* -i14_yields_calib(t,j,"begr",w) = f14_yields(t,j,"begr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -i14_yields_calib(t,j,"betr",w) = f14_yields(t,j,"betr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); - ***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),i14_yields_calib(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / +p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / sum(cell(i,j),pm_land_start(j,"past")) ); p14_pyield_corr(t,i) = (f14_pyld_hist(t,i)/p14_pyield_LPJ_reg(t,i))$(sum(sameas(t_past,t),1) = 1) + sum(t_past,(f14_pyld_hist(t_past,i)/(p14_pyield_LPJ_reg(t_past,i)+0.000001))$(ord(t_past)=card(t_past)))$(sum(sameas(t_past,t),1) <> 1); -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); +i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); ***YIELD MANAGEMENT CALIBRATION************************************************************ @@ -105,10 +97,15 @@ loop(t, * modules or within the equations or whatever that I don't want to have changed to some nonsense * Adding gsadapt/noadapt domain for loop in management calibration -i14_yields_combined(t,j,"nogsadapt",kve,w) = f14_yields(t,j,kve,w); -i14_yields_combined(t,j,"gsadapt",kve,w) = f14_yields_gsadapt(t,j,kve,w); +i14_yields_combined(t,j,"nogsadapt",kcr,w) = f14_yields_nogsadapt(t,j,kcr,w); +i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); -i14_yields_calib_combined(t,j,yldtype,kve,w) = i14_yields_combined(t,j,yldtype,kve,w); +***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* +i14_yields_calib_combined(t,j,yldtype,"begr",w) = i14_yields_combined(t,j,yldtype,"begr",w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +i14_yields_calib_combined(t,j,yldtype,"betr",w) = i14_yields_combined(t,j,yldtype,"betr",w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +******************************************************************************************* loop(yldtype, @@ -118,55 +115,50 @@ loop(yldtype, (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); -* LPJ2MAGPIE: We believe that we are writing over the same pm_yields_semi_calib with the same data twice. Kristine, is that true? Can we move this out of the loop? +* Note that i14_managementcalib is written over as it is used for each round of the loop over yldtype i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,yldtype,knbe14,w); +); + +* Note that values of `i14_yields_calib_combined` are identical for for the year 1995 for gsadapt and nogsadapt +* as adapted growing period are held constant from 1995 onwards for the nogsadpt case. +* In the following we subset `gsadapt` in 1995 taking advantage of teh identity of the yield values in 1995. + +pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); *' Note that the calculation is split into two parts for better readability. *' Irrigated yields are calibrated to meet the country-level *' ratio between irrigated and rainfed yields reported by Aquastat. *' This can be de-activated with the switch `s14_calib_ir2rf`. - if ((s14_calib_ir2rf = 1), +if ((s14_calib_ir2rf = 1), * Weighted yields - i14_calib_yields_hist(i,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); + i14_calib_yields_hist(i,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * pm_yields_semi_calib(j,knbe14,w)) / + sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); * Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); - i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); + i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); + i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); * 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_combined("y1995",j,yldtype,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) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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); - -* LPJ2ML we replaced f14_yields with i14_yields_calib_combined. Could it be that this should be i14_yields_calib_combined + i14_modeled_yields_hist2(i,knbe14) + = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * pm_yields_semi_calib(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) + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * pm_yields_semi_calib(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); - i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,knbe14)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,w); - -* LPJ2MAGPIE: We believe that we are writing over the same pm_yields_semi_calib with the same data twice. Kristine, is that true? Can we move this out of the loop? - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,yldtype,knbe14,w); - ); + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / + i14_modeled_yields_hist2(i,knbe14)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,w); + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); ); -i14_yields_calib_gsadapt(t,j,kve,w) = i14_yields_calib_combined(t,j,"gsadapt",kve,w); -i14_yields_calib(t,j,kve,w) = i14_yields_calib_combined(t,j,"nogsadapt",kve,w); - -* Here we calculate the gsadapt ratio for tau calibration as a weighted mean using croparea as weight -pm_yields_gsadapt_ratio(t,j,kve,w) = i14_yields_calib_gsadapt(t,j,kve,w) / (i14_yields_calib(t,j,kve,w) + 1e-8); - -* Cap the ratio at 5 -pm_yields_gsadapt_ratio(t,j,kve,w) = min(pm_yields_gsadapt_ratio(t,j,kve,w), 2); +* Set yields to gsadapt values (pasture yields are not effected by growing period adaption) +i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); *' @stop diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms index 9b95c9e4ca..8f0207909e 100644 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ b/modules/14_yields/managementcalib_aug19/presolve.gms @@ -63,3 +63,12 @@ pm_timber_yield(t,j,ac,"other") = pm_timber_yield(t,j,ac,land_timber) = pm_timber_yield(t,j,ac,land_timber)$(pm_timber_yield(t,j,ac,land_timber) > 0) + 0.0001$(pm_timber_yield(t,j,ac,land_timber) = 0); ** Put yields to 0 where they dont exceed a minimum yield for harvest pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_minimum_wood_yield) = 0; + + +* Calculate growing period adaption factor based on previous croppping pattern +pm_yields_gsadapt_ratio(i) = sum((cell(i,j),w,kcr,ct), i14_yields_calib_combined(ct,j,"gsadapt",kcr,w) * + pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr,ct), i14_yields_calib_combined(ct,j,"nogsadapt",kcr,w) * + pcm_area(j,w,kcr)); + +***i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) / sum(cell(i,j),pm_yields_gsadapt_ratio(i)); From 432581cecf015f4113faff706167ed93b592ddff Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Wed, 9 Jul 2025 09:00:26 +0200 Subject: [PATCH 03/42] change to time depending parameters --- config/default.cfg | 13 ++++++++++--- .../managementcalib_aug19/declarations.gms | 4 +++- .../14_yields/managementcalib_aug19/presolve.gms | 14 ++++++++++---- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index dd496ae559..8bd7094e26 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,12 +22,19 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.118_h12_magpie.tgz", - cellular = "rev4.118_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz", - validation = "rev4.118_h12_validation.tgz", + +cfg$input <- c(regional = "rev4.118L2Mv10_h12_magpie.tgz", + cellular = "WARNINGS1_rev4.118L2Mv10_h12_8e163481_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-510661ce.tgz", + validation = "WARNINGS1_rev4.118L2Mv10_h12_validation.tgz", additional = "additional_data_rev4.62.tgz", calibration = "calibration_H12_FAO_13Mar25.tgz") +#cfg$input <- c(regional = "rev4.118_h12_magpie.tgz", +# cellular = "rev4.118_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz", +# validation = "rev4.118_h12_validation.tgz", +# additional = "additional_data_rev4.62.tgz", +# calibration = "calibration_H12_FAO_13Mar25.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, # e.g. changes in costs structure, NPI policies, etc. diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms index 05519a72f4..99cb8e314b 100644 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ b/modules/14_yields/managementcalib_aug19/declarations.gms @@ -9,7 +9,9 @@ parameters i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) i14_yields_combined(t,j,yldtype,kcr,w) Blah blah blah (blah) i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) - pm_yields_gsadapt_ratio(i) Ratio between gsadapt and nosadapt yields (1) + p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) + p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) + p14_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms index 8f0207909e..2b3053a988 100644 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ b/modules/14_yields/managementcalib_aug19/presolve.gms @@ -66,9 +66,15 @@ pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_m * Calculate growing period adaption factor based on previous croppping pattern -pm_yields_gsadapt_ratio(i) = sum((cell(i,j),w,kcr,ct), i14_yields_calib_combined(ct,j,"gsadapt",kcr,w) * - pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr,ct), i14_yields_calib_combined(ct,j,"nogsadapt",kcr,w) * - pcm_area(j,w,kcr)); +p14_yields_gsadapt_ratio(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); + + +p14_yields_gsadapt_ratio_previous(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); + +p14_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); ***i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) / sum(cell(i,j),pm_yields_gsadapt_ratio(i)); From aa6a8e96e982ef0501888d25912a5d5c7575d7ef Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Mon, 14 Jul 2025 15:05:24 +0200 Subject: [PATCH 04/42] gsadapt versio accounting for the incremental change due to gsadapt in tau for each time step --- config/default.cfg | 7 ++ modules/13_tc/endo_jan22/declarations.gms | 2 + modules/13_tc/endo_jan22/equations.gms | 7 ++ modules/13_tc/endo_jan22/postsolve.gms | 4 + modules/13_tc/exo/not_used.txt | 1 + .../managementcalib_aug19/declarations.gms | 23 ++--- .../managementcalib_aug19/equations.gms | 2 +- .../14_yields/managementcalib_aug19/input.gms | 2 + .../managementcalib_aug19/preloop.gms | 90 +++++++++---------- .../managementcalib_aug19/presolve.gms | 39 +++++--- 10 files changed, 107 insertions(+), 70 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 8bd7094e26..4460da28a3 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -364,6 +364,13 @@ cfg$gms$s14_use_yield_calib <- 0 # def = 0 # Age classes with wood yields below this threshold have a production of zero. cfg$gms$s14_minimum_wood_yield <- 10 #def = 10 +# Use growing period adaption for yield under climate change +cfg$gms$s14_use_gsadapt <- 1 #def = 1 + +# Account for growing period adaption (gsadapt) in tau (1) +# Do not consider gsadapt in tau (it than comes for free) (0) +cfg$gms$s14_gsadapt2tau <- 1 #def = 1 + # ***--------------------- 15_food --------------------------------------- # * (anthropometrics_jan18): estimates food using scenario dependent regression # * and demography drivers diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms index 1e8dea5faf..dfeabf508c 100644 --- a/modules/13_tc/endo_jan22/declarations.gms +++ b/modules/13_tc/endo_jan22/declarations.gms @@ -16,6 +16,7 @@ equations q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr) + q13_lower_bound_tau(h) Lower limit constraint for tau (1) ; parameters @@ -35,5 +36,6 @@ parameters oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr) + oq13_lower_bound_tau(t,h,type) Lower limit constraint for tau (1) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jan22/equations.gms b/modules/13_tc/endo_jan22/equations.gms index 45bea6e0d0..7bad610958 100644 --- a/modules/13_tc/endo_jan22/equations.gms +++ b/modules/13_tc/endo_jan22/equations.gms @@ -43,3 +43,10 @@ q13_tech_cost(i2, tautype) .. q13_tech_cost_sum(i2) .. vm_tech_cost(i2) =e= sum(tautype, v13_tech_cost(i2, tautype)); + + +* restricting tau to gsadapt levels + +q13_lower_bound_tau(h2) .. + vm_tau(h2,"crop") =g= pcm_tau(h2,"crop") * sum((ct,supreg(h2,i2)), pm_yields_gsadapt_ratio_increment(ct,i2)); + diff --git a/modules/13_tc/endo_jan22/postsolve.gms b/modules/13_tc/endo_jan22/postsolve.gms index be936502d6..93ab896ff9 100644 --- a/modules/13_tc/endo_jan22/postsolve.gms +++ b/modules/13_tc/endo_jan22/postsolve.gms @@ -22,6 +22,7 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"marginal") = q13_tech_cost.m(i,tautype); oq13_cost_tc(t,i,tautype,"marginal") = q13_cost_tc.m(i,tautype); oq13_tech_cost_sum(t,i,"marginal") = q13_tech_cost_sum.m(i); + oq13_lower_bound_tau(t,h,"marginal") = q13_lower_bound_tau.m(h); ov_tau(t,h,tautype,"level") = vm_tau.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); @@ -29,6 +30,7 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"level") = q13_tech_cost.l(i,tautype); oq13_cost_tc(t,i,tautype,"level") = q13_cost_tc.l(i,tautype); oq13_tech_cost_sum(t,i,"level") = q13_tech_cost_sum.l(i); + oq13_lower_bound_tau(t,h,"level") = q13_lower_bound_tau.l(h); ov_tau(t,h,tautype,"upper") = vm_tau.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); @@ -36,6 +38,7 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"upper") = q13_tech_cost.up(i,tautype); oq13_cost_tc(t,i,tautype,"upper") = q13_cost_tc.up(i,tautype); oq13_tech_cost_sum(t,i,"upper") = q13_tech_cost_sum.up(i); + oq13_lower_bound_tau(t,h,"upper") = q13_lower_bound_tau.up(h); ov_tau(t,h,tautype,"lower") = vm_tau.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); @@ -43,4 +46,5 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"lower") = q13_tech_cost.lo(i,tautype); oq13_cost_tc(t,i,tautype,"lower") = q13_cost_tc.lo(i,tautype); oq13_tech_cost_sum(t,i,"lower") = q13_tech_cost_sum.lo(i); + oq13_lower_bound_tau(t,h,"lower") = q13_lower_bound_tau.lo(h); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/13_tc/exo/not_used.txt b/modules/13_tc/exo/not_used.txt index 0d06794292..5ce3267a0b 100644 --- a/modules/13_tc/exo/not_used.txt +++ b/modules/13_tc/exo/not_used.txt @@ -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 diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms index 99cb8e314b..4fa8bfeab9 100644 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ b/modules/14_yields/managementcalib_aug19/declarations.gms @@ -7,24 +7,25 @@ parameters i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) - i14_yields_combined(t,j,yldtype,kcr,w) Blah blah blah (blah) + i14_yields_combined(t_all,j,yldtype,kcr,w) Blah blah blah (blah) i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) - p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) - p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) - p14_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) + p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) + p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) + pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) + p14_yields_gsadapt_ratio_cummulative(t,i) Cummulative effect of growing period adaption from the first to the current timestep (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) - i14_modeled_yields_hist(t_all,i,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical referende year (tDM per ha per yr) - i14_lambda_yields(t,i,kcr) Scaling factor for non-linear management calibration (1) - i14_managementcalib(t,j,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) + i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) + i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) pm_timber_yield(t,j,ac,land_timber) Forest growing stock (tDM per ha per yr) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) - i14_calib_yields_hist(i,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) - i14_calib_yields_ratio(i) Irrigated to rainfed yield ratio for calibrated yields (1) - i14_target_ratio(i) Target irrigated to rainfed ratio as upper bound (1) - i14_modeled_yields_hist2(i,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) + i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) + i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) + i14_modeled_yields_hist2(i,yldtype,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) ; positive variables diff --git a/modules/14_yields/managementcalib_aug19/equations.gms b/modules/14_yields/managementcalib_aug19/equations.gms index 908a52fbbc..218156e858 100644 --- a/modules/14_yields/managementcalib_aug19/equations.gms +++ b/modules/14_yields/managementcalib_aug19/equations.gms @@ -12,7 +12,7 @@ *' Technological change can increase the initial calibrated yields by: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * + vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms index dee7ad397f..76fabacea1 100644 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ b/modules/14_yields/managementcalib_aug19/input.gms @@ -19,6 +19,8 @@ scalars s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 / s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ + s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 1 / + s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 1 / ; diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index 4d34e7a537..988ab2c86b 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -44,6 +44,15 @@ i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j), *' to an additive term in case of a strongly underestimated baseline. The scalar *' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). +*' To be able to assess the impacts of growing period adaption, both type of yields +*' (with and without adapted growing perdiods and varieties) have to be calibrated. +*' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate +*' both types individually as even so the growing seasons are held constant from 1995 +*' onwards, due to long term averaging the yields already differ in 1995. + +i14_yields_combined(t,j,"nogsadapt",kcr,w) = f14_yields_nogsadapt(t,j,kcr,w); +i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); + i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); *' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields @@ -51,13 +60,12 @@ i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); *' a region has no crop area reported for a given crop type, the total crop area is *' used to calculate a proxy yield for the calibration, given by the following equation: -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)) / +i14_modeled_yields_hist(t_past,i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,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), 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) * i14_yields_combined(t_past,j,yldtype,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); - *' The factor `i14_lambda_yields` is calculated for the initial time step depending *' on the setting `s14_limit_calib` and is then held constant for all other time steps. *' The regional FAO yield and regional yield of the crop model input of the initial @@ -68,25 +76,25 @@ loop(t, if(sum(sameas(t,"y1995"),1)=1, if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,knbe14) = 1; + i14_lambda_yields(t,i,yldtype,knbe14) = 1; Elseif (s14_limit_calib =1 ), - i14_lambda_yields(t,i,knbe14) = - 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,knbe14)) - + sqrt(i14_modeled_yields_hist(t,i,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ - (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,knbe14)); + i14_lambda_yields(t,i,yldtype,knbe14) = + 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,yldtype,knbe14)) + + sqrt(i14_modeled_yields_hist(t,i,yldtype,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ + (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,yldtype,knbe14)); ); i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); Else - i14_modeled_yields_hist(t,i,knbe14) = i14_modeled_yields_hist(t-1,i,knbe14); - i14_FAO_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); - i14_lambda_yields(t,i,knbe14) = i14_lambda_yields(t-1,i,knbe14); + i14_modeled_yields_hist(t,i,yldtype,knbe14) = i14_modeled_yields_hist(t-1,i,yldtype,knbe14); + i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); + i14_lambda_yields(t,i,yldtype,knbe14) = i14_lambda_yields(t-1,i,yldtype,knbe14); ); ); -*' The calibrated cellular yield `i14_yields_calib` is calculated for each time step depending +*' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending *' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` *' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: @@ -96,10 +104,6 @@ loop(t, * what are temporary parameters that are being used in the loop that might be needed later on by other * modules or within the equations or whatever that I don't want to have changed to some nonsense -* Adding gsadapt/noadapt domain for loop in management calibration -i14_yields_combined(t,j,"nogsadapt",kcr,w) = f14_yields_nogsadapt(t,j,kcr,w); -i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); - ***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* i14_yields_calib_combined(t,j,yldtype,"begr",w) = i14_yields_combined(t,j,yldtype,"begr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); @@ -107,23 +111,13 @@ i14_yields_calib_combined(t,j,yldtype,"betr",w) = i14_yields_combined(t,j,yldtyp sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); ******************************************************************************************* -loop(yldtype, +i14_managementcalib(t,j,yldtype,knbe14,w) = + 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,yldtype,knbe14)) / + i14_yields_combined(t,j,yldtype,knbe14,w) * + (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,knbe14))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,yldtype,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); - i14_managementcalib(t,j,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / - i14_yields_combined(t,j,yldtype,knbe14,w) * - (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); - -* Note that i14_managementcalib is written over as it is used for each round of the loop over yldtype - i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); -); - -* Note that values of `i14_yields_calib_combined` are identical for for the year 1995 for gsadapt and nogsadapt -* as adapted growing period are held constant from 1995 onwards for the nogsadpt case. -* In the following we subset `gsadapt` in 1995 taking advantage of teh identity of the yield values in 1995. - -pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); +i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,yldtype,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); *' Note that the calculation is split into two parts for better readability. @@ -133,35 +127,39 @@ pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt if ((s14_calib_ir2rf = 1), * Weighted yields - i14_calib_yields_hist(i,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * pm_yields_semi_calib(j,knbe14,w)) / + i14_calib_yields_hist(i,yldtype,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); * Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); - i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * + i14_calib_yields_ratio(i,yldtype) = i14_calib_yields_hist(i,yldtype,"irrigated") / i14_calib_yields_hist(i,yldtype,"rainfed"); + i14_target_ratio(i,yldtype) = max(i14_calib_yields_ratio(i,yldtype), f14_ir2rf_ratio(i)); + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); * Calibrate newly calibrated yields to FAO yields - i14_modeled_yields_hist2(i,knbe14) - = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * pm_yields_semi_calib(j,knbe14,w)) / + i14_modeled_yields_hist2(i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * pm_yields_semi_calib(j,knbe14,w)) / + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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); i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,knbe14)) * + i14_modeled_yields_hist2(i,yldtype,knbe14)) * i14_yields_calib_combined(t,j,yldtype,knbe14,w); - - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); ); * Set yields to gsadapt values (pasture yields are not effected by growing period adaption) -i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); -*' @stop +if(s14_use_gsadapt = 1, + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); + else + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"nogsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"nogsadapt",kcr,w); +); +*' @stop ***YIELD CALIBRATION*********************************************************************** diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms index 2b3053a988..502bc51fd9 100644 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ b/modules/14_yields/managementcalib_aug19/presolve.gms @@ -66,15 +66,30 @@ pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_m * Calculate growing period adaption factor based on previous croppping pattern -p14_yields_gsadapt_ratio(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); - - -p14_yields_gsadapt_ratio_previous(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); - -p14_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); - -***i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) / sum(cell(i,j),pm_yields_gsadapt_ratio(i)); +if (ord(t)>1, + p14_yields_gsadapt_ratio(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); + + p14_yields_gsadapt_ratio_previous(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); + + pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); + p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * pm_yields_gsadapt_ratio_increment(t-1,i); + +else + + p14_yields_gsadapt_ratio(t,i) = 1; + p14_yields_gsadapt_ratio_previous(t,i) = 1; + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cummulative(t,i) = 1; + +); + +if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cummulative(t,i) = 1; +); + +i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w)/sum(cell(i,j), p14_yields_gsadapt_ratio_cummulative(t,i)); From a91f5efa246e54889f717e8dde48781b7d7bb3f6 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Tue, 15 Jul 2025 16:52:51 +0200 Subject: [PATCH 05/42] fix order of time steps, and cummulative factor definition --- .../managementcalib_aug19/presolve.gms | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms index 502bc51fd9..e49d7977cd 100644 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ b/modules/14_yields/managementcalib_aug19/presolve.gms @@ -64,9 +64,16 @@ pm_timber_yield(t,j,ac,land_timber) = pm_timber_yield(t,j,ac,land_timber)$(pm_ti ** Put yields to 0 where they dont exceed a minimum yield for harvest pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_minimum_wood_yield) = 0; - * Calculate growing period adaption factor based on previous croppping pattern -if (ord(t)>1, +if (ord(t) = 1, + + p14_yields_gsadapt_ratio(t,i) = 1; + p14_yields_gsadapt_ratio_previous(t,i) = 1; + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cummulative(t,i) = 1; + +else + p14_yields_gsadapt_ratio(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); @@ -76,15 +83,8 @@ if (ord(t)>1, sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); - p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * pm_yields_gsadapt_ratio_increment(t-1,i); + p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cummulative(t-1,i); -else - - p14_yields_gsadapt_ratio(t,i) = 1; - p14_yields_gsadapt_ratio_previous(t,i) = 1; - pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cummulative(t,i) = 1; - ); if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, From 6c80eca18db76d1fe81c6acdd78e08a56d3117ae Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Wed, 12 Nov 2025 13:59:11 +0100 Subject: [PATCH 06/42] changed naming of constgsadapt and added new realization for testing both old and new version in parallel --- config/default.cfg | 8 +- core/sets.gms | 48 ++-- main.gms | 8 +- modules/13_tc/endo_jan22/declarations.gms | 2 - modules/13_tc/endo_jan22/equations.gms | 7 - modules/13_tc/endo_jan22/not_used.txt | 2 + modules/13_tc/endo_jan22/postsolve.gms | 4 - modules/13_tc/endo_jan22/presolve.gms | 1 + modules/13_tc/endo_nov25/declarations.gms | 41 ++++ modules/13_tc/endo_nov25/equations.gms | 52 +++++ modules/13_tc/endo_nov25/input.gms | 52 +++++ modules/13_tc/endo_nov25/nl_fix.gms | 10 + modules/13_tc/endo_nov25/nl_relax.gms | 10 + modules/13_tc/endo_nov25/nl_release.gms | 11 + modules/13_tc/endo_nov25/postsolve.gms | 50 +++++ modules/13_tc/endo_nov25/preloop.gms | 20 ++ modules/13_tc/endo_nov25/presolve.gms | 41 ++++ modules/13_tc/endo_nov25/realization.gms | 55 +++++ modules/13_tc/endo_nov25/scaling.gms | 10 + modules/13_tc/endo_nov25/sets.gms | 18 ++ modules/13_tc/endo_nov25/tau_regional.png | Bin 0 -> 12653 bytes modules/13_tc/endo_nov25/tc_schematic.png | Bin 0 -> 21370 bytes modules/13_tc/endo_nov25/tcc_regression.png | Bin 0 -> 27968 bytes modules/13_tc/module.gms | 1 + .../14_yields/gsadapt_nov25/declarations.gms | 46 ++++ modules/14_yields/gsadapt_nov25/equations.gms | 39 ++++ modules/14_yields/gsadapt_nov25/input.gms | 111 ++++++++++ modules/14_yields/gsadapt_nov25/input/files | 5 + modules/14_yields/gsadapt_nov25/nl_fix.gms | 11 + .../14_yields/gsadapt_nov25/nl_release.gms | 11 + modules/14_yields/gsadapt_nov25/postsolve.gms | 24 ++ modules/14_yields/gsadapt_nov25/preloop.gms | 206 ++++++++++++++++++ modules/14_yields/gsadapt_nov25/presolve.gms | 95 ++++++++ .../14_yields/gsadapt_nov25/realization.gms | 39 ++++ modules/14_yields/gsadapt_nov25/sets.gms | 40 ++++ modules/14_yields/input/files | 4 +- .../managementcalib_aug19/declarations.gms | 22 +- .../managementcalib_aug19/equations.gms | 2 +- .../14_yields/managementcalib_aug19/input.gms | 42 ++-- .../managementcalib_aug19/not_used.txt | 3 + .../managementcalib_aug19/preloop.gms | 108 ++++----- .../managementcalib_aug19/presolve.gms | 30 --- .../14_yields/managementcalib_aug19/sets.gms | 3 - modules/14_yields/module.gms | 1 + 44 files changed, 1113 insertions(+), 180 deletions(-) create mode 100644 modules/13_tc/endo_jan22/not_used.txt create mode 100644 modules/13_tc/endo_nov25/declarations.gms create mode 100644 modules/13_tc/endo_nov25/equations.gms create mode 100644 modules/13_tc/endo_nov25/input.gms create mode 100644 modules/13_tc/endo_nov25/nl_fix.gms create mode 100644 modules/13_tc/endo_nov25/nl_relax.gms create mode 100644 modules/13_tc/endo_nov25/nl_release.gms create mode 100644 modules/13_tc/endo_nov25/postsolve.gms create mode 100644 modules/13_tc/endo_nov25/preloop.gms create mode 100644 modules/13_tc/endo_nov25/presolve.gms create mode 100644 modules/13_tc/endo_nov25/realization.gms create mode 100644 modules/13_tc/endo_nov25/scaling.gms create mode 100644 modules/13_tc/endo_nov25/sets.gms create mode 100644 modules/13_tc/endo_nov25/tau_regional.png create mode 100644 modules/13_tc/endo_nov25/tc_schematic.png create mode 100644 modules/13_tc/endo_nov25/tcc_regression.png create mode 100644 modules/14_yields/gsadapt_nov25/declarations.gms create mode 100644 modules/14_yields/gsadapt_nov25/equations.gms create mode 100644 modules/14_yields/gsadapt_nov25/input.gms create mode 100644 modules/14_yields/gsadapt_nov25/input/files create mode 100644 modules/14_yields/gsadapt_nov25/nl_fix.gms create mode 100644 modules/14_yields/gsadapt_nov25/nl_release.gms create mode 100644 modules/14_yields/gsadapt_nov25/postsolve.gms create mode 100644 modules/14_yields/gsadapt_nov25/preloop.gms create mode 100644 modules/14_yields/gsadapt_nov25/presolve.gms create mode 100644 modules/14_yields/gsadapt_nov25/realization.gms create mode 100644 modules/14_yields/gsadapt_nov25/sets.gms create mode 100644 modules/14_yields/managementcalib_aug19/not_used.txt diff --git a/config/default.cfg b/config/default.cfg index d0f5199ae1..473edb65bd 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -287,6 +287,9 @@ 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 +# * (endo_jan25): endogenous technological change with full cost accounting and +# * stepwise updated crop and managed pastures area information +# * including account of growing period adaptation # * (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 @@ -308,6 +311,9 @@ cfg$gms$s13_max_gdp_shr <- Inf # def = Inf # * (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 +# * (gsadapt_nov25): yields with future growing period adaptation based on LPJmL simulations +# * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional, +# * pasture yields increase based on exogenous demand-side proxy for growth rate of cattle stocks cfg$gms$yields <- "managementcalib_aug19" # def = managementcalib_aug19 # * yield scenario @@ -361,7 +367,7 @@ cfg$gms$s14_minimum_wood_yield <- 10 #def = 10 cfg$gms$s14_use_gsadapt <- 1 #def = 1 # Account for growing period adaption (gsadapt) in tau (1) -# Do not consider gsadapt in tau (it than comes for free) (0) +# Do not consider gsadapt in tau (it then comes for free) (0) cfg$gms$s14_gsadapt2tau <- 1 #def = 1 # ***--------------------- 15_food --------------------------------------- diff --git a/core/sets.gms b/core/sets.gms index 7f07b28586..37298c3c4f 100644 --- a/core/sets.gms +++ b/core/sets.gms @@ -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_13, + CHA_14*CHA_30, + EUR_31*EUR_42, + IND_43*IND_56, + JPN_57*JPN_65, + LAM_66*LAM_98, + MEA_99*MEA_115, + NEU_116*NEU_124, + OAS_125*OAS_150, + REF_151*REF_161, + SSA_162*SSA_185, + USA_186*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_13) + CHA . (CHA_14*CHA_30) + EUR . (EUR_31*EUR_42) + IND . (IND_43*IND_56) + JPN . (JPN_57*JPN_65) + LAM . (LAM_66*LAM_98) + MEA . (MEA_99*MEA_115) + NEU . (NEU_116*NEU_124) + OAS . (OAS_125*OAS_150) + REF . (REF_151*REF_161) + SSA . (SSA_162*SSA_185) + USA . (USA_186*USA_200) / i_to_iso(i,iso) mapping regions to iso countries / CAZ . (AUS, CAN, HMD, NZL, SPM) diff --git a/main.gms b/main.gms index e098e32f31..c6e2f9c78b 100644 --- a/main.gms +++ b/main.gms @@ -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 +* 13 17 12 14 9 33 17 9 26 11 24 15 * * Regionscode: 62eff8f7 *###################### R SECTION END (VERSION INFO) ########################### @@ -181,7 +181,7 @@ $offlisting $setglobal c_timesteps coup2100 $setglobal c_past till_2015 -$setglobal c_title default +$setglobal c_title LPJmL_5p9.16-m2_NOgsadapt scalars s_use_gdx use of gdx files / 0 / @@ -194,8 +194,8 @@ $setglobal drivers aug17 $setglobal land landmatrix_dec18 $setglobal costs default $setglobal interest_rate select_apr20 -$setglobal tc endo_jan22 -$setglobal yields managementcalib_aug19 +$setglobal tc endo_nov25 +$setglobal yields gsadapt_nov25 $setglobal food anthro_iso_jun22 $setglobal demand sector_may15 diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms index dfeabf508c..1e8dea5faf 100644 --- a/modules/13_tc/endo_jan22/declarations.gms +++ b/modules/13_tc/endo_jan22/declarations.gms @@ -16,7 +16,6 @@ equations q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr) - q13_lower_bound_tau(h) Lower limit constraint for tau (1) ; parameters @@ -36,6 +35,5 @@ parameters oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr) - oq13_lower_bound_tau(t,h,type) Lower limit constraint for tau (1) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jan22/equations.gms b/modules/13_tc/endo_jan22/equations.gms index 7bad610958..45bea6e0d0 100644 --- a/modules/13_tc/endo_jan22/equations.gms +++ b/modules/13_tc/endo_jan22/equations.gms @@ -43,10 +43,3 @@ q13_tech_cost(i2, tautype) .. q13_tech_cost_sum(i2) .. vm_tech_cost(i2) =e= sum(tautype, v13_tech_cost(i2, tautype)); - - -* restricting tau to gsadapt levels - -q13_lower_bound_tau(h2) .. - vm_tau(h2,"crop") =g= pcm_tau(h2,"crop") * sum((ct,supreg(h2,i2)), pm_yields_gsadapt_ratio_increment(ct,i2)); - diff --git a/modules/13_tc/endo_jan22/not_used.txt b/modules/13_tc/endo_jan22/not_used.txt new file mode 100644 index 0000000000..f09dd19cf3 --- /dev/null +++ b/modules/13_tc/endo_jan22/not_used.txt @@ -0,0 +1,2 @@ +name,type,reason +pm_yields_gsadapt_ratio_increment, interface, not needed diff --git a/modules/13_tc/endo_jan22/postsolve.gms b/modules/13_tc/endo_jan22/postsolve.gms index 93ab896ff9..be936502d6 100644 --- a/modules/13_tc/endo_jan22/postsolve.gms +++ b/modules/13_tc/endo_jan22/postsolve.gms @@ -22,7 +22,6 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"marginal") = q13_tech_cost.m(i,tautype); oq13_cost_tc(t,i,tautype,"marginal") = q13_cost_tc.m(i,tautype); oq13_tech_cost_sum(t,i,"marginal") = q13_tech_cost_sum.m(i); - oq13_lower_bound_tau(t,h,"marginal") = q13_lower_bound_tau.m(h); ov_tau(t,h,tautype,"level") = vm_tau.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); @@ -30,7 +29,6 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"level") = q13_tech_cost.l(i,tautype); oq13_cost_tc(t,i,tautype,"level") = q13_cost_tc.l(i,tautype); oq13_tech_cost_sum(t,i,"level") = q13_tech_cost_sum.l(i); - oq13_lower_bound_tau(t,h,"level") = q13_lower_bound_tau.l(h); ov_tau(t,h,tautype,"upper") = vm_tau.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); @@ -38,7 +36,6 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"upper") = q13_tech_cost.up(i,tautype); oq13_cost_tc(t,i,tautype,"upper") = q13_cost_tc.up(i,tautype); oq13_tech_cost_sum(t,i,"upper") = q13_tech_cost_sum.up(i); - oq13_lower_bound_tau(t,h,"upper") = q13_lower_bound_tau.up(h); ov_tau(t,h,tautype,"lower") = vm_tau.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); @@ -46,5 +43,4 @@ pcm_tau(h, tautype) = vm_tau.l(h, tautype); oq13_tech_cost(t,i,tautype,"lower") = q13_tech_cost.lo(i,tautype); oq13_cost_tc(t,i,tautype,"lower") = q13_cost_tc.lo(i,tautype); oq13_tech_cost_sum(t,i,"lower") = q13_tech_cost_sum.lo(i); - oq13_lower_bound_tau(t,h,"lower") = q13_lower_bound_tau.lo(h); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/13_tc/endo_jan22/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms index 7147262a5b..97f576a2e8 100644 --- a/modules/13_tc/endo_jan22/presolve.gms +++ b/modules/13_tc/endo_jan22/presolve.gms @@ -5,6 +5,7 @@ *** | 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")); diff --git a/modules/13_tc/endo_nov25/declarations.gms b/modules/13_tc/endo_nov25/declarations.gms new file mode 100644 index 0000000000..dfeabf508c --- /dev/null +++ b/modules/13_tc/endo_nov25/declarations.gms @@ -0,0 +1,41 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +positive variable + vm_tau(h,tautype) Agricultural land use intensity tau (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) +; + +equations + q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) + q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) + q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr) + q13_lower_bound_tau(h) Lower limit constraint for tau (1) +; + +parameters + pc13_land(i, tautype) Crop and grass land area per region (mio ha) + pcm_tau(h, tautype) Tau factor of the previous time step (1) + pc13_tcguess(h, tautype) Guess for annual tc rates in the next time step (1) + i13_tc_factor(t) Regression factor (USD17MER per ha) + i13_tc_exponent(t) Regression exponent (1) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) + ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17MER per yr) + ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17MER) + ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) + oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) + oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) + oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr) + oq13_lower_bound_tau(t,h,type) Lower limit constraint for tau (1) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_nov25/equations.gms b/modules/13_tc/endo_nov25/equations.gms new file mode 100644 index 0000000000..7bad610958 --- /dev/null +++ b/modules/13_tc/endo_nov25/equations.gms @@ -0,0 +1,52 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @equations + +*' ![Investment-yield ratio in relation to $\tau$-factor +*' [@dietrich_forecasting_2014]](tcc_regression.png){ width=60% } +*' +*' Relative technological change costs `v13_cost_tc` are calculated as a +*' heuristically derived power function of the land use intensity `vm_tau` for +*' the investment-yield-ratio (see figure above) multiplied by the current +*' regional crop areas `pc13_land` (taken from previous time step) and shifted +*' 15 years into the future using the region specific interest +*' rate `pm_interest`: + +q13_cost_tc(i2, tautype) .. + v13_cost_tc(i2, tautype) =e= sum(ct, pc13_land(i2, tautype) * + i13_tc_factor(ct) * sum(supreg(h2,i2),vm_tau(h2,tautype))** + i13_tc_exponent(ct) * (1+pm_interest(ct,i2))**15); + + +*' The shifting is performed because investments into technological change +*' require on average 15 years of research before a yield increase is achieved, +*' but the model has to see costs and benefits concurrently in order to take the +*' right investment decisions (see also @dietrich_forecasting_2014). Investment +*' costs are scaled in relation to crop area, since a wider areal coverage means +*' typically also higher variety in biophysical conditions, which would require +*' more research for the same overall intensity boost. +*' +*' In order to get the full investments required for the desired intensification +*' the relative technological change costs are multiplied with the given +*' intensification rate. These full costs are then distributed over an infinite +*' time horizon by multiplication with the interest rate `pm_interest(i)` +*' (annuity with infinite time horizon): + +q13_tech_cost(i2, tautype) .. + v13_tech_cost(i2, tautype) =e= sum(supreg(h2,i2), vm_tau(h2,tautype)/pcm_tau(h2,tautype)-1) * v13_cost_tc(i2,tautype) + * sum(ct,pm_interest(ct,i2)/(1+pm_interest(ct,i2))); + +q13_tech_cost_sum(i2) .. + vm_tech_cost(i2) =e= sum(tautype, v13_tech_cost(i2, tautype)); + + +* restricting tau to gsadapt levels + +q13_lower_bound_tau(h2) .. + vm_tau(h2,"crop") =g= pcm_tau(h2,"crop") * sum((ct,supreg(h2,i2)), pm_yields_gsadapt_ratio_increment(ct,i2)); + diff --git a/modules/13_tc/endo_nov25/input.gms b/modules/13_tc/endo_nov25/input.gms new file mode 100644 index 0000000000..c6a23997fc --- /dev/null +++ b/modules/13_tc/endo_nov25/input.gms @@ -0,0 +1,52 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +scalars + s13_ignore_tau_historical ignore historical tau (1) or use it as lower bound (0) (binary) / 1 / + s13_max_gdp_shr Maximum tech cost as share of regional GDP / Inf / +; + +parameter fm_tau1995(h) Agricultural land use intensity tau in 1995 (1) +/ +$ondelim +$include "./modules/13_tc/input/fm_tau1995.cs4" +$offdelim +/; + +parameter f13_tcguess(h) Guess for initial annual TC rates (1) +/ +$ondelim +$include "./modules/13_tc/input/f13_tcguess.cs4" +$offdelim +/; + +$setglobal c13_tccost medium + +table f13_tc_factor(t_all,scen13) Regression factor (USD17MER per ha) +$ondelim +$include "./modules/13_tc/input/f13_tc_factor.cs3" +$offdelim +; + +table f13_tc_exponent(t_all,scen13) Regression exponent (1) +$ondelim +$include "./modules/13_tc/input/f13_tc_exponent.cs3" +$offdelim +; + +table f13_tau_historical(t_all,h) historical tau scenario (1) +$ondelim +$include "./modules/13_tc/input/f13_tau_historical.csv" +$offdelim +; + +table f13_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) +$ondelim +$include "./modules/13_tc/input/f13_pastr_tau_hist.csv" +$offdelim +; diff --git a/modules/13_tc/endo_nov25/nl_fix.gms b/modules/13_tc/endo_nov25/nl_fix.gms new file mode 100644 index 0000000000..d03aaaabf4 --- /dev/null +++ b/modules/13_tc/endo_nov25/nl_fix.gms @@ -0,0 +1,10 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_fix ### + +vm_tau.fx(h,tautype) = max(vm_tau.lo(h,tautype), min(vm_tau.up(h,tautype), vm_tau.l(h,tautype))); diff --git a/modules/13_tc/endo_nov25/nl_relax.gms b/modules/13_tc/endo_nov25/nl_relax.gms new file mode 100644 index 0000000000..2d6ffe041f --- /dev/null +++ b/modules/13_tc/endo_nov25/nl_relax.gms @@ -0,0 +1,10 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_relax ### + +vm_tau.l(h,tautype) = vm_tau.l(h,tautype) + 0.1; diff --git a/modules/13_tc/endo_nov25/nl_release.gms b/modules/13_tc/endo_nov25/nl_release.gms new file mode 100644 index 0000000000..2bddbd429a --- /dev/null +++ b/modules/13_tc/endo_nov25/nl_release.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_release ### + +vm_tau.lo(h,tautype) = pcm_tau(h,tautype); +vm_tau.up(h,tautype) = 2*pcm_tau(h,tautype); diff --git a/modules/13_tc/endo_nov25/postsolve.gms b/modules/13_tc/endo_nov25/postsolve.gms new file mode 100644 index 0000000000..93ab896ff9 --- /dev/null +++ b/modules/13_tc/endo_nov25/postsolve.gms @@ -0,0 +1,50 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* Overall TC cost for the current timestep + +if((ord(t)>1), + pc13_tcguess(h,tautype) = (vm_tau.l(h,tautype)/pcm_tau(h, tautype))**(1/m_yeardiff(t)) - 1; +); + +pcm_tau(h, tautype) = vm_tau.l(h, tautype); + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_tau(t,h,tautype,"marginal") = vm_tau.m(h,tautype); + ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); + ov13_cost_tc(t,i,tautype,"marginal") = v13_cost_tc.m(i,tautype); + ov13_tech_cost(t,i,tautype,"marginal") = v13_tech_cost.m(i,tautype); + oq13_tech_cost(t,i,tautype,"marginal") = q13_tech_cost.m(i,tautype); + oq13_cost_tc(t,i,tautype,"marginal") = q13_cost_tc.m(i,tautype); + oq13_tech_cost_sum(t,i,"marginal") = q13_tech_cost_sum.m(i); + oq13_lower_bound_tau(t,h,"marginal") = q13_lower_bound_tau.m(h); + ov_tau(t,h,tautype,"level") = vm_tau.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); + ov13_tech_cost(t,i,tautype,"level") = v13_tech_cost.l(i,tautype); + oq13_tech_cost(t,i,tautype,"level") = q13_tech_cost.l(i,tautype); + oq13_cost_tc(t,i,tautype,"level") = q13_cost_tc.l(i,tautype); + oq13_tech_cost_sum(t,i,"level") = q13_tech_cost_sum.l(i); + oq13_lower_bound_tau(t,h,"level") = q13_lower_bound_tau.l(h); + ov_tau(t,h,tautype,"upper") = vm_tau.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); + ov13_tech_cost(t,i,tautype,"upper") = v13_tech_cost.up(i,tautype); + oq13_tech_cost(t,i,tautype,"upper") = q13_tech_cost.up(i,tautype); + oq13_cost_tc(t,i,tautype,"upper") = q13_cost_tc.up(i,tautype); + oq13_tech_cost_sum(t,i,"upper") = q13_tech_cost_sum.up(i); + oq13_lower_bound_tau(t,h,"upper") = q13_lower_bound_tau.up(h); + ov_tau(t,h,tautype,"lower") = vm_tau.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); + ov13_tech_cost(t,i,tautype,"lower") = v13_tech_cost.lo(i,tautype); + oq13_tech_cost(t,i,tautype,"lower") = q13_tech_cost.lo(i,tautype); + oq13_cost_tc(t,i,tautype,"lower") = q13_cost_tc.lo(i,tautype); + oq13_tech_cost_sum(t,i,"lower") = q13_tech_cost_sum.lo(i); + oq13_lower_bound_tau(t,h,"lower") = q13_lower_bound_tau.lo(h); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/13_tc/endo_nov25/preloop.gms b/modules/13_tc/endo_nov25/preloop.gms new file mode 100644 index 0000000000..7c75fcca4a --- /dev/null +++ b/modules/13_tc/endo_nov25/preloop.gms @@ -0,0 +1,20 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +loop(t, + if(m_year(t) <= sm_fix_SSP2, + i13_tc_factor(t) = f13_tc_factor(t,"medium"); + i13_tc_exponent(t) = f13_tc_exponent(t,"medium"); + else + i13_tc_factor(t) = f13_tc_factor(t,"%c13_tccost%"); + i13_tc_exponent(t) = f13_tc_exponent(t,"%c13_tccost%"); + ); +); + +pcm_tau(h,"crop") = fm_tau1995(h); +pcm_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); +pc13_tcguess(h,tautype) = f13_tcguess(h); diff --git a/modules/13_tc/endo_nov25/presolve.gms b/modules/13_tc/endo_nov25/presolve.gms new file mode 100644 index 0000000000..7147262a5b --- /dev/null +++ b/modules/13_tc/endo_nov25/presolve.gms @@ -0,0 +1,41 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | 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")); + +if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, + vm_tau.lo(h,"pastr") = f13_pastr_tau_hist(t,h); + vm_tau.lo(h,"crop") = f13_tau_historical(t,h); +else + vm_tau.lo(h, tautype) = pcm_tau(h, tautype); +); + + vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); + +* educated guess for vm_tau.l: +if(ord(t) = 1, + vm_tau.l(h,tautype) = pcm_tau(h,tautype); +else + vm_tau.l(h,tautype) = pcm_tau(h,tautype)*(1+pc13_tcguess(h,tautype))**m_yeardiff(t); +); + +vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); + +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 + 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; + +* We set the initial solving basis for the tech cost to its upper bound to support the solver in finding +* a proper solution. Without such initial values, the model leave tech cost at 0 and as such ignore tau +* as an efficient part of the optimal solution. + vm_tech_cost.l(i) = vm_tech_cost.up(i); + +); diff --git a/modules/13_tc/endo_nov25/realization.gms b/modules/13_tc/endo_nov25/realization.gms new file mode 100644 index 0000000000..b2c830c172 --- /dev/null +++ b/modules/13_tc/endo_nov25/realization.gms @@ -0,0 +1,55 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The endo 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 +*' below). This module realization contains the implementation as described +*' in @dietrich_forecasting_2014 with two minor modifications: +*' +*' * rates of previous investment decisions which still have to be paid are +*' added to the technological change costs +*' * the planning horizon for investments is unified over all investments in +*' the model. +*' +*' ![Implementation of technological change in MAgPIE +*' [@dietrich_forecasting_2014]](tc_schematic.png){ width=60% } +*' +*' Initial land use intensity $\tau$ values for the year 2000 come from +*' @dietrich_measuring_2012 and are shown below. +*' +*' ![$\tau$-factors in world regions & global (GLO) for the year 2000. +*' [@dietrich_measuring_2012]](tau_regional.png){ width=60% } +*' +*' Investments into technological change (TC) trigger land use intensification +*' ($\tau$) which triggers in turn yields increases. How much intensification +*' can be triggered by an investment, depends on the investment-yield ratio, +*' which in turn depends on the current agricultural land use intensity. The +*' higher the current intensity level, the more expensive the additional +*' intensification will become. The interaction between land use intensity and +*' production costs per area as shown in the schematic is not covered by this +*' module and can be found instead in [38_factor_costs]. + +*' @limitations This module significantly reduces the overall computational +*' performance of the model since these endogenous calculations are highly +*' computational intensive. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_nov25/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_nov25/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_nov25/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_nov25/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_nov25/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_nov25/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_nov25/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_nov25/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_nov25/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_nov25/nl_release.gms" +$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_nov25/nl_relax.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/13_tc/endo_nov25/scaling.gms b/modules/13_tc/endo_nov25/scaling.gms new file mode 100644 index 0000000000..6b174c52da --- /dev/null +++ b/modules/13_tc/endo_nov25/scaling.gms @@ -0,0 +1,10 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +vm_tech_cost.scale(i) = 10e3; +v13_cost_tc.scale(i,tautype) = 10e6; +v13_tech_cost.scale(i,tautype) = 10e3; diff --git a/modules/13_tc/endo_nov25/sets.gms b/modules/13_tc/endo_nov25/sets.gms new file mode 100644 index 0000000000..97ee7b8043 --- /dev/null +++ b/modules/13_tc/endo_nov25/sets.gms @@ -0,0 +1,18 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +sets + + scen13 tc cost scenario + /low, medium, high/ + + tautype tc type + / pastr, crop / + +; + +*** EOF sets.gms *** diff --git a/modules/13_tc/endo_nov25/tau_regional.png b/modules/13_tc/endo_nov25/tau_regional.png new file mode 100644 index 0000000000000000000000000000000000000000..3d2a1a1db8338d2d342e8e2c58ff1d52489859a7 GIT binary patch literal 12653 zcmd^mc|4T;-*5NbUELAVLbjB$FH?lF-h~P=cE&bELt*So_WMq@Y-Qht5Hmx@ZZH+X z2o+;rvNae(ma)!^a}8Ra=k+_!InVRYdCoarm+R`)^}Rmd&+`5(-_Q3eTu1vB69Xs1 zfddDa)NiZm9XRm2*MS4SrTqCj@IUvN|2734hpjYksRB>nXHx|e2t1BD--fsyIKbRQ z|NSjNl$q^Z&zcd4<8(t3{_zgxNLm>YN=NB39DmIa<3k@wsvrM zbN5oi>(Vzj8>Xyj7upK0oQ>k|XiaPwlU+Qd+5159LPtv~N5`MxVPRpb>Ki`415b)f zJU<`bXVL%K-8uo)*}rDvUexxHaFLI1+3>xHnTtc>nGBP=Gj1nXSvN)M<2!~*N$;R58bGPu@G{SXrOTE{CHJh36)8X_R`mC#uH@Rx$0Y zlAOS_?kvAc{{U1*TLp26g5YlVg@PSL_Zi9|#$(Cn`1tq~=RR%2bQ8nEd_06S>686> z_YqFxRsOspI+iWQ%1WMF)vK(WF{ixK8TVVlteHbMn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X+d0hpi?=0M$p32B5BOm;30X`57zRma=m^~Z*5Hk z5redNQ^q?o@hw)8vIfYysADIeO)uQQ$E41 zr8eloPNPn65chl_%CY*(Xz5mQ%Pe3w?B8TPBfGkUOPw+-x9$Xbbu|QSPg=7_mXfM` zC%bz)9LY69H{jUI7X)Z;-oDIOtW)Z*9r671kOd2!f67#`dCf~b8D4axzVgvZF^gx* z&FCuLA*r<>Vy0izEmy#bAQ)3wPliH@1(CVg*FV<5`Yd-%*ErQ`=g*!M&4uUxhIgmICd>}_Cm z*j_@(ysx#yjY479ghk~OFp5nwYT~#p2i;oJe>C@vT#VKmcrMJ7SlImutf7_IC)#n% z<@(d1fO%-C=V)dAdGSei&4D9FqfEE;YDm&HOkAxcF~mJx?VzQvYz4AAYaZXn z0^-5@xGF8pgjG$HE!JS~)$@DEn0Iu6o_1G(XPx_zXXN00YK!TAfMFpI{H7ly=Z$oh z4Ul08Rf2^PZcpL3*4|}$I`FI#(7!pq@f)f8%2Wr7Yf&od)(sCmqk9u(%BN(EX2^4P z$m-V~Ryx~ZL4=DI#7l@;Q=AVHeJVcTWvyl!O5PHVvokB0MGN7Lzo2SNLEbJ=oI1d1 mR#py9`hE8FfAWssIr7mFGIQ2C$e#XJ6Y6T(s>L_%KK>ua*#=nv literal 0 HcmV?d00001 diff --git a/modules/13_tc/endo_nov25/tc_schematic.png b/modules/13_tc/endo_nov25/tc_schematic.png new file mode 100644 index 0000000000000000000000000000000000000000..2252895c029f5495248545c2a6ba6323cde97ed3 GIT binary patch literal 21370 zcmbrm1yq!6_dW`OfXEOcNJvX4Au)8PARP+QNDd+0-3=l=w7^gb2!en#(#;SO(j9_y zb8g<(@B9DGIqR%btmPW#nP;B6_rCVEuRY-^N-rSTWY{PuC=fYWDK!+7J9H>0s0vtj zz?Gys%!l9wBps_$>g^i zq(2T*M?m~`Cj=RHum3ZpxJB~zEoZL1T-!K!{q1!J8;DxA&yVltdCT|M&O*eJnPCu^Gkq=xFs<`#4Vq>-+z<5p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?d00001 diff --git a/modules/13_tc/endo_nov25/tcc_regression.png b/modules/13_tc/endo_nov25/tcc_regression.png new file mode 100644 index 0000000000000000000000000000000000000000..67a1c0abcfaede215e949b2d0fd4d660a4a20c64 GIT binary patch literal 27968 zcmce;bx>SE^ESGK1d?DO1PdAn5ZqY^79e==0Kp-+yJgX!!JXg)cXto&u8RfNWs$(* zd}s6i-uvCUU)BBV*4?VD-8wsGPESuy&(lx$><>kGNv!9upMyXkENQ8a${^4q;EmGy z^bv4HNfPG>_(1zAEBO)l1YTES&ECMrGdn2_M-T|R8~H|wXT&A}fha-JA4NX9r5>g| z^Y}co@K8?4pgCP6r^g6QhPL3}OtyVtuzoH6%KeHuPwH1chWM{cbL8Dq9qP zkjSG)z7@}+iC&6INm0IyiVF9C8x?RED;R6U;dt+OlqPLrb5w#DT}m2&-y}skBsMz6 z3@^b`9n*LCFi`-Jny|u_u#h6AqSv5cFyQj8#0LoSN8E985Xi^o@qd1rD6Mr} z>kP04ei4YEmW=q>bmnRaJKvo!Txzg?cnkvl(O|<=(bQyc+kwwQ&rVMnSXmRB@qy-V zw}tOFgpXF+S>2vO{VqVDjwzoDe_!MmYTy5lzU<9HEzQjfIev4F37`Ul@Yw<61v~Fg z=YQ&88&2bQ-L# zXm*Wom_JhCf1-n@b$iKgO8b~XO5-nrqFceB?#-$@z9Wi4!M>d-3+8DGIESoyL@w_@?-c*ORW2R+Ceh8s6EHE{`?{ zg3AmCG=?6X+W7%O?$6-NPZlRN_mrY6EOm%YmSrwJPz(ZcLQO4f!B%AF>3elecj zmpQz||J@+af3pUIY$h(ydyuWzOp(0?{X_kSuQ2Y_@FfBF%)LKy^^JueAn771+bir) z#Bz`U;;|v$OaL7nyY4~5nt~aQkBx5*w77|F&SS8%BZ{;V%jM;Gx;vNVri~vBbSRqu zYrO4%HfX#4c}A40QB7Swq1H^l1D(~&F01yH`T3VN&;# zSI7Ruk;lk;EB>2geF+VtTaI0O!O7@?G4=Is`_|>?ig)ejg4TU#*!U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She zcF^_L5(p9TYIr`bLu3(NF5@DzvS(^69zE-m0`YhvI7 z>Ou@Wyy1i(B!SK z7h9Hu4K^<}H!H+eEWod9AK*er0ir9*z*1noE$UZz%4Ie~v8B&QH>^wRvbVbrda`Bxg|5P^G6$(0tTmxs;fnOj-JEn*?#&rZmKM zm()kBmO)DGLR#$kcVX~S)qN@bcW*M|m%T~7;Vg2jovGV9P zb>?s%NNvupHj;0N>OC3~G>MpVE2rbh#B=(usr3K+Dn66mXJnNksWA5eQg19}1r7N! IS@VGZ29}hrr~m)} literal 0 HcmV?d00001 diff --git a/modules/13_tc/module.gms b/modules/13_tc/module.gms index 8b95777c0f..11275fdd90 100644 --- a/modules/13_tc/module.gms +++ b/modules/13_tc/module.gms @@ -23,5 +23,6 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%tc%" == "endo_jan22" $include "./modules/13_tc/endo_jan22/realization.gms" +$Ifi "%tc%" == "endo_nov25" $include "./modules/13_tc/endo_nov25/realization.gms" $Ifi "%tc%" == "exo" $include "./modules/13_tc/exo/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms new file mode 100644 index 0000000000..ca917b393e --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -0,0 +1,46 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) + i14_yields_combined(t_all,j,yldtype,kcr,w) Blah blah blah (blah) + i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) + p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) + p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) + pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) + p14_yields_gsadapt_ratio_cummulative(t,i) Cummulative effect of growing period adaption from the first to the current timestep (1) + p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) + p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) + i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) + i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical referende year (tDM per ha per yr) + i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) + i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) + pm_timber_yield(t,j,ac,land_timber) Forest growing stock (tDM per ha per yr) + pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) + i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) + i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) + i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) + i14_modeled_yields_hist2(i,yldtype,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) + ; + +positive variables + vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) +; + +equations + q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) + q14_yield_past(j,w) Pasture yields (tDM per ha per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) + oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) + oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms new file mode 100644 index 0000000000..218156e858 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -0,0 +1,39 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @equations + +***CROP YIELD CALCULATIONS********************************************** + +*' Technological change can increase the initial calibrated yields by: + +q14_yield_crop(j2,kcr,w) .. + vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * + sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); + +*' For the current time step of the optimization, cellular yields of irrigated +*' and rainfed crops are calculated by multiplying calibrated input yields from +*' LPJmL with the intensification rate relative to the initial time step 1995. + +***PASTURE YIELD CALCULATIONS******************************************* + +*' In the case of pasture yields, technological change cannot be fully +*' translated into yield increases, to address that, an exogenous pasture management +*' factor `pm_past_mngmnt_factor` is used to scale pasture yields based on the +*' number of cattle reared to fulfill the domestic demand for ruminant livestock +*' products in module 70. +*' +*' Additionally, the parameter `s14_yld_past_switch` can be used to capture a +*' certain magnitude of spillovers of the yield increase due to technological +*' change from the time step before. It can range from 0 (no spillover) to 1 +*' (full spillover). + +q14_yield_past(j2,w) .. + vm_yld(j2,"pasture",w) =e= + sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) + * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) + * (1 + s14_yld_past_switch*(sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(h2, "crop")/fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms new file mode 100644 index 0000000000..42314eae2a --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -0,0 +1,111 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +$setglobal c14_yields_scenario cc +* options: cc (climate change) +* nocc (no climate change) +* nocc_hist (no climate change after year defined by sm_fix_cc) + +scalars + s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / + s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / + s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / + s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / + s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / + s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 / + s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ + s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / + s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / +; + + +******* Calibration factor +$onEmpty +table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) +$ondelim +$if exist "./modules/14_yields/input/f14_yld_calib.csv" $include "./modules/14_yields/input/f14_yld_calib.csv" +$offdelim +; +$offEmpty + +* LPJmL2MAGPIE In nocc runs, should one replace the i14_yields variable with the constgsadapt variant? +* Now that constgsadapt is the "default" this will actually be a different fix, I guess on the tau side? +* Also, some renaming will need to occur here. The gsadapt constgsadapt file names and variables are inconsistent. + +table f14_yields_constgsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields_constgsadapt.cs3" +$offdelim +; + +* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used +$if "%c14_yields_scenario%" == "nocc" f14_yields_constgsadapt(t_all,j,kve,w) = f14_yields_constgsadapt("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields_constgsadapt,"j,kve,w"); + +table f14_yields(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields.cs3" +$offdelim +; + +* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used +$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields,"j,kve,w"); + +table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" +$offdelim; + + +table f14_fao_yields_hist(t_all,i,kcr) FAO yields per region (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/gsadapt_nov25/input/f14_region_yields.cs3" +$offdelim +; +m_fillmissingyears(f14_fao_yields_hist,"i,kcr"); + +parameter f14_ir2rf_ratio(i) AQUASTAT ratio of irrigated to rainfed yields per region (1) +/ +$ondelim +$include "./modules/14_yields/gsadapt_nov25/input/f14_ir2rf_ratio.cs4" +$offdelim +/ +; + +table f14_ipcc_bce(clcl,forest_type) IPCC Biomass Conversion and Expansion factors (1) +$ondelim +$include "./modules/14_yields/input/f14_ipcc_bce.cs3" +$offdelim +; + +parameter f14_aboveground_fraction(land_timber) Root to shoot ratio (1) +/ +$ondelim +$include "./modules/14_yields/input/f14_aboveground_fraction.csv" +$offdelim +/ +; + +$onEmpty +table f14_yld_ncp_report(t_all,j,ncp_type14) Share of land with intact natures contributions to people (NCP) (1) +$ondelim +$if exist "./modules/14_yields/input/f14_yld_ncp_report.cs3" $include "./modules/14_yields/input/f14_yld_ncp_report.cs3" +$offdelim +; +$offEmpty + +parameter f14_kcr_pollinator_dependence(kcr) Share of total yield dependent on biotic pollination (1) +/ +$ondelim +$include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" +$offdelim +/ +; diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files new file mode 100644 index 0000000000..cf2be7a6dc --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/input/files @@ -0,0 +1,5 @@ +* list of files that are required here +f14_region_yields.cs3 +f14_ir2rf_ratio.cs4 +f14_ipcc_bce.cs3 +f14_aboveground_fraction.csv diff --git a/modules/14_yields/gsadapt_nov25/nl_fix.gms b/modules/14_yields/gsadapt_nov25/nl_fix.gms new file mode 100644 index 0000000000..07339b646d --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/nl_fix.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_fix ### + +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); +vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/nl_release.gms b/modules/14_yields/gsadapt_nov25/nl_release.gms new file mode 100644 index 0000000000..f3261b8f87 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/nl_release.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_release ### + +vm_yld.lo(j,kve,w) = 0; +vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/gsadapt_nov25/postsolve.gms b/modules/14_yields/gsadapt_nov25/postsolve.gms new file mode 100644 index 0000000000..398d8cf124 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/postsolve.gms @@ -0,0 +1,24 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); + oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); + ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); + oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); + ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); + oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); + ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); + oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms new file mode 100644 index 0000000000..091fe144f7 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -0,0 +1,206 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** +p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / + sum(cell(i,j),pm_land_start(j,"past")) ); + +p14_pyield_corr(t,i) = (f14_pyld_hist(t,i)/p14_pyield_LPJ_reg(t,i))$(sum(sameas(t_past,t),1) = 1) + + sum(t_past,(f14_pyld_hist(t_past,i)/(p14_pyield_LPJ_reg(t_past,i)+0.000001))$(ord(t_past)=card(t_past)))$(sum(sameas(t_past,t),1) <> 1); +i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); + + +***YIELD MANAGEMENT CALIBRATION************************************************************ + + +*' @code + +*' The following equations calibrate the cellular yield patterns (`f14_yields`) to match +*' FAO historical yields (`f14_fao_yields_hist`) by calculating a calibration term called +*' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical +*' yields reported by FAO (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) +*' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models +*' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative +*' calibration factor that depends only on the initial conditions of the starting year. +*' +*' However, when FAO yields are significantly higher than given by the cellular yield inputs +*' (underestimated baseline), the relative calibration terms can lead to unrealistically large +*' yields in the case of future yield increases within the cellular yield patterns. +*' +*' To address this issue, the factor `i14_lambda_yields` determines the degree +*' to which the baseline (FAO) is under- or overestimated and therefore controls +*' whether the calibration factor is applied as an absolute or relative change. +*' For overestimated FAO yields, `i14_lambda_yields` is 1, which is equivalent +*' to an entirely relative calibration. For underestimated yields, `i14_lambda_yields` +*' is calculated as the squared root of the ratio between LPJmL yields and FAO historical +*' yields, and as `i14_lambda_yields` approaches 0, it reduces the applied relative change +*' resulting in a mean change increasingly similar to an additive term (@Heinke.2013). + +*' This concept is referred to as limited calibration, as it limits the calibration +*' to an additive term in case of a strongly underestimated baseline. The scalar +*' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). + +*' To be able to assess the impacts of growing period adaption, both type of yields +*' (with and without adapted growing perdiods and varieties) have to be calibrated. +*' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate +*' both types individually as even so the growing seasons are held constant from 1995 +*' onwards, due to long term averaging the yields already differ in 1995. + +i14_yields_combined(t,j,"constgsadapt",kcr,w) = f14_yields_constgsadapt(t,j,kcr,w); +i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); + +i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); + +*' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields +*' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where +*' a region has no crop area reported for a given crop type, the total crop area is +*' used to calculate a proxy yield for the calibration, given by the following equation: + +i14_modeled_yields_hist(t_past,i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,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 AND + sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) > 0.00001) + + (sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined(t_past,j,yldtype,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 OR + sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); + +*' The factor `i14_lambda_yields` is calculated for the initial time step depending +*' on the setting `s14_limit_calib` and is then held constant for all other time steps. +*' The regional FAO yield and regional yield of the crop model input of the initial +*' time step is kept constant in the two parameters `i14_fao_yields_hist` and +*' `i14_modeled_yields_hist`: + +loop(t, + if(sum(sameas(t,"y1995"),1)=1, + + if ((s14_limit_calib = 0), + i14_lambda_yields(t,i,yldtype,knbe14) = 1; + + Elseif (s14_limit_calib =1 ), + i14_lambda_yields(t,i,yldtype,knbe14) = + 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,yldtype,knbe14)) + + sqrt(i14_modeled_yields_hist(t,i,yldtype,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ + (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,yldtype,knbe14)); + ); + + i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); + + Else + i14_modeled_yields_hist(t,i,yldtype,knbe14) = i14_modeled_yields_hist(t-1,i,yldtype,knbe14); + i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); + i14_lambda_yields(t,i,yldtype,knbe14) = i14_lambda_yields(t-1,i,yldtype,knbe14); + ); +); + +*' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending +*' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` +*' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: + +***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* +i14_yields_calib_combined(t,j,yldtype,"begr",w) = i14_yields_combined(t,j,yldtype,"begr",w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +i14_yields_calib_combined(t,j,yldtype,"betr",w) = i14_yields_combined(t,j,yldtype,"betr",w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +******************************************************************************************* + +i14_managementcalib(t,j,yldtype,knbe14,w) = + 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,yldtype,knbe14)) / + i14_yields_combined(t,j,yldtype,knbe14,w) * + (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,knbe14))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,yldtype,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); + +i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,yldtype,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); + +*' Note that the calculation is split into two parts for better readability. + +*' Irrigated yields are calibrated to meet the country-level +*' ratio between irrigated and rainfed yields reported by Aquastat. +*' This can be de-activated with the switch `s14_calib_ir2rf`. +if ((s14_calib_ir2rf = 1), + +* Weighted yields + i14_calib_yields_hist(i,yldtype,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / + sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); + +* Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio + i14_calib_yields_ratio(i,yldtype) = i14_calib_yields_hist(i,yldtype,"irrigated") / i14_calib_yields_hist(i,yldtype,"rainfed"); + i14_target_ratio(i,yldtype) = max(i14_calib_yields_ratio(i,yldtype), f14_ir2rf_ratio(i)); + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); + +* Calibrate newly calibrated yields to FAO yields + i14_modeled_yields_hist2(i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) > 0.00001) + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * f14_yields("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_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); + + + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / + i14_modeled_yields_hist2(i,yldtype,knbe14)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,w); +); + +* Set yields to gsadapt values (pasture yields are not effected by growing period adaption) + +if(s14_use_gsadapt = 1, + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); + else + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"constgsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"constgsadapt",kcr,w); +); + +*' @stop + + +***YIELD CALIBRATION*********************************************************************** + +*' @code +*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' +*' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional +*' yields are outlier corrected, historical production and croparea can in some cases +*' be better represented with this additional correction: + +* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) +* or missing input file +if(s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, + f14_yld_calib(i,ltype14) = 1; +); + + +i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) + * sum(cell(i,j),f14_yld_calib(i,"crop")); +i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) + * sum(cell(i,j),f14_yld_calib(i,"past")); + +*' @stop + +*' @code +*' Land degradation can negatively affect yields. Soil loss for example can +*' notably affect land productivity. Similarly, the yield of pollinator-dependent crops +*' is reduced when there is a lack of pollinators. To account for the impacts of degradation, +*' calibrated yields are multiplied by the share of land with intact NCP in each cell and specific +*' yield reduction coefficients that represent yield loss due to soil erosion and pollination +*' deficiency on non-intact land. + +* set default values in case of missing input file. +if(sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, + f14_yld_ncp_report(t,j,ncp_type14) = 1; +); + +if ((s14_degradation = 1), + i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - s14_yld_reduction_soil_loss) + + i14_yields_calib(t,j,kcr,w) * s14_yld_reduction_soil_loss * f14_yld_ncp_report(t,j,"soil_intact"); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - f14_kcr_pollinator_dependence(kcr)) + + i14_yields_calib(t,j,kcr,w) * f14_kcr_pollinator_dependence(kcr) * f14_yld_ncp_report(t,j,"poll_suff"); +); + +*' @stop diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms new file mode 100644 index 0000000000..9d130cdd4c --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -0,0 +1,95 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*** EOF presolve.gms *** + +* calculate carbon density + +*** YIELDS + +*` `pm_carbon_density_plantation_ac` for vegetation Carbon is above- and belowground +*' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon +*' fraction of `s14_carbon_fraction` in tC/tDM. For assessing wood harvesting +*' we need only aboveground biomass information, therefore we multiply with +*' aboveground `f14_aboveground_fraction`. Additionally, we divide aboveground +*' tree biomass by biomass conversion and expansion (BCE) factor to get stem +*' biomass in tDM/ha. + +*` @code + +pm_timber_yield(t,j,ac,"forestry") = + ( + pm_carbon_density_plantation_ac(t,j,ac,"vegc") + / s14_carbon_fraction + * f14_aboveground_fraction("forestry") + / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"plantations")) + ) + ; + +pm_timber_yield(t,j,ac,"primforest") = + ( + fm_carbon_density(t,j,"primforest","vegc") + / s14_carbon_fraction + * f14_aboveground_fraction("primforest") + / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + ) + ; + +pm_timber_yield(t,j,ac,"secdforest") = + ( + pm_carbon_density_secdforest_ac(t,j,ac,"vegc") + / s14_carbon_fraction + * f14_aboveground_fraction("secdforest") + / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + ) + ; + +pm_timber_yield(t,j,ac,"other") = + ( + pm_carbon_density_other_ac(t,j,ac,"vegc") + / s14_carbon_fraction + * f14_aboveground_fraction("other") + / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + ) + ; + +*` @stop + +** Hard constraint to always have a positive number in pm_timber_yield +pm_timber_yield(t,j,ac,land_timber) = pm_timber_yield(t,j,ac,land_timber)$(pm_timber_yield(t,j,ac,land_timber) > 0) + 0.0001$(pm_timber_yield(t,j,ac,land_timber) = 0); +** Put yields to 0 where they dont exceed a minimum yield for harvest +pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_minimum_wood_yield) = 0; + +* Calculate growing period adaption factor based on previous croppping pattern +if (ord(t) = 1, + + p14_yields_gsadapt_ratio(t,i) = 1; + p14_yields_gsadapt_ratio_previous(t,i) = 1; + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cummulative(t,i) = 1; + +else + + p14_yields_gsadapt_ratio(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + + p14_yields_gsadapt_ratio_previous(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + + pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); + p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cummulative(t-1,i); + +); + +if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cummulative(t,i) = 1; +); + +i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w)/sum(cell(i,j), p14_yields_gsadapt_ratio_cummulative(t,i)); diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms new file mode 100644 index 0000000000..a4a29c5504 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/realization.gms @@ -0,0 +1,39 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The managementcalib_aug19 realization reads in the LPJmL data and +*' performs a number of calibrations. First, a bioenergy yield correction is performed. +*' As there is currently no robust information on bioenergy yields available in +*' [@FAOSTAT], it is assumed that the LPJmL yields for bioenergy correspond to the +*' yields achieved under the highest currently observed value of the $\tau$ factor +*' representing agricultural land-use intensity. Secondly, pasture yields are calculated +*' based on pasture demand to account for in- and extensification of managed grasslands. +*' Thirdly, irrigated yields are scaled to meet the irrigated-to-rainfed yield +*' ratio as provided by AQUASTAT [@fao_aquastat_2016]. +*' Finally, crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the +*' initial time step. An additional feature of this realization is to allow crop yields +*' technological change from the precedent times step to spillover to pasture areas. This +*' realization also calculates the growth stocks in commercial plantations and natural +*' vegetation using LPJmL Carbon stocks. + +*' @limitations The exogenous implementation of pasture intensification cannot +*' capture feedbacks between land scarcity and efforts to improve pasture +*' management. Moreover, the magnitude of spillover effects from technological change +*' in the crop sector towards improvements in pasture management is very uncertain. + + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_nov25/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_nov25/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_nov25/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/14_yields/gsadapt_nov25/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/14_yields/gsadapt_nov25/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/14_yields/gsadapt_nov25/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/gsadapt_nov25/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/gsadapt_nov25/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/gsadapt_nov25/nl_release.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/gsadapt_nov25/sets.gms b/modules/14_yields/gsadapt_nov25/sets.gms new file mode 100644 index 0000000000..d40bc8a900 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/sets.gms @@ -0,0 +1,40 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +sets + ltype14 calibration land types + / crop, past / + + k(kall) Primary products + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, pasture, cottn_pro, begr, betr, livst_rum, livst_pig, + livst_chick, livst_egg, livst_milk, fish, wood, woodfuel/ + + kve(k) Land-use activities + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, pasture, cottn_pro, begr, betr / + + kcr(kve) Cropping activities + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, cottn_pro, begr, betr / + + knbe14(kcr) Cropping activities excluding bioenergy plants + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, cottn_pro / + + ncp_type14 natures contributions to people (NCP) relevant for agricultural yields + / soil_intact, poll_suff / + + yldtype Yield LPJmL run type with or without growing season adaptation + / gsadapt, constgsadapt / + +; + diff --git a/modules/14_yields/input/files b/modules/14_yields/input/files index 2d0893b571..cffb8a3e30 100644 --- a/modules/14_yields/input/files +++ b/modules/14_yields/input/files @@ -1,9 +1,9 @@ * list of files that are required here lpj_yields.cs3 -lpj_yields_nogsadapt.cs3 +lpj_yields_constgsadapt.cs3 f14_yld_calib.csv lpj_yields_0.5.mz -lpj_yields_nogsadapt_0.5.mz +lpj_yields_constgsadapt_0.5.mz f14_pasture_yields_hist.csv f14_ipcc_bce.cs3 f14_aboveground_fraction.csv diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms index 4fa8bfeab9..7af3eb8597 100644 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ b/modules/14_yields/managementcalib_aug19/declarations.gms @@ -6,26 +6,20 @@ *** | Contact: magpie@pik-potsdam.de parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) - i14_yields_combined(t_all,j,yldtype,kcr,w) Blah blah blah (blah) - i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and nogsadapt yields (tDM per ha per yr) - p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) - p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) - pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) - p14_yields_gsadapt_ratio_cummulative(t,i) Cummulative effect of growing period adaption from the first to the current timestep (1) + i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields (excluding technological change) (tDM per ha per yr) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) - i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_modeled_yields_hist(t_all,i,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical referende year (tDM per ha per yr) - i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) - i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) + i14_lambda_yields(t,i,kcr) Scaling factor for non-linear management calibration (1) + i14_managementcalib(t,j,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) pm_timber_yield(t,j,ac,land_timber) Forest growing stock (tDM per ha per yr) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) - i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) - i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) - i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) - i14_modeled_yields_hist2(i,yldtype,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_calib_yields_hist(i,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) + i14_calib_yields_ratio(i) Irrigated to rainfed yield ratio for calibrated yields (1) + i14_target_ratio(i) Target irrigated to rainfed ratio as upper bound (1) + i14_modeled_yields_hist2(i,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) ; positive variables diff --git a/modules/14_yields/managementcalib_aug19/equations.gms b/modules/14_yields/managementcalib_aug19/equations.gms index 218156e858..908a52fbbc 100644 --- a/modules/14_yields/managementcalib_aug19/equations.gms +++ b/modules/14_yields/managementcalib_aug19/equations.gms @@ -12,7 +12,7 @@ *' Technological change can increase the initial calibrated yields by: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * + vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms index 76fabacea1..9e5f7733f8 100644 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ b/modules/14_yields/managementcalib_aug19/input.gms @@ -10,17 +10,23 @@ $setglobal c14_yields_scenario cc * nocc (no climate change) * nocc_hist (no climate change after year defined by sm_fix_cc) +scalar s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 /; + +scalar s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 /; + +scalar s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 /; + +scalar s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 /; + +scalar s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 /; + scalars - s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / - s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / - s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / - s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / - s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / - s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 / - s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ - s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 1 / - s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 1 / +; + +scalars + s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ ; @@ -33,27 +39,11 @@ $offdelim ; $offEmpty -* LPJmL2MAGPIE In nocc runs, should one replace the i14_yields variable with the nogsadapt variant? -* Now that nogsadapt is the "default" this will actually be a different fix, I guess on the tau side? -* Also, some renaming will need to occur here. The gsadapt nogsadapt file names and variables are inconsistent. - -table f14_yields_nogsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields_nogsadapt.cs3" -$offdelim -; - -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields_nogsadapt(t_all,j,kve,w) = f14_yields_nogsadapt("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_nogsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_nogsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields_nogsadapt,"j,kve,w"); - -table f14_yields(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) +table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) $ondelim $include "./modules/14_yields/input/lpj_yields.cs3" $offdelim ; - * set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used $if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); $if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); diff --git a/modules/14_yields/managementcalib_aug19/not_used.txt b/modules/14_yields/managementcalib_aug19/not_used.txt new file mode 100644 index 0000000000..033cb7f96a --- /dev/null +++ b/modules/14_yields/managementcalib_aug19/not_used.txt @@ -0,0 +1,3 @@ +name,type,reason +pm_yields_gsadapt_ratio_increment, interface, not needed +pcm_area, interface, not needed diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index 961b71e70b..c889c3a1a8 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -5,13 +5,19 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +i14_yields_calib(t,j,kve,w) = f14_yields(t,j,kve,w); + +***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* +i14_yields_calib(t,j,"begr",w) = f14_yields(t,j,"begr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +i14_yields_calib(t,j,"betr",w) = f14_yields(t,j,"betr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); + ***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / +p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),i14_yields_calib(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / sum(cell(i,j),pm_land_start(j,"past")) ); p14_pyield_corr(t,i) = (f14_pyld_hist(t,i)/p14_pyield_LPJ_reg(t,i))$(sum(sameas(t_past,t),1) = 1) + sum(t_past,(f14_pyld_hist(t_past,i)/(p14_pyield_LPJ_reg(t_past,i)+0.000001))$(ord(t_past)=card(t_past)))$(sum(sameas(t_past,t),1) <> 1); -i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); +i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); ***YIELD MANAGEMENT CALIBRATION************************************************************ @@ -44,15 +50,6 @@ i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j), *' to an additive term in case of a strongly underestimated baseline. The scalar *' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). -*' To be able to assess the impacts of growing period adaption, both type of yields -*' (with and without adapted growing perdiods and varieties) have to be calibrated. -*' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate -*' both types individually as even so the growing seasons are held constant from 1995 -*' onwards, due to long term averaging the yields already differ in 1995. - -i14_yields_combined(t,j,"nogsadapt",kcr,w) = f14_yields_nogsadapt(t,j,kcr,w); -i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); - i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); *' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields @@ -60,13 +57,14 @@ i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); *' a region has no crop area reported for a given crop type, the total crop area is *' used to calculate a proxy yield for the calibration, given by the following equation: -i14_modeled_yields_hist(t_past,i,yldtype,knbe14) - = (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) / +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 AND - sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) > 0.00001) - + (sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) / + 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 OR - sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); + 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 *' on the setting `s14_limit_calib` and is then held constant for all other time steps. @@ -78,42 +76,37 @@ loop(t, if(sum(sameas(t,"y1995"),1)=1, if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,yldtype,knbe14) = 1; + i14_lambda_yields(t,i,knbe14) = 1; Elseif (s14_limit_calib =1 ), - i14_lambda_yields(t,i,yldtype,knbe14) = - 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,yldtype,knbe14)) - + sqrt(i14_modeled_yields_hist(t,i,yldtype,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ - (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,yldtype,knbe14)); + i14_lambda_yields(t,i,knbe14) = + 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,knbe14)) + + sqrt(i14_modeled_yields_hist(t,i,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ + (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,knbe14)); ); i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); Else - i14_modeled_yields_hist(t,i,yldtype,knbe14) = i14_modeled_yields_hist(t-1,i,yldtype,knbe14); - i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); - i14_lambda_yields(t,i,yldtype,knbe14) = i14_lambda_yields(t-1,i,yldtype,knbe14); + i14_modeled_yields_hist(t,i,knbe14) = i14_modeled_yields_hist(t-1,i,knbe14); + i14_FAO_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); + i14_lambda_yields(t,i,knbe14) = i14_lambda_yields(t-1,i,knbe14); ); ); -*' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending +*' The calibrated cellular yield `i14_yields_calib` is calculated for each time step depending *' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` *' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: -***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* -i14_yields_calib_combined(t,j,yldtype,"begr",w) = i14_yields_combined(t,j,yldtype,"begr",w) * - sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -i14_yields_calib_combined(t,j,yldtype,"betr",w) = i14_yields_combined(t,j,yldtype,"betr",w) * - sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -******************************************************************************************* +i14_managementcalib(t,j,knbe14,w) = + 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / + f14_yields(t,j,knbe14,w) * + (f14_yields(t,j,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(f14_yields(t,j,knbe14,w)>0); -i14_managementcalib(t,j,yldtype,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,yldtype,knbe14)) / - i14_yields_combined(t,j,yldtype,knbe14,w) * - (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,yldtype,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); -i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,yldtype,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); +i14_yields_calib(t,j,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * f14_yields(t,j,knbe14,w); +pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); *' Note that the calculation is split into two parts for better readability. @@ -123,39 +116,30 @@ i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,yldtyp if ((s14_calib_ir2rf = 1), * Weighted yields - i14_calib_yields_hist(i,yldtype,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); + i14_calib_yields_hist(i,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib("y1995",j,knbe14,w)) / + sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); * Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i,yldtype) = i14_calib_yields_hist(i,yldtype,"irrigated") / i14_calib_yields_hist(i,yldtype,"rainfed"); - i14_target_ratio(i,yldtype) = max(i14_calib_yields_ratio(i,yldtype), f14_ir2rf_ratio(i)); - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); + i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); + i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); + i14_yields_calib(t,j,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * + i14_yields_calib(t,j,knbe14,"irrigated"); * Calibrate newly calibrated yields to FAO yields - i14_modeled_yields_hist2(i,yldtype,knbe14) - = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / + 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_combined("y1995",j,yldtype,knbe14,w)) > 0.00001) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * f14_yields("y1995",j,knbe14,w)) / + 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_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); - - - i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,yldtype,knbe14)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,w); -); + sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib("y1995",j,knbe14,w)) <= 0.00001); -* Set yields to gsadapt values (pasture yields are not effected by growing period adaption) + i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / + i14_modeled_yields_hist2(i,knbe14)) * + i14_yields_calib(t,j,knbe14,w); -if(s14_use_gsadapt = 1, - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); - else - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"nogsadapt",knbe14,w); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"nogsadapt",kcr,w); + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); ); *' @stop diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms index e49d7977cd..9b95c9e4ca 100644 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ b/modules/14_yields/managementcalib_aug19/presolve.gms @@ -63,33 +63,3 @@ pm_timber_yield(t,j,ac,"other") = pm_timber_yield(t,j,ac,land_timber) = pm_timber_yield(t,j,ac,land_timber)$(pm_timber_yield(t,j,ac,land_timber) > 0) + 0.0001$(pm_timber_yield(t,j,ac,land_timber) = 0); ** Put yields to 0 where they dont exceed a minimum yield for harvest pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_minimum_wood_yield) = 0; - -* Calculate growing period adaption factor based on previous croppping pattern -if (ord(t) = 1, - - p14_yields_gsadapt_ratio(t,i) = 1; - p14_yields_gsadapt_ratio_previous(t,i) = 1; - pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cummulative(t,i) = 1; - -else - - p14_yields_gsadapt_ratio(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); - - p14_yields_gsadapt_ratio_previous(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"nogsadapt",kcr,w) * pcm_area(j,w,kcr)); - - pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); - p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cummulative(t-1,i); - -); - -if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, - pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cummulative(t,i) = 1; -); - -i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w)/sum(cell(i,j), p14_yields_gsadapt_ratio_cummulative(t,i)); diff --git a/modules/14_yields/managementcalib_aug19/sets.gms b/modules/14_yields/managementcalib_aug19/sets.gms index 55ee9be34d..894b3ac2f9 100644 --- a/modules/14_yields/managementcalib_aug19/sets.gms +++ b/modules/14_yields/managementcalib_aug19/sets.gms @@ -33,8 +33,5 @@ sets ncp_type14 natures contributions to people (NCP) relevant for agricultural yields / soil_intact, poll_suff / - yldtype Yield LPJmL run type with or without growing season adaptation - / gsadapt, nogsadapt / - ; diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index 059e893eba..4a0b5bd989 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -28,5 +28,6 @@ *###################### R SECTION START (MODULETYPES) ########################## +$Ifi "%yields%" == "gsadapt_nov25" $include "./modules/14_yields/gsadapt_nov25/realization.gms" $Ifi "%yields%" == "managementcalib_aug19" $include "./modules/14_yields/managementcalib_aug19/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From c27336c74ffe65d1eb751bd164ef9032ef5746be Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Thu, 13 Nov 2025 15:55:02 +0100 Subject: [PATCH 07/42] added start script for testing --- scripts/start/projects/test_lpjml2magpie.R | 191 +++++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 scripts/start/projects/test_lpjml2magpie.R diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R new file mode 100644 index 0000000000..b4da0b4d06 --- /dev/null +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -0,0 +1,191 @@ +# | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# ---------------------------------------------------------- +# description: Test new lpjml version in magpie +# ---------------------------------------------------------- + +###################################### +#### Script to start a MAgPIE run #### +###################################### +# Load start_run(cfg) function which is needed to start MAgPIE runs +source("scripts/start_functions.R") + +# # Current MAgPIE default with same preprocessing status as the lpjml ones to be compared with +# source("config/default.cfg") +# cfg$title <- "Default_mngtcalib" +# # input data +# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", +# cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", +# validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", +# additional = "additional_data_rev4.63.tgz", +# calibration = "calibration_H12_FAO_18Sep25.tgz") +# # old yield realization +# cfg$gms$yields <- "managementcalib_aug19" +# cfg$gms$tc <- "endo_jan22" +# # start MAgPIE run +# start_run(cfg, codeCheck = TRUE) + +# # LPJmL Version runs_lpjml5.9.16-m2 +# source("config/default.cfg") +# cfg$title <- "LPJmL_5.9.16-m2_gsadapt" +# # input data +# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", +# cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", +# validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", +# additional = "additional_data_rev4.63.tgz", +# calibration = "calibration_H12_FAO_18Sep25.tgz") +# # new yield realization +# cfg$gms$yields <- "gsadapt_nov25" +# cfg$gms$tc <- "endo_nov25" +# # start MAgPIE run +# start_run(cfg, codeCheck = TRUE) + +# # LPJmL Version runs_lpjml5.10.0-m1 +# source("config/default.cfg") +# cfg$title <- "LPJmL_5.10.0-m1_gsadapt" +# # input data +# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", +# cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", +# validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", +# additional = "additional_data_rev4.63.tgz", +# calibration = "calibration_H12_FAO_18Sep25.tgz") +# # new yield realization +# cfg$gms$yields <- "gsadapt_nov25" +# cfg$gms$tc <- "endo_nov25" +# # start MAgPIE run +# start_run(cfg, codeCheck = TRUE) + + +# # LPJmL Version runs_lpjml5.9.16-m2 +# source("config/default.cfg") +# cfg$title <- "LPJmL_5.9.16-m2_NOgsadapt" +# # input data +# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", +# cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", +# validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", +# additional = "additional_data_rev4.63.tgz", +# calibration = "calibration_H12_FAO_18Sep25.tgz") +# # new yield realization +# cfg$gms$yields <- "gsadapt_nov25" +# cfg$gms$tc <- "endo_nov25" +# # deactivate gsadapt +# cfg$gms$s14_use_gsadapt <- 0 +# cfg$gms$s14_gsadapt2tau <- 0 +# # start MAgPIE run +# start_run(cfg, codeCheck = TRUE) + +# # LPJmL Version runs_lpjml5.10.0-m1 +# source("config/default.cfg") +# cfg$title <- "LPJmL_5.10.0-m1_NOgsadapt" +# # input data +# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", +# cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", +# validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", +# additional = "additional_data_rev4.63.tgz", +# calibration = "calibration_H12_FAO_18Sep25.tgz") +# # new yield realization +# cfg$gms$yields <- "gsadapt_nov25" +# cfg$gms$tc <- "endo_nov25" +# # deactivate gsadapt +# cfg$gms$s14_use_gsadapt <- 0 +# cfg$gms$s14_gsadapt2tau <- 0 +# # start MAgPIE run +# start_run(cfg, codeCheck = TRUE) + + +### Runs without irrigated2rainfed correction ### +# Current MAgPIE default with same preprocessing status as the lpjml ones to be compared with +source("config/default.cfg") +cfg$title <- "Default_mngtcalib_ir2rfOff" +# input data +cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", + cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") +# old yield realization +cfg$gms$yields <- "managementcalib_aug19" +cfg$gms$tc <- "endo_jan22" +# deactivate irrigated2rainfed correction +cfg$gms$s14_calib_ir2rf <- 0 +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +# LPJmL Version runs_lpjml5.9.16-m2 +source("config/default.cfg") +cfg$title <- "LPJmL_5.9.16-m2_gsadapt_ir2rfOff" +# input data +cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", + validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") +# new yield realization +cfg$gms$yields <- "gsadapt_nov25" +cfg$gms$tc <- "endo_nov25" +# deactivate irrigated2rainfed correction +cfg$gms$s14_calib_ir2rf <- 0 +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +# LPJmL Version runs_lpjml5.10.0-m1 +source("config/default.cfg") +cfg$title <- "LPJmL_5.10.0-m1_gsadapt_ir2rfOff" +# input data +cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", + validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") +# new yield realization +cfg$gms$yields <- "gsadapt_nov25" +cfg$gms$tc <- "endo_nov25" +# deactivate irrigated2rainfed correction +cfg$gms$s14_calib_ir2rf <- 0 +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +# LPJmL Version runs_lpjml5.9.16-m2 +source("config/default.cfg") +cfg$title <- "LPJmL_5.9.16-m2_NOgsadapt_ir2rfOff" +# input data +cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", + validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") +# new yield realization +cfg$gms$yields <- "gsadapt_nov25" +cfg$gms$tc <- "endo_nov25" +# deactivate gsadapt +cfg$gms$s14_use_gsadapt <- 0 +cfg$gms$s14_gsadapt2tau <- 0 +# deactivate irrigated2rainfed correction +cfg$gms$s14_calib_ir2rf <- 0 +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +# LPJmL Version runs_lpjml5.10.0-m1 +source("config/default.cfg") +cfg$title <- "LPJmL_5.10.0-m1_NOgsadapt_ir2rfOff" +# input data +cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", + validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") +# new yield realization +cfg$gms$yields <- "gsadapt_nov25" +cfg$gms$tc <- "endo_nov25" +# deactivate gsadapt +cfg$gms$s14_use_gsadapt <- 0 +cfg$gms$s14_gsadapt2tau <- 0 +# deactivate irrigated2rainfed correction +cfg$gms$s14_calib_ir2rf <- 0 +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) From 1b89ab3462eea1d77493ad40622af02c19c4a766 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Thu, 13 Nov 2025 16:28:52 +0100 Subject: [PATCH 08/42] get a clean i14_yields_calib (move gsadapt factor to equation) --- modules/14_yields/gsadapt_nov25/equations.gms | 2 +- modules/14_yields/gsadapt_nov25/presolve.gms | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index 218156e858..4307574211 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -12,7 +12,7 @@ *' Technological change can increase the initial calibrated yields by: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * + vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cummulative(ct,i2))) * sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index 9d130cdd4c..d5b6e79a88 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -91,5 +91,3 @@ if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, pm_yields_gsadapt_ratio_increment(t,i) = 1; p14_yields_gsadapt_ratio_cummulative(t,i) = 1; ); - -i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w)/sum(cell(i,j), p14_yields_gsadapt_ratio_cummulative(t,i)); From 5c4910de0318ec1b83a551e9da680947acc313b5 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Tue, 27 Jan 2026 16:31:54 +0100 Subject: [PATCH 09/42] changes in l2m start script --- scripts/start/projects/test_lpjml2magpie.R | 280 ++++++++------------- 1 file changed, 111 insertions(+), 169 deletions(-) diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index b4da0b4d06..e0157f6e2e 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -15,177 +15,119 @@ # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") -# # Current MAgPIE default with same preprocessing status as the lpjml ones to be compared with -# source("config/default.cfg") -# cfg$title <- "Default_mngtcalib" -# # input data -# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", -# cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", -# validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", -# additional = "additional_data_rev4.63.tgz", -# calibration = "calibration_H12_FAO_18Sep25.tgz") -# # old yield realization -# cfg$gms$yields <- "managementcalib_aug19" -# cfg$gms$tc <- "endo_jan22" -# # start MAgPIE run -# start_run(cfg, codeCheck = TRUE) - -# # LPJmL Version runs_lpjml5.9.16-m2 -# source("config/default.cfg") -# cfg$title <- "LPJmL_5.9.16-m2_gsadapt" -# # input data -# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", -# cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", -# validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", -# additional = "additional_data_rev4.63.tgz", -# calibration = "calibration_H12_FAO_18Sep25.tgz") -# # new yield realization -# cfg$gms$yields <- "gsadapt_nov25" -# cfg$gms$tc <- "endo_nov25" -# # start MAgPIE run -# start_run(cfg, codeCheck = TRUE) - -# # LPJmL Version runs_lpjml5.10.0-m1 -# source("config/default.cfg") -# cfg$title <- "LPJmL_5.10.0-m1_gsadapt" -# # input data -# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", -# cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", -# validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", -# additional = "additional_data_rev4.63.tgz", -# calibration = "calibration_H12_FAO_18Sep25.tgz") -# # new yield realization -# cfg$gms$yields <- "gsadapt_nov25" -# cfg$gms$tc <- "endo_nov25" -# # start MAgPIE run -# start_run(cfg, codeCheck = TRUE) - - -# # LPJmL Version runs_lpjml5.9.16-m2 -# source("config/default.cfg") -# cfg$title <- "LPJmL_5.9.16-m2_NOgsadapt" -# # input data -# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", -# cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", -# validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", -# additional = "additional_data_rev4.63.tgz", -# calibration = "calibration_H12_FAO_18Sep25.tgz") -# # new yield realization -# cfg$gms$yields <- "gsadapt_nov25" -# cfg$gms$tc <- "endo_nov25" -# # deactivate gsadapt -# cfg$gms$s14_use_gsadapt <- 0 -# cfg$gms$s14_gsadapt2tau <- 0 -# # start MAgPIE run -# start_run(cfg, codeCheck = TRUE) - -# # LPJmL Version runs_lpjml5.10.0-m1 -# source("config/default.cfg") -# cfg$title <- "LPJmL_5.10.0-m1_NOgsadapt" -# # input data -# cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", -# cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", -# validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", -# additional = "additional_data_rev4.63.tgz", -# calibration = "calibration_H12_FAO_18Sep25.tgz") -# # new yield realization -# cfg$gms$yields <- "gsadapt_nov25" -# cfg$gms$tc <- "endo_nov25" -# # deactivate gsadapt -# cfg$gms$s14_use_gsadapt <- 0 -# cfg$gms$s14_gsadapt2tau <- 0 -# # start MAgPIE run -# start_run(cfg, codeCheck = TRUE) - - -### Runs without irrigated2rainfed correction ### -# Current MAgPIE default with same preprocessing status as the lpjml ones to be compared with +# source default configuration source("config/default.cfg") -cfg$title <- "Default_mngtcalib_ir2rfOff" -# input data -cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", - cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") -# old yield realization -cfg$gms$yields <- "managementcalib_aug19" -cfg$gms$tc <- "endo_jan22" -# deactivate irrigated2rainfed correction -cfg$gms$s14_calib_ir2rf <- 0 -# start MAgPIE run -start_run(cfg, codeCheck = TRUE) +cfg$title <- title <- "l2m" -# LPJmL Version runs_lpjml5.9.16-m2 -source("config/default.cfg") -cfg$title <- "LPJmL_5.9.16-m2_gsadapt_ir2rfOff" -# input data -cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", - validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") -# new yield realization -cfg$gms$yields <- "gsadapt_nov25" -cfg$gms$tc <- "endo_nov25" -# deactivate irrigated2rainfed correction -cfg$gms$s14_calib_ir2rf <- 0 -# start MAgPIE run -start_run(cfg, codeCheck = TRUE) +for (ir2rf in c(0, 1)) { + for (limitCalib in c(0, 1)) { + # Default runs + cfg$title <- paste0(title, "_Default_mngtcalib_", + "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), + ifelse(limitCalib == 0, "_noLimitCalib", "_limitCalib")) + # input data + cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", + cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") + # old yield realization + cfg$gms$yields <- "managementcalib_aug19" + cfg$gms$tc <- "endo_jan22" + # irrigated2rainfed setting + cfg$gms$s14_calib_ir2rf <- ir2rf + # limited calibration setting + cfg$gms$s14_limit_calib <- limitCalib + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) -# LPJmL Version runs_lpjml5.10.0-m1 -source("config/default.cfg") -cfg$title <- "LPJmL_5.10.0-m1_gsadapt_ir2rfOff" -# input data -cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", - validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") -# new yield realization -cfg$gms$yields <- "gsadapt_nov25" -cfg$gms$tc <- "endo_nov25" -# deactivate irrigated2rainfed correction -cfg$gms$s14_calib_ir2rf <- 0 -# start MAgPIE run -start_run(cfg, codeCheck = TRUE) + # New LPJmL Versions + for (gsadaptOption in c("gsadapt", "NOgsadapt")) { -# LPJmL Version runs_lpjml5.9.16-m2 -source("config/default.cfg") -cfg$title <- "LPJmL_5.9.16-m2_NOgsadapt_ir2rfOff" -# input data -cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v1_l2m_h12_a23b62b7_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-491b39ba.tgz", - validation = "rev4.125+griddedL2Mcomp_v1_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") -# new yield realization -cfg$gms$yields <- "gsadapt_nov25" -cfg$gms$tc <- "endo_nov25" -# deactivate gsadapt -cfg$gms$s14_use_gsadapt <- 0 -cfg$gms$s14_gsadapt2tau <- 0 -# deactivate irrigated2rainfed correction -cfg$gms$s14_calib_ir2rf <- 0 -# start MAgPIE run -start_run(cfg, codeCheck = TRUE) + # LPJmL Version runs_lpjml5.10.0-m2 + # +griddedL2Mcomp_v10_2_l2m + cfg$title <- paste0(title, "_v5.10.0-2_", gsadaptOption, "_", + "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), + ifelse(limitCalib == 0, "_noLimC", "_limC")) + # input data + cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_magpie.tgz", + cellular = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + validation = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") + # new yield realization + cfg$gms$yields <- "gsadapt_nov25" + cfg$gms$tc <- "endo_nov25" + # irrigated2rainfed setting + cfg$gms$s14_calib_ir2rf <- ir2rf + # limited calibration setting + cfg$gms$s14_limit_calib <- limitCalib + # gsadapt settings + if (gsadaptOption == "NOgsadapt") { + cfg$gms$s14_use_gsadapt <- 0 + cfg$gms$s14_gsadapt2tau <- 0 + } else { + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 1 + } + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) -# LPJmL Version runs_lpjml5.10.0-m1 -source("config/default.cfg") -cfg$title <- "LPJmL_5.10.0-m1_NOgsadapt_ir2rfOff" -# input data -cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", - validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") -# new yield realization -cfg$gms$yields <- "gsadapt_nov25" -cfg$gms$tc <- "endo_nov25" -# deactivate gsadapt -cfg$gms$s14_use_gsadapt <- 0 -cfg$gms$s14_gsadapt2tau <- 0 -# deactivate irrigated2rainfed correction -cfg$gms$s14_calib_ir2rf <- 0 -# start MAgPIE run -start_run(cfg, codeCheck = TRUE) + # LPJmL Version runs_lpjml5.10.0-m1 + cfg$title <- paste0(title, "_v5.10.0-1_", gsadaptOption, "_", + "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), + ifelse(limitCalib == 0, "_noLimC", "_limC")) + # input data + cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", + validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") + # new yield realization + cfg$gms$yields <- "gsadapt_nov25" + cfg$gms$tc <- "endo_nov25" + # irrigated2rainfed setting + cfg$gms$s14_calib_ir2rf <- ir2rf + # limited calibration setting + cfg$gms$s14_limit_calib <- limitCalib + # gsadapt settings + if (gsadaptOption == "NOgsadapt") { + cfg$gms$s14_use_gsadapt <- 0 + cfg$gms$s14_gsadapt2tau <- 0 + } else { + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 1 + } + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) + + # LPJmL Version runs_lpjml5.9.16-m2 + cfg$title <- paste0(title, "_v5.9.16-2_", gsadaptOption, "_", + "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), + ifelse(limitCalib == 0, "_noLimC", "_limC")) + # input data + cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", + cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", + validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") + # new yield realization + cfg$gms$yields <- "gsadapt_nov25" + cfg$gms$tc <- "endo_nov25" + # irrigated2rainfed setting + cfg$gms$s14_calib_ir2rf <- ir2rf + # limited calibration setting + cfg$gms$s14_limit_calib <- limitCalib + # gsadapt settings + if (gsadaptOption == "NOgsadapt") { + cfg$gms$s14_use_gsadapt <- 0 + cfg$gms$s14_gsadapt2tau <- 0 + } else { + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 1 + } + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) + } + } +} From 30a62797df7788a44c611a934971409b3367422c Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Tue, 17 Feb 2026 17:49:05 +0100 Subject: [PATCH 10/42] updated start script --- scripts/start/projects/test_lpjml2magpie.R | 207 +++++++++++---------- 1 file changed, 106 insertions(+), 101 deletions(-) diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index e0157f6e2e..c89b4ae87b 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -17,117 +17,122 @@ source("scripts/start_functions.R") # source default configuration source("config/default.cfg") -cfg$title <- title <- "l2m" - -for (ir2rf in c(0, 1)) { - for (limitCalib in c(0, 1)) { - # Default runs - cfg$title <- paste0(title, "_Default_mngtcalib_", - "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), - ifelse(limitCalib == 0, "_noLimitCalib", "_limitCalib")) - # input data - cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v1_default_h12_magpie.tgz", - cellular = "rev4.125+griddedL2Mcomp_v1_default_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.125+griddedL2Mcomp_v1_default_h12_validation.tgz", +title <- "l2m_feb26" +cfg$recalibrate_landconversion_cost <- "ifneeded" #### Should I change this to TRUE? + +############################################## +### Current default (i.e., old lpjml data) ### +############################################## +cfg$gms$yields <- "managementcalib_aug19" +cfg$gms$tc <- "endo_jan22" + +# RCP2.6 +cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp26") +cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", + cellular = "rev4.130l2m_default_feb2026_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz", + validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +# RCP7.0 +cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp70") +cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", + cellular = "rev4.130l2m_default_feb2026_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? +# start MAgPIE run +start_run(cfg, codeCheck = TRUE) + +##################### +### Newlpjml data ### +##################### + +### Different RCPs (2x) ### +for (rcp in c("2p6", "7p0")) { + + if (rcp == "2p6") { + # RCP2.6 + cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", + cellular = "WARNINGS1_rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", + validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? + } else if (rcp == "7p0") { + # RCP7.0 + cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", + cellular = "WARNINGS1_rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") - # old yield realization + calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? + } else { + stop("selected rcp not available") + } + + ### Different realizations (2x) ### + for (realization in c("mngt", "gsadapt")) { + + if (realization == "mngt") { + # default realizations cfg$gms$yields <- "managementcalib_aug19" cfg$gms$tc <- "endo_jan22" - # irrigated2rainfed setting - cfg$gms$s14_calib_ir2rf <- ir2rf - # limited calibration setting - cfg$gms$s14_limit_calib <- limitCalib + + # title + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization) # start MAgPIE run start_run(cfg, codeCheck = TRUE) - # New LPJmL Versions - for (gsadaptOption in c("gsadapt", "NOgsadapt")) { - - # LPJmL Version runs_lpjml5.10.0-m2 - # +griddedL2Mcomp_v10_2_l2m - cfg$title <- paste0(title, "_v5.10.0-2_", gsadaptOption, "_", - "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), - ifelse(limitCalib == 0, "_noLimC", "_limC")) - # input data - cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_magpie.tgz", - cellular = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", - validation = "rev4.125+griddedL2Mcomp_v10_2_l2m_h12_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") - # new yield realization - cfg$gms$yields <- "gsadapt_nov25" - cfg$gms$tc <- "endo_nov25" - # irrigated2rainfed setting - cfg$gms$s14_calib_ir2rf <- ir2rf - # limited calibration setting - cfg$gms$s14_limit_calib <- limitCalib - # gsadapt settings - if (gsadaptOption == "NOgsadapt") { - cfg$gms$s14_use_gsadapt <- 0 - cfg$gms$s14_gsadapt2tau <- 0 - } else { - cfg$gms$s14_use_gsadapt <- 1 - cfg$gms$s14_gsadapt2tau <- 1 - } - # start MAgPIE run - start_run(cfg, codeCheck = TRUE) - - # LPJmL Version runs_lpjml5.10.0-m1 - cfg$title <- paste0(title, "_v5.10.0-1_", gsadaptOption, "_", - "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), - ifelse(limitCalib == 0, "_noLimC", "_limC")) - # input data - cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", - validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") - # new yield realization - cfg$gms$yields <- "gsadapt_nov25" - cfg$gms$tc <- "endo_nov25" - # irrigated2rainfed setting - cfg$gms$s14_calib_ir2rf <- ir2rf - # limited calibration setting - cfg$gms$s14_limit_calib <- limitCalib - # gsadapt settings - if (gsadaptOption == "NOgsadapt") { - cfg$gms$s14_use_gsadapt <- 0 - cfg$gms$s14_gsadapt2tau <- 0 - } else { - cfg$gms$s14_use_gsadapt <- 1 - cfg$gms$s14_gsadapt2tau <- 1 - } - # start MAgPIE run - start_run(cfg, codeCheck = TRUE) - - # LPJmL Version runs_lpjml5.9.16-m2 - cfg$title <- paste0(title, "_v5.9.16-2_", gsadaptOption, "_", - "ir2rf_", ifelse(ir2rf == 0, "Off", "On"), - ifelse(limitCalib == 0, "_noLimC", "_limC")) - # input data - cfg$input <- c(regional = "rev4.125+griddedL2Mcomp_v2_l2m_h12_magpie_debug.tgz", - cellular = "rev4.125+griddedL2Mcomp_v2_l2m_h12_4ad25a7f_cellularmagpie_debug_c200_MRI-ESM2-0-ssp370_lpjml-351193fc.tgz", - validation = "rev4.125+griddedL2Mcomp_v2_l2m_h12_validation_debug.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") - # new yield realization - cfg$gms$yields <- "gsadapt_nov25" - cfg$gms$tc <- "endo_nov25" - # irrigated2rainfed setting - cfg$gms$s14_calib_ir2rf <- ir2rf - # limited calibration setting - cfg$gms$s14_limit_calib <- limitCalib - # gsadapt settings - if (gsadaptOption == "NOgsadapt") { + } else if (realization == "gsadpat") { + # new realizations + cfg$gms$yields <- "gsadapt_nov25" + cfg$gms$tc <- "endo_nov25" + + for (gsadapt in c("const", "adapt")) { + if (gsadapt == "const") { + # no growing period adaptation cfg$gms$s14_use_gsadapt <- 0 cfg$gms$s14_gsadapt2tau <- 0 + + # title + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt) + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) + + } else if (gsadapt == "adapt") { + + for (tauspillover in c("TCspill0", "TCspill1")) { + if (tauspillover == "TCspill0") { + # growing period adaptation + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 0 + + # title + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, tauspillover) + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) + + } else if (tauspillover == "TCspill1") { + # growing period adaptation + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 1 + + # title + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, tauspillover) + # start MAgPIE run + start_run(cfg, codeCheck = TRUE) + + } else { + stop("Selected tauspillover is not available.") + } + } } else { - cfg$gms$s14_use_gsadapt <- 1 - cfg$gms$s14_gsadapt2tau <- 1 + stop("gsadapt setting does not exist") } - # start MAgPIE run - start_run(cfg, codeCheck = TRUE) + } + } else { + stop("selected realization is not available.") } } } From 7c9f505597c7c8f16cc4c89e1f311924599014fb Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Wed, 18 Feb 2026 10:41:03 +0100 Subject: [PATCH 11/42] =?UTF-8?q?fix:=20gsadapt=20audit=20=E2=80=94=20crit?= =?UTF-8?q?ical=20bug=20fixes=20and=20cleanup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix nl_fix.gms: add missing division by p14_yields_gsadapt_ratio_cumulative to match the equation in equations.gms (crop yields were inconsistent between NLP and LP solve phases when s14_gsadapt2tau=1) - Fix start script typo: gsadpat -> gsadapt (all gsadapt test runs were dead code) - Fix spelling: cummulative -> cumulative (variable name, 6 occurrences) - Fix placeholder description in declarations.gms - Remove misplaced EOF comment at top of presolve.gms - Add division-by-zero protection (+1e-8) in presolve gsadapt ratio calculations - Document max(1,...) ratchet design choice in presolve.gms - Fix comment typos in croparea modules (Are -> Area, pcm_land -> pcm_area) - Add missing trailing newlines Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- modules/14_yields/gsadapt_nov25/declarations.gms | 4 ++-- modules/14_yields/gsadapt_nov25/equations.gms | 2 +- modules/14_yields/gsadapt_nov25/nl_fix.gms | 2 +- modules/14_yields/gsadapt_nov25/presolve.gms | 15 ++++++++------- modules/30_croparea/detail_apr24/postsolve.gms | 2 +- modules/30_croparea/detail_apr24/preloop.gms | 2 +- modules/30_croparea/simple_apr24/postsolve.gms | 2 +- modules/30_croparea/simple_apr24/preloop.gms | 4 ++-- scripts/start/projects/test_lpjml2magpie.R | 2 +- 9 files changed, 18 insertions(+), 17 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index ca917b393e..6beb15a8b9 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -7,12 +7,12 @@ parameters i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) - i14_yields_combined(t_all,j,yldtype,kcr,w) Blah blah blah (blah) + i14_yields_combined(t_all,j,yldtype,kcr,w) Combined biophysical yields for gsadapt and constgsadapt before calibration (tDM per ha per yr) i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) - p14_yields_gsadapt_ratio_cummulative(t,i) Cummulative effect of growing period adaption from the first to the current timestep (1) + p14_yields_gsadapt_ratio_cumulative(t,i) Cumulative effect of growing period adaption from the first to the current timestep (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index 4307574211..80a393e361 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -12,7 +12,7 @@ *' Technological change can increase the initial calibrated yields by: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cummulative(ct,i2))) * + vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/gsadapt_nov25/nl_fix.gms b/modules/14_yields/gsadapt_nov25/nl_fix.gms index 07339b646d..a45e645a33 100644 --- a/modules/14_yields/gsadapt_nov25/nl_fix.gms +++ b/modules/14_yields/gsadapt_nov25/nl_fix.gms @@ -7,5 +7,5 @@ * ### nl_fix ### -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w) / sum(cell(i,j), p14_yields_gsadapt_ratio_cumulative(ct,i))) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index d5b6e79a88..eb360e8f11 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -5,8 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*** EOF presolve.gms *** - * calculate carbon density *** YIELDS @@ -70,24 +68,27 @@ if (ord(t) = 1, p14_yields_gsadapt_ratio(t,i) = 1; p14_yields_gsadapt_ratio_previous(t,i) = 1; pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cummulative(t,i) = 1; + p14_yields_gsadapt_ratio_cumulative(t,i) = 1; else p14_yields_gsadapt_ratio(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + (sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)) + 10**(-8)); p14_yields_gsadapt_ratio_previous(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + (sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)) + 10**(-8)); pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); - p14_yields_gsadapt_ratio_cummulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cummulative(t-1,i); +* The max(1,...) ensures the cumulative factor can only grow, never shrink. +* This means declining adaptation opportunities are not represented — once +* adaptation gains are accounted for via tau, they cannot be reversed. + p14_yields_gsadapt_ratio_cumulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cumulative(t-1,i); ); if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cummulative(t,i) = 1; + p14_yields_gsadapt_ratio_cumulative(t,i) = 1; ); diff --git a/modules/30_croparea/detail_apr24/postsolve.gms b/modules/30_croparea/detail_apr24/postsolve.gms index e679015950..1c01a19b89 100644 --- a/modules/30_croparea/detail_apr24/postsolve.gms +++ b/modules/30_croparea/detail_apr24/postsolve.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de * -*** Are Patterns are transferred to next timestep +*** Area patterns are transferred to next timestep pcm_area(j,w,kcr) = vm_area.l(j,kcr,w); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### diff --git a/modules/30_croparea/detail_apr24/preloop.gms b/modules/30_croparea/detail_apr24/preloop.gms index 5903307bb5..f749c91e36 100644 --- a/modules/30_croparea/detail_apr24/preloop.gms +++ b/modules/30_croparea/detail_apr24/preloop.gms @@ -50,4 +50,4 @@ vm_bv.l(j,"crop_per",potnatveg) = * fm_luh2_side_layers(j,potnatveg); * Initialize pcm_area -pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); \ No newline at end of file +pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); diff --git a/modules/30_croparea/simple_apr24/postsolve.gms b/modules/30_croparea/simple_apr24/postsolve.gms index 78fbbeda66..9c098d21bd 100644 --- a/modules/30_croparea/simple_apr24/postsolve.gms +++ b/modules/30_croparea/simple_apr24/postsolve.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*** Are Patterns are transferred to next timestep +*** Area patterns are transferred to next timestep pcm_area(j,w,kcr) = vm_area.l(j,kcr,w); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### diff --git a/modules/30_croparea/simple_apr24/preloop.gms b/modules/30_croparea/simple_apr24/preloop.gms index 1975db712d..3ef7edb055 100644 --- a/modules/30_croparea/simple_apr24/preloop.gms +++ b/modules/30_croparea/simple_apr24/preloop.gms @@ -33,5 +33,5 @@ vm_bv.l(j,"crop_per",potnatveg) = sum((crop_per30,w), fm_croparea("y1995",j,w,crop_per30)) * fm_bii_coeff("crop_per",potnatveg) * fm_luh2_side_layers(j,potnatveg); -* Initialize pcm_land -pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); \ No newline at end of file +* Initialize pcm_area +pcm_area(j,w,kcr) = fm_croparea("y1995",j,w,kcr); diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index c89b4ae87b..b48748d1ef 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -84,7 +84,7 @@ for (rcp in c("2p6", "7p0")) { # start MAgPIE run start_run(cfg, codeCheck = TRUE) - } else if (realization == "gsadpat") { + } else if (realization == "gsadapt") { # new realizations cfg$gms$yields <- "gsadapt_nov25" cfg$gms$tc <- "endo_nov25" From b58c05041a750da2e2d894f771e6911cc17d9a86 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Wed, 18 Feb 2026 16:43:29 +0100 Subject: [PATCH 12/42] fix: use calibrated yields in gsadapt_nov25 preloop fallback proxy The fallback branch of i14_modeled_yields_hist2 (for regions with near-zero crop area) was incorrectly using raw f14_yields instead of i14_yields_calib_combined, and was missing the yldtype dimension. This made it inconsistent with the managementcalib_aug19 realization and with the non-fallback branch in the same calculation. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- modules/14_yields/gsadapt_nov25/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index 091fe144f7..a6fa983ccc 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -138,7 +138,7 @@ if ((s14_calib_ir2rf = 1), = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) > 0.00001) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * f14_yields("y1995",j,knbe14,w)) / + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); From 9525d0272a7acac6a0739a7fa3e7ec747a909b0b Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Wed, 18 Feb 2026 17:28:33 +0100 Subject: [PATCH 13/42] fix: move EOF comment to bottom of presolve.gms Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- modules/14_yields/gsadapt_nov25/presolve.gms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index eb360e8f11..58ed6c8dda 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -92,3 +92,5 @@ if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, pm_yields_gsadapt_ratio_increment(t,i) = 1; p14_yields_gsadapt_ratio_cumulative(t,i) = 1; ); + +*** EOF presolve.gms *** From a2cb101f566c2f6f3f667ba7736d137855c171c3 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Fri, 20 Feb 2026 14:57:53 +0100 Subject: [PATCH 14/42] updated start script --- scripts/start/projects/test_lpjml2magpie.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index c89b4ae87b..14bad61e12 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -29,7 +29,7 @@ cfg$gms$tc <- "endo_jan22" # RCP2.6 cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp26") cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", - cellular = "rev4.130l2m_default_feb2026_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz", + cellular = "rev4.130l2m_default_feb2026_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz", validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", additional = "additional_data_rev4.63.tgz", calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? @@ -56,14 +56,14 @@ for (rcp in c("2p6", "7p0")) { if (rcp == "2p6") { # RCP2.6 cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", - cellular = "WARNINGS1_rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", + cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_e3aebc2e_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", additional = "additional_data_rev4.63.tgz", calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? } else if (rcp == "7p0") { # RCP7.0 cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", - cellular = "WARNINGS1_rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", additional = "additional_data_rev4.63.tgz", calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? @@ -84,7 +84,7 @@ for (rcp in c("2p6", "7p0")) { # start MAgPIE run start_run(cfg, codeCheck = TRUE) - } else if (realization == "gsadpat") { + } else if (realization == "gsadapt") { # new realizations cfg$gms$yields <- "gsadapt_nov25" cfg$gms$tc <- "endo_nov25" From c530edd112866dacdee56e66fb8a7bac8f33996a Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Fri, 20 Feb 2026 19:27:13 +0100 Subject: [PATCH 15/42] fix: remove division-by-zero guards from gsadapt ratio calculations Remove the +1e-8 guards from p14_yields_gsadapt_ratio and p14_yields_gsadapt_ratio_previous denominators in presolve.gms. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- modules/14_yields/gsadapt_nov25/presolve.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index 58ed6c8dda..fb3b2131ea 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -74,11 +74,11 @@ else p14_yields_gsadapt_ratio(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - (sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)) + 10**(-8)); + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); p14_yields_gsadapt_ratio_previous(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - (sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)) + 10**(-8)); + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); * The max(1,...) ensures the cumulative factor can only grow, never shrink. From 84fdb5a767baaee27ef66d53b1866676aec80902 Mon Sep 17 00:00:00 2001 From: FelicitasBeier Date: Mon, 23 Feb 2026 17:23:10 +0100 Subject: [PATCH 16/42] updated endo_nov25 realization to include the changes by Pat from endo_jan22 --- modules/13_tc/endo_nov25/declarations.gms | 33 +++++++++--- modules/13_tc/endo_nov25/equations.gms | 25 ++++++--- modules/13_tc/endo_nov25/input.gms | 41 +++++++++++++- modules/13_tc/endo_nov25/nl_fix.gms | 2 +- modules/13_tc/endo_nov25/nl_relax.gms | 2 +- modules/13_tc/endo_nov25/nl_release.gms | 4 +- modules/13_tc/endo_nov25/postsolve.gms | 38 +++++++++---- modules/13_tc/endo_nov25/preloop.gms | 19 +++++-- modules/13_tc/endo_nov25/presolve.gms | 65 ++++++++++++++++++----- 9 files changed, 183 insertions(+), 46 deletions(-) diff --git a/modules/13_tc/endo_nov25/declarations.gms b/modules/13_tc/endo_nov25/declarations.gms index dfeabf508c..c03f5275da 100644 --- a/modules/13_tc/endo_nov25/declarations.gms +++ b/modules/13_tc/endo_nov25/declarations.gms @@ -6,36 +6,53 @@ *** | Contact: magpie@pik-potsdam.de positive variable - vm_tau(h,tautype) Agricultural land use intensity tau (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) + 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) + vm_tau(j,tautype) Overall agricultural land use intensity tau at cluster level (1) + v13_tau_consv(h,tautype) Tau for cropland within conservation priority areas (1) ; equations q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) q13_tech_cost_sum(i) Total Total annuitized costs for TC (mio. USD17MER per yr) - q13_lower_bound_tau(h) Lower limit constraint for tau (1) + 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 pc13_land(i, tautype) Crop and grass land area per region (mio ha) - pcm_tau(h, tautype) Tau factor of the previous time step (1) + pcm_tau(j, tautype) Tau factor of the previous time step (1) + pc13_tau(h, tautype) Tau for conventional cropland of the previous time step (1) + pc13_tau_consv(h, tautype) Tau for cropland within conservation priority areas of the previous time step (1) pc13_tcguess(h, tautype) Guess for annual tc rates in the next time step (1) i13_tc_factor(t) Regression factor (USD17MER per ha) i13_tc_exponent(t) Regression exponent (1) + p13_cropland_consv_shr(t,j) Share of cropland within conservation priority areas(1) + p13_croparea_consv_tau_factor(h) Regional tau factor for crop area conservation (1) + i13_croparea_consv_fader(t_all) Crop area conservation fader (1) + i13_tau_croparea_consv_fader(t_all) Fader for tau factor for crop area conservation (1) + p13_country_weight(i) Policy country weight per region (1) + p13_country_switch(iso) Switch indicating whether country is affected by selected cropland policy (1) + p13_country_wght_supreg(h) Policy country weight per super region (1) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_tau(t,h,tautype,type) Agricultural land use intensity tau (1) + ov13_tau_core(t,h,tautype,type) Agricultural land use intensity tau for conventional cropland (1) ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17MER per yr) ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17MER) ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) + ov_tau(t,j,tautype,type) Overall agricultural land use intensity tau at cluster level (1) + ov13_tau_consv(t,h,tautype,type) Tau for cropland within conservation priority areas (1) oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) oq13_tech_cost_sum(t,i,type) Total Total annuitized costs for TC (mio. USD17MER per yr) - oq13_lower_bound_tau(t,h,type) Lower limit constraint for tau (1) + 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) ##################### diff --git a/modules/13_tc/endo_nov25/equations.gms b/modules/13_tc/endo_nov25/equations.gms index 7bad610958..72a3ec4c53 100644 --- a/modules/13_tc/endo_nov25/equations.gms +++ b/modules/13_tc/endo_nov25/equations.gms @@ -11,7 +11,7 @@ *' [@dietrich_forecasting_2014]](tcc_regression.png){ width=60% } *' *' Relative technological change costs `v13_cost_tc` are calculated as a -*' heuristically derived power function of the land use intensity `vm_tau` for +*' heuristically derived power function of the land use intensity `v13_tau_core` for *' the investment-yield-ratio (see figure above) multiplied by the current *' regional crop areas `pc13_land` (taken from previous time step) and shifted *' 15 years into the future using the region specific interest @@ -19,7 +19,7 @@ q13_cost_tc(i2, tautype) .. v13_cost_tc(i2, tautype) =e= sum(ct, pc13_land(i2, tautype) * - i13_tc_factor(ct) * sum(supreg(h2,i2),vm_tau(h2,tautype))** + i13_tc_factor(ct) * sum(supreg(h2,i2),v13_tau_core(h2,tautype))** i13_tc_exponent(ct) * (1+pm_interest(ct,i2))**15); @@ -38,15 +38,28 @@ q13_cost_tc(i2, tautype) .. *' (annuity with infinite time horizon): q13_tech_cost(i2, tautype) .. - v13_tech_cost(i2, tautype) =e= sum(supreg(h2,i2), vm_tau(h2,tautype)/pcm_tau(h2,tautype)-1) * v13_cost_tc(i2,tautype) + v13_tech_cost(i2, tautype) =e= sum(supreg(h2,i2), v13_tau_core(h2,tautype)/pc13_tau(h2,tautype)-1) * v13_cost_tc(i2,tautype) * sum(ct,pm_interest(ct,i2)/(1+pm_interest(ct,i2))); 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 -* restricting tau to gsadapt levels +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)); -q13_lower_bound_tau(h2) .. - vm_tau(h2,"crop") =g= pcm_tau(h2,"crop") * sum((ct,supreg(h2,i2)), 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` +*' for cropland in conservation priority areas. + +q13_tau(j2,tautype).. + vm_tau(j2,tautype) =e= sum((ct, cell(i2,j2), supreg(h2,i2)), (1-p13_cropland_consv_shr(ct,j2)) * v13_tau_core(h2,tautype) + p13_cropland_consv_shr(ct,j2) * v13_tau_consv(h2,tautype)); + +*' `v13_tau_consv` for cropland in conservation priority areas is linked to `v13_tau_core` +*' through a multiplication factor that can lower land use intensity in +*' conservation priority areas. + +q13_tau_consv(h2,tautype)$(c13_croparea_consv_tau_increase = 1 OR sum(ct, m_year(ct)) < s13_croparea_consv_start).. + v13_tau_consv(h2,tautype) =e= p13_croparea_consv_tau_factor(h2) * v13_tau_core(h2,tautype); diff --git a/modules/13_tc/endo_nov25/input.gms b/modules/13_tc/endo_nov25/input.gms index c6a23997fc..ccff226873 100644 --- a/modules/13_tc/endo_nov25/input.gms +++ b/modules/13_tc/endo_nov25/input.gms @@ -7,8 +7,45 @@ scalars - s13_ignore_tau_historical ignore historical tau (1) or use it as lower bound (0) (binary) / 1 / - s13_max_gdp_shr Maximum tech cost as share of regional GDP / Inf / + s13_ignore_tau_historical ignore historical tau (1) or use it as lower bound (0) (binary) / 1 / + s13_max_gdp_shr Maximum tech cost as share of regional GDP / Inf / + c13_croparea_consv Switch for crop area conservation either in conservation priority areas or in a given share of the total croparea (0=no 1=yes) / 0 / + c13_croparea_consv_tau_increase Switch for tau increase on crop area conservation (0=no 1=yes) / 1 / + s13_croparea_consv_tau_factor Tau factor for crop area conservation / 0.8 / + s13_croparea_consv_tau_factor_noselect Tau factor for crop area conservation in unselected countries / 0.8 / + s13_croparea_consv_shr Share of crop area in which no endogeneous yield changes are allowed due to conservation (1) / 0 / + s13_croparea_consv_shr_noselect Share of crop area in which no endogeneous yield changes are allowed due to conservation (1) / 0 / + s13_croparea_consv_start Croparea conservation start year / 2025 / + s13_croparea_consv_target Croparea conservation target year / 2030 / +; + +sets + croparea_consv_countries13(iso) countries to be affected by croparea conserv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_tau1995(h) Agricultural land use intensity tau in 1995 (1) diff --git a/modules/13_tc/endo_nov25/nl_fix.gms b/modules/13_tc/endo_nov25/nl_fix.gms index d03aaaabf4..559acb6fcd 100644 --- a/modules/13_tc/endo_nov25/nl_fix.gms +++ b/modules/13_tc/endo_nov25/nl_fix.gms @@ -7,4 +7,4 @@ * ### nl_fix ### -vm_tau.fx(h,tautype) = max(vm_tau.lo(h,tautype), min(vm_tau.up(h,tautype), vm_tau.l(h,tautype))); +v13_tau_core.fx(h,tautype) = max(v13_tau_core.lo(h,tautype), min(v13_tau_core.up(h,tautype), v13_tau_core.l(h,tautype))); diff --git a/modules/13_tc/endo_nov25/nl_relax.gms b/modules/13_tc/endo_nov25/nl_relax.gms index 2d6ffe041f..26c1be6133 100644 --- a/modules/13_tc/endo_nov25/nl_relax.gms +++ b/modules/13_tc/endo_nov25/nl_relax.gms @@ -7,4 +7,4 @@ * ### nl_relax ### -vm_tau.l(h,tautype) = vm_tau.l(h,tautype) + 0.1; +v13_tau_core.l(h,tautype) = v13_tau_core.l(h,tautype) + 0.1; diff --git a/modules/13_tc/endo_nov25/nl_release.gms b/modules/13_tc/endo_nov25/nl_release.gms index 2bddbd429a..c7b6c2d9e0 100644 --- a/modules/13_tc/endo_nov25/nl_release.gms +++ b/modules/13_tc/endo_nov25/nl_release.gms @@ -7,5 +7,5 @@ * ### nl_release ### -vm_tau.lo(h,tautype) = pcm_tau(h,tautype); -vm_tau.up(h,tautype) = 2*pcm_tau(h,tautype); +v13_tau_core.lo(h,tautype) = pc13_tau(h,tautype); +v13_tau_core.up(h,tautype) = 2*pc13_tau(h,tautype); diff --git a/modules/13_tc/endo_nov25/postsolve.gms b/modules/13_tc/endo_nov25/postsolve.gms index 93ab896ff9..d54912b88a 100644 --- a/modules/13_tc/endo_nov25/postsolve.gms +++ b/modules/13_tc/endo_nov25/postsolve.gms @@ -8,43 +8,61 @@ * Overall TC cost for the current timestep if((ord(t)>1), - pc13_tcguess(h,tautype) = (vm_tau.l(h,tautype)/pcm_tau(h, tautype))**(1/m_yeardiff(t)) - 1; + pc13_tcguess(h,tautype) = (v13_tau_core.l(h,tautype)/pc13_tau(h, tautype))**(1/m_yeardiff(t)) - 1; ); -pcm_tau(h, tautype) = vm_tau.l(h, tautype); +pc13_tau(h, tautype) = v13_tau_core.l(h, tautype); +pc13_tau_consv(h, tautype) = v13_tau_consv.l(h, tautype); +pcm_tau(j, tautype) = vm_tau.l(j, tautype); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_tau(t,h,tautype,"marginal") = vm_tau.m(h,tautype); + ov13_tau_core(t,h,tautype,"marginal") = v13_tau_core.m(h,tautype); ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); ov13_cost_tc(t,i,tautype,"marginal") = v13_cost_tc.m(i,tautype); ov13_tech_cost(t,i,tautype,"marginal") = v13_tech_cost.m(i,tautype); + ov_tau(t,j,tautype,"marginal") = vm_tau.m(j,tautype); + ov13_tau_consv(t,h,tautype,"marginal") = v13_tau_consv.m(h,tautype); oq13_tech_cost(t,i,tautype,"marginal") = q13_tech_cost.m(i,tautype); oq13_cost_tc(t,i,tautype,"marginal") = q13_cost_tc.m(i,tautype); oq13_tech_cost_sum(t,i,"marginal") = q13_tech_cost_sum.m(i); - oq13_lower_bound_tau(t,h,"marginal") = q13_lower_bound_tau.m(h); - ov_tau(t,h,tautype,"level") = vm_tau.l(h,tautype); + 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); ov13_tech_cost(t,i,tautype,"level") = v13_tech_cost.l(i,tautype); + ov_tau(t,j,tautype,"level") = vm_tau.l(j,tautype); + ov13_tau_consv(t,h,tautype,"level") = v13_tau_consv.l(h,tautype); oq13_tech_cost(t,i,tautype,"level") = q13_tech_cost.l(i,tautype); oq13_cost_tc(t,i,tautype,"level") = q13_cost_tc.l(i,tautype); oq13_tech_cost_sum(t,i,"level") = q13_tech_cost_sum.l(i); - oq13_lower_bound_tau(t,h,"level") = q13_lower_bound_tau.l(h); - ov_tau(t,h,tautype,"upper") = vm_tau.up(h,tautype); + 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); ov13_tech_cost(t,i,tautype,"upper") = v13_tech_cost.up(i,tautype); + ov_tau(t,j,tautype,"upper") = vm_tau.up(j,tautype); + ov13_tau_consv(t,h,tautype,"upper") = v13_tau_consv.up(h,tautype); oq13_tech_cost(t,i,tautype,"upper") = q13_tech_cost.up(i,tautype); oq13_cost_tc(t,i,tautype,"upper") = q13_cost_tc.up(i,tautype); oq13_tech_cost_sum(t,i,"upper") = q13_tech_cost_sum.up(i); - oq13_lower_bound_tau(t,h,"upper") = q13_lower_bound_tau.up(h); - ov_tau(t,h,tautype,"lower") = vm_tau.lo(h,tautype); + 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); ov13_tech_cost(t,i,tautype,"lower") = v13_tech_cost.lo(i,tautype); + ov_tau(t,j,tautype,"lower") = vm_tau.lo(j,tautype); + ov13_tau_consv(t,h,tautype,"lower") = v13_tau_consv.lo(h,tautype); oq13_tech_cost(t,i,tautype,"lower") = q13_tech_cost.lo(i,tautype); oq13_cost_tc(t,i,tautype,"lower") = q13_cost_tc.lo(i,tautype); oq13_tech_cost_sum(t,i,"lower") = q13_tech_cost_sum.lo(i); - oq13_lower_bound_tau(t,h,"lower") = q13_lower_bound_tau.lo(h); + 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) ###################### diff --git a/modules/13_tc/endo_nov25/preloop.gms b/modules/13_tc/endo_nov25/preloop.gms index 7c75fcca4a..b0f0079536 100644 --- a/modules/13_tc/endo_nov25/preloop.gms +++ b/modules/13_tc/endo_nov25/preloop.gms @@ -15,6 +15,19 @@ loop(t, ); ); -pcm_tau(h,"crop") = fm_tau1995(h); -pcm_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); -pc13_tcguess(h,tautype) = f13_tcguess(h); +pc13_tau(h,"crop") = fm_tau1995(h); +pc13_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); +pc13_tcguess(h,tautype) = f13_tcguess(h); + + +* Country switch to determine countries for which certain policies shall be applied. +* In the default case, the policy affects all countries when activated. +p13_country_switch(iso) = 0; +p13_country_switch(croparea_consv_countries13) = 1; + +** Trajectory for implementation of croparea conservation +* sigmoidal interpolation between 2020 and target year +m_sigmoid_time_interpol(i13_croparea_consv_fader,s13_croparea_consv_start,s13_croparea_consv_target,0,1); + +m_sigmoid_time_interpol(i13_tau_croparea_consv_fader,s13_croparea_consv_start,s13_croparea_consv_target,1,s13_croparea_consv_tau_factor); + diff --git a/modules/13_tc/endo_nov25/presolve.gms b/modules/13_tc/endo_nov25/presolve.gms index 7147262a5b..0266613145 100644 --- a/modules/13_tc/endo_nov25/presolve.gms +++ b/modules/13_tc/endo_nov25/presolve.gms @@ -9,22 +9,13 @@ pc13_land(i,"pastr") = sum(cell(i,j),pcm_land(j,"past")); pc13_land(i,"crop") = sum(cell(i,j),pcm_land(j,"crop")); if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, - vm_tau.lo(h,"pastr") = f13_pastr_tau_hist(t,h); - vm_tau.lo(h,"crop") = f13_tau_historical(t,h); + v13_tau_core.lo(h,"pastr") = f13_pastr_tau_hist(t,h); + v13_tau_core.lo(h,"crop") = f13_tau_historical(t,h); else - vm_tau.lo(h, tautype) = pcm_tau(h, tautype); + v13_tau_core.lo(h, tautype) = pc13_tau(h, tautype); ); - vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); - -* educated guess for vm_tau.l: -if(ord(t) = 1, - vm_tau.l(h,tautype) = pcm_tau(h,tautype); -else - vm_tau.l(h,tautype) = pcm_tau(h,tautype)*(1+pc13_tcguess(h,tautype))**m_yeardiff(t); -); - -vm_tau.up(h,tautype) = 2 * pcm_tau(h,tautype); + v13_tau_core.up(h,tautype) = 2 * pc13_tau(h,tautype); if(m_year(t) > sm_fix_SSP2 AND s13_max_gdp_shr <> Inf, @@ -39,3 +30,51 @@ if(m_year(t) > sm_fix_SSP2 AND s13_max_gdp_shr <> Inf, vm_tech_cost.l(i) = vm_tech_cost.up(i); ); + +*** Share of cropland within conservation priority area +p13_cropland_consv_shr(t,j) = 0; + +if(c13_croparea_consv = 1, +* the cropland area within conservation priority areas is provided by the interface `pm_land_conservation` + p13_cropland_consv_shr(t,j)$(pcm_land(j,"crop") > 0) = sum(consv_type, pm_land_conservation(t,j,"crop",consv_type))/pcm_land(j,"crop"); + p13_cropland_consv_shr(t,j)$(p13_cropland_consv_shr(t,j) > 1) = 1; + +* The following lines allow to freely chose a given share of the total cropland +* area that should be subject to conservation management with a lower land use intensity. + if(s13_croparea_consv_shr > 0 AND m_year(t) >= s13_croparea_consv_start, +* Because MAgPIE is not run at country-level, but at region level, a region +* share is calculated that translates the countries' influence to regional level. +* Countries are weighted by available cropland area. + p13_country_weight(i) = sum(i_to_iso(i,iso), p13_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); + p13_cropland_consv_shr(t,j) = i13_croparea_consv_fader(t) * + (s13_croparea_consv_shr * sum(cell(i,j), p13_country_weight(i)) + + s13_croparea_consv_shr_noselect * sum(cell(i,j), 1-p13_country_weight(i))); + + ); + +); + +* ISO country weights are calculated based on the available cropland area in each country +p13_country_wght_supreg(h) = sum((i_to_iso(i,iso), supreg(h,i)), p13_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum((i_to_iso(i,iso), supreg(h,i)), pm_avl_cropland_iso(iso)); + +* Country-weighted tau reduction factor for conservation land +p13_croparea_consv_tau_factor(h) = (s13_croparea_consv_tau_factor * p13_country_wght_supreg(h) + + s13_croparea_consv_tau_factor_noselect * (1-p13_country_wght_supreg(h))); + +if (ord(t) = 1, + pc13_tau_consv(h,tautype) = p13_croparea_consv_tau_factor(h) * pc13_tau(h,"crop"); +elseif c13_croparea_consv_tau_increase = 0 AND m_year(t) >= s13_croparea_consv_start, + v13_tau_consv.fx(h,tautype) = pc13_tau_consv(h,tautype); +); + + +* educated guess for tau levels: +if(ord(t) = 1, + v13_tau_core.l(h,tautype) = pc13_tau(h,tautype); + v13_tau_consv.l(h,tautype) = pc13_tau_consv(h,tautype); + vm_tau.l(j,tautype) = sum((cell(i,j), supreg(h,i)),(1-p13_cropland_consv_shr(t,j)) * v13_tau_core.l(h,tautype) + p13_cropland_consv_shr(t,j) * v13_tau_consv.l(h,tautype)); + pcm_tau(j,tautype) = vm_tau.l(j,tautype); +else + v13_tau_core.l(h,tautype) = pc13_tau(h,tautype)*(1+pc13_tcguess(h,tautype))**m_yeardiff(t); + v13_tau_consv.l(h,tautype) = p13_croparea_consv_tau_factor(h) * v13_tau_core.l(h,tautype); +); From 976b12e065fb2eb61d0147376f638c7f9aa3c5b3 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Thu, 26 Feb 2026 17:36:50 +0100 Subject: [PATCH 17/42] corrected set in equations of gsadapt yield realization --- modules/14_yields/gsadapt_nov25/equations.gms | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index 80a393e361..bed0930299 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -13,7 +13,7 @@ q14_yield_crop(j2,kcr,w) .. vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * - sum((cell(i2,j2), supreg(h2,i2)), vm_tau(h2,"crop") / fm_tau1995(h2)); + vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated *' and rainfed crops are calculated by multiplying calibrated input yields from @@ -35,5 +35,5 @@ q14_yield_crop(j2,kcr,w) .. q14_yield_past(j2,w) .. vm_yld(j2,"pasture",w) =e= sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) - * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) - * (1 + s14_yld_past_switch*(sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(h2, "crop")/fm_tau1995(h2)) - 1)); + * sum(cell(i2,j2), pm_past_mngmnt_factor(ct,i2))) + * (1 + s14_yld_past_switch * (pcm_tau(j2, "crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)) - 1)); From fe89ed8276a29a5bb57a82a7e656c7357200d60d Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Thu, 26 Feb 2026 17:44:49 +0100 Subject: [PATCH 18/42] correct set of vm_tau in nl_fix of gsadapt realization --- modules/14_yields/gsadapt_nov25/nl_fix.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/nl_fix.gms b/modules/14_yields/gsadapt_nov25/nl_fix.gms index a45e645a33..c33cf90636 100644 --- a/modules/14_yields/gsadapt_nov25/nl_fix.gms +++ b/modules/14_yields/gsadapt_nov25/nl_fix.gms @@ -7,5 +7,5 @@ * ### nl_fix ### -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w) / sum(cell(i,j), p14_yields_gsadapt_ratio_cumulative(ct,i))) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); -vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w) / sum(cell(i,j), p14_yields_gsadapt_ratio_cumulative(ct,i))) * vm_tau.l(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)); +vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (pcm_tau(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)) - 1)); From 6e98b322cd71d8574919796e697be71e3f6294c0 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Thu, 26 Feb 2026 17:47:25 +0100 Subject: [PATCH 19/42] correct set of vm_tau in nl_fix of mngt realization --- modules/14_yields/managementcalib_aug19/nl_fix.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/14_yields/managementcalib_aug19/nl_fix.gms b/modules/14_yields/managementcalib_aug19/nl_fix.gms index 07339b646d..e93d662442 100644 --- a/modules/14_yields/managementcalib_aug19/nl_fix.gms +++ b/modules/14_yields/managementcalib_aug19/nl_fix.gms @@ -7,5 +7,5 @@ * ### nl_fix ### -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); -vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * vm_tau.l(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)); +vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (pcm_tau(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)) - 1)); From f24c5a7b88cd397db50a4a0127051681322e6115 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Fri, 27 Feb 2026 10:41:27 +0100 Subject: [PATCH 20/42] set default to new realizations with constgsadapt --- config/default.cfg | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index e7a2b6094b..f8dd7e4ad9 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -287,13 +287,13 @@ 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 -# * (endo_jan25): endogenous technological change with full cost accounting and +# * (endo_nov25): endogenous technological change with full cost accounting and # * stepwise updated crop and managed pastures area information -# * including account of growing period adaptation -# * (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 +# * 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_nov25" # def = endo_nov25 # * tc cost scenario crops: low, medium or high cfg$gms$c13_tccost <- "medium" # def = medium @@ -354,10 +354,10 @@ cfg$gms$s13_croparea_consv_target <- 2030 # def = 2030 # * (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 -# * (gsadapt_nov25): yields with future growing period adaptation based on LPJmL simulations -# * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional, +# * (gsadapt_nov25): yields (optionally with future growing period adaptation) based on LPJmL simulations +# * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional levels, # * pasture yields increase based on exogenous demand-side proxy for growth rate of cattle stocks -cfg$gms$yields <- "managementcalib_aug19" # def = managementcalib_aug19 +cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 # * yield scenario # * options: cc (climate change) @@ -404,14 +404,18 @@ 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 <- 10 #def = 10 - -# Use growing period adaption for yield under climate change -cfg$gms$s14_use_gsadapt <- 1 #def = 1 - -# Account for growing period adaption (gsadapt) in tau (1) -# Do not consider gsadapt in tau (it then comes for free) (0) -cfg$gms$s14_gsadapt2tau <- 1 #def = 1 +cfg$gms$s14_minimum_wood_yield <- 10 # def = 10 + +# 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 <- 0 # 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 <- 0 # def = 0 # ***--------------------- 15_food --------------------------------------- # * (anthropometrics_jan18): estimates food using scenario dependent regression From f308eab08cec1f8207c7d0f801bc04b0859caeb9 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Fri, 27 Feb 2026 16:46:44 +0100 Subject: [PATCH 21/42] update input vector to lpjml5 data --- config/default.cfg | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index fe4fee4414..0256d36bef 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -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.130_h12_magpie.tgz", - cellular = "rev4.130_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz", - validation = "rev4.130_h12_92e02314_validation.tgz", +cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", + cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_e3aebc2e_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", + validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") + calibration = "calibration_H12_FAO_18Sep25.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, From 5117130450bb231d8c74a50c000a6e80bd7eae27 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Tue, 3 Mar 2026 15:48:40 +0100 Subject: [PATCH 22/42] update start script --- modules/14_yields/gsadapt_nov25/preloop.gms | 2 +- scripts/start/projects/test_lpjml2magpie.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index a6fa983ccc..60feebd133 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -148,7 +148,7 @@ if ((s14_calib_ir2rf = 1), i14_yields_calib_combined(t,j,yldtype,knbe14,w); ); -* Set yields to gsadapt values (pasture yields are not effected by growing period adaption) +* Set yields to gsadapt values (pasture yields are not affected by growing period adaption) if(s14_use_gsadapt = 1, pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index 14bad61e12..ba62694070 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -17,8 +17,8 @@ source("scripts/start_functions.R") # source default configuration source("config/default.cfg") -title <- "l2m_feb26" -cfg$recalibrate_landconversion_cost <- "ifneeded" #### Should I change this to TRUE? +title <- "l2m_mar26" +cfg$recalibrate_landconversion_cost <- TRUE ############################################## ### Current default (i.e., old lpjml data) ### From 52584893980ce1cf6a418c4577888e319c080605 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Sun, 12 Apr 2026 00:45:42 +0200 Subject: [PATCH 23/42] BE yield calibration + testing script --- config/default.cfg | 6 +++ .../14_yields/gsadapt_nov25/declarations.gms | 9 ++++ modules/14_yields/gsadapt_nov25/input.gms | 23 +++++++++ modules/14_yields/gsadapt_nov25/input/files | 3 ++ modules/14_yields/gsadapt_nov25/preloop.gms | 49 ++++++++++++++++--- modules/14_yields/gsadapt_nov25/sets.gms | 3 ++ scripts/start/projects/test_BEcalib.R | 47 ++++++++++++++++++ 7 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 scripts/start/projects/test_BEcalib.R diff --git a/config/default.cfg b/config/default.cfg index 0256d36bef..eb59d39fac 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -365,6 +365,12 @@ cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 # * nocc_hist (no climate change after year defined by sm_fix_cc) cfg$gms$c14_yields_scenario <- "cc" # def = "cc" +# * Li2020 biophysical calibration mode for bioenergy crops (begr, betr) +# * options: regional (calibrate to Li2020 regional means) +# * global (calibrate to Li2020 global mean) +# * off (no Li2020 biophysical calibration) +cfg$gms$c14_be_calib <- "regional" # def = "regional" + # * 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: diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index 6beb15a8b9..704e8c3631 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -20,6 +20,15 @@ parameters i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical referende year (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) + f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops aggregated to regions (tDM per ha per yr) + f14_global_be_yields(t_all,*,kbe14) Li2020 reference yields for bioenergy crops aggregated to global level (tDM per ha per yr) + f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster used for Li2020 bioenergy yield aggregation (mio. ha) +*' TODO: once preprocessing is rerun, this parameter will be timeless (no t_all dimension). +*' Remove t_all here and update the "y2010" index in preloop.gms accordingly. + i14_be_LPJ_reg(i,yldtype,kbe14) LPJmL regional mean rainfed yields for bioenergy crops at y1995 per yldtype (tDM per ha per yr) + i14_be_LPJ_glo(yldtype,kbe14) LPJmL global mean rainfed yields for bioenergy crops at y1995 per yldtype (tDM per ha per yr) + i14_be_calib_reg(i,yldtype,kbe14) Regional calibration factor for bioenergy crops based on Li2020 per yldtype (1) + i14_be_calib_glo(yldtype,kbe14) Global calibration factor for bioenergy crops based on Li2020 per yldtype (1) pm_timber_yield(t,j,ac,land_timber) Forest growing stock (tDM per ha per yr) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index 42314eae2a..dddd2b9968 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -5,6 +5,11 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +$setglobal c14_be_calib regional +* options: regional (biophysical calibration using Li2020 regional means) +* global (biophysical calibration using Li2020 global mean) +* off (no Li2020 biophysical calibration) + $setglobal c14_yields_scenario cc * options: cc (climate change) * nocc (no climate change) @@ -109,3 +114,21 @@ $include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" $offdelim / ; + +table f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops per region (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/gsadapt_nov25/input/f14_region_be_yields.cs3" +$offdelim +; + +table f14_global_be_yields(t_all,*,kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.cs3" +$offdelim +; + +table f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster for Li2020 bioenergy yield aggregation (mio. ha) +$ondelim +$include "./modules/14_yields/gsadapt_nov25/input/f14_cluster_be_croparea_weights.cs3" +$offdelim +; diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files index cf2be7a6dc..63378a2e39 100644 --- a/modules/14_yields/gsadapt_nov25/input/files +++ b/modules/14_yields/gsadapt_nov25/input/files @@ -3,3 +3,6 @@ f14_region_yields.cs3 f14_ir2rf_ratio.cs4 f14_ipcc_bce.cs3 f14_aboveground_fraction.csv +f14_region_be_yields.cs3 +f14_global_be_yields.cs3 +f14_cluster_be_croparea_weights.cs3 diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index 60feebd133..f14dd05ae2 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -100,13 +100,6 @@ loop(t, *' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` *' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: -***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* -i14_yields_calib_combined(t,j,yldtype,"begr",w) = i14_yields_combined(t,j,yldtype,"begr",w) * - sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -i14_yields_calib_combined(t,j,yldtype,"betr",w) = i14_yields_combined(t,j,yldtype,"betr",w) * - sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -******************************************************************************************* - i14_managementcalib(t,j,yldtype,knbe14,w) = 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,yldtype,knbe14)) / i14_yields_combined(t,j,yldtype,knbe14,w) * @@ -148,6 +141,48 @@ if ((s14_calib_ir2rf = 1), i14_yields_calib_combined(t,j,yldtype,knbe14,w); ); +***BIOPHYSICAL CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (Li2020)******************* +*' Step 1: Compute LPJmL weighted mean rainfed yields for bioenergy crops at y1995 — +*' regional (weighted by cropland area per cluster) and global, per yldtype. +*' To-Do-NOTE: "y2010" index in f14_cluster_be_croparea_weights is a workaround — the data +*' are actually y1995 cropland areas mislabelled during preprocessing. Once preprocessing +*' is rerun the weights file will be timeless; remove "y2010" index and t_all from the +*' parameter declaration then. +i14_be_LPJ_reg(i,yldtype,kbe14) = + sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / + (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); + +i14_be_LPJ_glo(yldtype,kbe14) = + sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / + (sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); + +*' Step 2: Compute calibration factors as Li2020 / LPJmL mean — regional and global. +*' Fall back to 1 where LPJmL mean is zero. +i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) > 0) = + f14_region_be_yields("y2010",i,kbe14) / i14_be_LPJ_reg(i,yldtype,kbe14); +i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) = 0) = 1; + +i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) > 0) = + f14_global_be_yields("y2010","GLO",kbe14) / i14_be_LPJ_glo(yldtype,kbe14); +i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) = 0) = 1; + +*' Step 3: Apply Li2020 biophysical calibration to i14_yields_calib_combined. +$ifthen "%c14_be_calib%" == "regional" + i14_yields_calib_combined(t,j,yldtype,kbe14,w) = + i14_yields_combined(t,j,yldtype,kbe14,w) * sum(cell(i,j), i14_be_calib_reg(i,yldtype,kbe14)); +$elseif "%c14_be_calib%" == "global" + i14_yields_calib_combined(t,j,yldtype,kbe14,w) = + i14_yields_combined(t,j,yldtype,kbe14,w) * i14_be_calib_glo(yldtype,kbe14); +$else + i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_combined(t,j,yldtype,kbe14,w); +$endif + +***MANAGEMENT CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (tau scaling)**************** +*' Tau-based management calibration applied on top of the Li2020 biophysical calibration. +i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,yldtype,kbe14,w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +******************************************************************************************* + * Set yields to gsadapt values (pasture yields are not affected by growing period adaption) if(s14_use_gsadapt = 1, diff --git a/modules/14_yields/gsadapt_nov25/sets.gms b/modules/14_yields/gsadapt_nov25/sets.gms index d40bc8a900..73167b8d61 100644 --- a/modules/14_yields/gsadapt_nov25/sets.gms +++ b/modules/14_yields/gsadapt_nov25/sets.gms @@ -30,6 +30,9 @@ sets oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, foddr, cottn_pro / + kbe14(kcr) Bioenergy cropping activities + / begr, betr / + ncp_type14 natures contributions to people (NCP) relevant for agricultural yields / soil_intact, poll_suff / diff --git a/scripts/start/projects/test_BEcalib.R b/scripts/start/projects/test_BEcalib.R new file mode 100644 index 0000000000..8f1bb590a7 --- /dev/null +++ b/scripts/start/projects/test_BEcalib.R @@ -0,0 +1,47 @@ +# | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# ---------------------------------------------------------- +# description: Test Li2020 bioenergy yield calibration in gsadapt_nov25 +# 3 BE calibration options (off, regional, global) x +# 2 gsadapt options (gsconst, gsadapt) = 6 runs +# ---------------------------------------------------------- + +###################################### +#### Script to start a MAgPIE run #### +###################################### +source("scripts/start_functions.R") +source("config/default.cfg") + +title <- "l2m_apr26" + +cfg$gms$yields <- "gsadapt_nov25" +cfg$gms$tc <- "endo_nov25" +cfg$recalibrate_landconversion_cost <- FALSE + +cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_mar2026+BEdata_h12_magpie.tgz", + cellular = "rev4.130l2m_v5-10-0m2_mar2026+BEdata_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + validation = "rev4.130l2m_v5-10-0m2_mar2026+BEdata_h12_92e02314_validation.tgz", + additional = "additional_data_rev4.63.tgz", + calibration = "calibration_H12_FAO_18Sep25.tgz") + +for (becalib in c("off", "regional", "global")) { + cfg$gms$c14_be_calib <- becalib + + for (gsadapt in c("gsconst", "gsadapt")) { + if (gsadapt == "gsconst") { + cfg$gms$s14_use_gsadapt <- 0 + cfg$gms$s14_gsadapt2tau <- 0 + } else { + cfg$gms$s14_use_gsadapt <- 1 + cfg$gms$s14_gsadapt2tau <- 1 + } + + cfg$title <- paste0(title, "_BEcalib", becalib, "_", gsadapt) + start_run(cfg, codeCheck = TRUE) + } +} From 896eace77fe5f22b036dc786ebe1f5282065586a Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Sun, 12 Apr 2026 00:59:50 +0200 Subject: [PATCH 24/42] fix GLO dimension --- modules/14_yields/gsadapt_nov25/declarations.gms | 2 +- modules/14_yields/gsadapt_nov25/input.gms | 2 +- modules/14_yields/gsadapt_nov25/preloop.gms | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index 704e8c3631..6d09d1f54a 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -21,7 +21,7 @@ parameters i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops aggregated to regions (tDM per ha per yr) - f14_global_be_yields(t_all,*,kbe14) Li2020 reference yields for bioenergy crops aggregated to global level (tDM per ha per yr) + f14_global_be_yields(t_all,kbe14) Li2020 reference yields for bioenergy crops aggregated to global level (tDM per ha per yr) f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster used for Li2020 bioenergy yield aggregation (mio. ha) *' TODO: once preprocessing is rerun, this parameter will be timeless (no t_all dimension). *' Remove t_all here and update the "y2010" index in preloop.gms accordingly. diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index dddd2b9968..97e1643aae 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -121,7 +121,7 @@ $include "./modules/14_yields/gsadapt_nov25/input/f14_region_be_yields.cs3" $offdelim ; -table f14_global_be_yields(t_all,*,kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) +table f14_global_be_yields(t_all,kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) $ondelim $include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.cs3" $offdelim diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index f14dd05ae2..d78dae27f6 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -163,7 +163,7 @@ i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) > 0) = i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) = 0) = 1; i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) > 0) = - f14_global_be_yields("y2010","GLO",kbe14) / i14_be_LPJ_glo(yldtype,kbe14); + f14_global_be_yields("y2010",kbe14) / i14_be_LPJ_glo(yldtype,kbe14); i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) = 0) = 1; *' Step 3: Apply Li2020 biophysical calibration to i14_yields_calib_combined. From 8b4dfb6119a6bfff0988a2fe04267a9bdf69f8bb Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Wed, 6 May 2026 15:15:08 +0200 Subject: [PATCH 25/42] update gsadapt yield realization with updates of the timber yields in managementcalib realization --- .../14_yields/gsadapt_nov25/declarations.gms | 4 +- modules/14_yields/gsadapt_nov25/equations.gms | 4 +- modules/14_yields/gsadapt_nov25/input.gms | 12 ++-- modules/14_yields/gsadapt_nov25/preloop.gms | 13 ++++- modules/14_yields/gsadapt_nov25/presolve.gms | 58 ++++++++++--------- .../14_yields/gsadapt_nov25/realization.gms | 8 ++- modules/14_yields/gsadapt_nov25/scaling.gms | 8 +++ 7 files changed, 64 insertions(+), 43 deletions(-) create mode 100644 modules/14_yields/gsadapt_nov25/scaling.gms diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index 6d09d1f54a..ed3efe2ee8 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -17,7 +17,7 @@ parameters p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical referende year (tDM per ha per yr) + i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical reference year (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops aggregated to regions (tDM per ha per yr) @@ -29,7 +29,7 @@ parameters i14_be_LPJ_glo(yldtype,kbe14) LPJmL global mean rainfed yields for bioenergy crops at y1995 per yldtype (tDM per ha per yr) i14_be_calib_reg(i,yldtype,kbe14) Regional calibration factor for bioenergy crops based on Li2020 per yldtype (1) i14_be_calib_glo(yldtype,kbe14) Global calibration factor for bioenergy crops based on Li2020 per yldtype (1) - pm_timber_yield(t,j,ac,land_timber) Forest growing stock (tDM per ha per yr) + im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index bed0930299..0b40afad8c 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -35,5 +35,5 @@ q14_yield_crop(j2,kcr,w) .. q14_yield_past(j2,w) .. vm_yld(j2,"pasture",w) =e= sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) - * sum(cell(i2,j2), pm_past_mngmnt_factor(ct,i2))) - * (1 + s14_yld_past_switch * (pcm_tau(j2, "crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)) - 1)); + * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) + * (1 + s14_yld_past_switch*(sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(j2, "crop")/fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index 97e1643aae..9a085f549b 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -22,8 +22,8 @@ scalars s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / - s14_minimum_wood_yield Minimum wood yield for timber harvest in natural vegetation (tDM per ha per yr) / 10 / - s14_carbon_fraction Carbon fraction for conversion of biomass to dry matter (1) / 0.5/ + s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / + sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / ; @@ -85,13 +85,15 @@ $offdelim / ; -table f14_ipcc_bce(clcl,forest_type) IPCC Biomass Conversion and Expansion factors (1) +parameter fm_ipcc_bef(clcl) IPCC biomass expansion factor BEF (1) +/ $ondelim -$include "./modules/14_yields/input/f14_ipcc_bce.cs3" +$include "./modules/14_yields/input/f14_ipcc_bef.cs3" $offdelim +/ ; -parameter f14_aboveground_fraction(land_timber) Root to shoot ratio (1) +parameter fm_aboveground_fraction(land_timber) Aboveground fraction of total biomass (1) / $ondelim $include "./modules/14_yields/input/f14_aboveground_fraction.csv" diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index d78dae27f6..ef251e157e 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -9,9 +9,16 @@ p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / sum(cell(i,j),pm_land_start(j,"past")) ); -p14_pyield_corr(t,i) = (f14_pyld_hist(t,i)/p14_pyield_LPJ_reg(t,i))$(sum(sameas(t_past,t),1) = 1) - + sum(t_past,(f14_pyld_hist(t_past,i)/(p14_pyield_LPJ_reg(t_past,i)+0.000001))$(ord(t_past)=card(t_past)))$(sum(sameas(t_past,t),1) <> 1); -i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); +*' Pasture yield correction: use historical data for all years where available +*' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. +*' This avoids a discontinuity at the t_past boundary by using observed data +*' through y2020 instead of freezing at the last t_past year (y2015). +p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); +loop(t, + p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); +); + +i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); ***YIELD MANAGEMENT CALIBRATION************************************************************ diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index fb3b2131ea..027777de5d 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -5,62 +5,64 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de +*** EOF presolve.gms *** + * calculate carbon density -*** YIELDS +*** HARVESTABLE GROWING STOCK -*` `pm_carbon_density_plantation_ac` for vegetation Carbon is above- and belowground +*' `pm_carbon_density_plantation_ac` for vegetation carbon is above- and belowground *' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon -*' fraction of `s14_carbon_fraction` in tC/tDM. For assessing wood harvesting +*' fraction of `sm_carbon_fraction` in tC/tDM. For assessing wood harvesting *' we need only aboveground biomass information, therefore we multiply with -*' aboveground `f14_aboveground_fraction`. Additionally, we divide aboveground -*' tree biomass by biomass conversion and expansion (BCE) factor to get stem -*' biomass in tDM/ha. +*' aboveground `fm_aboveground_fraction`. Additionally, we divide aboveground +*' tree biomass by the Biomass Expansion Factor (BEF, dimensionless) to get +*' stem biomass in tDM/ha. BEF = AGB (aboveground biomass) / stem_biomass (always > 1). -*` @code +*' @code -pm_timber_yield(t,j,ac,"forestry") = +im_growing_stock(t,j,ac,"forestry") = ( pm_carbon_density_plantation_ac(t,j,ac,"vegc") - / s14_carbon_fraction - * f14_aboveground_fraction("forestry") - / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"plantations")) + / sm_carbon_fraction + * fm_aboveground_fraction("forestry") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) ) ; -pm_timber_yield(t,j,ac,"primforest") = +im_growing_stock(t,j,ac,"primforest") = ( fm_carbon_density(t,j,"primforest","vegc") - / s14_carbon_fraction - * f14_aboveground_fraction("primforest") - / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + / sm_carbon_fraction + * fm_aboveground_fraction("primforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) ) ; -pm_timber_yield(t,j,ac,"secdforest") = +im_growing_stock(t,j,ac,"secdforest") = ( pm_carbon_density_secdforest_ac(t,j,ac,"vegc") - / s14_carbon_fraction - * f14_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + / sm_carbon_fraction + * fm_aboveground_fraction("secdforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) ) ; -pm_timber_yield(t,j,ac,"other") = +im_growing_stock(t,j,ac,"other") = ( pm_carbon_density_other_ac(t,j,ac,"vegc") - / s14_carbon_fraction - * f14_aboveground_fraction("other") - / sum(clcl, pm_climate_class(j,clcl) * f14_ipcc_bce(clcl,"natveg")) + / sm_carbon_fraction + * fm_aboveground_fraction("other") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) ) ; -*` @stop +*' @stop -** Hard constraint to always have a positive number in pm_timber_yield -pm_timber_yield(t,j,ac,land_timber) = pm_timber_yield(t,j,ac,land_timber)$(pm_timber_yield(t,j,ac,land_timber) > 0) + 0.0001$(pm_timber_yield(t,j,ac,land_timber) = 0); -** Put yields to 0 where they dont exceed a minimum yield for harvest -pm_timber_yield(t,j,ac,land_natveg)$(pm_timber_yield(t,j,ac,land_natveg) < s14_minimum_wood_yield) = 0; +** Hard constraint to always have a positive number in im_growing_stock +im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); +** Set growing stock to 0 where it does not exceed a minimum for harvest +im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; * Calculate growing period adaption factor based on previous croppping pattern if (ord(t) = 1, diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms index a4a29c5504..6135231ff6 100644 --- a/modules/14_yields/gsadapt_nov25/realization.gms +++ b/modules/14_yields/gsadapt_nov25/realization.gms @@ -16,9 +16,10 @@ *' ratio as provided by AQUASTAT [@fao_aquastat_2016]. *' Finally, crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the *' initial time step. An additional feature of this realization is to allow crop yields -*' technological change from the precedent times step to spillover to pasture areas. This -*' realization also calculates the growth stocks in commercial plantations and natural -*' vegetation using LPJmL Carbon stocks. +*' technological change from the precedent times step to spillover to pasture areas. +*' This realization also calculates harvestable growing stock (`im_growing_stock`) as +*' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion +*' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. *' @limitations The exogenous implementation of pasture intensification cannot *' capture feedbacks between land scarcity and efforts to improve pasture @@ -31,6 +32,7 @@ $Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_nov25/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_nov25/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_nov25/input.gms" $Ifi "%phase%" == "equations" $include "./modules/14_yields/gsadapt_nov25/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/14_yields/gsadapt_nov25/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/14_yields/gsadapt_nov25/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/14_yields/gsadapt_nov25/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/14_yields/gsadapt_nov25/postsolve.gms" diff --git a/modules/14_yields/gsadapt_nov25/scaling.gms b/modules/14_yields/gsadapt_nov25/scaling.gms new file mode 100644 index 0000000000..ef2b844f16 --- /dev/null +++ b/modules/14_yields/gsadapt_nov25/scaling.gms @@ -0,0 +1,8 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*q14_yield_past.scale(j,w) = 1e-2; From 2081ba33a52a4c2ed0b159dca67e32091be72563 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Wed, 6 May 2026 23:52:44 +0200 Subject: [PATCH 26/42] update BE calibration to be included in the limit calibration approach --- .../14_yields/gsadapt_nov25/declarations.gms | 10 +- modules/14_yields/gsadapt_nov25/preloop.gms | 144 ++++++++++-------- 2 files changed, 85 insertions(+), 69 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index ed3efe2ee8..da3a28dd3c 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -11,13 +11,13 @@ parameters i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) - pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) + pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) p14_yields_gsadapt_ratio_cumulative(t,i) Cumulative effect of growing period adaption from the first to the current timestep (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical reference year (tDM per ha per yr) + i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (FAO for crops, Li2020 for bioenergy crops) (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops aggregated to regions (tDM per ha per yr) @@ -25,11 +25,7 @@ parameters f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster used for Li2020 bioenergy yield aggregation (mio. ha) *' TODO: once preprocessing is rerun, this parameter will be timeless (no t_all dimension). *' Remove t_all here and update the "y2010" index in preloop.gms accordingly. - i14_be_LPJ_reg(i,yldtype,kbe14) LPJmL regional mean rainfed yields for bioenergy crops at y1995 per yldtype (tDM per ha per yr) - i14_be_LPJ_glo(yldtype,kbe14) LPJmL global mean rainfed yields for bioenergy crops at y1995 per yldtype (tDM per ha per yr) - i14_be_calib_reg(i,yldtype,kbe14) Regional calibration factor for bioenergy crops based on Li2020 per yldtype (1) - i14_be_calib_glo(yldtype,kbe14) Global calibration factor for bioenergy crops based on Li2020 per yldtype (1) - im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) + im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index ef251e157e..e8b0762b50 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -27,9 +27,10 @@ i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell *' @code *' The following equations calibrate the cellular yield patterns (`f14_yields`) to match -*' FAO historical yields (`f14_fao_yields_hist`) by calculating a calibration term called +*' historical reference yields (`i14_calib_target_yields_hist`) by calculating a calibration term called *' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical -*' yields reported by FAO (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) +*' yields reported by FAO for croplands (`f14_fao_yields_hist`) or Li2020 for bioenergy crops +*' (`f14_region_be_yields` / `f14_global_be_yields`) and regional mean yields (`i14_modeled_yields_hist`) *' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models *' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative *' calibration factor that depends only on the initial conditions of the starting year. @@ -57,11 +58,16 @@ i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell *' both types individually as even so the growing seasons are held constant from 1995 *' onwards, due to long term averaging the yields already differ in 1995. +*** INITIALIZATION of crop yield parameters + i14_yields_combined(t,j,"constgsadapt",kcr,w) = f14_yields_constgsadapt(t,j,kcr,w); i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); +************************************************************************************** +*** STEP 1: CALCULATE modeled regional historical yields + *' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields *' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where *' a region has no crop area reported for a given crop type, the total crop area is @@ -75,51 +81,101 @@ i14_modeled_yields_hist(t_past,i,yldtype,knbe14) 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) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); +*' Compute LPJmL weighted mean rainfed yields for bioenergy crops at y1995 — +*' regional (weighted by cropland area per cluster) and global, per yldtype. +*' To-Do-NOTE: "y2010" index in f14_cluster_be_croparea_weights is a workaround — the data +*' are actually y1995 cropland areas mislabelled during preprocessing. Once preprocessing +*' is rerun the weights file will be timeless; remove "y2010" index and t_all from the +*' parameter declaration then. +*' NOTE: For BE yield calibration "off" calibration target will be set to `i14_modeled_yields_hist`, +*' so calibration factors are always 1. Modeled yield has to be calculated therefore. + +$ifthen "%c14_be_calib%" == "regional" + i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = + sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / + (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); +$elseif "%c14_be_calib%" == "global" + i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = + sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / + (sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); +$else + i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = + sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / + (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); +$endif + +************************************************************************************** +*** STEP 2: SET CALIB TARGET with FAO for knbe14 and Li historical data for kbe14 + +i14_calib_target_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); + +$ifthen "%c14_be_calib%" == "regional" + i14_calib_target_yields_hist(t,i,kbe14) = f14_region_be_yields("y2010",i,kbe14); +$elseif "%c14_be_calib%" == "global" + i14_calib_target_yields_hist(t,i,kbe14) = f14_global_be_yields("y2010",kbe14); +$else + i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); +$endif + +*' NOTE: For BE yield calibration "off" calibration target will be set to `i14_modeled_yields_hist`, +*' so calibration factors are always 1. + +************************************************************************************** +*** STEP 3: LOOP OVER TIME calculating calibration parameters for all time steps + *' The factor `i14_lambda_yields` is calculated for the initial time step depending *' on the setting `s14_limit_calib` and is then held constant for all other time steps. -*' The regional FAO yield and regional yield of the crop model input of the initial -*' time step is kept constant in the two parameters `i14_fao_yields_hist` and -*' `i14_modeled_yields_hist`: +*' The regional calibration target yield and regional yield of the crop model input of +*' the initial time step is kept constant in the two parameters `i14_calib_target_yields_hist` +*' and `i14_modeled_yields_hist`: loop(t, if(sum(sameas(t,"y1995"),1)=1, - if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,yldtype,knbe14) = 1; + if ((s14_limit_calib = 0), + i14_lambda_yields(t,i,yldtype,kcr) = 1; - Elseif (s14_limit_calib =1 ), - i14_lambda_yields(t,i,yldtype,knbe14) = - 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,yldtype,knbe14)) - + sqrt(i14_modeled_yields_hist(t,i,yldtype,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ - (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,yldtype,knbe14)); + Elseif (s14_limit_calib = 1 ), + i14_lambda_yields(t,i,yldtype,kcr) = + 1$(i14_calib_target_yields_hist(t,i,kcr) <= i14_modeled_yields_hist(t,i,yldtype,kcr)) + + sqrt(i14_modeled_yields_hist(t,i,yldtype,kcr)/i14_calib_target_yields_hist(t,i,kcr))$ + (i14_calib_target_yields_hist(t,i,kcr) > i14_modeled_yields_hist(t,i,yldtype,kcr)); ); - i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); - Else - i14_modeled_yields_hist(t,i,yldtype,knbe14) = i14_modeled_yields_hist(t-1,i,yldtype,knbe14); - i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); - i14_lambda_yields(t,i,yldtype,knbe14) = i14_lambda_yields(t-1,i,yldtype,knbe14); + i14_modeled_yields_hist(t,i,yldtype,kcr) = i14_modeled_yields_hist(t-1,i,yldtype,kcr); + i14_calib_target_yields_hist(t,i,kcr) = i14_calib_target_yields_hist(t-1,i,kcr); + i14_lambda_yields(t,i,yldtype,kcr) = i14_lambda_yields(t-1,i,yldtype,kcr); ); ); +************************************************************************************** +*** STEP 4: APPLY calculated calibration factors for all time steps + *' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending -*' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` +*' on the constant values `i14_modeled_yields_hist`, `i14_calib_target_yields_hist`, `i14_lambda_yields` *' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: -i14_managementcalib(t,j,yldtype,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,yldtype,knbe14)) / - i14_yields_combined(t,j,yldtype,knbe14,w) * - (i14_yields_combined(t,j,yldtype,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,yldtype,knbe14)))$(i14_yields_combined(t,j,yldtype,knbe14,w)>0); +i14_managementcalib(t,j,yldtype,kcr,w) = + 1 + (sum(cell(i,j), i14_calib_target_yields_hist(t,i,kcr) - i14_modeled_yields_hist(t,i,yldtype,kcr)) / + i14_yields_combined(t,j,yldtype,kcr,w) * + (i14_yields_combined(t,j,yldtype,kcr,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,kcr))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,yldtype,kcr)))$(i14_yields_combined(t,j,yldtype,kcr,w)>0); + +$ifthen "%c14_be_calib%" == "off" + i14_managementcalib(t,j,yldtype,kbe14,w) = 1; +$endif -i14_yields_calib_combined(t,j,yldtype,knbe14,w) = i14_managementcalib(t,j,yldtype,knbe14,w) * i14_yields_combined(t,j,yldtype,knbe14,w); +i14_yields_calib_combined(t,j,yldtype,kcr,w) = i14_managementcalib(t,j,yldtype,kcr,w) * i14_yields_combined(t,j,yldtype,kcr,w); *' Note that the calculation is split into two parts for better readability. +************************************************************************************** + *' Irrigated yields are calibrated to meet the country-level *' ratio between irrigated and rainfed yields reported by Aquastat. *' This can be de-activated with the switch `s14_calib_ir2rf`. +*' This calibration in only done for knbe14 (all crops excluding bioenergy crops) if ((s14_calib_ir2rf = 1), * Weighted yields @@ -133,7 +189,7 @@ if ((s14_calib_ir2rf = 1), i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); -* Calibrate newly calibrated yields to FAO yields +* Calibrate newly calibrated yields to calib target yields i14_modeled_yields_hist2(i,yldtype,knbe14) = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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 @@ -143,47 +199,11 @@ if ((s14_calib_ir2rf = 1), sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); - i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_calib_target_yields_hist("y1995",i,knbe14) / i14_modeled_yields_hist2(i,yldtype,knbe14)) * i14_yields_calib_combined(t,j,yldtype,knbe14,w); ); -***BIOPHYSICAL CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (Li2020)******************* -*' Step 1: Compute LPJmL weighted mean rainfed yields for bioenergy crops at y1995 — -*' regional (weighted by cropland area per cluster) and global, per yldtype. -*' To-Do-NOTE: "y2010" index in f14_cluster_be_croparea_weights is a workaround — the data -*' are actually y1995 cropland areas mislabelled during preprocessing. Once preprocessing -*' is rerun the weights file will be timeless; remove "y2010" index and t_all from the -*' parameter declaration then. -i14_be_LPJ_reg(i,yldtype,kbe14) = - sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / - (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); - -i14_be_LPJ_glo(yldtype,kbe14) = - sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / - (sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); - -*' Step 2: Compute calibration factors as Li2020 / LPJmL mean — regional and global. -*' Fall back to 1 where LPJmL mean is zero. -i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) > 0) = - f14_region_be_yields("y2010",i,kbe14) / i14_be_LPJ_reg(i,yldtype,kbe14); -i14_be_calib_reg(i,yldtype,kbe14)$(i14_be_LPJ_reg(i,yldtype,kbe14) = 0) = 1; - -i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) > 0) = - f14_global_be_yields("y2010",kbe14) / i14_be_LPJ_glo(yldtype,kbe14); -i14_be_calib_glo(yldtype,kbe14)$(i14_be_LPJ_glo(yldtype,kbe14) = 0) = 1; - -*' Step 3: Apply Li2020 biophysical calibration to i14_yields_calib_combined. -$ifthen "%c14_be_calib%" == "regional" - i14_yields_calib_combined(t,j,yldtype,kbe14,w) = - i14_yields_combined(t,j,yldtype,kbe14,w) * sum(cell(i,j), i14_be_calib_reg(i,yldtype,kbe14)); -$elseif "%c14_be_calib%" == "global" - i14_yields_calib_combined(t,j,yldtype,kbe14,w) = - i14_yields_combined(t,j,yldtype,kbe14,w) * i14_be_calib_glo(yldtype,kbe14); -$else - i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_combined(t,j,yldtype,kbe14,w); -$endif - ***MANAGEMENT CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (tau scaling)**************** *' Tau-based management calibration applied on top of the Li2020 biophysical calibration. i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,yldtype,kbe14,w) * From fc43e14f0c66a48b863948d24636be0eb636d3e3 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Fri, 15 May 2026 00:01:00 +0200 Subject: [PATCH 27/42] update BE calib to new (timeless) format of input data + irrigation information of BE croparea weights --- .../14_yields/gsadapt_nov25/declarations.gms | 5 ----- modules/14_yields/gsadapt_nov25/input.gms | 6 +++--- modules/14_yields/gsadapt_nov25/preloop.gms | 20 ++++++++----------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index da3a28dd3c..cf0bcf8056 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -20,11 +20,6 @@ parameters i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (FAO for crops, Li2020 for bioenergy crops) (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) - f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops aggregated to regions (tDM per ha per yr) - f14_global_be_yields(t_all,kbe14) Li2020 reference yields for bioenergy crops aggregated to global level (tDM per ha per yr) - f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster used for Li2020 bioenergy yield aggregation (mio. ha) -*' TODO: once preprocessing is rerun, this parameter will be timeless (no t_all dimension). -*' Remove t_all here and update the "y2010" index in preloop.gms accordingly. im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index 9a085f549b..cfaacd215c 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -117,19 +117,19 @@ $offdelim / ; -table f14_region_be_yields(t_all,i,kbe14) Li2020 reference yields for bioenergy crops per region (tDM per ha per yr) +table f14_region_be_yields(i,kbe14) Li2020 reference yields for bioenergy crops per region (tDM per ha per yr) $ondelim $include "./modules/14_yields/gsadapt_nov25/input/f14_region_be_yields.cs3" $offdelim ; -table f14_global_be_yields(t_all,kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) +table f14_global_be_yields(kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) $ondelim $include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.cs3" $offdelim ; -table f14_cluster_be_croparea_weights(t_all,j,kbe14) Cropland area weights per cluster for Li2020 bioenergy yield aggregation (mio. ha) +table f14_cluster_be_croparea_weights(j,kbe14,w) Cropland area weights per cluster for Li2020 bioenergy yield aggregation (mio. ha) $ondelim $include "./modules/14_yields/gsadapt_nov25/input/f14_cluster_be_croparea_weights.cs3" $offdelim diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index e8b0762b50..0b46fde94d 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -83,25 +83,21 @@ i14_modeled_yields_hist(t_past,i,yldtype,knbe14) *' Compute LPJmL weighted mean rainfed yields for bioenergy crops at y1995 — *' regional (weighted by cropland area per cluster) and global, per yldtype. -*' To-Do-NOTE: "y2010" index in f14_cluster_be_croparea_weights is a workaround — the data -*' are actually y1995 cropland areas mislabelled during preprocessing. Once preprocessing -*' is rerun the weights file will be timeless; remove "y2010" index and t_all from the -*' parameter declaration then. *' NOTE: For BE yield calibration "off" calibration target will be set to `i14_modeled_yields_hist`, *' so calibration factors are always 1. Modeled yield has to be calculated therefore. $ifthen "%c14_be_calib%" == "regional" i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / - (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); + sum((cell(i,j),w) f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + (sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); $elseif "%c14_be_calib%" == "global" i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / - (sum(j, f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); + sum((j,w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + (sum((j,w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); $else i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14) * i14_yields_combined("y1995",j,yldtype,kbe14,"rainfed")) / - (sum(cell(i,j), f14_cluster_be_croparea_weights("y2010",j,kbe14)) + 1e-8); + sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + (sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); $endif ************************************************************************************** @@ -110,9 +106,9 @@ $endif i14_calib_target_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); $ifthen "%c14_be_calib%" == "regional" - i14_calib_target_yields_hist(t,i,kbe14) = f14_region_be_yields("y2010",i,kbe14); + i14_calib_target_yields_hist(t,i,kbe14) = f14_region_be_yields(i,kbe14); $elseif "%c14_be_calib%" == "global" - i14_calib_target_yields_hist(t,i,kbe14) = f14_global_be_yields("y2010",kbe14); + i14_calib_target_yields_hist(t,i,kbe14) = f14_global_be_yields(kbe14); $else i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); $endif From e98afee6b460963105f3f4c6ab932fb1cdccddc6 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Thu, 21 May 2026 11:06:44 +0200 Subject: [PATCH 28/42] update start script --- scripts/start/projects/test_lpjml2magpie.R | 48 +++++++++++----------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index ba62694070..7f7209073f 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -17,7 +17,7 @@ source("scripts/start_functions.R") # source default configuration source("config/default.cfg") -title <- "l2m_mar26" +title <- "l2m_may26" cfg$recalibrate_landconversion_cost <- TRUE ############################################## @@ -27,52 +27,52 @@ cfg$gms$yields <- "managementcalib_aug19" cfg$gms$tc <- "endo_jan22" # RCP2.6 -cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp26") -cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", - cellular = "rev4.130l2m_default_feb2026_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz", - validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? +#cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp26") +#cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", +# cellular = "rev4.130l2m_default_feb2026_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz", +# validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", +# additional = "additional_data_rev4.65.tgz", +# calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? # start MAgPIE run -start_run(cfg, codeCheck = TRUE) +#start_run(cfg, codeCheck = TRUE) # RCP7.0 -cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp70") -cfg$input <- c(regional = "rev4.130l2m_default_feb2026_h12_magpie.tgz", - cellular = "rev4.130l2m_default_feb2026_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.130l2m_default_feb2026_h12_92e02314_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? +#cfg$title <- paste0(title, "_Default_mngtcalib_", "rcp70") +#cfg$input <- c(regional = "rev4.131_h12_magpie.tgz", +# cellular = "rev4.131_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz", +# validation = "rev4.131_h12_92e02314_validation.tgz", +# additional = "additional_data_rev4.65.tgz", + # calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? # start MAgPIE run -start_run(cfg, codeCheck = TRUE) +#start_run(cfg, codeCheck = TRUE) ##################### ### Newlpjml data ### ##################### ### Different RCPs (2x) ### -for (rcp in c("2p6", "7p0")) { +for (rcp in c("7p0")) { # 2p6 if (rcp == "2p6") { # RCP2.6 cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_e3aebc2e_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? + additional = "additional_data_rev4.65.tgz", + calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? } else if (rcp == "7p0") { # RCP7.0 - cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", - cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", - validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", - additional = "additional_data_rev4.63.tgz", - calibration = "calibration_H12_FAO_18Sep25.tgz") #### Do I need to change this when I recalibrate? + cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_magpie.tgz", + cellular = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + validation = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_92e02314_validation.tgz", + additional = "additional_data_rev4.65.tgz", + calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? } else { stop("selected rcp not available") } ### Different realizations (2x) ### - for (realization in c("mngt", "gsadapt")) { + for (realization in c("gsadapt")) { # "mngt", if (realization == "mngt") { # default realizations From 79acb802f19240e4f3d51b6474d9c10b8b16f141 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Fri, 29 May 2026 11:26:02 +0200 Subject: [PATCH 29/42] bugfixes and code clean up and documentation as part of L2M data update --- config/default.cfg | 8 ++-- core/sets.gms | 48 +++++++++---------- literature.bib | 20 ++++++++ main.gms | 2 +- modules/13_tc/endo_nov25/equations.gms | 2 - modules/13_tc/endo_nov25/presolve.gms | 5 +- modules/13_tc/endo_nov25/realization.gms | 2 +- .../14_yields/gsadapt_nov25/declarations.gms | 10 ++-- modules/14_yields/gsadapt_nov25/equations.gms | 5 +- modules/14_yields/gsadapt_nov25/input.gms | 22 +++++---- modules/14_yields/gsadapt_nov25/input/files | 4 +- modules/14_yields/gsadapt_nov25/preloop.gms | 21 ++++---- .../14_yields/gsadapt_nov25/realization.gms | 23 +++++---- modules/14_yields/gsadapt_nov25/scaling.gms | 8 ---- modules/14_yields/gsadapt_nov25/sets.gms | 4 +- modules/14_yields/module.gms | 9 ++-- modules/56_ghg_policy/price_aug22/sets.gms | 6 +-- .../1st2ndgen_priced_feb24/sets.gms | 6 +-- .../60_bioenergy/1stgen_priced_dec18/sets.gms | 6 +-- scripts/start/projects/test_lpjml2magpie.R | 23 ++++----- 20 files changed, 124 insertions(+), 110 deletions(-) delete mode 100644 modules/14_yields/gsadapt_nov25/scaling.gms diff --git a/config/default.cfg b/config/default.cfg index 2b8b16e517..2df94d6669 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -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.131_h12_magpie.tgz", - cellular = "rev4.131_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz", - validation = "rev4.131_h12_92e02314_validation.tgz", +cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata3_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") + 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, diff --git a/core/sets.gms b/core/sets.gms index 37298c3c4f..b3a8eee287 100644 --- a/core/sets.gms +++ b/core/sets.gms @@ -55,32 +55,32 @@ sets VEN, VGB, VIR, VNM, VUT, WLF, WSM, YEM, ZAF, ZMB, ZWE / j number of LPJ cells - / CAZ_1*CAZ_13, - CHA_14*CHA_30, - EUR_31*EUR_42, - IND_43*IND_56, - JPN_57*JPN_65, - LAM_66*LAM_98, - MEA_99*MEA_115, - NEU_116*NEU_124, - OAS_125*OAS_150, - REF_151*REF_161, - SSA_162*SSA_185, - USA_186*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_13) - CHA . (CHA_14*CHA_30) - EUR . (EUR_31*EUR_42) - IND . (IND_43*IND_56) - JPN . (JPN_57*JPN_65) - LAM . (LAM_66*LAM_98) - MEA . (MEA_99*MEA_115) - NEU . (NEU_116*NEU_124) - OAS . (OAS_125*OAS_150) - REF . (REF_151*REF_161) - SSA . (SSA_162*SSA_185) - USA . (USA_186*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) diff --git a/literature.bib b/literature.bib index 3ad81cc362..6e1e46bb5c 100644 --- a/literature.bib +++ b/literature.bib @@ -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} +} diff --git a/main.gms b/main.gms index c6e2f9c78b..5a8bde93f7 100644 --- a/main.gms +++ b/main.gms @@ -154,7 +154,7 @@ $title magpie * * Number of cells per region: * CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA -* 13 17 12 14 9 33 17 9 26 11 24 15 +* 14 17 12 14 8 34 18 9 27 11 22 14 * * Regionscode: 62eff8f7 *###################### R SECTION END (VERSION INFO) ########################### diff --git a/modules/13_tc/endo_nov25/equations.gms b/modules/13_tc/endo_nov25/equations.gms index 72a3ec4c53..33d84cc6ff 100644 --- a/modules/13_tc/endo_nov25/equations.gms +++ b/modules/13_tc/endo_nov25/equations.gms @@ -45,11 +45,9 @@ 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` *' for cropland in conservation priority areas. diff --git a/modules/13_tc/endo_nov25/presolve.gms b/modules/13_tc/endo_nov25/presolve.gms index 0266613145..760f119d17 100644 --- a/modules/13_tc/endo_nov25/presolve.gms +++ b/modules/13_tc/endo_nov25/presolve.gms @@ -19,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; diff --git a/modules/13_tc/endo_nov25/realization.gms b/modules/13_tc/endo_nov25/realization.gms index b2c830c172..9a73b55eca 100644 --- a/modules/13_tc/endo_nov25/realization.gms +++ b/modules/13_tc/endo_nov25/realization.gms @@ -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_nov25 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 diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index cf0bcf8056..094772e564 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -6,18 +6,18 @@ *** | Contact: magpie@pik-potsdam.de parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields WITHOUT growing period adaptation (excluding technological change) (tDM per ha per yr) + i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields without growing period adaptation excluding technological change (tDM per ha per yr) i14_yields_combined(t_all,j,yldtype,kcr,w) Combined biophysical yields for gsadapt and constgsadapt before calibration (tDM per ha per yr) i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) - p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and nosadapt yields (1) - p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and nosadapt yields for the previous time-step (1) + p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields (1) + p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields for the previous time-step (1) pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) p14_yields_gsadapt_ratio_cumulative(t,i) Cumulative effect of growing period adaption from the first to the current timestep (1) p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (FAO for crops, Li2020 for bioenergy crops) (tDM per ha per yr) + i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year using FAO for crops and Li2020 for bioenergy crops (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) @@ -29,7 +29,7 @@ parameters ; positive variables - vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) + vm_yld(j,kve,w) Yields declared as variable because of technological change (tDM per ha per yr) ; equations diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index 0b40afad8c..c91d5b292f 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -9,10 +9,9 @@ ***CROP YIELD CALCULATIONS********************************************** -*' Technological change can increase the initial calibrated yields by: - +*' Technological change can increase the initial calibrated yields: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * + vm_yld(j2,kcr,w) =e= sum(ct, i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index cfaacd215c..6e157eac21 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -16,16 +16,16 @@ $setglobal c14_yields_scenario cc * nocc_hist (no climate change after year defined by sm_fix_cc) scalars - s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / - s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / + s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / + s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / - s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / - s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / - s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / - sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / - s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / - s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / + s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / + s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / + sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / + s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / + s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / ; @@ -123,10 +123,12 @@ $include "./modules/14_yields/gsadapt_nov25/input/f14_region_be_yields.cs3" $offdelim ; -table f14_global_be_yields(kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) +parameter f14_global_be_yields(kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) +/ $ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.cs3" +$include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.csv" $offdelim +/ ; table f14_cluster_be_croparea_weights(j,kbe14,w) Cropland area weights per cluster for Li2020 bioenergy yield aggregation (mio. ha) diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files index 63378a2e39..8b44c75b1e 100644 --- a/modules/14_yields/gsadapt_nov25/input/files +++ b/modules/14_yields/gsadapt_nov25/input/files @@ -1,8 +1,8 @@ * list of files that are required here f14_region_yields.cs3 f14_ir2rf_ratio.cs4 -f14_ipcc_bce.cs3 +f14_ipcc_bef.cs3 f14_aboveground_fraction.csv f14_region_be_yields.cs3 -f14_global_be_yields.cs3 +f14_global_be_yields.csv f14_cluster_be_croparea_weights.cs3 diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index 0b46fde94d..38634de1fa 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -13,6 +13,7 @@ p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * p *' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. *' This avoids a discontinuity at the t_past boundary by using observed data *' through y2020 instead of freezing at the last t_past year (y2015). +p14_pyield_corr(t,i) = 0; p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); loop(t, p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); @@ -52,11 +53,13 @@ i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell *' to an additive term in case of a strongly underestimated baseline. The scalar *' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). -*' To be able to assess the impacts of growing period adaption, both type of yields -*' (with and without adapted growing perdiods and varieties) have to be calibrated. +*' To account for growing period adaption to climate change, two types of yields +*' (one with adaption of growing periods and varieties to changes in climatic conditions (gsadapt) +*' and one with no changes in growing periods and varieties in the future (constgsadapt)) +*' have to be calibrated. *' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate -*' both types individually as even so the growing seasons are held constant from 1995 -*' onwards, due to long term averaging the yields already differ in 1995. +*' both types individually as even though the growing seasons are held constant from 1995 +*' onwards, the yields already differ in 1995 due to long term averaging. *** INITIALIZATION of crop yield parameters @@ -88,7 +91,7 @@ i14_modeled_yields_hist(t_past,i,yldtype,knbe14) $ifthen "%c14_be_calib%" == "regional" i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum((cell(i,j),w) f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / (sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); $elseif "%c14_be_calib%" == "global" i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = @@ -126,7 +129,7 @@ $endif *' and `i14_modeled_yields_hist`: loop(t, - if(sum(sameas(t,"y1995"),1)=1, + if (sum(sameas(t,"y1995"),1) = 1, if ((s14_limit_calib = 0), i14_lambda_yields(t,i,yldtype,kcr) = 1; @@ -208,7 +211,7 @@ i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,y * Set yields to gsadapt values (pasture yields are not affected by growing period adaption) -if(s14_use_gsadapt = 1, +if (s14_use_gsadapt = 1, pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); else @@ -229,7 +232,7 @@ if(s14_use_gsadapt = 1, * set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) * or missing input file -if(s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, +if (s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, f14_yld_calib(i,ltype14) = 1; ); @@ -250,7 +253,7 @@ i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) *' deficiency on non-intact land. * set default values in case of missing input file. -if(sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, +if (sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, f14_yld_ncp_report(t,j,ncp_type14) = 1; ); diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms index 6135231ff6..02500495c4 100644 --- a/modules/14_yields/gsadapt_nov25/realization.gms +++ b/modules/14_yields/gsadapt_nov25/realization.gms @@ -5,18 +5,17 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' @description The managementcalib_aug19 realization reads in the LPJmL data and -*' performs a number of calibrations. First, a bioenergy yield correction is performed. -*' As there is currently no robust information on bioenergy yields available in -*' [@FAOSTAT], it is assumed that the LPJmL yields for bioenergy correspond to the -*' yields achieved under the highest currently observed value of the $\tau$ factor -*' representing agricultural land-use intensity. Secondly, pasture yields are calculated -*' based on pasture demand to account for in- and extensification of managed grasslands. -*' Thirdly, irrigated yields are scaled to meet the irrigated-to-rainfed yield +*' @description The gsadapt_nov25 realization reads in the LPJmL data +*' accounts for growing period adaption to climate change and also +*' performs a number of calibrations. +*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step +*' and bioenergy crops (betr, begr) are calibrated to global data by Li et al. [@li_mapping_2020] [@li_global_2018]. +*' Bioenergy yields are corrected using the $\tau$ factor +*' representing agricultural land-use intensity. +*' Pasture yields are calculated based on pasture demand to account for +*' intensification and extensification of managed grasslands. +*' Optionally, irrigated yields are scaled to meet the irrigated-to-rainfed yield *' ratio as provided by AQUASTAT [@fao_aquastat_2016]. -*' Finally, crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the -*' initial time step. An additional feature of this realization is to allow crop yields -*' technological change from the precedent times step to spillover to pasture areas. *' This realization also calculates harvestable growing stock (`im_growing_stock`) as *' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion *' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. @@ -24,7 +23,7 @@ *' @limitations The exogenous implementation of pasture intensification cannot *' capture feedbacks between land scarcity and efforts to improve pasture *' management. Moreover, the magnitude of spillover effects from technological change -*' in the crop sector towards improvements in pasture management is very uncertain. +*' in the crop sector towards improvements in pasture management is very uncertain. *####################### R SECTION START (PHASES) ############################## diff --git a/modules/14_yields/gsadapt_nov25/scaling.gms b/modules/14_yields/gsadapt_nov25/scaling.gms deleted file mode 100644 index ef2b844f16..0000000000 --- a/modules/14_yields/gsadapt_nov25/scaling.gms +++ /dev/null @@ -1,8 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*q14_yield_past.scale(j,w) = 1e-2; diff --git a/modules/14_yields/gsadapt_nov25/sets.gms b/modules/14_yields/gsadapt_nov25/sets.gms index 73167b8d61..282dbd2f9e 100644 --- a/modules/14_yields/gsadapt_nov25/sets.gms +++ b/modules/14_yields/gsadapt_nov25/sets.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de sets - ltype14 calibration land types + ltype14 Calibration land types / crop, past / k(kall) Primary products @@ -33,7 +33,7 @@ sets kbe14(kcr) Bioenergy cropping activities / begr, betr / - ncp_type14 natures contributions to people (NCP) relevant for agricultural yields + ncp_type14 Natures contributions to people (NCP) relevant for agricultural yields / soil_intact, poll_suff / yldtype Yield LPJmL run type with or without growing season adaptation diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index 4a0b5bd989..455378f7f3 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -14,17 +14,16 @@ *' managed Land) [@bondeau_lpjml_2007]. In the initial year of the simulation *' period, crop yields and pasture productivity are calibrated at the regional *' level to meet the observed cropland and pasture area as reported by FAO -*' [@FAOSTAT]. For the simulation of the temporal development of agricultural -*' yields, the module receives information about the agricultural land use +*' [@FAOSTAT] or in the case of bioenergy crops Li et al. [@li_mapping_2020] [@li_global_2018]. +*' For the simulation of the temporal development of agricultural +*' yields beyond biophysical processes, the module receives information about the agricultural land use *' intensity represented by the $\tau$ factor coming from the module [13_tc]. -*' Irrigated yields can optionally be calibrated to meet irrigated-rainfed -*' country-level yield ratios as reported by Aquastat [@fao_aquastat_2016]. *' *' The module returns yields for all crops and for pasture, which is then used *' by the modules [30_crop] and [31_past]. *' *' @authors Jan Philipp Dietrich, Isabelle Weindl, Florian Humpenöder, -*' Anne Biewald, Kristine Karstens +*' Anne Biewald, Kristine Karstens, Felicitas Beier *###################### R SECTION START (MODULETYPES) ########################## diff --git a/modules/56_ghg_policy/price_aug22/sets.gms b/modules/56_ghg_policy/price_aug22/sets.gms index 3cf489603a..71db3deb8e 100644 --- a/modules/56_ghg_policy/price_aug22/sets.gms +++ b/modules/56_ghg_policy/price_aug22/sets.gms @@ -67,12 +67,12 @@ sets R34M410-SSP1-NPi2025, R34M410-SSP1-PkBudg1000, R34M410-SSP1-PkBudg650, - R34M410-SSP2_lowEn-NPi2025, - R34M410-SSP2_lowEn-PkBudg1000, - R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP2-NPi2025, R34M410-SSP2-PkBudg1000, R34M410-SSP2-PkBudg650, + R34M410-SSP2_lowEn-NPi2025, + R34M410-SSP2_lowEn-PkBudg1000, + R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP3-NPi2025, R34M410-SSP3-PkBudg1000, R34M410-SSP3-rollBack, diff --git a/modules/60_bioenergy/1st2ndgen_priced_feb24/sets.gms b/modules/60_bioenergy/1st2ndgen_priced_feb24/sets.gms index ce043a67d3..9b0947c2a4 100644 --- a/modules/60_bioenergy/1st2ndgen_priced_feb24/sets.gms +++ b/modules/60_bioenergy/1st2ndgen_priced_feb24/sets.gms @@ -67,12 +67,12 @@ sets R34M410-SSP1-NPi2025, R34M410-SSP1-PkBudg1000, R34M410-SSP1-PkBudg650, - R34M410-SSP2_lowEn-NPi2025, - R34M410-SSP2_lowEn-PkBudg1000, - R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP2-NPi2025, R34M410-SSP2-PkBudg1000, R34M410-SSP2-PkBudg650, + R34M410-SSP2_lowEn-NPi2025, + R34M410-SSP2_lowEn-PkBudg1000, + R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP3-NPi2025, R34M410-SSP3-PkBudg1000, R34M410-SSP3-rollBack, diff --git a/modules/60_bioenergy/1stgen_priced_dec18/sets.gms b/modules/60_bioenergy/1stgen_priced_dec18/sets.gms index ce043a67d3..9b0947c2a4 100644 --- a/modules/60_bioenergy/1stgen_priced_dec18/sets.gms +++ b/modules/60_bioenergy/1stgen_priced_dec18/sets.gms @@ -67,12 +67,12 @@ sets R34M410-SSP1-NPi2025, R34M410-SSP1-PkBudg1000, R34M410-SSP1-PkBudg650, - R34M410-SSP2_lowEn-NPi2025, - R34M410-SSP2_lowEn-PkBudg1000, - R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP2-NPi2025, R34M410-SSP2-PkBudg1000, R34M410-SSP2-PkBudg650, + R34M410-SSP2_lowEn-NPi2025, + R34M410-SSP2_lowEn-PkBudg1000, + R34M410-SSP2_lowEn-PkBudg650, R34M410-SSP3-NPi2025, R34M410-SSP3-PkBudg1000, R34M410-SSP3-rollBack, diff --git a/scripts/start/projects/test_lpjml2magpie.R b/scripts/start/projects/test_lpjml2magpie.R index 7f7209073f..fe758c4f45 100644 --- a/scripts/start/projects/test_lpjml2magpie.R +++ b/scripts/start/projects/test_lpjml2magpie.R @@ -17,7 +17,7 @@ source("scripts/start_functions.R") # source default configuration source("config/default.cfg") -title <- "l2m_may26" +title <- "l2m_jun26" cfg$recalibrate_landconversion_cost <- TRUE ############################################## @@ -47,7 +47,7 @@ cfg$gms$tc <- "endo_jan22" #start_run(cfg, codeCheck = TRUE) ##################### -### Newlpjml data ### +### New lpjml data ### ##################### ### Different RCPs (2x) ### @@ -55,6 +55,7 @@ for (rcp in c("7p0")) { # 2p6 if (rcp == "2p6") { # RCP2.6 + # To Do: need to run preprocessing for RCP2p6!!! cfg$input <- c(regional = "rev4.130l2m_v5-10-0m2_feb2026_h12_magpie.tgz", cellular = "rev4.130l2m_v5-10-0m2_feb2026_h12_e3aebc2e_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-a0c283bd.tgz", validation = "rev4.130l2m_v5-10-0m2_feb2026_h12_92e02314_validation.tgz", @@ -62,9 +63,9 @@ for (rcp in c("7p0")) { # 2p6 calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? } else if (rcp == "7p0") { # RCP7.0 - cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_magpie.tgz", - cellular = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", - validation = "rev4.131l2m_v5-10-0m2_may2026+BEdata_h12_92e02314_validation.tgz", + cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata3_h12_magpie.tgz", + cellular = "rev4.131l2m_v5-10-0m2_may2026+BEdata3_h12_00e02813_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-a0c283bd.tgz", + validation = "rev4.131l2m_v5-10-0m2_may2026+BEdata3_h12_92e02314_validation.tgz", additional = "additional_data_rev4.65.tgz", calibration = "calibration_H12_FAO_01Apr26.tgz") #### Do I need to change this when I recalibrate? } else { @@ -102,29 +103,29 @@ for (rcp in c("7p0")) { # 2p6 } else if (gsadapt == "adapt") { - for (tauspillover in c("TCspill0", "TCspill1")) { - if (tauspillover == "TCspill0") { + for (gsad_in_tau in c("TCgsad0", "TCgsad1")) { + if (gsad_in_tau == "TCgsad0") { # growing period adaptation cfg$gms$s14_use_gsadapt <- 1 cfg$gms$s14_gsadapt2tau <- 0 # title - cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, tauspillover) + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, gsad_in_tau) # start MAgPIE run start_run(cfg, codeCheck = TRUE) - } else if (tauspillover == "TCspill1") { + } else if (gsad_in_tau == "TCgsad1") { # growing period adaptation cfg$gms$s14_use_gsadapt <- 1 cfg$gms$s14_gsadapt2tau <- 1 # title - cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, tauspillover) + cfg$title <- paste0(title, "_LPJmL5-10-0m2", "_", "rcp", rcp, "_", realization, "_gs", gsadapt, gsad_in_tau) # start MAgPIE run start_run(cfg, codeCheck = TRUE) } else { - stop("Selected tauspillover is not available.") + stop("Selected gsad_in_tau is not available.") } } } else { From 6fcc96c9a80069c385718f3b36358bd24e7bcd75 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Fri, 29 May 2026 14:41:16 +0200 Subject: [PATCH 30/42] small bug fixes in gsadapt implementation --- config/default.cfg | 2 +- modules/14_yields/gsadapt_nov25/input.gms | 4 ---- modules/14_yields/gsadapt_nov25/preloop.gms | 6 ++--- .../14_yields/gsadapt_nov25/realization.gms | 1 - renv/activate.R | 23 ++----------------- 5 files changed, 6 insertions(+), 30 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 8e9c9950fe..19d021fda6 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,7 +22,7 @@ cfg$model <- "main.gms" # def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.131l2m_v5-10-0m2_may2026+BEdata3_h12_magpie.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", diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index 6e157eac21..273f7c1152 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -38,10 +38,6 @@ $offdelim ; $offEmpty -* LPJmL2MAGPIE In nocc runs, should one replace the i14_yields variable with the constgsadapt variant? -* Now that constgsadapt is the "default" this will actually be a different fix, I guess on the tau side? -* Also, some renaming will need to occur here. The gsadapt constgsadapt file names and variables are inconsistent. - table f14_yields_constgsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) $ondelim $include "./modules/14_yields/input/lpj_yields_constgsadapt.cs3" diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index 38634de1fa..fd60a45d68 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -6,8 +6,8 @@ *** | Contact: magpie@pik-potsdam.de ***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / - sum(cell(i,j),pm_land_start(j,"past")) ); +p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j), f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / + sum(cell(i,j), pm_land_start(j,"past")) ); *' Pasture yield correction: use historical data for all years where available *' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. @@ -19,7 +19,7 @@ loop(t, p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); ); -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); +i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); ***YIELD MANAGEMENT CALIBRATION************************************************************ diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms index 02500495c4..64d1d3ea96 100644 --- a/modules/14_yields/gsadapt_nov25/realization.gms +++ b/modules/14_yields/gsadapt_nov25/realization.gms @@ -31,7 +31,6 @@ $Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_nov25/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_nov25/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_nov25/input.gms" $Ifi "%phase%" == "equations" $include "./modules/14_yields/gsadapt_nov25/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/14_yields/gsadapt_nov25/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/14_yields/gsadapt_nov25/preloop.gms" $Ifi "%phase%" == "presolve" $include "./modules/14_yields/gsadapt_nov25/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/14_yields/gsadapt_nov25/postsolve.gms" diff --git a/renv/activate.R b/renv/activate.R index e233670cc8..0ffd65ca38 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -226,17 +226,13 @@ local({ section <- header(sprintf("Bootstrapping renv %s", friendly)) catf(section) - # ensure the target library path exists; required for file.copy(..., recursive = TRUE) - dir.create(library, showWarnings = FALSE, recursive = TRUE) - # try to install renv from cache md5 <- attr(version, "md5", exact = TRUE) if (length(md5)) { pkgpath <- renv_bootstrap_find(version) if (length(pkgpath) && file.exists(pkgpath)) { - ok <- file.copy(pkgpath, library, recursive = TRUE) - if (isTRUE(ok)) - return(invisible()) + file.copy(pkgpath, library, recursive = TRUE) + return(invisible()) } } @@ -1235,21 +1231,6 @@ local({ } renv_bootstrap_run <- function(project, libpath, version) { - tryCatch( - renv_bootstrap_run_impl(project, libpath, version), - error = function(e) { - msg <- paste( - "failed to bootstrap renv: the project will not be loaded.", - paste("Reason:", conditionMessage(e)), - "Use `renv::activate()` to re-initialize the project.", - sep = "\n" - ) - warning(msg, call. = FALSE) - } - ) - } - - renv_bootstrap_run_impl <- function(project, libpath, version) { # perform bootstrap bootstrap(version, libpath) From 7ae5368aaa13004bd3dfe4f90c1695cdaedd8922 Mon Sep 17 00:00:00 2001 From: Felicitas Beier Date: Mon, 1 Jun 2026 16:04:23 +0200 Subject: [PATCH 31/42] deleted f38_region_yield.csv from inputs since not used --- modules/38_factor_costs/sticky_feb18/input/files | 1 - modules/38_factor_costs/sticky_labor/input/files | 1 - 2 files changed, 2 deletions(-) diff --git a/modules/38_factor_costs/sticky_feb18/input/files b/modules/38_factor_costs/sticky_feb18/input/files index dbebab811f..95d020d2db 100644 --- a/modules/38_factor_costs/sticky_feb18/input/files +++ b/modules/38_factor_costs/sticky_feb18/input/files @@ -1,5 +1,4 @@ * list of files that are required here -f38_region_yield.csv f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv diff --git a/modules/38_factor_costs/sticky_labor/input/files b/modules/38_factor_costs/sticky_labor/input/files index dbebab811f..95d020d2db 100644 --- a/modules/38_factor_costs/sticky_labor/input/files +++ b/modules/38_factor_costs/sticky_labor/input/files @@ -1,5 +1,4 @@ * list of files that are required here -f38_region_yield.csv f38_historical_share_iso.csv f38_regression_cap_share.csv f38_fac_req_fao.csv From 91d4a54e60375dbbc0795badc97d228e8e94f431 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Mon, 27 Jul 2026 18:52:58 +0200 Subject: [PATCH 32/42] remove BE yield calib but have preloop restructuring still in place --- config/default.cfg | 5 -- .../14_yields/gsadapt_nov25/declarations.gms | 2 +- modules/14_yields/gsadapt_nov25/equations.gms | 2 +- modules/14_yields/gsadapt_nov25/input.gms | 23 +------- modules/14_yields/gsadapt_nov25/input/files | 3 -- modules/14_yields/gsadapt_nov25/preloop.gms | 53 ++++++------------- modules/14_yields/gsadapt_nov25/presolve.gms | 6 +-- .../14_yields/gsadapt_nov25/realization.gms | 7 ++- modules/14_yields/gsadapt_nov25/sets.gms | 2 +- modules/14_yields/module.gms | 2 +- 10 files changed, 28 insertions(+), 77 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 19d021fda6..03f42885ac 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -365,11 +365,6 @@ cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 # * nocc_hist (no climate change after year defined by sm_fix_cc) cfg$gms$c14_yields_scenario <- "cc" # def = "cc" -# * Li2020 biophysical calibration mode for bioenergy crops (begr, betr) -# * options: regional (calibrate to Li2020 regional means) -# * global (calibrate to Li2020 global mean) -# * off (no Li2020 biophysical calibration) -cfg$gms$c14_be_calib <- "regional" # def = "regional" # * 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) diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index 094772e564..e215672d12 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -17,7 +17,7 @@ parameters p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year using FAO for crops and Li2020 for bioenergy crops (tDM per ha per yr) + i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms index c91d5b292f..aebb75cd3b 100644 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ b/modules/14_yields/gsadapt_nov25/equations.gms @@ -11,7 +11,7 @@ *' Technological change can increase the initial calibrated yields: q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct, i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * + vm_yld(j2,kcr,w) =e= sum(ct, i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); *' For the current time step of the optimization, cellular yields of irrigated diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms index 273f7c1152..a6fef2c1c8 100644 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ b/modules/14_yields/gsadapt_nov25/input.gms @@ -5,11 +5,6 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -$setglobal c14_be_calib regional -* options: regional (biophysical calibration using Li2020 regional means) -* global (biophysical calibration using Li2020 global mean) -* off (no Li2020 biophysical calibration) - $setglobal c14_yields_scenario cc * options: cc (climate change) * nocc (no climate change) @@ -113,22 +108,6 @@ $offdelim / ; -table f14_region_be_yields(i,kbe14) Li2020 reference yields for bioenergy crops per region (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_region_be_yields.cs3" -$offdelim -; -parameter f14_global_be_yields(kbe14) Li2020 reference yields for bioenergy crops at global level (tDM per ha per yr) -/ -$ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_global_be_yields.csv" -$offdelim -/ -; -table f14_cluster_be_croparea_weights(j,kbe14,w) Cropland area weights per cluster for Li2020 bioenergy yield aggregation (mio. ha) -$ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_cluster_be_croparea_weights.cs3" -$offdelim -; + diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files index 8b44c75b1e..51db0ce782 100644 --- a/modules/14_yields/gsadapt_nov25/input/files +++ b/modules/14_yields/gsadapt_nov25/input/files @@ -3,6 +3,3 @@ f14_region_yields.cs3 f14_ir2rf_ratio.cs4 f14_ipcc_bef.cs3 f14_aboveground_fraction.csv -f14_region_be_yields.cs3 -f14_global_be_yields.csv -f14_cluster_be_croparea_weights.cs3 diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms index fd60a45d68..c49b8c064a 100644 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ b/modules/14_yields/gsadapt_nov25/preloop.gms @@ -30,8 +30,7 @@ i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j), *' The following equations calibrate the cellular yield patterns (`f14_yields`) to match *' historical reference yields (`i14_calib_target_yields_hist`) by calculating a calibration term called *' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical -*' yields reported by FAO for croplands (`f14_fao_yields_hist`) or Li2020 for bioenergy crops -*' (`f14_region_be_yields` / `f14_global_be_yields`) and regional mean yields (`i14_modeled_yields_hist`) +*' yields reported by FAO for croplands (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) *' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models *' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative *' calibration factor that depends only on the initial conditions of the starting year. @@ -55,7 +54,7 @@ i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j), *' To account for growing period adaption to climate change, two types of yields *' (one with adaption of growing periods and varieties to changes in climatic conditions (gsadapt) -*' and one with no changes in growing periods and varieties in the future (constgsadapt)) +*' and one with no changes in growing periods and varieties in the future (constgsadapt)) *' have to be calibrated. *' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate *' both types individually as even though the growing seasons are held constant from 1995 @@ -84,40 +83,24 @@ i14_modeled_yields_hist(t_past,i,yldtype,knbe14) 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) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); -*' Compute LPJmL weighted mean rainfed yields for bioenergy crops at y1995 — -*' regional (weighted by cropland area per cluster) and global, per yldtype. -*' NOTE: For BE yield calibration "off" calibration target will be set to `i14_modeled_yields_hist`, -*' so calibration factors are always 1. Modeled yield has to be calculated therefore. - -$ifthen "%c14_be_calib%" == "regional" - i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / - (sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); -$elseif "%c14_be_calib%" == "global" - i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum((j,w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / - (sum((j,w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); -$else - i14_modeled_yields_hist(t_past,i,yldtype,kbe14) = - sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / - (sum((cell(i,j),w), f14_cluster_be_croparea_weights(j,kbe14,w)) + 1e-8); -$endif +i14_modeled_yields_hist(t_past,i,yldtype,kbe14) + = sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + sum((cell(i,j),w), i14_croparea_total(t_past,w,j)); ************************************************************************************** -*** STEP 2: SET CALIB TARGET with FAO for knbe14 and Li historical data for kbe14 +*** STEP 2: SET CALIB TARGET with FAO for knbe14 and modeled yields for kbe14 +*' Use FAO data as calibration data for all crop types except bioenergy crops: i14_calib_target_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); -$ifthen "%c14_be_calib%" == "regional" - i14_calib_target_yields_hist(t,i,kbe14) = f14_region_be_yields(i,kbe14); -$elseif "%c14_be_calib%" == "global" - i14_calib_target_yields_hist(t,i,kbe14) = f14_global_be_yields(kbe14); -$else - i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); -$endif - -*' NOTE: For BE yield calibration "off" calibration target will be set to `i14_modeled_yields_hist`, -*' so calibration factors are always 1. +*' For bioenergy crops, no meaningful calibration target is currently available. The calibration target +*' is set to the regional modeled yield, which results in a calibration factor of 1 and effectively +*' performs no calibration. This is a placeholder implementation that can be replaced with actual +*' calibration data when it becomes available. +i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); +if (s14_use_gsadapt = 0, + i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"constgsadapt",kbe14); +); ************************************************************************************** *** STEP 3: LOOP OVER TIME calculating calibration parameters for all time steps @@ -161,9 +144,7 @@ i14_managementcalib(t,j,yldtype,kcr,w) = (i14_yields_combined(t,j,yldtype,kcr,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,kcr))+10**(-8))) ** sum(cell(i,j),i14_lambda_yields(t,i,yldtype,kcr)))$(i14_yields_combined(t,j,yldtype,kcr,w)>0); -$ifthen "%c14_be_calib%" == "off" - i14_managementcalib(t,j,yldtype,kbe14,w) = 1; -$endif + i14_yields_calib_combined(t,j,yldtype,kcr,w) = i14_managementcalib(t,j,yldtype,kcr,w) * i14_yields_combined(t,j,yldtype,kcr,w); @@ -204,7 +185,7 @@ if ((s14_calib_ir2rf = 1), ); ***MANAGEMENT CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (tau scaling)**************** -*' Tau-based management calibration applied on top of the Li2020 biophysical calibration. +*' Tau-based management calibration applied on top of the biophysical yields. i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,yldtype,kbe14,w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); ******************************************************************************************* diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index 027777de5d..671b9e13aa 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -72,7 +72,7 @@ if (ord(t) = 1, pm_yields_gsadapt_ratio_increment(t,i) = 1; p14_yields_gsadapt_ratio_cumulative(t,i) = 1; -else +else p14_yields_gsadapt_ratio(t,i) = sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / @@ -86,8 +86,8 @@ else * The max(1,...) ensures the cumulative factor can only grow, never shrink. * This means declining adaptation opportunities are not represented — once * adaptation gains are accounted for via tau, they cannot be reversed. - p14_yields_gsadapt_ratio_cumulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cumulative(t-1,i); - + p14_yields_gsadapt_ratio_cumulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cumulative(t-1,i); + ); if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms index 64d1d3ea96..8d09710b9d 100644 --- a/modules/14_yields/gsadapt_nov25/realization.gms +++ b/modules/14_yields/gsadapt_nov25/realization.gms @@ -5,11 +5,10 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' @description The gsadapt_nov25 realization reads in the LPJmL data +*' @description The gsadapt_nov25 realization reads in the LPJmL data *' accounts for growing period adaption to climate change and also -*' performs a number of calibrations. -*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step -*' and bioenergy crops (betr, begr) are calibrated to global data by Li et al. [@li_mapping_2020] [@li_global_2018]. +*' performs a number of calibrations. +*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step. *' Bioenergy yields are corrected using the $\tau$ factor *' representing agricultural land-use intensity. *' Pasture yields are calculated based on pasture demand to account for diff --git a/modules/14_yields/gsadapt_nov25/sets.gms b/modules/14_yields/gsadapt_nov25/sets.gms index 282dbd2f9e..c0059412ec 100644 --- a/modules/14_yields/gsadapt_nov25/sets.gms +++ b/modules/14_yields/gsadapt_nov25/sets.gms @@ -38,6 +38,6 @@ sets yldtype Yield LPJmL run type with or without growing season adaptation / gsadapt, constgsadapt / - + ; diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index 455378f7f3..42eb2b7be5 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -14,7 +14,7 @@ *' managed Land) [@bondeau_lpjml_2007]. In the initial year of the simulation *' period, crop yields and pasture productivity are calibrated at the regional *' level to meet the observed cropland and pasture area as reported by FAO -*' [@FAOSTAT] or in the case of bioenergy crops Li et al. [@li_mapping_2020] [@li_global_2018]. +*' [@FAOSTAT]. *' For the simulation of the temporal development of agricultural *' yields beyond biophysical processes, the module receives information about the agricultural land use *' intensity represented by the $\tau$ factor coming from the module [13_tc]. From 74d14d55ac7dfa6fda1652123f1920b29edd4773 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 14:21:32 +0200 Subject: [PATCH 33/42] update yield realization and merge new dynamic regional pasture spillover into a new joint realization --- config/default.cfg | 12 +- .../declarations.gms | 48 ++++ .../gsadapt_dynPastrTau_jul26/equations.gms | 39 +++ .../gsadapt_dynPastrTau_jul26/input.gms | 118 ++++++++ .../gsadapt_dynPastrTau_jul26/input/files | 4 + .../gsadapt_dynPastrTau_jul26/nl_fix.gms | 11 + .../gsadapt_dynPastrTau_jul26/nl_release.gms | 11 + .../gsadapt_dynPastrTau_jul26/postsolve.gms | 24 ++ .../gsadapt_dynPastrTau_jul26/preloop.gms | 255 ++++++++++++++++++ .../gsadapt_dynPastrTau_jul26/presolve.gms | 81 ++++++ .../gsadapt_dynPastrTau_jul26/realization.gms | 48 ++++ .../gsadapt_dynPastrTau_jul26/scaling.gms | 8 + .../gsadapt_dynPastrTau_jul26/sets.gms | 42 +++ .../14_yields/gsadapt_nov25/declarations.gms | 5 +- modules/14_yields/gsadapt_nov25/input/files | 2 - modules/14_yields/gsadapt_nov25/presolve.gms | 16 ++ 16 files changed, 717 insertions(+), 7 deletions(-) create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/equations.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/input/files create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/nl_release.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/postsolve.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/scaling.gms create mode 100644 modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms diff --git a/config/default.cfg b/config/default.cfg index dbf449c9f6..4143e9e0cd 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -357,9 +357,9 @@ cfg$gms$s13_croparea_consv_target <- 2030 # def = 2030 # * (gsadapt_nov25): yields (optionally with future growing period adaptation) based on LPJmL simulations # * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional levels, # * 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 +# * (gsadapt_dynPastrTau_jul26): as gsadapt_nov25, but the pasture yield spillover from crop-sector TC +# * is controlled by s14_past_spillover_mode switch +# * (0=static scalar s14_yld_past_switch, 1=regional dynamic f14_yld_past_switch) cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 # * yield scenario @@ -368,6 +368,12 @@ cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 # * 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 <- 1 # 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) diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms new file mode 100644 index 0000000000..f74255cc27 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms @@ -0,0 +1,48 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +parameters + i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields without growing period adaptation excluding technological change (tDM per ha per yr) + i14_yields_combined(t_all,j,yldtype,kcr,w) Combined biophysical yields for gsadapt and constgsadapt before calibration (tDM per ha per yr) + i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) + p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields (1) + p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields for the previous time-step (1) + pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) + p14_yields_gsadapt_ratio_cumulative(t,i) Cumulative effect of growing period adaption from the first to the current timestep (1) + p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) + p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) + i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) + i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (tDM per ha per yr) + i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) + i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) + im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) + im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha) + pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) + i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) + i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) + i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) + i14_modeled_yields_hist2(i,yldtype,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) + i14_yld_past_switch_eff(t_all,i) Effective pasture spillover parameter (1) + ; + +positive variables + vm_yld(j,kve,w) Yields declared as variable because of technological change (tDM per ha per yr) +; + +equations + q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) + q14_yield_past(j,w) Pasture yields (tDM per ha per yr) +; + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) + oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) + oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/equations.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/equations.gms new file mode 100644 index 0000000000..e4ff620b5c --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/equations.gms @@ -0,0 +1,39 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @equations + +***CROP YIELD CALCULATIONS********************************************** + +*' Technological change can increase the initial calibrated yields: +q14_yield_crop(j2,kcr,w) .. + vm_yld(j2,kcr,w) =e= sum(ct, i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * + vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); + +*' For the current time step of the optimization, cellular yields of irrigated +*' and rainfed crops are calculated by multiplying calibrated input yields from +*' LPJmL with the intensification rate relative to the initial time step 1995. + +***PASTURE YIELD CALCULATIONS******************************************* + +*' In the case of pasture yields, technological change cannot be fully +*' translated into yield increases, to address that, an exogenous pasture management +*' factor `pm_past_mngmnt_factor` is used to scale pasture yields based on the +*' number of cattle reared to fulfill the domestic demand for ruminant livestock +*' products in module 70. +*' +*' Additionally, the parameter `i14_yld_past_switch_eff` can be used to capture a +*' certain magnitude of spillovers of the yield increase due to technological +*' change from the time step before. It is defined per model region and time step, +*' and can range from 0 (no spillover) to 1 (full spillover). + +q14_yield_past(j2,w) .. + vm_yld(j2,"pasture",w) =e= + sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) + * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) + * (1 + sum(ct, sum(cell(i2,j2), i14_yld_past_switch_eff(ct,i2))) + * (sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(j2,"crop") / fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms new file mode 100644 index 0000000000..1067f98282 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms @@ -0,0 +1,118 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +$setglobal c14_yields_scenario cc +* options: cc (climate change) +* nocc (no climate change) +* nocc_hist (no climate change after year defined by sm_fix_cc) + +scalars + s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / + s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / + s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / + s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / + s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / + s14_past_spillover_mode Switch for pasture spillover mode: 0 = static scalar - 1 = regional dynamic= / 1 / + s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases in static mode (1) / 0.25 / + s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / + sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / + s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / + s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / +; + + +******* Calibration factor +$onEmpty +table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) +$ondelim +$if exist "./modules/14_yields/input/f14_yld_calib.csv" $include "./modules/14_yields/input/f14_yld_calib.csv" +$offdelim +; +$offEmpty + +table f14_yields_constgsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields_constgsadapt.cs3" +$offdelim +; + +* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used +$if "%c14_yields_scenario%" == "nocc" f14_yields_constgsadapt(t_all,j,kve,w) = f14_yields_constgsadapt("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields_constgsadapt,"j,kve,w"); + +table f14_yields(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/lpj_yields.cs3" +$offdelim +; + +* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used +$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); +$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); +m_fillmissingyears(f14_yields,"j,kve,w"); + +table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" +$offdelim; + +$onEmpty +table f14_yld_past_switch(t_all,i) Pasture yield spillover factor from crop-sector TC by region (1) +$ondelim +$if exist "./modules/14_yields/gsadapt_dynPastrTau_jul26/input/f14_yld_past_switch.csv" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/input/f14_yld_past_switch.csv" +$offdelim +; +$offEmpty +m_fillmissingyears(f14_yld_past_switch,"i"); + +table f14_fao_yields_hist(t_all,i,kcr) FAO yields per region (tDM per ha per yr) +$ondelim +$include "./modules/14_yields/gsadapt_dynPastrTau_jul26/input/f14_region_yields.cs3" +$offdelim +; +m_fillmissingyears(f14_fao_yields_hist,"i,kcr"); + +parameter f14_ir2rf_ratio(i) AQUASTAT ratio of irrigated to rainfed yields per region (1) +/ +$ondelim +$include "./modules/14_yields/gsadapt_dynPastrTau_jul26/input/f14_ir2rf_ratio.cs4" +$offdelim +/ +; + +parameter fm_ipcc_bef(clcl) IPCC biomass expansion factor BEF (1) +/ +$ondelim +$include "./modules/14_yields/input/f14_ipcc_bef.cs3" +$offdelim +/ +; + +parameter fm_aboveground_fraction(land_timber) Aboveground fraction of total biomass (1) +/ +$ondelim +$include "./modules/14_yields/input/f14_aboveground_fraction.csv" +$offdelim +/ +; + +$onEmpty +table f14_yld_ncp_report(t_all,j,ncp_type14) Share of land with intact natures contributions to people (NCP) (1) +$ondelim +$if exist "./modules/14_yields/input/f14_yld_ncp_report.cs3" $include "./modules/14_yields/input/f14_yld_ncp_report.cs3" +$offdelim +; +$offEmpty + +parameter f14_kcr_pollinator_dependence(kcr) Share of total yield dependent on biotic pollination (1) +/ +$ondelim +$include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" +$offdelim +/ +; diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/input/files b/modules/14_yields/gsadapt_dynPastrTau_jul26/input/files new file mode 100644 index 0000000000..fec4acdcf9 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/input/files @@ -0,0 +1,4 @@ +* list of files that are required here +f14_region_yields.cs3 +f14_ir2rf_ratio.cs4 +f14_yld_past_switch.csv diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms new file mode 100644 index 0000000000..c27256f054 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_fix ### + +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); +vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + sum(cell(i,j), i14_yld_past_switch_eff("y1995",i)) * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_release.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_release.gms new file mode 100644 index 0000000000..183fadf84b --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_release.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +* ### nl_release ### + +vm_yld.lo(j,kve,w) = 0; +vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/postsolve.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/postsolve.gms new file mode 100644 index 0000000000..b889d502a0 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/postsolve.gms @@ -0,0 +1,24 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + + + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); + oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); + ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); + oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); + ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); + oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); + ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); + oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); + oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms new file mode 100644 index 0000000000..6ec5947267 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms @@ -0,0 +1,255 @@ +*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** +p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j), f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / + sum(cell(i,j), pm_land_start(j,"past")) ); + +*' Pasture yield correction: use historical data for all years where available +*' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. +*' This avoids a discontinuity at the t_past boundary by using observed data +*' through y2020 instead of freezing at the last t_past year (y2015). +p14_pyield_corr(t,i) = 0; +p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); +loop(t, + p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); +); + +i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); + + +***YIELD MANAGEMENT CALIBRATION************************************************************ + + +*' @code + +*' The following equations calibrate the cellular yield patterns (`f14_yields`) to match +*' historical reference yields (`i14_calib_target_yields_hist`) by calculating a calibration term called +*' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical +*' yields reported by FAO for croplands (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) +*' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models +*' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative +*' calibration factor that depends only on the initial conditions of the starting year. +*' +*' However, when FAO yields are significantly higher than given by the cellular yield inputs +*' (underestimated baseline), the relative calibration terms can lead to unrealistically large +*' yields in the case of future yield increases within the cellular yield patterns. +*' +*' To address this issue, the factor `i14_lambda_yields` determines the degree +*' to which the baseline (FAO) is under- or overestimated and therefore controls +*' whether the calibration factor is applied as an absolute or relative change. +*' For overestimated FAO yields, `i14_lambda_yields` is 1, which is equivalent +*' to an entirely relative calibration. For underestimated yields, `i14_lambda_yields` +*' is calculated as the squared root of the ratio between LPJmL yields and FAO historical +*' yields, and as `i14_lambda_yields` approaches 0, it reduces the applied relative change +*' resulting in a mean change increasingly similar to an additive term (@Heinke.2013). + +*' This concept is referred to as limited calibration, as it limits the calibration +*' to an additive term in case of a strongly underestimated baseline. The scalar +*' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). + +*' To account for growing period adaption to climate change, two types of yields +*' (one with adaption of growing periods and varieties to changes in climatic conditions (gsadapt) +*' and one with no changes in growing periods and varieties in the future (constgsadapt)) +*' have to be calibrated. +*' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate +*' both types individually as even though the growing seasons are held constant from 1995 +*' onwards, the yields already differ in 1995 due to long term averaging. + +*** INITIALIZATION of crop yield parameters + +i14_yields_combined(t,j,"constgsadapt",kcr,w) = f14_yields_constgsadapt(t,j,kcr,w); +i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); + +i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); + +************************************************************************************** +*** STEP 1: CALCULATE modeled regional historical yields + +*' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields +*' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where +*' a region has no crop area reported for a given crop type, the total crop area is +*' used to calculate a proxy yield for the calibration, given by the following equation: + +i14_modeled_yields_hist(t_past,i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,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 AND + sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) > 0.00001) + + (sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined(t_past,j,yldtype,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 OR + sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); + +i14_modeled_yields_hist(t_past,i,yldtype,kbe14) + = sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / + sum((cell(i,j),w), i14_croparea_total(t_past,w,j)); + +************************************************************************************** +*** STEP 2: SET CALIB TARGET with FAO for knbe14 and modeled yields for kbe14 + +*' Use FAO data as calibration data for all crop types except bioenergy crops: +i14_calib_target_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); + +*' For bioenergy crops, no meaningful calibration target is currently available. The calibration target +*' is set to the regional modeled yield, which results in a calibration factor of 1 and effectively +*' performs no calibration. This is a placeholder implementation that can be replaced with actual +*' calibration data when it becomes available. +i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); +if (s14_use_gsadapt = 0, + i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"constgsadapt",kbe14); +); + +************************************************************************************** +*** STEP 3: LOOP OVER TIME calculating calibration parameters for all time steps + +*' The factor `i14_lambda_yields` is calculated for the initial time step depending +*' on the setting `s14_limit_calib` and is then held constant for all other time steps. +*' The regional calibration target yield and regional yield of the crop model input of +*' the initial time step is kept constant in the two parameters `i14_calib_target_yields_hist` +*' and `i14_modeled_yields_hist`: + +loop(t, + if (sum(sameas(t,"y1995"),1) = 1, + + if ((s14_limit_calib = 0), + i14_lambda_yields(t,i,yldtype,kcr) = 1; + + Elseif (s14_limit_calib = 1 ), + i14_lambda_yields(t,i,yldtype,kcr) = + 1$(i14_calib_target_yields_hist(t,i,kcr) <= i14_modeled_yields_hist(t,i,yldtype,kcr)) + + sqrt(i14_modeled_yields_hist(t,i,yldtype,kcr)/i14_calib_target_yields_hist(t,i,kcr))$ + (i14_calib_target_yields_hist(t,i,kcr) > i14_modeled_yields_hist(t,i,yldtype,kcr)); + ); + + Else + i14_modeled_yields_hist(t,i,yldtype,kcr) = i14_modeled_yields_hist(t-1,i,yldtype,kcr); + i14_calib_target_yields_hist(t,i,kcr) = i14_calib_target_yields_hist(t-1,i,kcr); + i14_lambda_yields(t,i,yldtype,kcr) = i14_lambda_yields(t-1,i,yldtype,kcr); + ); +); + +************************************************************************************** +*** STEP 4: APPLY calculated calibration factors for all time steps + +*' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending +*' on the constant values `i14_modeled_yields_hist`, `i14_calib_target_yields_hist`, `i14_lambda_yields` +*' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: + +i14_managementcalib(t,j,yldtype,kcr,w) = + 1 + (sum(cell(i,j), i14_calib_target_yields_hist(t,i,kcr) - i14_modeled_yields_hist(t,i,yldtype,kcr)) / + i14_yields_combined(t,j,yldtype,kcr,w) * + (i14_yields_combined(t,j,yldtype,kcr,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,kcr))+10**(-8))) ** + sum(cell(i,j),i14_lambda_yields(t,i,yldtype,kcr)))$(i14_yields_combined(t,j,yldtype,kcr,w)>0); + + + +i14_yields_calib_combined(t,j,yldtype,kcr,w) = i14_managementcalib(t,j,yldtype,kcr,w) * i14_yields_combined(t,j,yldtype,kcr,w); + +*' Note that the calculation is split into two parts for better readability. + +************************************************************************************** +*' Irrigated yields are calibrated to meet the country-level +*' ratio between irrigated and rainfed yields reported by Aquastat. +*' This can be de-activated with the switch `s14_calib_ir2rf`. +*' This calibration in only done for knbe14 (all crops excluding bioenergy crops) +if ((s14_calib_ir2rf = 1), + +* Weighted yields + i14_calib_yields_hist(i,yldtype,w) + = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / + sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); + +* Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio + i14_calib_yields_ratio(i,yldtype) = i14_calib_yields_hist(i,yldtype,"irrigated") / i14_calib_yields_hist(i,yldtype,"rainfed"); + i14_target_ratio(i,yldtype) = max(i14_calib_yields_ratio(i,yldtype), f14_ir2rf_ratio(i)); + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); + +* Calibrate newly calibrated yields to calib target yields + i14_modeled_yields_hist2(i,yldtype,knbe14) + = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) > 0.00001) + + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); + + + i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_calib_target_yields_hist("y1995",i,knbe14) / + i14_modeled_yields_hist2(i,yldtype,knbe14)) * + i14_yields_calib_combined(t,j,yldtype,knbe14,w); +); + +***MANAGEMENT CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (tau scaling)**************** +*' Tau-based management calibration applied on top of the biophysical yields. +i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,yldtype,kbe14,w) * + sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); +******************************************************************************************* + +* Set yields to gsadapt values (pasture yields are not affected by growing period adaption) + +if (s14_use_gsadapt = 1, + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); + else + pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"constgsadapt",knbe14,w); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"constgsadapt",kcr,w); +); + +*' @stop + + +***YIELD CALIBRATION*********************************************************************** + +*' @code +*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' +*' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional +*' yields are outlier corrected, historical production and croparea can in some cases +*' be better represented with this additional correction: + +* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) +* or missing input file +if (s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, + f14_yld_calib(i,ltype14) = 1; +); + + +i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) + * sum(cell(i,j),f14_yld_calib(i,"crop")); +i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) + * sum(cell(i,j),f14_yld_calib(i,"past")); + +* Set effective pasture spillover parameter to regional dynamic value + i14_yld_past_switch_eff(t,i) = f14_yld_past_switch(t,i); + +* If static spillover mode, override with scalar value +if (s14_past_spillover_mode = 0, + i14_yld_past_switch_eff(t,i) = s14_yld_past_switch; +); + +*' @stop + +*' @code +*' Land degradation can negatively affect yields. Soil loss for example can +*' notably affect land productivity. Similarly, the yield of pollinator-dependent crops +*' is reduced when there is a lack of pollinators. To account for the impacts of degradation, +*' calibrated yields are multiplied by the share of land with intact NCP in each cell and specific +*' yield reduction coefficients that represent yield loss due to soil erosion and pollination +*' deficiency on non-intact land. + +* set default values in case of missing input file. +if (sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, + f14_yld_ncp_report(t,j,ncp_type14) = 1; +); + +if ((s14_degradation = 1), + i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - s14_yld_reduction_soil_loss) + + i14_yields_calib(t,j,kcr,w) * s14_yld_reduction_soil_loss * f14_yld_ncp_report(t,j,"soil_intact"); + i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - f14_kcr_pollinator_dependence(kcr)) + + i14_yields_calib(t,j,kcr,w) * f14_kcr_pollinator_dependence(kcr) * f14_yld_ncp_report(t,j,"poll_suff"); +); + +*' @stop diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms new file mode 100644 index 0000000000..65d7cd4c80 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms @@ -0,0 +1,81 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*** EOF presolve.gms *** + +* calculate carbon density + +*** HARVESTABLE GROWING STOCK + +*' `pm_carbon_density_plantation_ac` for vegetation carbon is above- and belowground +*' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon +*' fraction of `sm_carbon_fraction` in tC/tDM. For assessing wood harvesting +*' we need only aboveground biomass information, therefore we multiply with +*' aboveground `fm_aboveground_fraction`. Additionally, we divide aboveground +*' tree biomass by the Biomass Expansion Factor (BEF, dimensionless) to get +*' stem biomass in tDM/ha. BEF = AGB (aboveground biomass) / stem_biomass (always > 1). + +*' @code + +im_growing_stock(t,j,ac,"forestry") = + ( + pm_carbon_density_plantation_ac(t,j,ac,"vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("forestry") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + +im_growing_stock(t,j,ac,"primforest") = + ( + fm_carbon_density(t,j,"primforest","vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("primforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + +im_growing_stock(t,j,ac,"secdforest") = + ( + pm_carbon_density_secdforest_ac(t,j,ac,"vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("secdforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + +im_growing_stock(t,j,ac,"other") = + ( + pm_carbon_density_other_ac(t,j,ac,"vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("other") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + +*' Growing stock for young secondary forest (youngsecdf) regrowing on other land. +*' It is derived from the *uncalibrated* secondary-forest carbon curve (the same +*' curve youngsecdf carbon uses in 35_natveg), with the secondary-forest aboveground +*' fraction, so that its wood yield and its carbon stock are consistent. +im_growing_stock_ysf(t,j,ac) = + ( + pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("secdforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + +*' @stop + +** Hard constraint to always have a positive number in im_growing_stock +im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); +** Set growing stock to 0 where it does not exceed a minimum for harvest +im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; +** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock +im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); +im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms new file mode 100644 index 0000000000..a184bf629b --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms @@ -0,0 +1,48 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' ### TODO: Fix module and realization text before production use +*' +*' @description The gsadapt_dynPastrTau_jul26 realization reads in the LPJmL data +*' and accounts for growing period adaption to climate change. It also +*' performs a number of calibrations. +*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step. +*' Bioenergy yields are corrected using the $\tau$ factor +*' representing agricultural land-use intensity. +*' Pasture yields are calculated based on pasture demand to account for +*' intensification and extensification of managed grasslands. +*' Optionally, irrigated yields are scaled to meet the irrigated-to-rainfed yield +*' ratio as provided by AQUASTAT [@fao_aquastat_2016]. +*' This realization also calculates harvestable growing stock (`im_growing_stock`) as +*' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion +*' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. +*' +*' The realization supports two pasture spillover modes controlled by s14_past_spillover_mode: +*' * Mode 0 (static scalar): Uses s14_yld_past_switch for all regions and timesteps +*' * Mode 1 (regional dynamic): Uses f14_yld_past_switch(t_all,i) per region and timestep +*' Both modes integrate growing period adaptation support (gsadapt/constgsadapt) via s14_use_gsadapt. + +*' @limitations The exogenous implementation of pasture intensification cannot +*' capture feedbacks between land scarcity and efforts to improve pasture +*' management. Moreover, the magnitude of spillover effects from technological change +*' in the crop sector towards improvements in pasture management is very uncertain +*' and varies across regions and time periods. + + +*####################### R SECTION START (PHASES) ############################## +*### TODO: Fix module and realization text before production use +$Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/nl_release.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/scaling.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/scaling.gms new file mode 100644 index 0000000000..c7671f82e4 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/scaling.gms @@ -0,0 +1,8 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*q14_yield_past.scale(j,w) = 1e-2; diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms new file mode 100644 index 0000000000..60354dbd48 --- /dev/null +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms @@ -0,0 +1,42 @@ +*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +sets + ltype14 calibration land types + / crop, past / + + k(kall) Primary products + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, pasture, cottn_pro, begr, betr, livst_rum, livst_pig, + livst_chick, livst_egg, livst_milk, fish, wood, woodfuel/ + + kve(k) Land-use activities + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, pasture, cottn_pro, begr, betr / + + kcr(kve) Cropping activities + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, cottn_pro, begr, betr / + + knbe14(kcr) Cropping activities excluding bioenergy plants + / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, + oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, + foddr, cottn_pro / + + kbe14(kcr) Bioenergy cropping activities + / begr, betr / + + ncp_type14 Natures contributions to people (NCP) relevant for agricultural yields + / soil_intact, poll_suff / + + yldtype Yield LPJmL run type with or without growing season adaptation + / gsadapt, constgsadapt / + +; diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms index e215672d12..22bf7e93c4 100644 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ b/modules/14_yields/gsadapt_nov25/declarations.gms @@ -20,8 +20,9 @@ parameters i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (tDM per ha per yr) i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) - im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) - pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) +im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) + im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha) + pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files index 51db0ce782..6f075de39f 100644 --- a/modules/14_yields/gsadapt_nov25/input/files +++ b/modules/14_yields/gsadapt_nov25/input/files @@ -1,5 +1,3 @@ * list of files that are required here f14_region_yields.cs3 f14_ir2rf_ratio.cs4 -f14_ipcc_bef.cs3 -f14_aboveground_fraction.csv diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms index 671b9e13aa..ef86929df0 100644 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ b/modules/14_yields/gsadapt_nov25/presolve.gms @@ -57,12 +57,28 @@ im_growing_stock(t,j,ac,"other") = ) ; +*' Growing stock for young secondary forest (youngsecdf) regrowing on other land. +*' It is derived from the *uncalibrated* secondary-forest carbon curve (the same +*' curve youngsecdf carbon uses in 35_natveg), with the secondary-forest aboveground +*' fraction, so that its wood yield and its carbon stock are consistent. +im_growing_stock_ysf(t,j,ac) = + ( + pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc") + / sm_carbon_fraction + * fm_aboveground_fraction("secdforest") + / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) + ) + ; + *' @stop ** Hard constraint to always have a positive number in im_growing_stock im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); ** Set growing stock to 0 where it does not exceed a minimum for harvest im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; +** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock +im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); +im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; * Calculate growing period adaption factor based on previous croppping pattern if (ord(t) = 1, From 162dd6bda6d70eda64e834c35abd511fb8c1ba46 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 15:32:27 +0200 Subject: [PATCH 34/42] remove old yield realizations --- config/default.cfg | 5 +- .../dynRegPastrTau_apr26/declarations.gms | 41 ---- .../dynRegPastrTau_apr26/equations.gms | 40 ---- .../14_yields/dynRegPastrTau_apr26/input.gms | 101 --------- .../dynRegPastrTau_apr26/input/files | 4 - .../14_yields/dynRegPastrTau_apr26/nl_fix.gms | 11 - .../dynRegPastrTau_apr26/nl_release.gms | 11 - .../dynRegPastrTau_apr26/postsolve.gms | 24 --- .../dynRegPastrTau_apr26/preloop.gms | 190 ----------------- .../dynRegPastrTau_apr26/presolve.gms | 81 ------- .../dynRegPastrTau_apr26/realization.gms | 42 ---- .../dynRegPastrTau_apr26/scaling.gms | 8 - .../14_yields/dynRegPastrTau_apr26/sets.gms | 36 ---- .../managementcalib_aug19/declarations.gms | 41 ---- .../managementcalib_aug19/equations.gms | 39 ---- .../14_yields/managementcalib_aug19/input.gms | 96 --------- .../managementcalib_aug19/input/files | 3 - .../managementcalib_aug19/nl_fix.gms | 11 - .../managementcalib_aug19/nl_release.gms | 11 - .../managementcalib_aug19/not_used.txt | 3 - .../managementcalib_aug19/postsolve.gms | 24 --- .../managementcalib_aug19/preloop.gms | 197 ------------------ .../managementcalib_aug19/presolve.gms | 81 ------- .../managementcalib_aug19/realization.gms | 41 ---- .../managementcalib_aug19/scaling.gms | 8 - .../14_yields/managementcalib_aug19/sets.gms | 37 ---- modules/14_yields/module.gms | 3 +- 27 files changed, 2 insertions(+), 1187 deletions(-) delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/declarations.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/equations.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/input.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/input/files delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/nl_fix.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/nl_release.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/postsolve.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/preloop.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/presolve.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/realization.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/scaling.gms delete mode 100644 modules/14_yields/dynRegPastrTau_apr26/sets.gms delete mode 100644 modules/14_yields/managementcalib_aug19/declarations.gms delete mode 100644 modules/14_yields/managementcalib_aug19/equations.gms delete mode 100644 modules/14_yields/managementcalib_aug19/input.gms delete mode 100644 modules/14_yields/managementcalib_aug19/input/files delete mode 100644 modules/14_yields/managementcalib_aug19/nl_fix.gms delete mode 100644 modules/14_yields/managementcalib_aug19/nl_release.gms delete mode 100644 modules/14_yields/managementcalib_aug19/not_used.txt delete mode 100644 modules/14_yields/managementcalib_aug19/postsolve.gms delete mode 100644 modules/14_yields/managementcalib_aug19/preloop.gms delete mode 100644 modules/14_yields/managementcalib_aug19/presolve.gms delete mode 100644 modules/14_yields/managementcalib_aug19/realization.gms delete mode 100644 modules/14_yields/managementcalib_aug19/scaling.gms delete mode 100644 modules/14_yields/managementcalib_aug19/sets.gms diff --git a/config/default.cfg b/config/default.cfg index 4143e9e0cd..b8f2209e0c 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -351,16 +351,13 @@ 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 # * (gsadapt_nov25): yields (optionally with future growing period adaptation) based on LPJmL simulations # * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional levels, # * pasture yields increase based on exogenous demand-side proxy for growth rate of cattle stocks # * (gsadapt_dynPastrTau_jul26): as gsadapt_nov25, but the pasture yield spillover from crop-sector TC # * is controlled by s14_past_spillover_mode switch # * (0=static scalar s14_yld_past_switch, 1=regional dynamic f14_yld_past_switch) -cfg$gms$yields <- "gsadapt_nov25" # def = gsadapt_nov25 +cfg$gms$yields <- "gsadapt_dynPastrTau_jul26" # def = gsadapt_dynPastrTau_jul26 # * yield scenario # * options: cc (climate change) diff --git a/modules/14_yields/dynRegPastrTau_apr26/declarations.gms b/modules/14_yields/dynRegPastrTau_apr26/declarations.gms deleted file mode 100644 index 3e80e0f90e..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/declarations.gms +++ /dev/null @@ -1,41 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields (excluding technological change) (tDM per ha per yr) - p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) - p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) - i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) - i14_modeled_yields_hist(t_all,i,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical reference year (tDM per ha per yr) - i14_lambda_yields(t,i,kcr) Scaling factor for non-linear management calibration (1) - i14_managementcalib(t,j,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) - im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) - im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha) - pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) - i14_calib_yields_hist(i,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) - i14_calib_yields_ratio(i) Irrigated to rainfed yield ratio for calibrated yields (1) - i14_target_ratio(i) Target irrigated to rainfed ratio as upper bound (1) - i14_modeled_yields_hist2(i,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) - ; - -positive variables - vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) -; - -equations - q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) - q14_yield_past(j,w) Pasture yields (tDM per ha per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) - oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) - oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/dynRegPastrTau_apr26/equations.gms b/modules/14_yields/dynRegPastrTau_apr26/equations.gms deleted file mode 100644 index e4f4a83966..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/equations.gms +++ /dev/null @@ -1,40 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @equations - -***CROP YIELD CALCULATIONS********************************************** - -*' Technological change can increase the initial calibrated yields by: - -q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * - vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); - -*' For the current time step of the optimization, cellular yields of irrigated -*' and rainfed crops are calculated by multiplying calibrated input yields from -*' LPJmL with the intensification rate relative to the initial time step 1995. - -***PASTURE YIELD CALCULATIONS******************************************* - -*' In the case of pasture yields, technological change cannot be fully -*' translated into yield increases, to address that, an exogenous pasture management -*' factor `pm_past_mngmnt_factor` is used to scale pasture yields based on the -*' number of cattle reared to fulfill the domestic demand for ruminant livestock -*' products in module 70. -*' -*' Additionally, the parameter `f14_yld_past_switch` can be used to capture a -*' certain magnitude of spillovers of the yield increase due to technological -*' change from the time step before. It is defined per model region and time step, -*' and can range from 0 (no spillover) to 1 (full spillover). - -q14_yield_past(j2,w) .. - vm_yld(j2,"pasture",w) =e= - sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) - * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) - * (1 + sum(ct, sum(cell(i2,j2), f14_yld_past_switch(ct,i2))) - * (sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(j2,"crop") / fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/dynRegPastrTau_apr26/input.gms b/modules/14_yields/dynRegPastrTau_apr26/input.gms deleted file mode 100644 index 585e604d96..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/input.gms +++ /dev/null @@ -1,101 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -$setglobal c14_yields_scenario cc -* options: cc (climate change) -* nocc (no climate change) -* nocc_hist (no climate change after year defined by sm_fix_cc) - - -scalars -s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / -s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / -s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / -s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / -s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / -s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / -sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / -; - - -******* Calibration factor -$onEmpty -table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_calib.csv" $include "./modules/14_yields/input/f14_yld_calib.csv" -$offdelim -; -$offEmpty - -table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" -$offdelim -; -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields,"j,kve,w"); - -table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" -$offdelim; - -table f14_yld_past_switch(t_all,i) Pasture yield spillover factor from crop-sector TC by region (1) -$ondelim -$include "./modules/14_yields/dynRegPastrTau_apr26/input/f14_yld_past_switch.csv" -$offdelim -; -m_fillmissingyears(f14_yld_past_switch,"i"); - -table f14_fao_yields_hist(t_all,i,kcr) FAO yields per region (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/dynRegPastrTau_apr26/input/f14_region_yields.cs3" -$offdelim -; -m_fillmissingyears(f14_fao_yields_hist,"i,kcr"); - -parameter f14_ir2rf_ratio(i) AQUASTAT ratio of irrigated to rainfed yields per region (1) -/ -$ondelim -$include "./modules/14_yields/dynRegPastrTau_apr26/input/f14_ir2rf_ratio.cs4" -$offdelim -/ -; - -parameter fm_ipcc_bef(clcl) IPCC biomass expansion factor BEF (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_ipcc_bef.cs3" -$offdelim -/ -; - -parameter fm_aboveground_fraction(land_timber) Aboveground fraction of total biomass (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_aboveground_fraction.csv" -$offdelim -/ -; - -$onEmpty -table f14_yld_ncp_report(t_all,j,ncp_type14) Share of land with intact natures contributions to people (NCP) (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_ncp_report.cs3" $include "./modules/14_yields/input/f14_yld_ncp_report.cs3" -$offdelim -; -$offEmpty - -parameter f14_kcr_pollinator_dependence(kcr) Share of total yield dependent on biotic pollination (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" -$offdelim -/ -; diff --git a/modules/14_yields/dynRegPastrTau_apr26/input/files b/modules/14_yields/dynRegPastrTau_apr26/input/files deleted file mode 100644 index fec4acdcf9..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/input/files +++ /dev/null @@ -1,4 +0,0 @@ -* list of files that are required here -f14_region_yields.cs3 -f14_ir2rf_ratio.cs4 -f14_yld_past_switch.csv diff --git a/modules/14_yields/dynRegPastrTau_apr26/nl_fix.gms b/modules/14_yields/dynRegPastrTau_apr26/nl_fix.gms deleted file mode 100644 index 88fbe71126..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/nl_fix.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_fix ### - -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); -vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + sum(ct, sum(cell(i,j), f14_yld_past_switch(ct,i))) * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/dynRegPastrTau_apr26/nl_release.gms b/modules/14_yields/dynRegPastrTau_apr26/nl_release.gms deleted file mode 100644 index 183fadf84b..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/nl_release.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_release ### - -vm_yld.lo(j,kve,w) = 0; -vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/dynRegPastrTau_apr26/postsolve.gms b/modules/14_yields/dynRegPastrTau_apr26/postsolve.gms deleted file mode 100644 index b889d502a0..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/postsolve.gms +++ /dev/null @@ -1,24 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); - oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); - ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); - oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); - ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); - oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); - ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); - oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/14_yields/dynRegPastrTau_apr26/preloop.gms b/modules/14_yields/dynRegPastrTau_apr26/preloop.gms deleted file mode 100644 index 39899859d7..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/preloop.gms +++ /dev/null @@ -1,190 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -i14_yields_calib(t,j,kve,w) = f14_yields(t,j,kve,w); - -***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* -i14_yields_calib(t,j,"begr",w) = f14_yields(t,j,"begr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -i14_yields_calib(t,j,"betr",w) = f14_yields(t,j,"betr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); - -***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),i14_yields_calib(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / - sum(cell(i,j),pm_land_start(j,"past")) ); - -p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); -loop(t, - p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); -); - -***YIELD MANAGEMENT CALIBRATION************************************************************ - - -*' @code - -*' The following equations calibrate the cellular yield patterns (`f14_yields`) to match -*' FAO historical yields (`f14_fao_yields_hist`) by calculating a calibration term called -*' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical -*' yields reported by FAO (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) -*' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models -*' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative -*' calibration factor that depends only on the initial conditions of the starting year. -*' -*' However, when FAO yields are significantly higher than given by the cellular yield inputs -*' (underestimated baseline), the relative calibration terms can lead to unrealistically large -*' yields in the case of future yield increases within the cellular yield patterns. -*' -*' To address this issue, the factor `i14_lambda_yields` determines the degree -*' to which the baseline (FAO) is under- or overestimated and therefore controls -*' whether the calibration factor is applied as an absolute or relative change. -*' For overestimated FAO yields, `i14_lambda_yields` is 1, which is equivalent -*' to an entirely relative calibration. For underestimated yields, `i14_lambda_yields` -*' is calculated as the squared root of the ratio between LPJmL yields and FAO historical -*' yields, and as `i14_lambda_yields` approaches 0, it reduces the applied relative change -*' resulting in a mean change increasingly similar to an additive term (@Heinke.2013). - -*' This concept is referred to as limited calibration, as it limits the calibration -*' to an additive term in case of a strongly underestimated baseline. The scalar -*' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). - -i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); - -*' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields -*' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where -*' a region has no crop area reported for a given crop type, the total crop area is -*' used to calculate a proxy yield for the calibration, given by the following equation: - -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 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 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 -*' on the setting `s14_limit_calib` and is then held constant for all other time steps. -*' The regional FAO yield and regional yield of the crop model input of the initial -*' time step is kept constant in the two parameters `i14_fao_yields_hist` and -*' `i14_modeled_yields_hist`: - -loop(t, - if(sum(sameas(t,"y1995"),1)=1, - - if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,knbe14) = 1; - - Elseif (s14_limit_calib =1 ), - i14_lambda_yields(t,i,knbe14) = - 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,knbe14)) - + sqrt(i14_modeled_yields_hist(t,i,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ - (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,knbe14)); - ); - - i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); - - Else - i14_modeled_yields_hist(t,i,knbe14) = i14_modeled_yields_hist(t-1,i,knbe14); - i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); - i14_lambda_yields(t,i,knbe14) = i14_lambda_yields(t-1,i,knbe14); - ); -); - -*' The calibrated cellular yield `i14_yields_calib` is calculated for each time step depending -*' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` -*' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: - -i14_managementcalib(t,j,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / - f14_yields(t,j,knbe14,w) * - (f14_yields(t,j,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(f14_yields(t,j,knbe14,w)>0); - - -i14_yields_calib(t,j,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * f14_yields(t,j,knbe14,w); -pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); - -*' Note that the calculation is split into two parts for better readability. - -*' Irrigated yields are calibrated to meet the country-level -*' ratio between irrigated and rainfed yields reported by Aquastat. -*' This can be de-activated with the switch `s14_calib_ir2rf`. -if ((s14_calib_ir2rf = 1), - -* Weighted yields - i14_calib_yields_hist(i,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib("y1995",j,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); - -* Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); - i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); - i14_yields_calib(t,j,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * - i14_yields_calib(t,j,knbe14,"irrigated"); - -* 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), 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); - - i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,knbe14)) * - i14_yields_calib(t,j,knbe14,w); - - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); -); - -*' @stop - - -***YIELD CALIBRATION*********************************************************************** - -*' @code -*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' -*' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional -*' yields are outlier corrected, historical production and croparea can in some cases -*' be better represented with this additional correction: - -* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) -* or missing input file -if(s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, - f14_yld_calib(i,ltype14) = 1; -); - - -i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) - * sum(cell(i,j),f14_yld_calib(i,"crop")); -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) - * sum(cell(i,j),f14_yld_calib(i,"past")); - -*' @stop - -*' @code -*' Land degradation can negatively affect yields. Soil loss for example can -*' notably affect land productivity. Similarly, the yield of pollinator-dependent crops -*' is reduced when there is a lack of pollinators. To account for the impacts of degradation, -*' calibrated yields are multiplied by the share of land with intact NCP in each cell and specific -*' yield reduction coefficients that represent yield loss due to soil erosion and pollination -*' deficiency on non-intact land. - -* set default values in case of missing input file. -if(sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, - f14_yld_ncp_report(t,j,ncp_type14) = 1; -); - -if ((s14_degradation = 1), - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - s14_yld_reduction_soil_loss) - + i14_yields_calib(t,j,kcr,w) * s14_yld_reduction_soil_loss * f14_yld_ncp_report(t,j,"soil_intact"); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - f14_kcr_pollinator_dependence(kcr)) - + i14_yields_calib(t,j,kcr,w) * f14_kcr_pollinator_dependence(kcr) * f14_yld_ncp_report(t,j,"poll_suff"); -); - -*' @stop diff --git a/modules/14_yields/dynRegPastrTau_apr26/presolve.gms b/modules/14_yields/dynRegPastrTau_apr26/presolve.gms deleted file mode 100644 index 65d7cd4c80..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/presolve.gms +++ /dev/null @@ -1,81 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*** EOF presolve.gms *** - -* calculate carbon density - -*** HARVESTABLE GROWING STOCK - -*' `pm_carbon_density_plantation_ac` for vegetation carbon is above- and belowground -*' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon -*' fraction of `sm_carbon_fraction` in tC/tDM. For assessing wood harvesting -*' we need only aboveground biomass information, therefore we multiply with -*' aboveground `fm_aboveground_fraction`. Additionally, we divide aboveground -*' tree biomass by the Biomass Expansion Factor (BEF, dimensionless) to get -*' stem biomass in tDM/ha. BEF = AGB (aboveground biomass) / stem_biomass (always > 1). - -*' @code - -im_growing_stock(t,j,ac,"forestry") = - ( - pm_carbon_density_plantation_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("forestry") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"primforest") = - ( - fm_carbon_density(t,j,"primforest","vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("primforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"secdforest") = - ( - pm_carbon_density_secdforest_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"other") = - ( - pm_carbon_density_other_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("other") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' Growing stock for young secondary forest (youngsecdf) regrowing on other land. -*' It is derived from the *uncalibrated* secondary-forest carbon curve (the same -*' curve youngsecdf carbon uses in 35_natveg), with the secondary-forest aboveground -*' fraction, so that its wood yield and its carbon stock are consistent. -im_growing_stock_ysf(t,j,ac) = - ( - pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' @stop - -** Hard constraint to always have a positive number in im_growing_stock -im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); -** Set growing stock to 0 where it does not exceed a minimum for harvest -im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; -** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock -im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); -im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; diff --git a/modules/14_yields/dynRegPastrTau_apr26/realization.gms b/modules/14_yields/dynRegPastrTau_apr26/realization.gms deleted file mode 100644 index ce5422c3b8..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/realization.gms +++ /dev/null @@ -1,42 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @description The dynRegPastrTau_apr26 realization extends managementcalib_aug19 -*' by replacing the global scalar spillover parameter for pasture yield increases -*' with a regional, time-varying input parameter `f14_yld_past_switch` (t_all x i). -*' All other yield calibration logic — bioenergy correction, pasture management -*' correction, FAO calibration, irrigated-to-rainfed ratio calibration, yield -*' calibration factors, and land degradation effects — is identical to -*' managementcalib_aug19. -*' -*' The parameter `f14_yld_past_switch(t_all,i)` scales the fraction of -*' crop-sector technological change (tau) that spills over to pasture yields, -*' and can vary across the MAgPIE world regions and across model -*' time steps from 1965 to 2150. A value of 0 implies no spillover; a value -*' of 1 implies full spillover equal to the crop-sector intensification rate. -*' The default input file populates all regions and time steps with values able to -*' reproduce the behaviour of managementcalib_aug19 realization. - -*' @limitations The exogenous implementation of pasture intensification cannot -*' capture feedbacks between land scarcity and efforts to improve pasture -*' management. Moreover, the magnitude of spillover effects from technological change -*' in the crop sector towards improvements in pasture management is very uncertain -*' and varies across regions and time periods. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/14_yields/dynRegPastrTau_apr26/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/14_yields/dynRegPastrTau_apr26/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/14_yields/dynRegPastrTau_apr26/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/14_yields/dynRegPastrTau_apr26/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/14_yields/dynRegPastrTau_apr26/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/14_yields/dynRegPastrTau_apr26/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/14_yields/dynRegPastrTau_apr26/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/dynRegPastrTau_apr26/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/dynRegPastrTau_apr26/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/dynRegPastrTau_apr26/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/dynRegPastrTau_apr26/scaling.gms b/modules/14_yields/dynRegPastrTau_apr26/scaling.gms deleted file mode 100644 index c7671f82e4..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/scaling.gms +++ /dev/null @@ -1,8 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*q14_yield_past.scale(j,w) = 1e-2; diff --git a/modules/14_yields/dynRegPastrTau_apr26/sets.gms b/modules/14_yields/dynRegPastrTau_apr26/sets.gms deleted file mode 100644 index 368f8a547d..0000000000 --- a/modules/14_yields/dynRegPastrTau_apr26/sets.gms +++ /dev/null @@ -1,36 +0,0 @@ -*** | (C) 2008-2026 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -sets - ltype14 calibration land types - / crop, past / - - k(kall) Primary products - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr, livst_rum, livst_pig, - livst_chick, livst_egg, livst_milk, fish, wood, woodfuel/ - - kve(k) Land-use activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr / - - kcr(kve) Cropping activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro, begr, betr / - - knbe14(kcr) Cropping activities excluding bioenergy plants - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro / - - ncp_type14 natures contributions to people (NCP) relevant for agricultural yields - / soil_intact, poll_suff / - -; diff --git a/modules/14_yields/managementcalib_aug19/declarations.gms b/modules/14_yields/managementcalib_aug19/declarations.gms deleted file mode 100644 index 5b7398872f..0000000000 --- a/modules/14_yields/managementcalib_aug19/declarations.gms +++ /dev/null @@ -1,41 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields (excluding technological change) (tDM per ha per yr) - p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) - p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) - i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) - i14_modeled_yields_hist(t_all,i,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_fao_yields_hist(t,i,kcr) FAO yields per region at the historical reference year (tDM per ha per yr) - i14_lambda_yields(t,i,kcr) Scaling factor for non-linear management calibration (1) - i14_managementcalib(t,j,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) - im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) - im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha) - pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) - i14_calib_yields_hist(i,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) - i14_calib_yields_ratio(i) Irrigated to rainfed yield ratio for calibrated yields (1) - i14_target_ratio(i) Target irrigated to rainfed ratio as upper bound (1) - i14_modeled_yields_hist2(i,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) - ; - -positive variables - vm_yld(j,kve,w) Yields (variable because of technical change) (tDM per ha per yr) -; - -equations - q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) - q14_yield_past(j,w) Pasture yields (tDM per ha per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) - oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) - oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/managementcalib_aug19/equations.gms b/modules/14_yields/managementcalib_aug19/equations.gms deleted file mode 100644 index bd8857f4cd..0000000000 --- a/modules/14_yields/managementcalib_aug19/equations.gms +++ /dev/null @@ -1,39 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @equations - -***CROP YIELD CALCULATIONS********************************************** - -*' Technological change can increase the initial calibrated yields by: - -q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct,i14_yields_calib(ct,j2,kcr,w)) * - vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); - -*' For the current time step of the optimization, cellular yields of irrigated -*' and rainfed crops are calculated by multiplying calibrated input yields from -*' LPJmL with the intensification rate relative to the initial time step 1995. - -***PASTURE YIELD CALCULATIONS******************************************* - -*' In the case of pasture yields, technological change cannot be fully -*' translated into yield increases, to address that, an exogenous pasture management -*' factor `pm_past_mngmnt_factor` is used to scale pasture yields based on the -*' number of cattle reared to fulfill the domestic demand for ruminant livestock -*' products in module 70. -*' -*' Additionally, the parameter `s14_yld_past_switch` can be used to capture a -*' certain magnitude of spillovers of the yield increase due to technological -*' change from the time step before. It can range from 0 (no spillover) to 1 -*' (full spillover). - -q14_yield_past(j2,w) .. - vm_yld(j2,"pasture",w) =e= - sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) - * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) - * (1 + s14_yld_past_switch*(sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(j2, "crop")/fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/managementcalib_aug19/input.gms b/modules/14_yields/managementcalib_aug19/input.gms deleted file mode 100644 index 49cbcc4078..0000000000 --- a/modules/14_yields/managementcalib_aug19/input.gms +++ /dev/null @@ -1,96 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -$setglobal c14_yields_scenario cc -* options: cc (climate change) -* nocc (no climate change) -* nocc_hist (no climate change after year defined by sm_fix_cc) - - -scalars -s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / -s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / -s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / -s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / -s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / -s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yieldincreases (1) / 0.25 / -s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / -sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / -; - - -******* Calibration factor -$onEmpty -table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_calib.csv" $include "./modules/14_yields/input/f14_yld_calib.csv" -$offdelim -; -$offEmpty - -table f14_yields(t_all,j,kve,w) LPJmL potential yields per cell (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" -$offdelim -; -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields,"j,kve,w"); - -table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" -$offdelim; - - -table f14_fao_yields_hist(t_all,i,kcr) FAO yields per region (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/managementcalib_aug19/input/f14_region_yields.cs3" -$offdelim -; -m_fillmissingyears(f14_fao_yields_hist,"i,kcr"); - -parameter f14_ir2rf_ratio(i) AQUASTAT ratio of irrigated to rainfed yields per region (1) -/ -$ondelim -$include "./modules/14_yields/managementcalib_aug19/input/f14_ir2rf_ratio.cs4" -$offdelim -/ -; - -parameter fm_ipcc_bef(clcl) IPCC biomass expansion factor BEF (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_ipcc_bef.cs3" -$offdelim -/ -; - -parameter fm_aboveground_fraction(land_timber) Aboveground fraction of total biomass (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_aboveground_fraction.csv" -$offdelim -/ -; - -$onEmpty -table f14_yld_ncp_report(t_all,j,ncp_type14) Share of land with intact natures contributions to people (NCP) (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_ncp_report.cs3" $include "./modules/14_yields/input/f14_yld_ncp_report.cs3" -$offdelim -; -$offEmpty - -parameter f14_kcr_pollinator_dependence(kcr) Share of total yield dependent on biotic pollination (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" -$offdelim -/ -; diff --git a/modules/14_yields/managementcalib_aug19/input/files b/modules/14_yields/managementcalib_aug19/input/files deleted file mode 100644 index 6f075de39f..0000000000 --- a/modules/14_yields/managementcalib_aug19/input/files +++ /dev/null @@ -1,3 +0,0 @@ -* list of files that are required here -f14_region_yields.cs3 -f14_ir2rf_ratio.cs4 diff --git a/modules/14_yields/managementcalib_aug19/nl_fix.gms b/modules/14_yields/managementcalib_aug19/nl_fix.gms deleted file mode 100644 index e93d662442..0000000000 --- a/modules/14_yields/managementcalib_aug19/nl_fix.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_fix ### - -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * vm_tau.l(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)); -vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (pcm_tau(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/managementcalib_aug19/nl_release.gms b/modules/14_yields/managementcalib_aug19/nl_release.gms deleted file mode 100644 index f3261b8f87..0000000000 --- a/modules/14_yields/managementcalib_aug19/nl_release.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_release ### - -vm_yld.lo(j,kve,w) = 0; -vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/managementcalib_aug19/not_used.txt b/modules/14_yields/managementcalib_aug19/not_used.txt deleted file mode 100644 index 033cb7f96a..0000000000 --- a/modules/14_yields/managementcalib_aug19/not_used.txt +++ /dev/null @@ -1,3 +0,0 @@ -name,type,reason -pm_yields_gsadapt_ratio_increment, interface, not needed -pcm_area, interface, not needed diff --git a/modules/14_yields/managementcalib_aug19/postsolve.gms b/modules/14_yields/managementcalib_aug19/postsolve.gms deleted file mode 100644 index 398d8cf124..0000000000 --- a/modules/14_yields/managementcalib_aug19/postsolve.gms +++ /dev/null @@ -1,24 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); - oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); - ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); - oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); - ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); - oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); - ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); - oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms deleted file mode 100644 index 90ed57ae81..0000000000 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ /dev/null @@ -1,197 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -i14_yields_calib(t,j,kve,w) = f14_yields(t,j,kve,w); - -***YIELD CORRECTION FOR 2ND GENERATION BIOENERGY CROPS************************************* -i14_yields_calib(t,j,"begr",w) = f14_yields(t,j,"begr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -i14_yields_calib(t,j,"betr",w) = f14_yields(t,j,"betr",w) * sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); - -***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j),i14_yields_calib(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / - sum(cell(i,j),pm_land_start(j,"past")) ); - -*' Pasture yield correction: use historical data for all years where available -*' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. -*' This avoids a discontinuity at the t_past boundary by using observed data -*' through y2020 instead of freezing at the last t_past year (y2015). -p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); -loop(t, - p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); -); - -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); - - -***YIELD MANAGEMENT CALIBRATION************************************************************ - - -*' @code - -*' The following equations calibrate the cellular yield patterns (`f14_yields`) to match -*' FAO historical yields (`f14_fao_yields_hist`) by calculating a calibration term called -*' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical -*' yields reported by FAO (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) -*' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models -*' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative -*' calibration factor that depends only on the initial conditions of the starting year. -*' -*' However, when FAO yields are significantly higher than given by the cellular yield inputs -*' (underestimated baseline), the relative calibration terms can lead to unrealistically large -*' yields in the case of future yield increases within the cellular yield patterns. -*' -*' To address this issue, the factor `i14_lambda_yields` determines the degree -*' to which the baseline (FAO) is under- or overestimated and therefore controls -*' whether the calibration factor is applied as an absolute or relative change. -*' For overestimated FAO yields, `i14_lambda_yields` is 1, which is equivalent -*' to an entirely relative calibration. For underestimated yields, `i14_lambda_yields` -*' is calculated as the squared root of the ratio between LPJmL yields and FAO historical -*' yields, and as `i14_lambda_yields` approaches 0, it reduces the applied relative change -*' resulting in a mean change increasingly similar to an additive term (@Heinke.2013). - -*' This concept is referred to as limited calibration, as it limits the calibration -*' to an additive term in case of a strongly underestimated baseline. The scalar -*' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). - -i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); - -*' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields -*' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where -*' a region has no crop area reported for a given crop type, the total crop area is -*' used to calculate a proxy yield for the calibration, given by the following equation: - -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 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 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 -*' on the setting `s14_limit_calib` and is then held constant for all other time steps. -*' The regional FAO yield and regional yield of the crop model input of the initial -*' time step is kept constant in the two parameters `i14_fao_yields_hist` and -*' `i14_modeled_yields_hist`: - -loop(t, - if(sum(sameas(t,"y1995"),1)=1, - - if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,knbe14) = 1; - - Elseif (s14_limit_calib =1 ), - i14_lambda_yields(t,i,knbe14) = - 1$(f14_fao_yields_hist(t,i,knbe14) <= i14_modeled_yields_hist(t,i,knbe14)) - + sqrt(i14_modeled_yields_hist(t,i,knbe14)/f14_fao_yields_hist(t,i,knbe14))$ - (f14_fao_yields_hist(t,i,knbe14) > i14_modeled_yields_hist(t,i,knbe14)); - ); - - i14_fao_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); - - Else - i14_modeled_yields_hist(t,i,knbe14) = i14_modeled_yields_hist(t-1,i,knbe14); - i14_fao_yields_hist(t,i,knbe14) = i14_fao_yields_hist(t-1,i,knbe14); - i14_lambda_yields(t,i,knbe14) = i14_lambda_yields(t-1,i,knbe14); - ); -); - -*' The calibrated cellular yield `i14_yields_calib` is calculated for each time step depending -*' on the constant values `i14_modeled_yields_hist`, `i14_fao_yields_hist`, `i14_lambda_yields` -*' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: - -i14_managementcalib(t,j,knbe14,w) = - 1 + (sum(cell(i,j), i14_fao_yields_hist(t,i,knbe14) - i14_modeled_yields_hist(t,i,knbe14)) / - f14_yields(t,j,knbe14,w) * - (f14_yields(t,j,knbe14,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,knbe14))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,knbe14)))$(f14_yields(t,j,knbe14,w)>0); - - -i14_yields_calib(t,j,knbe14,w) = i14_managementcalib(t,j,knbe14,w) * f14_yields(t,j,knbe14,w); -pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); - -*' Note that the calculation is split into two parts for better readability. - -*' Irrigated yields are calibrated to meet the country-level -*' ratio between irrigated and rainfed yields reported by Aquastat. -*' This can be de-activated with the switch `s14_calib_ir2rf`. -if ((s14_calib_ir2rf = 1), - -* Weighted yields - i14_calib_yields_hist(i,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib("y1995",j,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); - -* Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i) = i14_calib_yields_hist(i,"irrigated") / i14_calib_yields_hist(i,"rainfed"); - i14_target_ratio(i) = max(i14_calib_yields_ratio(i), f14_ir2rf_ratio(i)); - i14_yields_calib(t,j,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i) / i14_calib_yields_ratio(i)) * - i14_yields_calib(t,j,knbe14,"irrigated"); - -* 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), 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); - - i14_yields_calib(t,j,knbe14,w) = sum((cell(i,j)), i14_fao_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,knbe14)) * - i14_yields_calib(t,j,knbe14,w); - - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); -); - -*' @stop - - -***YIELD CALIBRATION*********************************************************************** - -*' @code -*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' -*' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional -*' yields are outlier corrected, historical production and croparea can in some cases -*' be better represented with this additional correction: - -* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) -* or missing input file -if(s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, - f14_yld_calib(i,ltype14) = 1; -); - - -i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) - * sum(cell(i,j),f14_yld_calib(i,"crop")); -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) - * sum(cell(i,j),f14_yld_calib(i,"past")); - -*' @stop - -*' @code -*' Land degradation can negatively affect yields. Soil loss for example can -*' notably affect land productivity. Similarly, the yield of pollinator-dependent crops -*' is reduced when there is a lack of pollinators. To account for the impacts of degradation, -*' calibrated yields are multiplied by the share of land with intact NCP in each cell and specific -*' yield reduction coefficients that represent yield loss due to soil erosion and pollination -*' deficiency on non-intact land. - -* set default values in case of missing input file. -if(sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, - f14_yld_ncp_report(t,j,ncp_type14) = 1; -); - -if ((s14_degradation = 1), - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - s14_yld_reduction_soil_loss) - + i14_yields_calib(t,j,kcr,w) * s14_yld_reduction_soil_loss * f14_yld_ncp_report(t,j,"soil_intact"); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - f14_kcr_pollinator_dependence(kcr)) - + i14_yields_calib(t,j,kcr,w) * f14_kcr_pollinator_dependence(kcr) * f14_yld_ncp_report(t,j,"poll_suff"); -); - -*' @stop diff --git a/modules/14_yields/managementcalib_aug19/presolve.gms b/modules/14_yields/managementcalib_aug19/presolve.gms deleted file mode 100644 index 86b9a8f5aa..0000000000 --- a/modules/14_yields/managementcalib_aug19/presolve.gms +++ /dev/null @@ -1,81 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*** EOF presolve.gms *** - -* calculate carbon density - -*** HARVESTABLE GROWING STOCK - -*' `pm_carbon_density_plantation_ac` for vegetation carbon is above- and belowground -*' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon -*' fraction of `sm_carbon_fraction` in tC/tDM. For assessing wood harvesting -*' we need only aboveground biomass information, therefore we multiply with -*' aboveground `fm_aboveground_fraction`. Additionally, we divide aboveground -*' tree biomass by the Biomass Expansion Factor (BEF, dimensionless) to get -*' stem biomass in tDM/ha. BEF = AGB (aboveground biomass) / stem_biomass (always > 1). - -*' @code - -im_growing_stock(t,j,ac,"forestry") = - ( - pm_carbon_density_plantation_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("forestry") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"primforest") = - ( - fm_carbon_density(t,j,"primforest","vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("primforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"secdforest") = - ( - pm_carbon_density_secdforest_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"other") = - ( - pm_carbon_density_other_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("other") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' Growing stock for young secondary forest (youngsecdf) regrowing on other land. -*' It is derived from the *uncalibrated* secondary-forest carbon curve (the same -*' curve youngsecdf carbon uses in 35_natveg), with the secondary-forest aboveground -*' fraction, so that its wood yield and its carbon stock are consistent. -im_growing_stock_ysf(t,j,ac) = - ( - pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' @stop - -** Hard constraint to always have a positive number in im_growing_stock -im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); -** Set growing stock to 0 where it does not exceed a minimum for harvest -im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; -** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock -im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); -im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; diff --git a/modules/14_yields/managementcalib_aug19/realization.gms b/modules/14_yields/managementcalib_aug19/realization.gms deleted file mode 100644 index a2b52b06b3..0000000000 --- a/modules/14_yields/managementcalib_aug19/realization.gms +++ /dev/null @@ -1,41 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @description The managementcalib_aug19 realization reads in the LPJmL data and -*' performs a number of calibrations. First, a bioenergy yield correction is performed. -*' As there is currently no robust information on bioenergy yields available in -*' [@FAOSTAT], it is assumed that the LPJmL yields for bioenergy correspond to the -*' yields achieved under the highest currently observed value of the $\tau$ factor -*' representing agricultural land-use intensity. Secondly, pasture yields are calculated -*' based on pasture demand to account for in- and extensification of managed grasslands. -*' Thirdly, irrigated yields are scaled to meet the irrigated-to-rainfed yield -*' ratio as provided by AQUASTAT [@fao_aquastat_2016]. -*' Finally, crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the -*' initial time step. An additional feature of this realization is to allow crop yields -*' technological change from the precedent times step to spillover to pasture areas. -*' This realization also calculates harvestable growing stock (`im_growing_stock`) as -*' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion -*' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. - -*' @limitations The exogenous implementation of pasture intensification cannot -*' capture feedbacks between land scarcity and efforts to improve pasture -*' management. Moreover, the magnitude of spillover effects from technological change -*' in the crop sector towards improvements in pasture management is very uncertain. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/14_yields/managementcalib_aug19/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/14_yields/managementcalib_aug19/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/14_yields/managementcalib_aug19/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/14_yields/managementcalib_aug19/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/14_yields/managementcalib_aug19/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/14_yields/managementcalib_aug19/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/14_yields/managementcalib_aug19/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/managementcalib_aug19/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/managementcalib_aug19/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/managementcalib_aug19/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/managementcalib_aug19/scaling.gms b/modules/14_yields/managementcalib_aug19/scaling.gms deleted file mode 100644 index ef2b844f16..0000000000 --- a/modules/14_yields/managementcalib_aug19/scaling.gms +++ /dev/null @@ -1,8 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*q14_yield_past.scale(j,w) = 1e-2; diff --git a/modules/14_yields/managementcalib_aug19/sets.gms b/modules/14_yields/managementcalib_aug19/sets.gms deleted file mode 100644 index 894b3ac2f9..0000000000 --- a/modules/14_yields/managementcalib_aug19/sets.gms +++ /dev/null @@ -1,37 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -sets - ltype14 calibration land types - / crop, past / - - k(kall) Primary products - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr, livst_rum, livst_pig, - livst_chick, livst_egg, livst_milk, fish, wood, woodfuel/ - - kve(k) Land-use activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr / - - kcr(kve) Cropping activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro, begr, betr / - - knbe14(kcr) Cropping activities excluding bioenergy plants - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro / - - ncp_type14 natures contributions to people (NCP) relevant for agricultural yields - / soil_intact, poll_suff / - -; - diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index 20d767a59e..afc7fb1a94 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -27,6 +27,5 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%yields%" == "gsadapt_nov25" $include "./modules/14_yields/gsadapt_nov25/realization.gms" -$Ifi "%yields%" == "dynRegPastrTau_apr26" $include "./modules/14_yields/dynRegPastrTau_apr26/realization.gms" -$Ifi "%yields%" == "managementcalib_aug19" $include "./modules/14_yields/managementcalib_aug19/realization.gms" +$Ifi "%yields%" == "gsadapt_dynPastrTau_jul26" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From 17b5125d79490efb8fb4c751cd6c01be251ec0d4 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 15:42:38 +0200 Subject: [PATCH 35/42] remove tabs --- modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms index 6ec5947267..88a34a347d 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/preloop.gms @@ -223,7 +223,7 @@ i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) * sum(cell(i,j),f14_yld_calib(i,"past")); * Set effective pasture spillover parameter to regional dynamic value - i14_yld_past_switch_eff(t,i) = f14_yld_past_switch(t,i); + i14_yld_past_switch_eff(t,i) = f14_yld_past_switch(t,i); * If static spillover mode, override with scalar value if (s14_past_spillover_mode = 0, From 0ee0af94e66cb608716b276e27b6676cf3251d69 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Tue, 28 Jul 2026 16:00:00 +0200 Subject: [PATCH 36/42] change pasture spillover to static --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index b8f2209e0c..73d521d71e 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -370,7 +370,7 @@ cfg$gms$c14_yields_scenario <- "cc" # def = "cc" # * (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 <- 1 # def = 1 (regional dynamic mode) +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) From 739854e97bc7101074e1b5d3e9343f40c7906ba1 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 16:15:27 +0200 Subject: [PATCH 37/42] include gsadapt presolve statement also in new merged yield realization --- .../gsadapt_dynPastrTau_jul26/presolve.gms | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms index 65d7cd4c80..ca32c64219 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/presolve.gms @@ -79,3 +79,36 @@ im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14 ** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; + +* Calculate growing period adaption factor based on previous croppping pattern +if (ord(t) = 1, + + p14_yields_gsadapt_ratio(t,i) = 1; + p14_yields_gsadapt_ratio_previous(t,i) = 1; + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cumulative(t,i) = 1; + +else + + p14_yields_gsadapt_ratio(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + + p14_yields_gsadapt_ratio_previous(t,i) = + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / + sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); + + pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); +* The max(1,...) ensures the cumulative factor can only grow, never shrink. +* This means declining adaptation opportunities are not represented — once +* adaptation gains are accounted for via tau, they cannot be reversed. + p14_yields_gsadapt_ratio_cumulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cumulative(t-1,i); + +); + +if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, + pm_yields_gsadapt_ratio_increment(t,i) = 1; + p14_yields_gsadapt_ratio_cumulative(t,i) = 1; +); + +*** EOF presolve.gms *** From 9c410d805b98b8972581a1e5de6a21754c03cbbb Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 16:34:43 +0200 Subject: [PATCH 38/42] also update nl_fix file --- modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms index c27256f054..476da50131 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/nl_fix.gms @@ -7,5 +7,5 @@ * ### nl_fix ### -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w)) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); +vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w) / sum(cell(i,j), p14_yields_gsadapt_ratio_cumulative(ct,i))) * sum((cell(i,j), supreg(h,i)),vm_tau.l(h, "crop") / fm_tau1995(h)); vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + sum(cell(i,j), i14_yld_past_switch_eff("y1995",i)) * (sum((cell(i,j), supreg(h,i)), pcm_tau(h, "crop") / fm_tau1995(h)) - 1)); From 961eca5baf8481bd75b9bec9ab89f3db1d017c59 Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 17:57:13 +0200 Subject: [PATCH 39/42] clean-up old realization and description text --- config/default.cfg | 14 +- modules/13_tc/endo_jan22/declarations.gms | 56 ---- modules/13_tc/endo_jan22/equations.gms | 60 ----- modules/13_tc/endo_jan22/input.gms | 89 ------- modules/13_tc/endo_jan22/nl_fix.gms | 10 - modules/13_tc/endo_jan22/nl_relax.gms | 10 - modules/13_tc/endo_jan22/nl_release.gms | 11 - modules/13_tc/endo_jan22/not_used.txt | 2 - modules/13_tc/endo_jan22/postsolve.gms | 64 ----- modules/13_tc/endo_jan22/preloop.gms | 33 --- modules/13_tc/endo_jan22/presolve.gms | 81 ------ modules/13_tc/endo_jan22/realization.gms | 55 ---- modules/13_tc/endo_jan22/scaling.gms | 11 - modules/13_tc/endo_jan22/sets.gms | 18 -- modules/13_tc/endo_jan22/tau_regional.png | Bin 12653 -> 0 bytes modules/13_tc/endo_jan22/tc_schematic.png | Bin 21370 -> 0 bytes modules/13_tc/endo_jan22/tcc_regression.png | Bin 27968 -> 0 bytes .../gsadapt_dynPastrTau_jul26/realization.gms | 39 +-- .../14_yields/gsadapt_nov25/declarations.gms | 47 ---- modules/14_yields/gsadapt_nov25/equations.gms | 38 --- modules/14_yields/gsadapt_nov25/input.gms | 113 -------- modules/14_yields/gsadapt_nov25/input/files | 3 - modules/14_yields/gsadapt_nov25/nl_fix.gms | 11 - .../14_yields/gsadapt_nov25/nl_release.gms | 11 - modules/14_yields/gsadapt_nov25/postsolve.gms | 24 -- modules/14_yields/gsadapt_nov25/preloop.gms | 248 ------------------ modules/14_yields/gsadapt_nov25/presolve.gms | 114 -------- .../14_yields/gsadapt_nov25/realization.gms | 38 --- modules/14_yields/gsadapt_nov25/sets.gms | 43 --- modules/14_yields/module.gms | 8 +- 30 files changed, 31 insertions(+), 1220 deletions(-) delete mode 100644 modules/13_tc/endo_jan22/declarations.gms delete mode 100644 modules/13_tc/endo_jan22/equations.gms delete mode 100644 modules/13_tc/endo_jan22/input.gms delete mode 100644 modules/13_tc/endo_jan22/nl_fix.gms delete mode 100644 modules/13_tc/endo_jan22/nl_relax.gms delete mode 100644 modules/13_tc/endo_jan22/nl_release.gms delete mode 100644 modules/13_tc/endo_jan22/not_used.txt delete mode 100644 modules/13_tc/endo_jan22/postsolve.gms delete mode 100644 modules/13_tc/endo_jan22/preloop.gms delete mode 100644 modules/13_tc/endo_jan22/presolve.gms delete mode 100644 modules/13_tc/endo_jan22/realization.gms delete mode 100644 modules/13_tc/endo_jan22/scaling.gms delete mode 100644 modules/13_tc/endo_jan22/sets.gms delete mode 100644 modules/13_tc/endo_jan22/tau_regional.png delete mode 100644 modules/13_tc/endo_jan22/tc_schematic.png delete mode 100644 modules/13_tc/endo_jan22/tcc_regression.png delete mode 100644 modules/14_yields/gsadapt_nov25/declarations.gms delete mode 100644 modules/14_yields/gsadapt_nov25/equations.gms delete mode 100644 modules/14_yields/gsadapt_nov25/input.gms delete mode 100644 modules/14_yields/gsadapt_nov25/input/files delete mode 100644 modules/14_yields/gsadapt_nov25/nl_fix.gms delete mode 100644 modules/14_yields/gsadapt_nov25/nl_release.gms delete mode 100644 modules/14_yields/gsadapt_nov25/postsolve.gms delete mode 100644 modules/14_yields/gsadapt_nov25/preloop.gms delete mode 100644 modules/14_yields/gsadapt_nov25/presolve.gms delete mode 100644 modules/14_yields/gsadapt_nov25/realization.gms delete mode 100644 modules/14_yields/gsadapt_nov25/sets.gms diff --git a/config/default.cfg b/config/default.cfg index 73d521d71e..e3b3591f51 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -285,8 +285,6 @@ 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 # * (endo_nov25): endogenous technological change with full cost accounting and # * stepwise updated crop and managed pastures area information # * including account of growing period adaptation in yields and tau @@ -351,12 +349,12 @@ cfg$gms$s13_croparea_consv_target <- 2030 # def = 2030 # ***--------------------- 14_yield -------------------------------------- -# * (gsadapt_nov25): yields (optionally with future growing period adaptation) based on LPJmL simulations -# * inform MAgPIE yield patterns. LPJmL yield levels are calibrated to FAO regional levels, -# * pasture yields increase based on exogenous demand-side proxy for growth rate of cattle stocks -# * (gsadapt_dynPastrTau_jul26): as gsadapt_nov25, but the pasture yield spillover from crop-sector TC -# * is controlled by s14_past_spillover_mode switch -# * (0=static scalar s14_yld_past_switch, 1=regional dynamic f14_yld_past_switch) +# * (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 diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms deleted file mode 100644 index 66467de7f7..0000000000 --- a/modules/13_tc/endo_jan22/declarations.gms +++ /dev/null @@ -1,56 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -positive variable - 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) - vm_tau(j,tautype) Overall agricultural land use intensity tau at cluster level (1) - v13_tau_consv(h,tautype) Tau for cropland within conservation priority areas (1) -; - -equations - q13_tech_cost(i, tautype) Total annuitized costs for TC (mio. USD17MER) - q13_cost_tc(i, tautype) Costs for TC (mio. USD17MER per yr) - 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) -; - -parameters - pc13_land(i, tautype) Crop and grass land area per region (mio ha) - pcm_tau(j, tautype) Tau factor of the previous time step (1) - pc13_tau(h, tautype) Tau for conventional cropland of the previous time step (1) - pc13_tau_consv(h, tautype) Tau for cropland within conservation priority areas of the previous time step (1) - pc13_tcguess(h, tautype) Guess for annual tc rates in the next time step (1) - i13_tc_factor(t) Regression factor (USD17MER per ha) - i13_tc_exponent(t) Regression exponent (1) - p13_cropland_consv_shr(t,j) Share of cropland within conservation priority areas(1) - p13_croparea_consv_tau_factor(h) Regional tau factor for crop area conservation (1) - i13_croparea_consv_fader(t_all) Crop area conservation fader (1) - i13_tau_croparea_consv_fader(t_all) Fader for tau factor for crop area conservation (1) - p13_country_weight(i) Policy country weight per region (1) - p13_country_switch(iso) Switch indicating whether country is affected by selected cropland policy (1) - p13_country_wght_supreg(h) Policy country weight per super region (1) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov13_tau_core(t,h,tautype,type) Agricultural land use intensity tau for conventional cropland (1) - ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17MER per yr) - ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17MER) - ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) - ov_tau(t,j,tautype,type) Overall agricultural land use intensity tau at cluster level (1) - ov13_tau_consv(t,h,tautype,type) Tau for cropland within conservation priority areas (1) - oq13_tech_cost(t,i,tautype,type) Total annuitized costs for TC (mio. USD17MER) - oq13_cost_tc(t,i,tautype,type) Costs for TC (mio. USD17MER per yr) - 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) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/13_tc/endo_jan22/equations.gms b/modules/13_tc/endo_jan22/equations.gms deleted file mode 100644 index 7b0bdc570b..0000000000 --- a/modules/13_tc/endo_jan22/equations.gms +++ /dev/null @@ -1,60 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @equations - -*' ![Investment-yield ratio in relation to $\tau$-factor -*' [@dietrich_forecasting_2014]](tcc_regression.png){ width=60% } -*' -*' Relative technological change costs `v13_cost_tc` are calculated as a -*' heuristically derived power function of the land use intensity `v13_tau_core` for -*' the investment-yield-ratio (see figure above) multiplied by the current -*' regional crop areas `pc13_land` (taken from previous time step) and shifted -*' 15 years into the future using the region specific interest -*' rate `pm_interest`: - -q13_cost_tc(i2, tautype) .. - v13_cost_tc(i2, tautype) =e= sum(ct, pc13_land(i2, tautype) * - i13_tc_factor(ct) * sum(supreg(h2,i2),v13_tau_core(h2,tautype))** - i13_tc_exponent(ct) * (1+pm_interest(ct,i2))**15); - - -*' The shifting is performed because investments into technological change -*' require on average 15 years of research before a yield increase is achieved, -*' but the model has to see costs and benefits concurrently in order to take the -*' right investment decisions (see also @dietrich_forecasting_2014). Investment -*' costs are scaled in relation to crop area, since a wider areal coverage means -*' typically also higher variety in biophysical conditions, which would require -*' more research for the same overall intensity boost. -*' -*' In order to get the full investments required for the desired intensification -*' the relative technological change costs are multiplied with the given -*' intensification rate. These full costs are then distributed over an infinite -*' time horizon by multiplication with the interest rate `pm_interest(i)` -*' (annuity with infinite time horizon): - -q13_tech_cost(i2, tautype) .. - v13_tech_cost(i2, tautype) =e= sum(supreg(h2,i2), v13_tau_core(h2,tautype)/pc13_tau(h2,tautype)-1) * v13_cost_tc(i2,tautype) - * sum(ct,pm_interest(ct,i2)/(1+pm_interest(ct,i2))); - -q13_tech_cost_sum(i2) .. - vm_tech_cost(i2) =e= sum(tautype, v13_tech_cost(i2, tautype)); - - -*' 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` -*' for cropland in conservation priority areas. - -q13_tau(j2,tautype).. - vm_tau(j2,tautype) =e= sum((ct, cell(i2,j2), supreg(h2,i2)), (1-p13_cropland_consv_shr(ct,j2)) * v13_tau_core(h2,tautype) + p13_cropland_consv_shr(ct,j2) * v13_tau_consv(h2,tautype)); - -*' `v13_tau_consv` for cropland in conservation priority areas is linked to `v13_tau_core` -*' through a multiplication factor that can lower land use intensity in -*' conservation priority areas. - -q13_tau_consv(h2,tautype)$(c13_croparea_consv_tau_increase = 1 OR sum(ct, m_year(ct)) < s13_croparea_consv_start).. - v13_tau_consv(h2,tautype) =e= p13_croparea_consv_tau_factor(h2) * v13_tau_core(h2,tautype); diff --git a/modules/13_tc/endo_jan22/input.gms b/modules/13_tc/endo_jan22/input.gms deleted file mode 100644 index ccff226873..0000000000 --- a/modules/13_tc/endo_jan22/input.gms +++ /dev/null @@ -1,89 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - - -scalars - s13_ignore_tau_historical ignore historical tau (1) or use it as lower bound (0) (binary) / 1 / - s13_max_gdp_shr Maximum tech cost as share of regional GDP / Inf / - c13_croparea_consv Switch for crop area conservation either in conservation priority areas or in a given share of the total croparea (0=no 1=yes) / 0 / - c13_croparea_consv_tau_increase Switch for tau increase on crop area conservation (0=no 1=yes) / 1 / - s13_croparea_consv_tau_factor Tau factor for crop area conservation / 0.8 / - s13_croparea_consv_tau_factor_noselect Tau factor for crop area conservation in unselected countries / 0.8 / - s13_croparea_consv_shr Share of crop area in which no endogeneous yield changes are allowed due to conservation (1) / 0 / - s13_croparea_consv_shr_noselect Share of crop area in which no endogeneous yield changes are allowed due to conservation (1) / 0 / - s13_croparea_consv_start Croparea conservation start year / 2025 / - s13_croparea_consv_target Croparea conservation target year / 2030 / -; - -sets - croparea_consv_countries13(iso) countries to be affected by croparea conservation policy - / ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, - ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, - BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, - BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, - CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL, - COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU, - DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP, - EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR, - GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC, - GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV, - HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL, - ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM, - KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE, - LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA, - MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG, - MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM, - NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU, - NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL, - PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS, - RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE, - SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN, - SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK, - TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, - UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, - VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / -; - -parameter fm_tau1995(h) Agricultural land use intensity tau in 1995 (1) -/ -$ondelim -$include "./modules/13_tc/input/fm_tau1995.cs4" -$offdelim -/; - -parameter f13_tcguess(h) Guess for initial annual TC rates (1) -/ -$ondelim -$include "./modules/13_tc/input/f13_tcguess.cs4" -$offdelim -/; - -$setglobal c13_tccost medium - -table f13_tc_factor(t_all,scen13) Regression factor (USD17MER per ha) -$ondelim -$include "./modules/13_tc/input/f13_tc_factor.cs3" -$offdelim -; - -table f13_tc_exponent(t_all,scen13) Regression exponent (1) -$ondelim -$include "./modules/13_tc/input/f13_tc_exponent.cs3" -$offdelim -; - -table f13_tau_historical(t_all,h) historical tau scenario (1) -$ondelim -$include "./modules/13_tc/input/f13_tau_historical.csv" -$offdelim -; - -table f13_pastr_tau_hist(t_all,h) Historical managed pasture tau (1) -$ondelim -$include "./modules/13_tc/input/f13_pastr_tau_hist.csv" -$offdelim -; diff --git a/modules/13_tc/endo_jan22/nl_fix.gms b/modules/13_tc/endo_jan22/nl_fix.gms deleted file mode 100644 index 559acb6fcd..0000000000 --- a/modules/13_tc/endo_jan22/nl_fix.gms +++ /dev/null @@ -1,10 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_fix ### - -v13_tau_core.fx(h,tautype) = max(v13_tau_core.lo(h,tautype), min(v13_tau_core.up(h,tautype), v13_tau_core.l(h,tautype))); diff --git a/modules/13_tc/endo_jan22/nl_relax.gms b/modules/13_tc/endo_jan22/nl_relax.gms deleted file mode 100644 index 26c1be6133..0000000000 --- a/modules/13_tc/endo_jan22/nl_relax.gms +++ /dev/null @@ -1,10 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_relax ### - -v13_tau_core.l(h,tautype) = v13_tau_core.l(h,tautype) + 0.1; diff --git a/modules/13_tc/endo_jan22/nl_release.gms b/modules/13_tc/endo_jan22/nl_release.gms deleted file mode 100644 index c7b6c2d9e0..0000000000 --- a/modules/13_tc/endo_jan22/nl_release.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_release ### - -v13_tau_core.lo(h,tautype) = pc13_tau(h,tautype); -v13_tau_core.up(h,tautype) = 2*pc13_tau(h,tautype); diff --git a/modules/13_tc/endo_jan22/not_used.txt b/modules/13_tc/endo_jan22/not_used.txt deleted file mode 100644 index f09dd19cf3..0000000000 --- a/modules/13_tc/endo_jan22/not_used.txt +++ /dev/null @@ -1,2 +0,0 @@ -name,type,reason -pm_yields_gsadapt_ratio_increment, interface, not needed diff --git a/modules/13_tc/endo_jan22/postsolve.gms b/modules/13_tc/endo_jan22/postsolve.gms deleted file mode 100644 index da0d81a720..0000000000 --- a/modules/13_tc/endo_jan22/postsolve.gms +++ /dev/null @@ -1,64 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* Overall TC cost for the current timestep - -if((ord(t)>1), - pc13_tcguess(h,tautype) = (v13_tau_core.l(h,tautype)/pc13_tau(h, tautype))**(1/m_yeardiff(t)) - 1; -); - -pc13_tau(h, tautype) = v13_tau_core.l(h, tautype); -pc13_tau_consv(h, tautype) = v13_tau_consv.l(h, tautype); -pcm_tau(j, tautype) = vm_tau.l(j, tautype); - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov13_tau_core(t,h,tautype,"marginal") = v13_tau_core.m(h,tautype); - ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); - ov13_cost_tc(t,i,tautype,"marginal") = v13_cost_tc.m(i,tautype); - ov13_tech_cost(t,i,tautype,"marginal") = v13_tech_cost.m(i,tautype); - ov_tau(t,j,tautype,"marginal") = vm_tau.m(j,tautype); - ov13_tau_consv(t,h,tautype,"marginal") = v13_tau_consv.m(h,tautype); - oq13_tech_cost(t,i,tautype,"marginal") = q13_tech_cost.m(i,tautype); - oq13_cost_tc(t,i,tautype,"marginal") = q13_cost_tc.m(i,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); - 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); - ov13_tech_cost(t,i,tautype,"level") = v13_tech_cost.l(i,tautype); - ov_tau(t,j,tautype,"level") = vm_tau.l(j,tautype); - ov13_tau_consv(t,h,tautype,"level") = v13_tau_consv.l(h,tautype); - oq13_tech_cost(t,i,tautype,"level") = q13_tech_cost.l(i,tautype); - oq13_cost_tc(t,i,tautype,"level") = q13_cost_tc.l(i,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); - 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); - ov13_tech_cost(t,i,tautype,"upper") = v13_tech_cost.up(i,tautype); - ov_tau(t,j,tautype,"upper") = vm_tau.up(j,tautype); - ov13_tau_consv(t,h,tautype,"upper") = v13_tau_consv.up(h,tautype); - oq13_tech_cost(t,i,tautype,"upper") = q13_tech_cost.up(i,tautype); - oq13_cost_tc(t,i,tautype,"upper") = q13_cost_tc.up(i,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); - 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); - ov13_tech_cost(t,i,tautype,"lower") = v13_tech_cost.lo(i,tautype); - ov_tau(t,j,tautype,"lower") = vm_tau.lo(j,tautype); - ov13_tau_consv(t,h,tautype,"lower") = v13_tau_consv.lo(h,tautype); - oq13_tech_cost(t,i,tautype,"lower") = q13_tech_cost.lo(i,tautype); - oq13_cost_tc(t,i,tautype,"lower") = q13_cost_tc.lo(i,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); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/13_tc/endo_jan22/preloop.gms b/modules/13_tc/endo_jan22/preloop.gms deleted file mode 100644 index b0f0079536..0000000000 --- a/modules/13_tc/endo_jan22/preloop.gms +++ /dev/null @@ -1,33 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -loop(t, - if(m_year(t) <= sm_fix_SSP2, - i13_tc_factor(t) = f13_tc_factor(t,"medium"); - i13_tc_exponent(t) = f13_tc_exponent(t,"medium"); - else - i13_tc_factor(t) = f13_tc_factor(t,"%c13_tccost%"); - i13_tc_exponent(t) = f13_tc_exponent(t,"%c13_tccost%"); - ); -); - -pc13_tau(h,"crop") = fm_tau1995(h); -pc13_tau(h,"pastr") = f13_pastr_tau_hist("y1995",h); -pc13_tcguess(h,tautype) = f13_tcguess(h); - - -* Country switch to determine countries for which certain policies shall be applied. -* In the default case, the policy affects all countries when activated. -p13_country_switch(iso) = 0; -p13_country_switch(croparea_consv_countries13) = 1; - -** Trajectory for implementation of croparea conservation -* sigmoidal interpolation between 2020 and target year -m_sigmoid_time_interpol(i13_croparea_consv_fader,s13_croparea_consv_start,s13_croparea_consv_target,0,1); - -m_sigmoid_time_interpol(i13_tau_croparea_consv_fader,s13_croparea_consv_start,s13_croparea_consv_target,1,s13_croparea_consv_tau_factor); - diff --git a/modules/13_tc/endo_jan22/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms deleted file mode 100644 index 99b1a42df8..0000000000 --- a/modules/13_tc/endo_jan22/presolve.gms +++ /dev/null @@ -1,81 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | 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")); - -if (sum(sameas(t_past,t),1) = 1 AND s13_ignore_tau_historical = 0, - v13_tau_core.lo(h,"pastr") = f13_pastr_tau_hist(t,h); - v13_tau_core.lo(h,"crop") = f13_tau_historical(t,h); -else - v13_tau_core.lo(h, tautype) = pc13_tau(h, tautype); -); - - v13_tau_core.up(h,tautype) = 2 * pc13_tau(h,tautype); - -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 - 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; - -* We set the initial solving basis for the tech cost to its upper bound to support the solver in finding -* a proper solution. Without such initial values, the model leave tech cost at 0 and as such ignore tau -* as an efficient part of the optimal solution. - vm_tech_cost.l(i) = vm_tech_cost.up(i); - -); - -*** Share of cropland within conservation priority area -p13_cropland_consv_shr(t,j) = 0; - -if(c13_croparea_consv = 1, -* the cropland area within conservation priority areas is provided by the interface `pm_land_conservation` - p13_cropland_consv_shr(t,j)$(pcm_land(j,"crop") > 0) = sum(consv_type, pm_land_conservation(t,j,"crop",consv_type))/pcm_land(j,"crop"); - p13_cropland_consv_shr(t,j)$(p13_cropland_consv_shr(t,j) > 1) = 1; - -* The following lines allow to freely chose a given share of the total cropland -* area that should be subject to conservation management with a lower land use intensity. - if(s13_croparea_consv_shr > 0 AND m_year(t) >= s13_croparea_consv_start, -* Because MAgPIE is not run at country-level, but at region level, a region -* share is calculated that translates the countries' influence to regional level. -* Countries are weighted by available cropland area. - p13_country_weight(i) = sum(i_to_iso(i,iso), p13_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum(i_to_iso(i,iso), pm_avl_cropland_iso(iso)); - p13_cropland_consv_shr(t,j) = i13_croparea_consv_fader(t) * - (s13_croparea_consv_shr * sum(cell(i,j), p13_country_weight(i)) - + s13_croparea_consv_shr_noselect * sum(cell(i,j), 1-p13_country_weight(i))); - - ); - -); - -* ISO country weights are calculated based on the available cropland area in each country -p13_country_wght_supreg(h) = sum((i_to_iso(i,iso), supreg(h,i)), p13_country_switch(iso) * pm_avl_cropland_iso(iso)) / sum((i_to_iso(i,iso), supreg(h,i)), pm_avl_cropland_iso(iso)); - -* Country-weighted tau reduction factor for conservation land -p13_croparea_consv_tau_factor(h) = (s13_croparea_consv_tau_factor * p13_country_wght_supreg(h) - + s13_croparea_consv_tau_factor_noselect * (1-p13_country_wght_supreg(h))); - -if (ord(t) = 1, - pc13_tau_consv(h,tautype) = p13_croparea_consv_tau_factor(h) * pc13_tau(h,"crop"); -elseif c13_croparea_consv_tau_increase = 0 AND m_year(t) >= s13_croparea_consv_start, - v13_tau_consv.fx(h,tautype) = pc13_tau_consv(h,tautype); -); - - -* educated guess for tau levels: -if(ord(t) = 1, - v13_tau_core.l(h,tautype) = pc13_tau(h,tautype); - v13_tau_consv.l(h,tautype) = pc13_tau_consv(h,tautype); - vm_tau.l(j,tautype) = sum((cell(i,j), supreg(h,i)),(1-p13_cropland_consv_shr(t,j)) * v13_tau_core.l(h,tautype) + p13_cropland_consv_shr(t,j) * v13_tau_consv.l(h,tautype)); - pcm_tau(j,tautype) = vm_tau.l(j,tautype); -else - v13_tau_core.l(h,tautype) = pc13_tau(h,tautype)*(1+pc13_tcguess(h,tautype))**m_yeardiff(t); - v13_tau_consv.l(h,tautype) = p13_croparea_consv_tau_factor(h) * v13_tau_core.l(h,tautype); -); diff --git a/modules/13_tc/endo_jan22/realization.gms b/modules/13_tc/endo_jan22/realization.gms deleted file mode 100644 index 5043498cd8..0000000000 --- a/modules/13_tc/endo_jan22/realization.gms +++ /dev/null @@ -1,55 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @description The endo 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 -*' below). This module realization contains the implementation as described -*' in @dietrich_forecasting_2014 with two minor modifications: -*' -*' * rates of previous investment decisions which still have to be paid are -*' added to the technological change costs -*' * the planning horizon for investments is unified over all investments in -*' the model. -*' -*' ![Implementation of technological change in MAgPIE -*' [@dietrich_forecasting_2014]](tc_schematic.png){ width=60% } -*' -*' Initial land use intensity $\tau$ values for the year 2000 come from -*' @dietrich_measuring_2012 and are shown below. -*' -*' ![$\tau$-factors in world regions & global (GLO) for the year 2000. -*' [@dietrich_measuring_2012]](tau_regional.png){ width=60% } -*' -*' Investments into technological change (TC) trigger land use intensification -*' ($\tau$) which triggers in turn yields increases. How much intensification -*' can be triggered by an investment, depends on the investment-yield ratio, -*' which in turn depends on the current agricultural land use intensity. The -*' higher the current intensity level, the more expensive the additional -*' intensification will become. The interaction between land use intensity and -*' production costs per area as shown in the schematic is not covered by this -*' module and can be found instead in [38_factor_costs]. - -*' @limitations This module significantly reduces the overall computational -*' performance of the model since these endogenous calculations are highly -*' computational intensive. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_jan22/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_jan22/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_jan22/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_jan22/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_jan22/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_jan22/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_jan22/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_jan22/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_jan22/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_jan22/nl_release.gms" -$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_jan22/nl_relax.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/13_tc/endo_jan22/scaling.gms b/modules/13_tc/endo_jan22/scaling.gms deleted file mode 100644 index 3d58af4c5a..0000000000 --- a/modules/13_tc/endo_jan22/scaling.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | 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; diff --git a/modules/13_tc/endo_jan22/sets.gms b/modules/13_tc/endo_jan22/sets.gms deleted file mode 100644 index 97ee7b8043..0000000000 --- a/modules/13_tc/endo_jan22/sets.gms +++ /dev/null @@ -1,18 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -sets - - scen13 tc cost scenario - /low, medium, high/ - - tautype tc type - / pastr, crop / - -; - -*** EOF sets.gms *** diff --git a/modules/13_tc/endo_jan22/tau_regional.png b/modules/13_tc/endo_jan22/tau_regional.png deleted file mode 100644 index 3d2a1a1db8338d2d342e8e2c58ff1d52489859a7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12653 zcmd^mc|4T;-*5NbUELAVLbjB$FH?lF-h~P=cE&bELt*So_WMq@Y-Qht5Hmx@ZZH+X z2o+;rvNae(ma)!^a}8Ra=k+_!InVRYdCoarm+R`)^}Rmd&+`5(-_Q3eTu1vB69Xs1 zfddDa)NiZm9XRm2*MS4SrTqCj@IUvN|2734hpjYksRB>nXHx|e2t1BD--fsyIKbRQ z|NSjNl$q^Z&zcd4<8(t3{_zgxNLm>YN=NB39DmIa<3k@wsvrM zbN5oi>(Vzj8>Xyj7upK0oQ>k|XiaPwlU+Qd+5159LPtv~N5`MxVPRpb>Ki`415b)f zJU<`bXVL%K-8uo)*}rDvUexxHaFLI1+3>xHnTtc>nGBP=Gj1nXSvN)M<2!~*N$;R58bGPu@G{SXrOTE{CHJh36)8X_R`mC#uH@Rx$0Y zlAOS_?kvAc{{U1*TLp26g5YlVg@PSL_Zi9|#$(Cn`1tq~=RR%2bQ8nEd_06S>686> z_YqFxRsOspI+iWQ%1WMF)vK(WF{ixK8TVVlteHbMnPK5!uZ#jqteql3PS_3H_tXSeRnL@064XrFFnlKQ~@47*I*qtVd7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@hw)8vIfYysADIeO)uQQ$E41 zr8eloPNPn65chl_%CY*(Xz5mQ%Pe3w?B8TPBfGkUOPw+-x9$Xbbu|QSPg=7_mXfM` zC%bz)9LY69H{jUI7X)Z;-oDIOtW)Z*9r671kOd2!f67#`dCf~b8D4axzVgvZF^gx* z&FCuLA*r<>Vy0izEmy#bAQ)3wPliH@1(CVg*FV<5`Yd-%*ErQ`=g*!M&4uUxhIgmICd>}_Cm z*j_@(ysx#yjY479ghk~OFp5nwYT~#p2i;oJe>C@vT#VKmcrMJ7SlImutf7_IC)#n% z<@(d1fO%-C=V)dAdGSei&4D9FqfEE;YDm&HOkAxcF~mJx?VzQvYz4AAYaZXn z0^-5@xGF8pgjG$HE!JS~)$@DEn0Iu6o_1G(XPx_zXXN00YK!TAfMFpI{H7ly=Z$oh z4Ul08Rf2^PZcpL3*4|}$I`FI#(7!pq@f)f8%2Wr7Yf&od)(sCmqk9u(%BN(EX2^4P z$m-V~Ryx~ZL4=DI#7l@;Q=AVHeJVcTWvyl!O5PHVvokB0MGN7Lzo2SNLEbJ=oI1d1 mR#py9`hE8FfAWssIr7mFGIQ2C$e#XJ6Y6T(s>L_%KK>ua*#=nv diff --git a/modules/13_tc/endo_jan22/tc_schematic.png b/modules/13_tc/endo_jan22/tc_schematic.png deleted file mode 100644 index 2252895c029f5495248545c2a6ba6323cde97ed3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21370 zcmbrm1yq!6_dW`OfXEOcNJvX4Au)8PARP+QNDd+0-3=l=w7^gb2!en#(#;SO(j9_y zb8g<(@B9DGIqR%btmPW#nP;B6_rCVEuRY-^N-rSTWY{PuC=fYWDK!+7J9H>0s0vtj zz?Gys%!l9wBps_$>g^i zq(2T*M?m~`Cj=RHum3ZpxJB~zEoZL1T-!K!{q1!J8;DxA&yVltdCT|M&O*eJnPCu^Gkq=xFs<`#4Vq>-+z<5pDOy8ODe2 z%?xY{t$$NM0yx+?Avn9l!(W=LB3<^%!vhOute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leted file mode 100644 index 67a1c0abcfaede215e949b2d0fd4d660a4a20c64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 27968 zcmce;bx>SE^ESGK1d?DO1PdAn5ZqY^79e==0Kp-+yJgX!!JXg)cXto&u8RfNWs$(* zd}s6i-uvCUU)BBV*4?VD-8wsGPESuy&(lx$><>kGNv!9upMyXkENQ8a${^4q;EmGy z^bv4HNfPG>_(1zAEBO)l1YTES&ECMrGdn2_M-T|R8~H|wXT&A}fha-JA4NX9r5>g| z^Y}co@K8?4pgCP6r^g6QhPL3}OtyVtuzoH6%KeHuPwH1chWM{cbL8Dq9qP zkjSG)z7@}+iC&6INm0IyiVF9C8x?RED;R6U;dt+OlqPLrb5w#DT}m2&-y}skBsMz6 z3@^b`9n*LCFi`-Jny|u_u#h6AqSv5cFyQj8#0LoSN8E985Xi^o@qd1rD6Mr} z>kP04ei4YEmW=q>bmnRaJKvo!Txzg?cnkvl(O|<=(bQyc+kwwQ&rVMnSXmRB@qy-V zw}tOFgpXF+S>2vO{VqVDjwzoDe_!MmYTy5lzU<9HEzQjfIev4F37`Ul@Yw<61v~Fg z=YQ&88&2bQ-L# zXm*Wom_JhCf1-n@b$iKgO8b~XO5-nrqFceB?#-$@z9Wi4!M>d-3+8DGIESoyL@w_@?-c*ORW2R+Ceh8s6EHE{`?{ zg3AmCG=?6X+W7%O?$6-NPZlRN_mrY6EOm%YmSrwJPz(ZcLQO4f!B%AF>3elecj zmpQz||J@+af3pUIY$h(ydyuWzOp(0?{X_kSuQ2Y_@FfBF%)LKy^^JueAn771+bir) z#Bz`U;;|v$OaL7nyY4~5nt~aQkBx5*w77|F&SS8%BZ{;V%jM;Gx;vNVri~vBbSRqu zYrO4%HfX#4c}A40QB7Swq1H^l1D(~&F01yH`T3VN&;# zSI7Ruk;lk;EB>2geF+VtTaI0O!O7@?G4=Is`_|>?ig)ejg4TU#*!UB%zxh{TI-V@$ zvfq5UcYcZ_LF~R?xcepasUqm`tckZuS_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 z>Ou@Wyy1i(B!SK z7h9Hu4K^<}H!H+eEWod9AK*er0ir9*z*1noE$UZz%4Ie~v8B&QH>^wRvbVbrda`Bxg|5P^G6$(0tTmxs;fnOj-JEn*?#&rZmKM zm()kBmO)DGLR#$kcVX~S)qN@bcW*M|m%T~7;Vg2jovGV9P zb>?s%NNvupHj;0N>OC3~G>MpVE2rbh#B=(usr3K+Dn66mXJnNksWA5eQg19}1r7N! IS@VGZ29}hrr~m)} diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms index a184bf629b..9090ed76dc 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms @@ -5,36 +5,37 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' ### TODO: Fix module and realization text before production use +*' @description The gsadapt_dynRegPastrTau realization reads in the LPJmL data +*' accounts for growing period adaption to climate change and also performs a number +*' of calibrations. (1) Crop yields are calibrated to FAO [@FAOSTAT] regional yield +*' levels of the initial time step. (2) Bioenergy yields are corrected using the +*' $\tau$ factor representing agricultural land-use intensity. (3) Pasture yields are +*' calculated based on pasture demand to account for intensification and extensification +*' of managed grasslands. Optionally, irrigated yields are scaled to meet the irrigated- +*' to-rainfed yield ratio as provided by AQUASTAT [@fao_aquastat_2016]. +*' +*' In addition, technological change in the crop sector can spill over to pasture yields, +*' with the magnitude of the spillover determined by the regional, time-varying input +*' parameter f14_yld_past_switch (t_all,i). A value of 0 implies no spillover, while a +*' value of 1 implies full spillover equal to the crop-sector intensification rate. +*' Technological spillover from the crop sector to pasture yields is controlled by +*' s14_past_spillover_mode. +*' * Mode 0 uses the static scalar s14_yld_past_switch +*' * Mode 1 can use regional, time-varying parameter provided by +*' f14_yld_past_switch(t_all,i) (default input is static though) +*' In both modes, 0 disables spillover and 1 applies the full crop-sector intensification rate. *' -*' @description The gsadapt_dynPastrTau_jul26 realization reads in the LPJmL data -*' and accounts for growing period adaption to climate change. It also -*' performs a number of calibrations. -*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step. -*' Bioenergy yields are corrected using the $\tau$ factor -*' representing agricultural land-use intensity. -*' Pasture yields are calculated based on pasture demand to account for -*' intensification and extensification of managed grasslands. -*' Optionally, irrigated yields are scaled to meet the irrigated-to-rainfed yield -*' ratio as provided by AQUASTAT [@fao_aquastat_2016]. *' This realization also calculates harvestable growing stock (`im_growing_stock`) as *' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion *' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. *' -*' The realization supports two pasture spillover modes controlled by s14_past_spillover_mode: -*' * Mode 0 (static scalar): Uses s14_yld_past_switch for all regions and timesteps -*' * Mode 1 (regional dynamic): Uses f14_yld_past_switch(t_all,i) per region and timestep -*' Both modes integrate growing period adaptation support (gsadapt/constgsadapt) via s14_use_gsadapt. - *' @limitations The exogenous implementation of pasture intensification cannot *' capture feedbacks between land scarcity and efforts to improve pasture *' management. Moreover, the magnitude of spillover effects from technological change *' in the crop sector towards improvements in pasture management is very uncertain -*' and varies across regions and time periods. - +*' and may vary across regions and time periods. *####################### R SECTION START (PHASES) ############################## -*### TODO: Fix module and realization text before production use $Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms" $Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms" diff --git a/modules/14_yields/gsadapt_nov25/declarations.gms b/modules/14_yields/gsadapt_nov25/declarations.gms deleted file mode 100644 index 22bf7e93c4..0000000000 --- a/modules/14_yields/gsadapt_nov25/declarations.gms +++ /dev/null @@ -1,47 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -parameters - i14_yields_calib(t,j,kve,w) Calibrated biophysical input yields without growing period adaptation excluding technological change (tDM per ha per yr) - i14_yields_combined(t_all,j,yldtype,kcr,w) Combined biophysical yields for gsadapt and constgsadapt before calibration (tDM per ha per yr) - i14_yields_calib_combined(t,j,yldtype,kcr,w) Combined parameter with gsadapt and constgsadapt yields (tDM per ha per yr) - p14_yields_gsadapt_ratio(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields (1) - p14_yields_gsadapt_ratio_previous(t,i) Ratio between regional aggregated gsadapt and constgsadapt yields for the previous time-step (1) - pm_yields_gsadapt_ratio_increment(t,i) Incremental change of growing period adaption from this time step (1) - p14_yields_gsadapt_ratio_cumulative(t,i) Cumulative effect of growing period adaption from the first to the current timestep (1) - p14_pyield_LPJ_reg(t_all,i) Regional average input yields aggregated from clusters with initial pasture area as weights (tDM per ha per yr) - p14_pyield_corr(t,i) Regional pasture management correction for historical time steps (1) - i14_croparea_total(t_all,w,j) Cellular croparea (mio. ha) - i14_modeled_yields_hist(t_all,i,yldtype,kcr) Biophysical input yields average over region and water supply type at the historical reference year (tDM per ha per yr) - i14_calib_target_yields_hist(t,i,kcr) Calibration target yields per region at the historical reference year (tDM per ha per yr) - i14_lambda_yields(t,i,yldtype,kcr) Scaling factor for non-linear management calibration (1) - i14_managementcalib(t,j,yldtype,kcr,w) Regional management calibration factor accounting for FAO yield levels (1) -im_growing_stock(t,j,ac,land_timber) Harvestable stem biomass per ha by age class (tDM per ha) - im_growing_stock_ysf(t,j,ac) Harvestable stem biomass per ha by age class for young secondary forest on other land (tDM per ha) - pm_yields_semi_calib(j,kve,w) Potential yields calibrated to FAO regional levels (tDM per ha per yr) - i14_calib_yields_hist(i,yldtype,w) Calibrated yields average over region and crop type at the historical reference year (tDM per ha per yr) - i14_calib_yields_ratio(i,yldtype) Irrigated to rainfed yield ratio for calibrated yields (1) - i14_target_ratio(i,yldtype) Target irrigated to rainfed ratio as upper bound (1) - i14_modeled_yields_hist2(i,yldtype,knbe14) Calibrated yields average over region and water supply type at the historical reference year (tDM per ha per yr) - ; - -positive variables - vm_yld(j,kve,w) Yields declared as variable because of technological change (tDM per ha per yr) -; - -equations - q14_yield_crop(j,kcr,w) Crop yields (tDM per ha per yr) - q14_yield_past(j,w) Pasture yields (tDM per ha per yr) -; - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) - oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) - oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/14_yields/gsadapt_nov25/equations.gms b/modules/14_yields/gsadapt_nov25/equations.gms deleted file mode 100644 index aebb75cd3b..0000000000 --- a/modules/14_yields/gsadapt_nov25/equations.gms +++ /dev/null @@ -1,38 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @equations - -***CROP YIELD CALCULATIONS********************************************** - -*' Technological change can increase the initial calibrated yields: -q14_yield_crop(j2,kcr,w) .. - vm_yld(j2,kcr,w) =e= sum(ct, i14_yields_calib(ct,j2,kcr,w) / sum(cell(i2,j2), p14_yields_gsadapt_ratio_cumulative(ct,i2))) * - vm_tau(j2,"crop") / sum((cell(i2,j2), supreg(h2,i2)), fm_tau1995(h2)); - -*' For the current time step of the optimization, cellular yields of irrigated -*' and rainfed crops are calculated by multiplying calibrated input yields from -*' LPJmL with the intensification rate relative to the initial time step 1995. - -***PASTURE YIELD CALCULATIONS******************************************* - -*' In the case of pasture yields, technological change cannot be fully -*' translated into yield increases, to address that, an exogenous pasture management -*' factor `pm_past_mngmnt_factor` is used to scale pasture yields based on the -*' number of cattle reared to fulfill the domestic demand for ruminant livestock -*' products in module 70. -*' -*' Additionally, the parameter `s14_yld_past_switch` can be used to capture a -*' certain magnitude of spillovers of the yield increase due to technological -*' change from the time step before. It can range from 0 (no spillover) to 1 -*' (full spillover). - -q14_yield_past(j2,w) .. - vm_yld(j2,"pasture",w) =e= - sum(ct,(i14_yields_calib(ct,j2,"pasture",w)) - * sum(cell(i2,j2),pm_past_mngmnt_factor(ct,i2))) - * (1 + s14_yld_past_switch*(sum((cell(i2,j2), supreg(h2,i2)), pcm_tau(j2, "crop")/fm_tau1995(h2)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/input.gms b/modules/14_yields/gsadapt_nov25/input.gms deleted file mode 100644 index a6fef2c1c8..0000000000 --- a/modules/14_yields/gsadapt_nov25/input.gms +++ /dev/null @@ -1,113 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -$setglobal c14_yields_scenario cc -* options: cc (climate change) -* nocc (no climate change) -* nocc_hist (no climate change after year defined by sm_fix_cc) - -scalars - s14_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 / - s14_calib_ir2rf Switch to calibrate rainfed to irrigated yield ratios (1=calib 0=not calib) / 1 / - s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / - s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / - s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / - s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases (1) / 0.25 / - s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / - sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / - s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / - s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / -; - - -******* Calibration factor -$onEmpty -table f14_yld_calib(i,ltype14) Calibration factor for the LPJmL yields (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_calib.csv" $include "./modules/14_yields/input/f14_yld_calib.csv" -$offdelim -; -$offEmpty - -table f14_yields_constgsadapt(t_all,j,kve,w) LPJmL potential yields per cell WITHOUT gsadapt (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields_constgsadapt.cs3" -$offdelim -; - -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields_constgsadapt(t_all,j,kve,w) = f14_yields_constgsadapt("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields_constgsadapt(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields_constgsadapt,"j,kve,w"); - -table f14_yields(t_all,j,kve,w) LPJmL potential yields WITH gsadapt per cell (rainfed and irrigated) (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/lpj_yields.cs3" -$offdelim -; - -* set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c14_yields_scenario%" == "nocc" f14_yields(t_all,j,kve,w) = f14_yields("y1995",j,kve,w); -$if "%c14_yields_scenario%" == "nocc_hist" f14_yields(t_all,j,kve,w)$(m_year(t_all) > sm_fix_cc) = f14_yields(t_all,j,kve,w)$(m_year(t_all) = sm_fix_cc); -m_fillmissingyears(f14_yields,"j,kve,w"); - -table f14_pyld_hist(t_all,i) Modelled regional pasture yields in the past (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/input/f14_pasture_yields_hist.csv" -$offdelim; - - -table f14_fao_yields_hist(t_all,i,kcr) FAO yields per region (tDM per ha per yr) -$ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_region_yields.cs3" -$offdelim -; -m_fillmissingyears(f14_fao_yields_hist,"i,kcr"); - -parameter f14_ir2rf_ratio(i) AQUASTAT ratio of irrigated to rainfed yields per region (1) -/ -$ondelim -$include "./modules/14_yields/gsadapt_nov25/input/f14_ir2rf_ratio.cs4" -$offdelim -/ -; - -parameter fm_ipcc_bef(clcl) IPCC biomass expansion factor BEF (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_ipcc_bef.cs3" -$offdelim -/ -; - -parameter fm_aboveground_fraction(land_timber) Aboveground fraction of total biomass (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_aboveground_fraction.csv" -$offdelim -/ -; - -$onEmpty -table f14_yld_ncp_report(t_all,j,ncp_type14) Share of land with intact natures contributions to people (NCP) (1) -$ondelim -$if exist "./modules/14_yields/input/f14_yld_ncp_report.cs3" $include "./modules/14_yields/input/f14_yld_ncp_report.cs3" -$offdelim -; -$offEmpty - -parameter f14_kcr_pollinator_dependence(kcr) Share of total yield dependent on biotic pollination (1) -/ -$ondelim -$include "./modules/14_yields/input/f14_kcr_pollinator_dependence.csv" -$offdelim -/ -; - - - - diff --git a/modules/14_yields/gsadapt_nov25/input/files b/modules/14_yields/gsadapt_nov25/input/files deleted file mode 100644 index 6f075de39f..0000000000 --- a/modules/14_yields/gsadapt_nov25/input/files +++ /dev/null @@ -1,3 +0,0 @@ -* list of files that are required here -f14_region_yields.cs3 -f14_ir2rf_ratio.cs4 diff --git a/modules/14_yields/gsadapt_nov25/nl_fix.gms b/modules/14_yields/gsadapt_nov25/nl_fix.gms deleted file mode 100644 index c33cf90636..0000000000 --- a/modules/14_yields/gsadapt_nov25/nl_fix.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_fix ### - -vm_yld.fx(j,kcr,w) = sum(ct,i14_yields_calib(ct,j,kcr,w) / sum(cell(i,j), p14_yields_gsadapt_ratio_cumulative(ct,i))) * vm_tau.l(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)); -vm_yld.fx(j,"pasture",w) = sum(ct,(i14_yields_calib(ct,j,"pasture",w)) * sum(cell(i,j), pm_past_mngmnt_factor(ct,i))) * (1 + s14_yld_past_switch * (pcm_tau(j, "crop") / sum((cell(i,j), supreg(h,i)), fm_tau1995(h)) - 1)); diff --git a/modules/14_yields/gsadapt_nov25/nl_release.gms b/modules/14_yields/gsadapt_nov25/nl_release.gms deleted file mode 100644 index f3261b8f87..0000000000 --- a/modules/14_yields/gsadapt_nov25/nl_release.gms +++ /dev/null @@ -1,11 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -* ### nl_release ### - -vm_yld.lo(j,kve,w) = 0; -vm_yld.up(j,kve,w) = Inf; diff --git a/modules/14_yields/gsadapt_nov25/postsolve.gms b/modules/14_yields/gsadapt_nov25/postsolve.gms deleted file mode 100644 index 398d8cf124..0000000000 --- a/modules/14_yields/gsadapt_nov25/postsolve.gms +++ /dev/null @@ -1,24 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_yld(t,j,kve,w,"marginal") = vm_yld.m(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"marginal") = q14_yield_crop.m(j,kcr,w); - oq14_yield_past(t,j,w,"marginal") = q14_yield_past.m(j,w); - ov_yld(t,j,kve,w,"level") = vm_yld.l(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"level") = q14_yield_crop.l(j,kcr,w); - oq14_yield_past(t,j,w,"level") = q14_yield_past.l(j,w); - ov_yld(t,j,kve,w,"upper") = vm_yld.up(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"upper") = q14_yield_crop.up(j,kcr,w); - oq14_yield_past(t,j,w,"upper") = q14_yield_past.up(j,w); - ov_yld(t,j,kve,w,"lower") = vm_yld.lo(j,kve,w); - oq14_yield_crop(t,j,kcr,w,"lower") = q14_yield_crop.lo(j,kcr,w); - oq14_yield_past(t,j,w,"lower") = q14_yield_past.lo(j,w); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/14_yields/gsadapt_nov25/preloop.gms b/modules/14_yields/gsadapt_nov25/preloop.gms deleted file mode 100644 index c49b8c064a..0000000000 --- a/modules/14_yields/gsadapt_nov25/preloop.gms +++ /dev/null @@ -1,248 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -***YIELD CORRECTION FOR PASTURE ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** -p14_pyield_LPJ_reg(t,i) = (sum(cell(i,j), f14_yields(t,j,"pasture","rainfed") * pm_land_start(j,"past")) / - sum(cell(i,j), pm_land_start(j,"past")) ); - -*' Pasture yield correction: use historical data for all years where available -*' (f14_pyld_hist covers y1965–y2020), freeze at the last available value beyond. -*' This avoids a discontinuity at the t_past boundary by using observed data -*' through y2020 instead of freezing at the last t_past year (y2015). -p14_pyield_corr(t,i) = 0; -p14_pyield_corr(t,i)$(f14_pyld_hist(t,i) > 0) = f14_pyld_hist(t,i) / (p14_pyield_LPJ_reg(t,i) + 0.000001); -loop(t, - p14_pyield_corr(t,i)$(p14_pyield_corr(t,i) = 0) = p14_pyield_corr(t-1,i); -); - -i14_yields_calib(t,j,"pasture",w) = f14_yields(t,j,"pasture",w) * sum(cell(i,j),p14_pyield_corr(t,i)); - - -***YIELD MANAGEMENT CALIBRATION************************************************************ - - -*' @code - -*' The following equations calibrate the cellular yield patterns (`f14_yields`) to match -*' historical reference yields (`i14_calib_target_yields_hist`) by calculating a calibration term called -*' 'i14_managementcalib'. For most cases, 'i14_managementcalib' is the ratio of the historical -*' yields reported by FAO for croplands (`f14_fao_yields_hist`) and regional mean yields (`i14_modeled_yields_hist`) -*' given historic crop area patterns ('fm_croparea') and cellular yields coming from crop models -*' like LPJmL (`f14_yields`). In these cases, 'i14_managementcalib' represents a purely relative -*' calibration factor that depends only on the initial conditions of the starting year. -*' -*' However, when FAO yields are significantly higher than given by the cellular yield inputs -*' (underestimated baseline), the relative calibration terms can lead to unrealistically large -*' yields in the case of future yield increases within the cellular yield patterns. -*' -*' To address this issue, the factor `i14_lambda_yields` determines the degree -*' to which the baseline (FAO) is under- or overestimated and therefore controls -*' whether the calibration factor is applied as an absolute or relative change. -*' For overestimated FAO yields, `i14_lambda_yields` is 1, which is equivalent -*' to an entirely relative calibration. For underestimated yields, `i14_lambda_yields` -*' is calculated as the squared root of the ratio between LPJmL yields and FAO historical -*' yields, and as `i14_lambda_yields` approaches 0, it reduces the applied relative change -*' resulting in a mean change increasingly similar to an additive term (@Heinke.2013). - -*' This concept is referred to as limited calibration, as it limits the calibration -*' to an additive term in case of a strongly underestimated baseline. The scalar -*' `s14_limit_calib` can be used to switch limited calibration on (1) and off (0). - -*' To account for growing period adaption to climate change, two types of yields -*' (one with adaption of growing periods and varieties to changes in climatic conditions (gsadapt) -*' and one with no changes in growing periods and varieties in the future (constgsadapt)) -*' have to be calibrated. -*' The joint parameter `i14_yields_combined(t,j,yldtype,kcr,w)` is used to calibrate -*' both types individually as even though the growing seasons are held constant from 1995 -*' onwards, the yields already differ in 1995 due to long term averaging. - -*** INITIALIZATION of crop yield parameters - -i14_yields_combined(t,j,"constgsadapt",kcr,w) = f14_yields_constgsadapt(t,j,kcr,w); -i14_yields_combined(t,j,"gsadapt",kcr,w) = f14_yields(t,j,kcr,w); - -i14_croparea_total(t_all,w,j) = sum(kcr, fm_croparea(t_all,j,w,kcr)); - -************************************************************************************** -*** STEP 1: CALCULATE modeled regional historical yields - -*' Historic crop area patterns (`fm_croprea`) are used to calculate regional yields -*' (`i14_modeled_yields_hist`) from the given cellular input pattern. In rare cases where -*' a region has no crop area reported for a given crop type, the total crop area is -*' used to calculate a proxy yield for the calibration, given by the following equation: - -i14_modeled_yields_hist(t_past,i,yldtype,knbe14) - = (sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,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 AND - sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) > 0.00001) - + (sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined(t_past,j,yldtype,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 OR - sum((cell(i,j),w), fm_croparea(t_past,j,w,knbe14) * i14_yields_combined(t_past,j,yldtype,knbe14,w)) <= 0.00001); - -i14_modeled_yields_hist(t_past,i,yldtype,kbe14) - = sum((cell(i,j),w), i14_croparea_total(t_past,w,j) * i14_yields_combined("y1995",j,yldtype,kbe14,w)) / - sum((cell(i,j),w), i14_croparea_total(t_past,w,j)); - -************************************************************************************** -*** STEP 2: SET CALIB TARGET with FAO for knbe14 and modeled yields for kbe14 - -*' Use FAO data as calibration data for all crop types except bioenergy crops: -i14_calib_target_yields_hist(t,i,knbe14) = f14_fao_yields_hist(t,i,knbe14); - -*' For bioenergy crops, no meaningful calibration target is currently available. The calibration target -*' is set to the regional modeled yield, which results in a calibration factor of 1 and effectively -*' performs no calibration. This is a placeholder implementation that can be replaced with actual -*' calibration data when it becomes available. -i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"gsadapt",kbe14); -if (s14_use_gsadapt = 0, - i14_calib_target_yields_hist(t,i,kbe14) = i14_modeled_yields_hist("y1995",i,"constgsadapt",kbe14); -); - -************************************************************************************** -*** STEP 3: LOOP OVER TIME calculating calibration parameters for all time steps - -*' The factor `i14_lambda_yields` is calculated for the initial time step depending -*' on the setting `s14_limit_calib` and is then held constant for all other time steps. -*' The regional calibration target yield and regional yield of the crop model input of -*' the initial time step is kept constant in the two parameters `i14_calib_target_yields_hist` -*' and `i14_modeled_yields_hist`: - -loop(t, - if (sum(sameas(t,"y1995"),1) = 1, - - if ((s14_limit_calib = 0), - i14_lambda_yields(t,i,yldtype,kcr) = 1; - - Elseif (s14_limit_calib = 1 ), - i14_lambda_yields(t,i,yldtype,kcr) = - 1$(i14_calib_target_yields_hist(t,i,kcr) <= i14_modeled_yields_hist(t,i,yldtype,kcr)) - + sqrt(i14_modeled_yields_hist(t,i,yldtype,kcr)/i14_calib_target_yields_hist(t,i,kcr))$ - (i14_calib_target_yields_hist(t,i,kcr) > i14_modeled_yields_hist(t,i,yldtype,kcr)); - ); - - Else - i14_modeled_yields_hist(t,i,yldtype,kcr) = i14_modeled_yields_hist(t-1,i,yldtype,kcr); - i14_calib_target_yields_hist(t,i,kcr) = i14_calib_target_yields_hist(t-1,i,kcr); - i14_lambda_yields(t,i,yldtype,kcr) = i14_lambda_yields(t-1,i,yldtype,kcr); - ); -); - -************************************************************************************** -*** STEP 4: APPLY calculated calibration factors for all time steps - -*' The calibrated cellular yield `i14_yields_calib_combined` is calculated for each time step depending -*' on the constant values `i14_modeled_yields_hist`, `i14_calib_target_yields_hist`, `i14_lambda_yields` -*' and the uncalibrated, cellular yield `f14_yields` following the idea of eq. (9) in [@Heinke.2013]: - -i14_managementcalib(t,j,yldtype,kcr,w) = - 1 + (sum(cell(i,j), i14_calib_target_yields_hist(t,i,kcr) - i14_modeled_yields_hist(t,i,yldtype,kcr)) / - i14_yields_combined(t,j,yldtype,kcr,w) * - (i14_yields_combined(t,j,yldtype,kcr,w) / (sum(cell(i,j),i14_modeled_yields_hist(t,i,yldtype,kcr))+10**(-8))) ** - sum(cell(i,j),i14_lambda_yields(t,i,yldtype,kcr)))$(i14_yields_combined(t,j,yldtype,kcr,w)>0); - - - -i14_yields_calib_combined(t,j,yldtype,kcr,w) = i14_managementcalib(t,j,yldtype,kcr,w) * i14_yields_combined(t,j,yldtype,kcr,w); - -*' Note that the calculation is split into two parts for better readability. - -************************************************************************************** - -*' Irrigated yields are calibrated to meet the country-level -*' ratio between irrigated and rainfed yields reported by Aquastat. -*' This can be de-activated with the switch `s14_calib_ir2rf`. -*' This calibration in only done for knbe14 (all crops excluding bioenergy crops) -if ((s14_calib_ir2rf = 1), - -* Weighted yields - i14_calib_yields_hist(i,yldtype,w) - = sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14) * i14_yields_calib_combined("y1995",j,yldtype,knbe14,w)) / - sum((cell(i,j), knbe14), fm_croparea("y1995",j,"irrigated",knbe14)); - -* Use irrigated-rainfed ratio of Aquastat if larger than our calculated ratio - i14_calib_yields_ratio(i,yldtype) = i14_calib_yields_hist(i,yldtype,"irrigated") / i14_calib_yields_hist(i,yldtype,"rainfed"); - i14_target_ratio(i,yldtype) = max(i14_calib_yields_ratio(i,yldtype), f14_ir2rf_ratio(i)); - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated") = sum((cell(i,j)), i14_target_ratio(i,yldtype) / i14_calib_yields_ratio(i,yldtype)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,"irrigated"); - -* Calibrate newly calibrated yields to calib target yields - i14_modeled_yields_hist2(i,yldtype,knbe14) - = (sum((cell(i,j),w), fm_croparea("y1995",j,w,knbe14) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) > 0.00001) - + (sum((cell(i,j),w), i14_croparea_total("y1995",w,j) * i14_yields_calib_combined("y1995",j,yldtype,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_combined("y1995",j,yldtype,knbe14,w)) <= 0.00001); - - - i14_yields_calib_combined(t,j,yldtype,knbe14,w) = sum((cell(i,j)), i14_calib_target_yields_hist("y1995",i,knbe14) / - i14_modeled_yields_hist2(i,yldtype,knbe14)) * - i14_yields_calib_combined(t,j,yldtype,knbe14,w); -); - -***MANAGEMENT CALIBRATION FOR 2ND GENERATION BIOENERGY CROPS (tau scaling)**************** -*' Tau-based management calibration applied on top of the biophysical yields. -i14_yields_calib_combined(t,j,yldtype,kbe14,w) = i14_yields_calib_combined(t,j,yldtype,kbe14,w) * - sum((supreg(h,i),cell(i,j)),fm_tau1995(h))/smax(h,fm_tau1995(h)); -******************************************************************************************* - -* Set yields to gsadapt values (pasture yields are not affected by growing period adaption) - -if (s14_use_gsadapt = 1, - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"gsadapt",knbe14,w); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"gsadapt",kcr,w); - else - pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib_combined("y1995",j,"constgsadapt",knbe14,w); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib_combined(t,j,"constgsadapt",kcr,w); -); - -*' @stop - - -***YIELD CALIBRATION*********************************************************************** - -*' @code -*' Calibrated yields can additionally be adjusted by calibration factors 'f14_yld_calib' -*' determined in a calibration run. As MAgPIE optimizes yield patterns and FAO regional -*' yields are outlier corrected, historical production and croparea can in some cases -*' be better represented with this additional correction: - -* set yield calib factors to 1 in case of no use of yield calibration factors (s14_use_yield_calib = 0) -* or missing input file -if (s14_use_yield_calib = 0 OR sum((i,ltype14),f14_yld_calib(i,ltype14)) = 0, - f14_yld_calib(i,ltype14) = 1; -); - - -i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) - * sum(cell(i,j),f14_yld_calib(i,"crop")); -i14_yields_calib(t,j,"pasture",w) = i14_yields_calib(t,j,"pasture",w) - * sum(cell(i,j),f14_yld_calib(i,"past")); - -*' @stop - -*' @code -*' Land degradation can negatively affect yields. Soil loss for example can -*' notably affect land productivity. Similarly, the yield of pollinator-dependent crops -*' is reduced when there is a lack of pollinators. To account for the impacts of degradation, -*' calibrated yields are multiplied by the share of land with intact NCP in each cell and specific -*' yield reduction coefficients that represent yield loss due to soil erosion and pollination -*' deficiency on non-intact land. - -* set default values in case of missing input file. -if (sum((t,j,ncp_type14),f14_yld_ncp_report(t,j,ncp_type14)) = 0, - f14_yld_ncp_report(t,j,ncp_type14) = 1; -); - -if ((s14_degradation = 1), - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - s14_yld_reduction_soil_loss) - + i14_yields_calib(t,j,kcr,w) * s14_yld_reduction_soil_loss * f14_yld_ncp_report(t,j,"soil_intact"); - i14_yields_calib(t,j,kcr,w) = i14_yields_calib(t,j,kcr,w) * (1 - f14_kcr_pollinator_dependence(kcr)) - + i14_yields_calib(t,j,kcr,w) * f14_kcr_pollinator_dependence(kcr) * f14_yld_ncp_report(t,j,"poll_suff"); -); - -*' @stop diff --git a/modules/14_yields/gsadapt_nov25/presolve.gms b/modules/14_yields/gsadapt_nov25/presolve.gms deleted file mode 100644 index ef86929df0..0000000000 --- a/modules/14_yields/gsadapt_nov25/presolve.gms +++ /dev/null @@ -1,114 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*** EOF presolve.gms *** - -* calculate carbon density - -*** HARVESTABLE GROWING STOCK - -*' `pm_carbon_density_plantation_ac` for vegetation carbon is above- and belowground -*' carbon density. We convert Carbon density in tC/ha to tDM/ha by using carbon -*' fraction of `sm_carbon_fraction` in tC/tDM. For assessing wood harvesting -*' we need only aboveground biomass information, therefore we multiply with -*' aboveground `fm_aboveground_fraction`. Additionally, we divide aboveground -*' tree biomass by the Biomass Expansion Factor (BEF, dimensionless) to get -*' stem biomass in tDM/ha. BEF = AGB (aboveground biomass) / stem_biomass (always > 1). - -*' @code - -im_growing_stock(t,j,ac,"forestry") = - ( - pm_carbon_density_plantation_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("forestry") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"primforest") = - ( - fm_carbon_density(t,j,"primforest","vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("primforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"secdforest") = - ( - pm_carbon_density_secdforest_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -im_growing_stock(t,j,ac,"other") = - ( - pm_carbon_density_other_ac(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("other") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' Growing stock for young secondary forest (youngsecdf) regrowing on other land. -*' It is derived from the *uncalibrated* secondary-forest carbon curve (the same -*' curve youngsecdf carbon uses in 35_natveg), with the secondary-forest aboveground -*' fraction, so that its wood yield and its carbon stock are consistent. -im_growing_stock_ysf(t,j,ac) = - ( - pm_carbon_density_secdforest_ac_uncalib(t,j,ac,"vegc") - / sm_carbon_fraction - * fm_aboveground_fraction("secdforest") - / sum(clcl, pm_climate_class(j,clcl) * fm_ipcc_bef(clcl)) - ) - ; - -*' @stop - -** Hard constraint to always have a positive number in im_growing_stock -im_growing_stock(t,j,ac,land_timber) = im_growing_stock(t,j,ac,land_timber)$(im_growing_stock(t,j,ac,land_timber) > 0) + 0.0001$(im_growing_stock(t,j,ac,land_timber) = 0); -** Set growing stock to 0 where it does not exceed a minimum for harvest -im_growing_stock(t,j,ac,land_natveg)$(im_growing_stock(t,j,ac,land_natveg) < s14_minimum_growing_stock) = 0; -** Apply the same positivity and minimum-growing-stock clamps to the youngsecdf growing stock -im_growing_stock_ysf(t,j,ac) = im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) > 0) + 0.0001$(im_growing_stock_ysf(t,j,ac) = 0); -im_growing_stock_ysf(t,j,ac)$(im_growing_stock_ysf(t,j,ac) < s14_minimum_growing_stock) = 0; - -* Calculate growing period adaption factor based on previous croppping pattern -if (ord(t) = 1, - - p14_yields_gsadapt_ratio(t,i) = 1; - p14_yields_gsadapt_ratio_previous(t,i) = 1; - pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cumulative(t,i) = 1; - -else - - p14_yields_gsadapt_ratio(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); - - p14_yields_gsadapt_ratio_previous(t,i) = - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"gsadapt",kcr,w) * pcm_area(j,w,kcr)) / - sum((cell(i,j),w,kcr), i14_yields_calib_combined(t-1,j,"constgsadapt",kcr,w) * pcm_area(j,w,kcr)); - - pm_yields_gsadapt_ratio_increment(t,i) = p14_yields_gsadapt_ratio(t,i) / p14_yields_gsadapt_ratio_previous(t,i); -* The max(1,...) ensures the cumulative factor can only grow, never shrink. -* This means declining adaptation opportunities are not represented — once -* adaptation gains are accounted for via tau, they cannot be reversed. - p14_yields_gsadapt_ratio_cumulative(t,i) = max(1,pm_yields_gsadapt_ratio_increment(t,i)) * p14_yields_gsadapt_ratio_cumulative(t-1,i); - -); - -if(s14_gsadapt2tau = 0 OR s14_use_gsadapt = 0, - pm_yields_gsadapt_ratio_increment(t,i) = 1; - p14_yields_gsadapt_ratio_cumulative(t,i) = 1; -); - -*** EOF presolve.gms *** diff --git a/modules/14_yields/gsadapt_nov25/realization.gms b/modules/14_yields/gsadapt_nov25/realization.gms deleted file mode 100644 index 8d09710b9d..0000000000 --- a/modules/14_yields/gsadapt_nov25/realization.gms +++ /dev/null @@ -1,38 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -*' @description The gsadapt_nov25 realization reads in the LPJmL data -*' accounts for growing period adaption to climate change and also -*' performs a number of calibrations. -*' Crop yields are calibrated to FAO [@FAOSTAT] regional yield levels of the initial time step. -*' Bioenergy yields are corrected using the $\tau$ factor -*' representing agricultural land-use intensity. -*' Pasture yields are calculated based on pasture demand to account for -*' intensification and extensification of managed grasslands. -*' Optionally, irrigated yields are scaled to meet the irrigated-to-rainfed yield -*' ratio as provided by AQUASTAT [@fao_aquastat_2016]. -*' This realization also calculates harvestable growing stock (`im_growing_stock`) as -*' stem biomass (tDM/ha) by dividing aboveground biomass by the IPCC biomass expansion -*' factor (BEF). BEF is always > 1 and converts total aboveground biomass to stem-only biomass. - -*' @limitations The exogenous implementation of pasture intensification cannot -*' capture feedbacks between land scarcity and efforts to improve pasture -*' management. Moreover, the magnitude of spillover effects from technological change -*' in the crop sector towards improvements in pasture management is very uncertain. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/14_yields/gsadapt_nov25/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/14_yields/gsadapt_nov25/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/14_yields/gsadapt_nov25/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/14_yields/gsadapt_nov25/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/14_yields/gsadapt_nov25/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/14_yields/gsadapt_nov25/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/14_yields/gsadapt_nov25/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/14_yields/gsadapt_nov25/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/14_yields/gsadapt_nov25/nl_release.gms" -*######################## R SECTION END (PHASES) ############################### diff --git a/modules/14_yields/gsadapt_nov25/sets.gms b/modules/14_yields/gsadapt_nov25/sets.gms deleted file mode 100644 index c0059412ec..0000000000 --- a/modules/14_yields/gsadapt_nov25/sets.gms +++ /dev/null @@ -1,43 +0,0 @@ -*** | (C) 2008-2025 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | MAgPIE License Exception, version 1.0 (see LICENSE file). -*** | Contact: magpie@pik-potsdam.de - -sets - ltype14 Calibration land types - / crop, past / - - k(kall) Primary products - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr, livst_rum, livst_pig, - livst_chick, livst_egg, livst_milk, fish, wood, woodfuel/ - - kve(k) Land-use activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, pasture, cottn_pro, begr, betr / - - kcr(kve) Cropping activities - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro, begr, betr / - - knbe14(kcr) Cropping activities excluding bioenergy plants - / tece, maiz, trce, rice_pro, soybean, rapeseed, groundnut, sunflower, - oilpalm, puls_pro, potato, cassav_sp, sugr_cane, sugr_beet, others, - foddr, cottn_pro / - - kbe14(kcr) Bioenergy cropping activities - / begr, betr / - - ncp_type14 Natures contributions to people (NCP) relevant for agricultural yields - / soil_intact, poll_suff / - - yldtype Yield LPJmL run type with or without growing season adaptation - / gsadapt, constgsadapt / - -; - diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index afc7fb1a94..b7ebda0ec4 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -15,9 +15,11 @@ *' period, crop yields and pasture productivity are calibrated at the regional *' level to meet the observed cropland and pasture area as reported by FAO *' [@FAOSTAT]. -*' For the simulation of the temporal development of agricultural -*' yields beyond biophysical processes, the module receives information about the agricultural land use -*' intensity represented by the $\tau$ factor coming from the module [13_tc]. +*' For the simulation of the temporal development of agricultural yields beyond +*' biophysical processes, the module receives information about the agricultural land +*' use intensity represented by the $\tau$ factor coming from the module [13_tc]. +*' Irrigated yields can optionally be calibrated to meet irrigated-rainfed +*' country-level yield ratios as reported by Aquastat [@fao_aquastat_2016]. *' *' The module returns yields for all crops and for pasture, which is then used *' by the modules [30_crop] and [31_past]. From 40f21850ce4d608ab45d9a3af417376fec21534d Mon Sep 17 00:00:00 2001 From: k4rst3ns Date: Tue, 28 Jul 2026 18:07:14 +0200 Subject: [PATCH 40/42] rename tc realization --- config/default.cfg | 4 +-- main.gms | 2 +- .../declarations.gms | 0 .../{endo_nov25 => endo_jan22}/equations.gms | 0 .../{endo_nov25 => endo_jan22}/input.gms | 0 .../{endo_nov25 => endo_jan22}/nl_fix.gms | 0 .../{endo_nov25 => endo_jan22}/nl_relax.gms | 0 .../{endo_nov25 => endo_jan22}/nl_release.gms | 0 .../{endo_nov25 => endo_jan22}/postsolve.gms | 0 .../{endo_nov25 => endo_jan22}/preloop.gms | 0 .../{endo_nov25 => endo_jan22}/presolve.gms | 0 .../realization.gms | 24 +++++++++--------- .../{endo_nov25 => endo_jan22}/scaling.gms | 0 .../13_tc/{endo_nov25 => endo_jan22}/sets.gms | 0 .../tau_regional.png | Bin .../tc_schematic.png | Bin .../tcc_regression.png | Bin modules/13_tc/module.gms | 2 +- 18 files changed, 16 insertions(+), 16 deletions(-) rename modules/13_tc/{endo_nov25 => endo_jan22}/declarations.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/equations.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/input.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/nl_fix.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/nl_relax.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/nl_release.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/postsolve.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/preloop.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/presolve.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/realization.gms (75%) rename modules/13_tc/{endo_nov25 => endo_jan22}/scaling.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/sets.gms (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/tau_regional.png (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/tc_schematic.png (100%) rename modules/13_tc/{endo_nov25 => endo_jan22}/tcc_regression.png (100%) diff --git a/config/default.cfg b/config/default.cfg index e3b3591f51..81f3096c48 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -285,13 +285,13 @@ cfg$gms$s12_hist_interest_hic_noselect <- "0.04" # def = 0.04 # ***--------------------- 13_tc ----------------------------------------- -# * (endo_nov25): endogenous technological change with full cost accounting and +# * (endo_jan22): endogenous technological change with full cost accounting and # * stepwise updated crop and managed pastures area information # * 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_nov25" # def = endo_nov25 +cfg$gms$tc <- "endo_jan22" # def = endo_jan22 # * tc cost scenario crops: low, medium or high cfg$gms$c13_tccost <- "medium" # def = medium diff --git a/main.gms b/main.gms index 5a8bde93f7..0c33fba7ad 100644 --- a/main.gms +++ b/main.gms @@ -194,7 +194,7 @@ $setglobal drivers aug17 $setglobal land landmatrix_dec18 $setglobal costs default $setglobal interest_rate select_apr20 -$setglobal tc endo_nov25 +$setglobal tc endo_jan22 $setglobal yields gsadapt_nov25 $setglobal food anthro_iso_jun22 diff --git a/modules/13_tc/endo_nov25/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms similarity index 100% rename from modules/13_tc/endo_nov25/declarations.gms rename to modules/13_tc/endo_jan22/declarations.gms diff --git a/modules/13_tc/endo_nov25/equations.gms b/modules/13_tc/endo_jan22/equations.gms similarity index 100% rename from modules/13_tc/endo_nov25/equations.gms rename to modules/13_tc/endo_jan22/equations.gms diff --git a/modules/13_tc/endo_nov25/input.gms b/modules/13_tc/endo_jan22/input.gms similarity index 100% rename from modules/13_tc/endo_nov25/input.gms rename to modules/13_tc/endo_jan22/input.gms diff --git a/modules/13_tc/endo_nov25/nl_fix.gms b/modules/13_tc/endo_jan22/nl_fix.gms similarity index 100% rename from modules/13_tc/endo_nov25/nl_fix.gms rename to modules/13_tc/endo_jan22/nl_fix.gms diff --git a/modules/13_tc/endo_nov25/nl_relax.gms b/modules/13_tc/endo_jan22/nl_relax.gms similarity index 100% rename from modules/13_tc/endo_nov25/nl_relax.gms rename to modules/13_tc/endo_jan22/nl_relax.gms diff --git a/modules/13_tc/endo_nov25/nl_release.gms b/modules/13_tc/endo_jan22/nl_release.gms similarity index 100% rename from modules/13_tc/endo_nov25/nl_release.gms rename to modules/13_tc/endo_jan22/nl_release.gms diff --git a/modules/13_tc/endo_nov25/postsolve.gms b/modules/13_tc/endo_jan22/postsolve.gms similarity index 100% rename from modules/13_tc/endo_nov25/postsolve.gms rename to modules/13_tc/endo_jan22/postsolve.gms diff --git a/modules/13_tc/endo_nov25/preloop.gms b/modules/13_tc/endo_jan22/preloop.gms similarity index 100% rename from modules/13_tc/endo_nov25/preloop.gms rename to modules/13_tc/endo_jan22/preloop.gms diff --git a/modules/13_tc/endo_nov25/presolve.gms b/modules/13_tc/endo_jan22/presolve.gms similarity index 100% rename from modules/13_tc/endo_nov25/presolve.gms rename to modules/13_tc/endo_jan22/presolve.gms diff --git a/modules/13_tc/endo_nov25/realization.gms b/modules/13_tc/endo_jan22/realization.gms similarity index 75% rename from modules/13_tc/endo_nov25/realization.gms rename to modules/13_tc/endo_jan22/realization.gms index 9a73b55eca..83fa0197b4 100644 --- a/modules/13_tc/endo_nov25/realization.gms +++ b/modules/13_tc/endo_jan22/realization.gms @@ -5,7 +5,7 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' @description The endo_nov25 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 @@ -41,15 +41,15 @@ *####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_nov25/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_nov25/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_nov25/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_nov25/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_nov25/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_nov25/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_nov25/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_nov25/postsolve.gms" -$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_nov25/nl_fix.gms" -$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_nov25/nl_release.gms" -$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_nov25/nl_relax.gms" +$Ifi "%phase%" == "sets" $include "./modules/13_tc/endo_jan22/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/13_tc/endo_jan22/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/13_tc/endo_jan22/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/13_tc/endo_jan22/equations.gms" +$Ifi "%phase%" == "scaling" $include "./modules/13_tc/endo_jan22/scaling.gms" +$Ifi "%phase%" == "preloop" $include "./modules/13_tc/endo_jan22/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/13_tc/endo_jan22/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/13_tc/endo_jan22/postsolve.gms" +$Ifi "%phase%" == "nl_fix" $include "./modules/13_tc/endo_jan22/nl_fix.gms" +$Ifi "%phase%" == "nl_release" $include "./modules/13_tc/endo_jan22/nl_release.gms" +$Ifi "%phase%" == "nl_relax" $include "./modules/13_tc/endo_jan22/nl_relax.gms" *######################## R SECTION END (PHASES) ############################### diff --git a/modules/13_tc/endo_nov25/scaling.gms b/modules/13_tc/endo_jan22/scaling.gms similarity index 100% rename from modules/13_tc/endo_nov25/scaling.gms rename to modules/13_tc/endo_jan22/scaling.gms diff --git a/modules/13_tc/endo_nov25/sets.gms b/modules/13_tc/endo_jan22/sets.gms similarity index 100% rename from modules/13_tc/endo_nov25/sets.gms rename to modules/13_tc/endo_jan22/sets.gms diff --git a/modules/13_tc/endo_nov25/tau_regional.png b/modules/13_tc/endo_jan22/tau_regional.png similarity index 100% rename from modules/13_tc/endo_nov25/tau_regional.png rename to modules/13_tc/endo_jan22/tau_regional.png diff --git a/modules/13_tc/endo_nov25/tc_schematic.png b/modules/13_tc/endo_jan22/tc_schematic.png similarity index 100% rename from modules/13_tc/endo_nov25/tc_schematic.png rename to modules/13_tc/endo_jan22/tc_schematic.png diff --git a/modules/13_tc/endo_nov25/tcc_regression.png b/modules/13_tc/endo_jan22/tcc_regression.png similarity index 100% rename from modules/13_tc/endo_nov25/tcc_regression.png rename to modules/13_tc/endo_jan22/tcc_regression.png diff --git a/modules/13_tc/module.gms b/modules/13_tc/module.gms index 11275fdd90..90a171faac 100644 --- a/modules/13_tc/module.gms +++ b/modules/13_tc/module.gms @@ -23,6 +23,6 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%tc%" == "endo_jan22" $include "./modules/13_tc/endo_jan22/realization.gms" -$Ifi "%tc%" == "endo_nov25" $include "./modules/13_tc/endo_nov25/realization.gms" +$Ifi "%tc%" == "endo_jan22" $include "./modules/13_tc/endo_jan22/realization.gms" $Ifi "%tc%" == "exo" $include "./modules/13_tc/exo/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From ad82d0e36893339c47f74150aa29af99922a9da6 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Tue, 28 Jul 2026 18:09:19 +0200 Subject: [PATCH 41/42] set new default to use gsadat yields and spillover --- config/default.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 81f3096c48..f6491e547e 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -410,13 +410,13 @@ 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 <- 0 # def = 0 +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 <- 0 # def = 0 +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. From 12304f40bf8527703cd89d0a32e0316baad79497 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Tue, 28 Jul 2026 21:14:58 +0200 Subject: [PATCH 42/42] Update all files to default --- main.gms | 4 +- modules/13_tc/endo_jan22/declarations.gms | 2 +- modules/13_tc/endo_jan22/postsolve.gms | 8 ++-- modules/13_tc/module.gms | 1 - .../declarations.gms | 2 +- .../gsadapt_dynPastrTau_jul26/input.gms | 6 +-- modules/14_yields/module.gms | 1 - modules/21_trade/exo/declarations.gms | 12 ++--- modules/21_trade/exo/postsolve.gms | 48 +++++++++---------- 9 files changed, 41 insertions(+), 43 deletions(-) diff --git a/main.gms b/main.gms index 0c33fba7ad..414ecc17ef 100644 --- a/main.gms +++ b/main.gms @@ -181,7 +181,7 @@ $offlisting $setglobal c_timesteps coup2100 $setglobal c_past till_2015 -$setglobal c_title LPJmL_5p9.16-m2_NOgsadapt +$setglobal c_title default scalars s_use_gdx use of gdx files / 0 / @@ -195,7 +195,7 @@ $setglobal land landmatrix_dec18 $setglobal costs default $setglobal interest_rate select_apr20 $setglobal tc endo_jan22 -$setglobal yields gsadapt_nov25 +$setglobal yields gsadapt_dynPastrTau_jul26 $setglobal food anthro_iso_jun22 $setglobal demand sector_may15 diff --git a/modules/13_tc/endo_jan22/declarations.gms b/modules/13_tc/endo_jan22/declarations.gms index c03f5275da..de870f57f1 100644 --- a/modules/13_tc/endo_jan22/declarations.gms +++ b/modules/13_tc/endo_jan22/declarations.gms @@ -42,7 +42,7 @@ parameters *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov13_tau_core(t,h,tautype,type) Agricultural land use intensity tau for conventional cropland (1) + ov13_tau_core(t,h,tautype,type) Agricultural land use intensity tau for conventional cropland (1) ov_tech_cost(t,i,type) Total Annuitized costs of TC (mio. USD17MER per yr) ov13_cost_tc(t,i,tautype,type) Technical change costs per region (mio. USD17MER) ov13_tech_cost(t,i,tautype,type) Annuitized costs of TC for crops and pasture (mio. USD17MER per yr) diff --git a/modules/13_tc/endo_jan22/postsolve.gms b/modules/13_tc/endo_jan22/postsolve.gms index d54912b88a..6a4698af8c 100644 --- a/modules/13_tc/endo_jan22/postsolve.gms +++ b/modules/13_tc/endo_jan22/postsolve.gms @@ -17,7 +17,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov13_tau_core(t,h,tautype,"marginal") = v13_tau_core.m(h,tautype); + ov13_tau_core(t,h,tautype,"marginal") = v13_tau_core.m(h,tautype); ov_tech_cost(t,i,"marginal") = vm_tech_cost.m(i); ov13_cost_tc(t,i,tautype,"marginal") = v13_cost_tc.m(i,tautype); ov13_tech_cost(t,i,tautype,"marginal") = v13_tech_cost.m(i,tautype); @@ -29,7 +29,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype); 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); + 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); ov13_tech_cost(t,i,tautype,"level") = v13_tech_cost.l(i,tautype); @@ -41,7 +41,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype); 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); + 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); ov13_tech_cost(t,i,tautype,"upper") = v13_tech_cost.up(i,tautype); @@ -53,7 +53,7 @@ pcm_tau(j, tautype) = vm_tau.l(j, tautype); 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); + 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); ov13_tech_cost(t,i,tautype,"lower") = v13_tech_cost.lo(i,tautype); diff --git a/modules/13_tc/module.gms b/modules/13_tc/module.gms index 90a171faac..8b95777c0f 100644 --- a/modules/13_tc/module.gms +++ b/modules/13_tc/module.gms @@ -23,6 +23,5 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%tc%" == "endo_jan22" $include "./modules/13_tc/endo_jan22/realization.gms" -$Ifi "%tc%" == "endo_jan22" $include "./modules/13_tc/endo_jan22/realization.gms" $Ifi "%tc%" == "exo" $include "./modules/13_tc/exo/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms index f74255cc27..4136de553c 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/declarations.gms @@ -41,7 +41,7 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_yld(t,j,kve,w,type) Yields (variable because of technical change) (tDM per ha per yr) + ov_yld(t,j,kve,w,type) Yields declared as variable because of technological change (tDM per ha per yr) oq14_yield_crop(t,j,kcr,w,type) Crop yields (tDM per ha per yr) oq14_yield_past(t,j,w,type) Pasture yields (tDM per ha per yr) ; diff --git a/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms b/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms index 1067f98282..941fdcc1b4 100644 --- a/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms +++ b/modules/14_yields/gsadapt_dynPastrTau_jul26/input.gms @@ -16,12 +16,12 @@ scalars s14_degradation Switch to include yield impacts of land degradation(0=no degradation 1=with degradation) / 0 / s14_yld_reduction_soil_loss Decline of land productivity in areas with severe soil loss (1) / 0.08 / s14_use_yield_calib Switch for using or not using yield calibration factors from the preprocessing (1=use facs 0=not use facs) / 0 / - s14_past_spillover_mode Switch for pasture spillover mode: 0 = static scalar - 1 = regional dynamic= / 1 / + s14_past_spillover_mode Switch for pasture spillover mode: 0 = static scalar - 1 = regional dynamic= / 0 / s14_yld_past_switch Spillover parameter for translating technological change in the crop sector into pasture yield increases in static mode (1) / 0.25 / s14_minimum_growing_stock Minimum growing stock for timber harvest in natural vegetation (tDM per ha) / 5 / sm_carbon_fraction Carbon fraction of dry matter (tC per tDM) / 0.5 / - s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 0 / - s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 0 / + s14_use_gsadapt Switch to use including growing period adaption (1) or not (0) for yield pattern (binary) / 1 / + s14_gsadapt2tau Switch to account for growing period adaption in tau (1) or not (0) (binary) / 1 / ; diff --git a/modules/14_yields/module.gms b/modules/14_yields/module.gms index b7ebda0ec4..480378c5d7 100644 --- a/modules/14_yields/module.gms +++ b/modules/14_yields/module.gms @@ -28,6 +28,5 @@ *' Anne Biewald, Kristine Karstens, Felicitas Beier, Alexandre Köberle *###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%yields%" == "gsadapt_nov25" $include "./modules/14_yields/gsadapt_nov25/realization.gms" $Ifi "%yields%" == "gsadapt_dynPastrTau_jul26" $include "./modules/14_yields/gsadapt_dynPastrTau_jul26/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/21_trade/exo/declarations.gms b/modules/21_trade/exo/declarations.gms index 1398dff8fa..4c93f445cd 100644 --- a/modules/21_trade/exo/declarations.gms +++ b/modules/21_trade/exo/declarations.gms @@ -25,11 +25,11 @@ equations *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_cost_trade_tariff(t,i,type) Regional tariff costs across all commodities entering objective (mio. USD17MER per yr) - ov_cost_trade_margin(t,i,type) Regional transport margin costs across all commodities entering objective (mio. USD17MER per yr) - ov_cost_trade_feasibility(t,i,type) Regional feasibility penalty costs across all commodities entering objective (mio. USD17MER per yr) - oq21_notrade(t,h,kall,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) - oq21_cost_trade_tariff(t,h,type) Superregional tariff costs (mio. USD17MER per yr) - oq21_cost_trade_margin(t,h,type) Superregional margin costs (mio. USD17MER per yr) + ov_cost_trade_tariff(t,i,type) Regional tariff costs across all commodities entering objective (mio. USD17MER per yr) + ov_cost_trade_margin(t,i,type) Regional transport margin costs across all commodities entering objective (mio. USD17MER per yr) + ov_cost_trade_feasibility(t,i,type) Regional feasibility penalty costs across all commodities entering objective (mio. USD17MER per yr) + oq21_notrade(t,h,kall,type) Superregional production constraint of non-tradable commodities (mio. tDM per yr) + oq21_cost_trade_tariff(t,h,type) Superregional tariff costs (mio. USD17MER per yr) + oq21_cost_trade_margin(t,h,type) Superregional margin costs (mio. USD17MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/21_trade/exo/postsolve.gms b/modules/21_trade/exo/postsolve.gms index 5bae31b1c7..4e52e49360 100644 --- a/modules/21_trade/exo/postsolve.gms +++ b/modules/21_trade/exo/postsolve.gms @@ -7,28 +7,28 @@ *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_cost_trade_tariff(t,i,"marginal") = vm_cost_trade_tariff.m(i); - ov_cost_trade_margin(t,i,"marginal") = vm_cost_trade_margin.m(i); - ov_cost_trade_feasibility(t,i,"marginal") = vm_cost_trade_feasibility.m(i); - oq21_notrade(t,h,kall,"marginal") = q21_notrade.m(h,kall); - oq21_cost_trade_tariff(t,h,"marginal") = q21_cost_trade_tariff.m(h); - oq21_cost_trade_margin(t,h,"marginal") = q21_cost_trade_margin.m(h); - ov_cost_trade_tariff(t,i,"level") = vm_cost_trade_tariff.l(i); - ov_cost_trade_margin(t,i,"level") = vm_cost_trade_margin.l(i); - ov_cost_trade_feasibility(t,i,"level") = vm_cost_trade_feasibility.l(i); - oq21_notrade(t,h,kall,"level") = q21_notrade.l(h,kall); - oq21_cost_trade_tariff(t,h,"level") = q21_cost_trade_tariff.l(h); - oq21_cost_trade_margin(t,h,"level") = q21_cost_trade_margin.l(h); - ov_cost_trade_tariff(t,i,"upper") = vm_cost_trade_tariff.up(i); - ov_cost_trade_margin(t,i,"upper") = vm_cost_trade_margin.up(i); - ov_cost_trade_feasibility(t,i,"upper") = vm_cost_trade_feasibility.up(i); - oq21_notrade(t,h,kall,"upper") = q21_notrade.up(h,kall); - oq21_cost_trade_tariff(t,h,"upper") = q21_cost_trade_tariff.up(h); - oq21_cost_trade_margin(t,h,"upper") = q21_cost_trade_margin.up(h); - ov_cost_trade_tariff(t,i,"lower") = vm_cost_trade_tariff.lo(i); - ov_cost_trade_margin(t,i,"lower") = vm_cost_trade_margin.lo(i); - ov_cost_trade_feasibility(t,i,"lower") = vm_cost_trade_feasibility.lo(i); - oq21_notrade(t,h,kall,"lower") = q21_notrade.lo(h,kall); - oq21_cost_trade_tariff(t,h,"lower") = q21_cost_trade_tariff.lo(h); - oq21_cost_trade_margin(t,h,"lower") = q21_cost_trade_margin.lo(h); + ov_cost_trade_tariff(t,i,"marginal") = vm_cost_trade_tariff.m(i); + ov_cost_trade_margin(t,i,"marginal") = vm_cost_trade_margin.m(i); + ov_cost_trade_feasibility(t,i,"marginal") = vm_cost_trade_feasibility.m(i); + oq21_notrade(t,h,kall,"marginal") = q21_notrade.m(h,kall); + oq21_cost_trade_tariff(t,h,"marginal") = q21_cost_trade_tariff.m(h); + oq21_cost_trade_margin(t,h,"marginal") = q21_cost_trade_margin.m(h); + ov_cost_trade_tariff(t,i,"level") = vm_cost_trade_tariff.l(i); + ov_cost_trade_margin(t,i,"level") = vm_cost_trade_margin.l(i); + ov_cost_trade_feasibility(t,i,"level") = vm_cost_trade_feasibility.l(i); + oq21_notrade(t,h,kall,"level") = q21_notrade.l(h,kall); + oq21_cost_trade_tariff(t,h,"level") = q21_cost_trade_tariff.l(h); + oq21_cost_trade_margin(t,h,"level") = q21_cost_trade_margin.l(h); + ov_cost_trade_tariff(t,i,"upper") = vm_cost_trade_tariff.up(i); + ov_cost_trade_margin(t,i,"upper") = vm_cost_trade_margin.up(i); + ov_cost_trade_feasibility(t,i,"upper") = vm_cost_trade_feasibility.up(i); + oq21_notrade(t,h,kall,"upper") = q21_notrade.up(h,kall); + oq21_cost_trade_tariff(t,h,"upper") = q21_cost_trade_tariff.up(h); + oq21_cost_trade_margin(t,h,"upper") = q21_cost_trade_margin.up(h); + ov_cost_trade_tariff(t,i,"lower") = vm_cost_trade_tariff.lo(i); + ov_cost_trade_margin(t,i,"lower") = vm_cost_trade_margin.lo(i); + ov_cost_trade_feasibility(t,i,"lower") = vm_cost_trade_feasibility.lo(i); + oq21_notrade(t,h,kall,"lower") = q21_notrade.lo(h,kall); + oq21_cost_trade_tariff(t,h,"lower") = q21_cost_trade_tariff.lo(h); + oq21_cost_trade_margin(t,h,"lower") = q21_cost_trade_margin.lo(h); *##################### R SECTION END (OUTPUT DEFINITIONS) ######################