From 809841f25c6741734fbb8a0ff5bf3fce47c805bd Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 10 Jul 2023 15:29:32 +0200 Subject: [PATCH 01/43] linear version --- modules/14_yields/managementcalib_aug19/preloop.gms | 1 + modules/17_production/flexreg_apr16/declarations.gms | 2 +- modules/17_production/flexreg_apr16/presolve.gms | 1 + .../71_disagg_lvst/foragebased_aug18/declarations.gms | 1 + .../71_disagg_lvst/foragebased_aug18/equations.gms | 2 +- modules/71_disagg_lvst/foragebased_aug18/preloop.gms | 2 +- modules/71_disagg_lvst/foragebased_aug18/presolve.gms | 11 +++++++++++ .../71_disagg_lvst/foragebased_aug18/realization.gms | 1 + modules/71_disagg_lvst/off/not_used.txt | 1 + 9 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 modules/71_disagg_lvst/foragebased_aug18/presolve.gms diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index b674237a64..005966b8b8 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -136,6 +136,7 @@ if ((s14_calib_ir2rf = 1), i14_yields_calib(t,j,knbe14,w); pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); + pm_yields_semi_calib(j,"pasture",w) = i14_yields_calib("y1995",j,"pasture",w); ); *' @stop diff --git a/modules/17_production/flexreg_apr16/declarations.gms b/modules/17_production/flexreg_apr16/declarations.gms index 235855f322..8187fd3fa9 100644 --- a/modules/17_production/flexreg_apr16/declarations.gms +++ b/modules/17_production/flexreg_apr16/declarations.gms @@ -15,7 +15,7 @@ equations ; parameters -pm_prod_init(j,kcr) Production initialization for year 1995 (tDM per yr) +pm_prod_init(j,k) Production initialization for year 1995 (tDM per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### diff --git a/modules/17_production/flexreg_apr16/presolve.gms b/modules/17_production/flexreg_apr16/presolve.gms index 09413ece73..c28ba01644 100644 --- a/modules/17_production/flexreg_apr16/presolve.gms +++ b/modules/17_production/flexreg_apr16/presolve.gms @@ -8,6 +8,7 @@ pm_prod_init(j,kcr)=sum(w,fm_croparea("y1995",j,w,kcr)*pm_yields_semi_calib(j,kcr,w)); +pm_prod_init(j,"pasture")=sum(w,pm_land_start(j,"past")*pm_yields_semi_calib(j,"pasture",w)); if (ord(t) = 1, diff --git a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms index 0bbcb46044..f22e4c9527 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms @@ -26,6 +26,7 @@ equations parameters i71_urban_area_share(j) Share of urban area within a region (1) + i71_forage_cell_prod_share(j,kforage) Cellular share of forage production within a region (1) ; scalars diff --git a/modules/71_disagg_lvst/foragebased_aug18/equations.gms b/modules/71_disagg_lvst/foragebased_aug18/equations.gms index e220bc9a52..a80b344d80 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/equations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/equations.gms @@ -35,7 +35,7 @@ q71_feed_forage(j2) .. q71_feed_balanceflow_nlp(j2)$(s71_lp_fix=0) .. sum(kforage, v71_feed_balanceflow(j2,kforage)) =e= sum((ct,cell(i2,j2),kli_rum,kforage), fm_feed_balanceflow(ct,i2,kli_rum,kforage) - * (vm_prod(j2,kli_rum) / (vm_prod_reg(i2,kli_rum)))); + * i71_forage_cell_prod_share(j2,kforage)); *' @stop diff --git a/modules/71_disagg_lvst/foragebased_aug18/preloop.gms b/modules/71_disagg_lvst/foragebased_aug18/preloop.gms index b4a0510e06..2828009296 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/preloop.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/preloop.gms @@ -14,4 +14,4 @@ s71_scale_mon = 1.10; s71_punish_additional_mon = 15000; * Minimal regional production of `kli_rum` to avoid division by zero in `q71_feed_balanceflow_nlp`. -vm_prod_reg.lo(i,kli_rum)$(s71_lp_fix=0) = 10**(-6); +*vm_prod_reg.lo(i,kli_rum)$(s71_lp_fix=0) = 10**(-6); diff --git a/modules/71_disagg_lvst/foragebased_aug18/presolve.gms b/modules/71_disagg_lvst/foragebased_aug18/presolve.gms new file mode 100644 index 0000000000..4f4d83ccd2 --- /dev/null +++ b/modules/71_disagg_lvst/foragebased_aug18/presolve.gms @@ -0,0 +1,11 @@ +*** | (C) 2008-2023 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 + +i71_forage_cell_prod_share(j,kforage) = + pm_prod_init(j,kforage) / (sum(cell(i,j),sum(cell2(i,j3), pm_prod_init(j3,kforage))) + 10**(-6)); + +* Note that $10^{-6}$ is required to avoid division by zero. diff --git a/modules/71_disagg_lvst/foragebased_aug18/realization.gms b/modules/71_disagg_lvst/foragebased_aug18/realization.gms index dfea6fd299..78f31a691b 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/realization.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/realization.gms @@ -21,6 +21,7 @@ $Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_ $Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_aug18/equations.gms" $Ifi "%phase%" == "scaling" $include "./modules/71_disagg_lvst/foragebased_aug18/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_aug18/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/71_disagg_lvst/foragebased_aug18/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_aug18/postsolve.gms" $Ifi "%phase%" == "nl_fix" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_fix.gms" $Ifi "%phase%" == "nl_release" $include "./modules/71_disagg_lvst/foragebased_aug18/nl_release.gms" diff --git a/modules/71_disagg_lvst/off/not_used.txt b/modules/71_disagg_lvst/off/not_used.txt index 79577f6d78..d45fbf352a 100644 --- a/modules/71_disagg_lvst/off/not_used.txt +++ b/modules/71_disagg_lvst/off/not_used.txt @@ -5,3 +5,4 @@ vm_prod,input,questionnaire vm_prod_reg,input,questionnaire pm_land_start,input,questionnaire pcm_land,input,questionnaire +pm_prod_init,input,questionnaire From 5a5a4a9a1d801e8a17620c410eb698bcdf2ad560 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 10 Jul 2023 17:28:39 +0200 Subject: [PATCH 02/43] linear version --- .../17_production/flexreg_apr16/presolve.gms | 3 +- .../foragebased_aug18/declarations.gms | 22 ++--- .../foragebased_aug18/equations.gms | 3 +- .../foragebased_aug18/postsolve.gms | 84 ++++++++++--------- .../foragebased_aug18/presolve.gms | 3 +- modules/71_disagg_lvst/off/not_used.txt | 1 - 6 files changed, 62 insertions(+), 54 deletions(-) diff --git a/modules/17_production/flexreg_apr16/presolve.gms b/modules/17_production/flexreg_apr16/presolve.gms index c28ba01644..c0def1bbc7 100644 --- a/modules/17_production/flexreg_apr16/presolve.gms +++ b/modules/17_production/flexreg_apr16/presolve.gms @@ -13,7 +13,8 @@ pm_prod_init(j,"pasture")=sum(w,pm_land_start(j,"past")*pm_yields_semi_calib(j," if (ord(t) = 1, $ifthen "%c17_prod_init%" == "on" -vm_prod.l(j,kcr) = pm_prod_init(j,kcr); +vm_prod.l(j,kve) = pm_prod_init(j,kve); +vm_prod_reg.l(i,kve) = sum(cell(i,j), pm_prod_init(j,kve)); $endif ); diff --git a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms index f22e4c9527..03a35e7a2e 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/declarations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/declarations.gms @@ -9,6 +9,7 @@ positive variables v71_feed_forage(j,kforage) Production of forage within a cell (mio. tDM per yr) v71_additional_mon(j, kli_mon) Additional punished production of monogastric livestock (mio. tDM per yr) vm_costs_additional_mon(i) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + v71_additional_feed_balanceflow(j,kforage) Additional punished production of ruminant feed (mio. tDM per yr) ; variables @@ -37,15 +38,16 @@ scalars *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov71_feed_forage(t,j,kforage,type) Production of forage within a cell (mio. tDM per yr) - ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) - ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) - ov71_feed_balanceflow(t,j,kforage,type) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) - oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) - oq71_feed_forage(t,j,type) Forage feed constraint (mio. tDM per yr) - oq71_feed_balanceflow_nlp(t,j,type) Non-linear balanceflow constraint for forage feed products (mio. tDM per yr) - oq71_feed_balanceflow_lp(t,i,type) Linear balanceflow constraint for forage feed products (mio. tDM per yr) - oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) - oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) + ov71_feed_forage(t,j,kforage,type) Production of forage within a cell (mio. tDM per yr) + ov71_additional_mon(t,j,kli_mon,type) Additional punished production of monogastric livestock (mio. tDM per yr) + ov_costs_additional_mon(t,i,type) Punishment cost for additionally transported monogastric livst_egg (mio. USD05MER per yr) + ov71_additional_feed_balanceflow(t,j,kforage,type) Additional punished production of ruminant feed (mio. tDM per yr) + ov71_feed_balanceflow(t,j,kforage,type) Cellular feed balanceflow for forage feed for ruminant livestock (mio. tDM per yr) + oq71_feed_rum_liv(t,j,kforage,type) Production constraint for ruminant livestock products (mio. tDM per yr) + oq71_feed_forage(t,j,type) Forage feed constraint (mio. tDM per yr) + oq71_feed_balanceflow_nlp(t,j,type) Non-linear balanceflow constraint for forage feed products (mio. tDM per yr) + oq71_feed_balanceflow_lp(t,i,type) Linear balanceflow constraint for forage feed products (mio. tDM per yr) + oq71_prod_mon_liv(t,j,kli_mon,type) Production constraint for monogastric livestock products (mio. tDM per yr) + oq71_punishment_mon(t,i,type) Punishment for additional monogastrics (mio. USD05MER per yr) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/equations.gms b/modules/71_disagg_lvst/foragebased_aug18/equations.gms index a80b344d80..ab113dd651 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/equations.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/equations.gms @@ -33,7 +33,7 @@ q71_feed_forage(j2) .. *' In each cluster the balance flow is constrained by its share of livestock production regarding the regional level by q71_feed_balanceflow_nlp(j2)$(s71_lp_fix=0) .. - sum(kforage, v71_feed_balanceflow(j2,kforage)) =e= + sum(kforage, v71_feed_balanceflow(j2,kforage) + v71_additional_feed_balanceflow(j2,kforage)) =e= sum((ct,cell(i2,j2),kli_rum,kforage), fm_feed_balanceflow(ct,i2,kli_rum,kforage) * i71_forage_cell_prod_share(j2,kforage)); @@ -68,6 +68,7 @@ q71_prod_mon_liv(j2,kli_mon) .. q71_punishment_mon(i2) .. vm_costs_additional_mon(i2) =e= sum((cell(i2,j2),kli_mon), v71_additional_mon(j2,kli_mon)) * s71_punish_additional_mon + + sum((cell(i2,j2),kforage), v71_additional_feed_balanceflow(j2,kforage)) * s71_punish_additional_mon ; *' Note that the punishment costs are based on transport costs and scaled up by one order of magnitude diff --git a/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms b/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms index 959882e6e9..3811083888 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/postsolve.gms @@ -6,44 +6,48 @@ *** | Contact: magpie@pik-potsdam.de *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov71_feed_forage(t,j,kforage,"marginal") = v71_feed_forage.m(j,kforage); - ov71_additional_mon(t,j,kli_mon,"marginal") = v71_additional_mon.m(j,kli_mon); - ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); - ov71_feed_balanceflow(t,j,kforage,"marginal") = v71_feed_balanceflow.m(j,kforage); - oq71_feed_rum_liv(t,j,kforage,"marginal") = q71_feed_rum_liv.m(j,kforage); - oq71_feed_forage(t,j,"marginal") = q71_feed_forage.m(j); - oq71_feed_balanceflow_nlp(t,j,"marginal") = q71_feed_balanceflow_nlp.m(j); - oq71_feed_balanceflow_lp(t,i,"marginal") = q71_feed_balanceflow_lp.m(i); - oq71_prod_mon_liv(t,j,kli_mon,"marginal") = q71_prod_mon_liv.m(j,kli_mon); - oq71_punishment_mon(t,i,"marginal") = q71_punishment_mon.m(i); - ov71_feed_forage(t,j,kforage,"level") = v71_feed_forage.l(j,kforage); - ov71_additional_mon(t,j,kli_mon,"level") = v71_additional_mon.l(j,kli_mon); - ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); - ov71_feed_balanceflow(t,j,kforage,"level") = v71_feed_balanceflow.l(j,kforage); - oq71_feed_rum_liv(t,j,kforage,"level") = q71_feed_rum_liv.l(j,kforage); - oq71_feed_forage(t,j,"level") = q71_feed_forage.l(j); - oq71_feed_balanceflow_nlp(t,j,"level") = q71_feed_balanceflow_nlp.l(j); - oq71_feed_balanceflow_lp(t,i,"level") = q71_feed_balanceflow_lp.l(i); - oq71_prod_mon_liv(t,j,kli_mon,"level") = q71_prod_mon_liv.l(j,kli_mon); - oq71_punishment_mon(t,i,"level") = q71_punishment_mon.l(i); - ov71_feed_forage(t,j,kforage,"upper") = v71_feed_forage.up(j,kforage); - ov71_additional_mon(t,j,kli_mon,"upper") = v71_additional_mon.up(j,kli_mon); - ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); - ov71_feed_balanceflow(t,j,kforage,"upper") = v71_feed_balanceflow.up(j,kforage); - oq71_feed_rum_liv(t,j,kforage,"upper") = q71_feed_rum_liv.up(j,kforage); - oq71_feed_forage(t,j,"upper") = q71_feed_forage.up(j); - oq71_feed_balanceflow_nlp(t,j,"upper") = q71_feed_balanceflow_nlp.up(j); - oq71_feed_balanceflow_lp(t,i,"upper") = q71_feed_balanceflow_lp.up(i); - oq71_prod_mon_liv(t,j,kli_mon,"upper") = q71_prod_mon_liv.up(j,kli_mon); - oq71_punishment_mon(t,i,"upper") = q71_punishment_mon.up(i); - ov71_feed_forage(t,j,kforage,"lower") = v71_feed_forage.lo(j,kforage); - ov71_additional_mon(t,j,kli_mon,"lower") = v71_additional_mon.lo(j,kli_mon); - ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); - ov71_feed_balanceflow(t,j,kforage,"lower") = v71_feed_balanceflow.lo(j,kforage); - oq71_feed_rum_liv(t,j,kforage,"lower") = q71_feed_rum_liv.lo(j,kforage); - oq71_feed_forage(t,j,"lower") = q71_feed_forage.lo(j); - oq71_feed_balanceflow_nlp(t,j,"lower") = q71_feed_balanceflow_nlp.lo(j); - oq71_feed_balanceflow_lp(t,i,"lower") = q71_feed_balanceflow_lp.lo(i); - oq71_prod_mon_liv(t,j,kli_mon,"lower") = q71_prod_mon_liv.lo(j,kli_mon); - oq71_punishment_mon(t,i,"lower") = q71_punishment_mon.lo(i); + ov71_feed_forage(t,j,kforage,"marginal") = v71_feed_forage.m(j,kforage); + ov71_additional_mon(t,j,kli_mon,"marginal") = v71_additional_mon.m(j,kli_mon); + ov_costs_additional_mon(t,i,"marginal") = vm_costs_additional_mon.m(i); + ov71_additional_feed_balanceflow(t,j,kforage,"marginal") = v71_additional_feed_balanceflow.m(j,kforage); + ov71_feed_balanceflow(t,j,kforage,"marginal") = v71_feed_balanceflow.m(j,kforage); + oq71_feed_rum_liv(t,j,kforage,"marginal") = q71_feed_rum_liv.m(j,kforage); + oq71_feed_forage(t,j,"marginal") = q71_feed_forage.m(j); + oq71_feed_balanceflow_nlp(t,j,"marginal") = q71_feed_balanceflow_nlp.m(j); + oq71_feed_balanceflow_lp(t,i,"marginal") = q71_feed_balanceflow_lp.m(i); + oq71_prod_mon_liv(t,j,kli_mon,"marginal") = q71_prod_mon_liv.m(j,kli_mon); + oq71_punishment_mon(t,i,"marginal") = q71_punishment_mon.m(i); + ov71_feed_forage(t,j,kforage,"level") = v71_feed_forage.l(j,kforage); + ov71_additional_mon(t,j,kli_mon,"level") = v71_additional_mon.l(j,kli_mon); + ov_costs_additional_mon(t,i,"level") = vm_costs_additional_mon.l(i); + ov71_additional_feed_balanceflow(t,j,kforage,"level") = v71_additional_feed_balanceflow.l(j,kforage); + ov71_feed_balanceflow(t,j,kforage,"level") = v71_feed_balanceflow.l(j,kforage); + oq71_feed_rum_liv(t,j,kforage,"level") = q71_feed_rum_liv.l(j,kforage); + oq71_feed_forage(t,j,"level") = q71_feed_forage.l(j); + oq71_feed_balanceflow_nlp(t,j,"level") = q71_feed_balanceflow_nlp.l(j); + oq71_feed_balanceflow_lp(t,i,"level") = q71_feed_balanceflow_lp.l(i); + oq71_prod_mon_liv(t,j,kli_mon,"level") = q71_prod_mon_liv.l(j,kli_mon); + oq71_punishment_mon(t,i,"level") = q71_punishment_mon.l(i); + ov71_feed_forage(t,j,kforage,"upper") = v71_feed_forage.up(j,kforage); + ov71_additional_mon(t,j,kli_mon,"upper") = v71_additional_mon.up(j,kli_mon); + ov_costs_additional_mon(t,i,"upper") = vm_costs_additional_mon.up(i); + ov71_additional_feed_balanceflow(t,j,kforage,"upper") = v71_additional_feed_balanceflow.up(j,kforage); + ov71_feed_balanceflow(t,j,kforage,"upper") = v71_feed_balanceflow.up(j,kforage); + oq71_feed_rum_liv(t,j,kforage,"upper") = q71_feed_rum_liv.up(j,kforage); + oq71_feed_forage(t,j,"upper") = q71_feed_forage.up(j); + oq71_feed_balanceflow_nlp(t,j,"upper") = q71_feed_balanceflow_nlp.up(j); + oq71_feed_balanceflow_lp(t,i,"upper") = q71_feed_balanceflow_lp.up(i); + oq71_prod_mon_liv(t,j,kli_mon,"upper") = q71_prod_mon_liv.up(j,kli_mon); + oq71_punishment_mon(t,i,"upper") = q71_punishment_mon.up(i); + ov71_feed_forage(t,j,kforage,"lower") = v71_feed_forage.lo(j,kforage); + ov71_additional_mon(t,j,kli_mon,"lower") = v71_additional_mon.lo(j,kli_mon); + ov_costs_additional_mon(t,i,"lower") = vm_costs_additional_mon.lo(i); + ov71_additional_feed_balanceflow(t,j,kforage,"lower") = v71_additional_feed_balanceflow.lo(j,kforage); + ov71_feed_balanceflow(t,j,kforage,"lower") = v71_feed_balanceflow.lo(j,kforage); + oq71_feed_rum_liv(t,j,kforage,"lower") = q71_feed_rum_liv.lo(j,kforage); + oq71_feed_forage(t,j,"lower") = q71_feed_forage.lo(j); + oq71_feed_balanceflow_nlp(t,j,"lower") = q71_feed_balanceflow_nlp.lo(j); + oq71_feed_balanceflow_lp(t,i,"lower") = q71_feed_balanceflow_lp.lo(i); + oq71_prod_mon_liv(t,j,kli_mon,"lower") = q71_prod_mon_liv.lo(j,kli_mon); + oq71_punishment_mon(t,i,"lower") = q71_punishment_mon.lo(i); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/71_disagg_lvst/foragebased_aug18/presolve.gms b/modules/71_disagg_lvst/foragebased_aug18/presolve.gms index 4f4d83ccd2..70d4ee4a61 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/presolve.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/presolve.gms @@ -6,6 +6,7 @@ *** | Contact: magpie@pik-potsdam.de i71_forage_cell_prod_share(j,kforage) = - pm_prod_init(j,kforage) / (sum(cell(i,j),sum(cell2(i,j3), pm_prod_init(j3,kforage))) + 10**(-6)); +* vm_prod.l(j,kforage) / (sum(cell(i,j),sum(cell2(i,j3), vm_prod.l(j3,kforage))) + 10**(-6)); + vm_prod.l(j,kforage) / (sum(cell(i,j), vm_prod_reg.l(i,kforage)) + 10**(-6)); * Note that $10^{-6}$ is required to avoid division by zero. diff --git a/modules/71_disagg_lvst/off/not_used.txt b/modules/71_disagg_lvst/off/not_used.txt index d45fbf352a..79577f6d78 100644 --- a/modules/71_disagg_lvst/off/not_used.txt +++ b/modules/71_disagg_lvst/off/not_used.txt @@ -5,4 +5,3 @@ vm_prod,input,questionnaire vm_prod_reg,input,questionnaire pm_land_start,input,questionnaire pcm_land,input,questionnaire -pm_prod_init,input,questionnaire From 63c23829ab44346aa27f26ee4915c50c13fca3ae Mon Sep 17 00:00:00 2001 From: Isabelle Weindl Date: Fri, 14 Jul 2023 15:20:25 +0200 Subject: [PATCH 03/43] temporal development of milk demand is integrated in the calculation of the pasture management factor --- .../15_food/anthro_iso_jun22/equations.gms | 2 +- .../15_food/anthro_iso_jun22/exodietmacro.gms | 2 +- modules/15_food/anthro_iso_jun22/input.gms | 4 +-- modules/15_food/anthro_iso_jun22/preloop.gms | 4 +-- modules/15_food/anthro_iso_jun22/sets.gms | 7 ++--- .../anthropometrics_jan18/equations.gms | 2 +- .../15_food/anthropometrics_jan18/input.gms | 4 +-- .../anthropometrics_jan18/intersolve.gms | 2 +- .../15_food/anthropometrics_jan18/preloop.gms | 4 +-- .../anthropometrics_jan18/presolve.gms | 2 +- .../15_food/anthropometrics_jan18/sets.gms | 7 ++--- modules/16_demand/sector_may15/sets.gms | 12 +++++++++ modules/31_past/grasslands_apr22/input.gms | 2 +- modules/51_nitrogen/module.gms | 1 - .../70_livestock/fbask_jan16/declarations.gms | 3 ++- modules/70_livestock/fbask_jan16/presolve.gms | 27 ++++++++++++++----- 16 files changed, 56 insertions(+), 29 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index 6cb9c227b4..421dd270e5 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -9,7 +9,7 @@ q15_food_demand(i2,kfo) .. (vm_dem_food(i2,kfo) + sum(ct, f15_household_balanceflow(ct,i2,kfo,"dm"))) - * sum(ct,(f15_nutrition_attributes(ct,kfo,"kcal") * 10**6)) =g= + * sum(ct,(fm_nutrition_attributes(ct,kfo,"kcal") * 10**6)) =g= sum(ct,im_pop(ct,i2) * p15_kcal_pc_calibrated(ct,i2,kfo)) * 365 ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index ca0b6813d4..9821ded778 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -108,7 +108,7 @@ if (s15_run_diet_postprocessing = 1, + p15_kcal_pc_iso_rumdairy_orig(t,iso) * (1- i15_rumdairy_fadeout(t,iso))); *** Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day - i15_protein_to_kcal_ratio(t,kfo) = f15_nutrition_attributes(t,kfo,"protein")/f15_nutrition_attributes(t,kfo,"kcal"); + i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein")/fm_nutrition_attributes(t,kfo,"kcal"); * Before the substitution, kfo_rd is converted from kcal/cap/day to g protein/cap/day * using i15_protein_to_kcal_ratio(t,kfo_rd). * After the substitution of kfo_rd with SCP (1-i15_rumdairy_scp_fadeout), SCP is converted diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index 45e9a4493e..56e930f351 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -29,7 +29,7 @@ $setglobal c15_fishscen constant $setglobal c15_alcscen constant $setglobal c15_livescen constant $setglobal c15_rumdairyscen constant -$setglobal c15_rumdairy_scp_scen constant +$setglobal c15_rumdairy_scp_scen sigmoid_20pc_20_50 $setglobal c15_livescen_target constant $setglobal c15_exo_foodscen lin_zero_20_50 @@ -124,7 +124,7 @@ $ondelim $include "./modules/15_food/input/f15_household_balanceflow.cs3" $offdelim; -table f15_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) +table fm_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) $ondelim $include "./modules/15_food/input/f15_nutrition_attributes.cs3" $offdelim; diff --git a/modules/15_food/anthro_iso_jun22/preloop.gms b/modules/15_food/anthro_iso_jun22/preloop.gms index 80684940c3..0397c55f4b 100644 --- a/modules/15_food/anthro_iso_jun22/preloop.gms +++ b/modules/15_food/anthro_iso_jun22/preloop.gms @@ -92,7 +92,7 @@ $else $endif * initial prices in $US per Kcal -i15_prices_initial_kcal(iso,kfo)$(f15_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) - / (f15_nutrition_attributes("y1995",kfo,"kcal")*10**6); +i15_prices_initial_kcal(iso,kfo)$(fm_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) + / (fm_nutrition_attributes("y1995",kfo,"kcal")*10**6); p15_prices_kcal(t,iso,kfo,"iter1")=i15_prices_initial_kcal(iso,kfo); p15_convergence_measure(t,iter15)=NA; diff --git a/modules/15_food/anthro_iso_jun22/sets.gms b/modules/15_food/anthro_iso_jun22/sets.gms index 942de46d9e..18f196764f 100644 --- a/modules/15_food/anthro_iso_jun22/sets.gms +++ b/modules/15_food/anthro_iso_jun22/sets.gms @@ -102,9 +102,6 @@ sets kfo_lp(kfo) Livestock food products / livst_rum,livst_pig,livst_chick, livst_egg, livst_milk / - kfo_rd(kfo) Ruminant meat and dairy food products - / livst_rum,livst_milk / - kfo_st(kfo) Staple products / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, potato,cassav_sp,sugr_cane,sugr_beet,molasses,brans,scp / @@ -148,6 +145,10 @@ sets livst_fadeoutscen15 Scenarios for changed composition of livestock products / halving2050, constant / +* The set kfo_rd can be defined in default.cfg and is used in the food substitution scenarios c15_rumdairy_scp_scen and c15_rumdairyscen + kfo_rd(kfo) Ruminant meat and dairy food products + / livst_rum,livst_milk / + fadeoutscen15 Food substitution scenarios including functional forms with targets and transition periods / constant, lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_zero_20_70, lin_50pc_20_50, lin_50pc_20_50_extend65, lin_50pc_20_50_extend80, diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms index 6cb9c227b4..421dd270e5 100644 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ b/modules/15_food/anthropometrics_jan18/equations.gms @@ -9,7 +9,7 @@ q15_food_demand(i2,kfo) .. (vm_dem_food(i2,kfo) + sum(ct, f15_household_balanceflow(ct,i2,kfo,"dm"))) - * sum(ct,(f15_nutrition_attributes(ct,kfo,"kcal") * 10**6)) =g= + * sum(ct,(fm_nutrition_attributes(ct,kfo,"kcal") * 10**6)) =g= sum(ct,im_pop(ct,i2) * p15_kcal_pc_calibrated(ct,i2,kfo)) * 365 ; diff --git a/modules/15_food/anthropometrics_jan18/input.gms b/modules/15_food/anthropometrics_jan18/input.gms index cbf8b2f6ac..895fe24a3a 100644 --- a/modules/15_food/anthropometrics_jan18/input.gms +++ b/modules/15_food/anthropometrics_jan18/input.gms @@ -29,7 +29,7 @@ $setglobal c15_fishscen constant $setglobal c15_alcscen constant $setglobal c15_livescen constant $setglobal c15_rumdairyscen constant -$setglobal c15_rumdairy_scp_scen constant +$setglobal c15_rumdairy_scp_scen sigmoid_20pc_20_50 $setglobal c15_livescen_target constant $setglobal c15_exo_foodscen lin_zero_20_50 @@ -105,7 +105,7 @@ $ondelim $include "./modules/15_food/input/f15_household_balanceflow.cs3" $offdelim; -table f15_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) +table fm_nutrition_attributes(t_all,kall,nutrition) Nutrition attributes of food items dedicated for fooduse (mio. kcal per tDM | t Protein per tDM) $ondelim $include "./modules/15_food/input/f15_nutrition_attributes.cs3" $offdelim; diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index c980023b73..a8326dab0a 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -222,7 +222,7 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) + p15_kcal_pc_calibrated_rumdairy_orig(t,i) * (1-i15_rumdairy_fadeout(t,i))); *** Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day -i15_protein_to_kcal_ratio(t,kfo) = f15_nutrition_attributes(t,kfo,"protein")/f15_nutrition_attributes(t,kfo,"kcal"); +i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein")/fm_nutrition_attributes(t,kfo,"kcal"); * Before the substitution, kfo_rd is converted from kcal/cap/day to g protein/cap/day * using i15_protein_to_kcal_ratio(t,kfo_rd). * After the substitution of kfo_rd with SCP (1-i15_rumdairy_scp_fadeout), SCP is converted diff --git a/modules/15_food/anthropometrics_jan18/preloop.gms b/modules/15_food/anthropometrics_jan18/preloop.gms index 00e0fbe2ac..8d84dcd7c6 100644 --- a/modules/15_food/anthropometrics_jan18/preloop.gms +++ b/modules/15_food/anthropometrics_jan18/preloop.gms @@ -98,7 +98,7 @@ i15_exo_foodscen_fader(t,i) = (1-f15_food_substitution_fader(t,"%c15_exo_foodsce * initial prices in $US per Kcal -i15_prices_initial_kcal(iso,kfo)$(f15_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) - / (f15_nutrition_attributes("y1995",kfo,"kcal")*10**6); +i15_prices_initial_kcal(iso,kfo)$(fm_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) + / (fm_nutrition_attributes("y1995",kfo,"kcal")*10**6); p15_prices_kcal(t,iso,kfo,"iter1")=i15_prices_initial_kcal(iso,kfo); p15_convergence_measure(t,iter15)=NA; diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 4cb9ed673d..64ed7f2fe4 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -429,7 +429,7 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) + p15_kcal_pc_calibrated_rumdairy_orig(t,i) * (1-i15_rumdairy_fadeout(t,i))); *** Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day -i15_protein_to_kcal_ratio(t,kfo) = f15_nutrition_attributes(t,kfo,"protein")/f15_nutrition_attributes(t,kfo,"kcal"); +i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein")/fm_nutrition_attributes(t,kfo,"kcal"); * Before the substitution, kfo_rd is converted from kcal/cap/day to g protein/cap/day * using i15_protein_to_kcal_ratio(t,kfo_rd). * After the substitution of kfo_rd with SCP (1-i15_rumdairy_scp_fadeout), SCP is converted diff --git a/modules/15_food/anthropometrics_jan18/sets.gms b/modules/15_food/anthropometrics_jan18/sets.gms index 04a1576e6f..4f1ae4d1d5 100644 --- a/modules/15_food/anthropometrics_jan18/sets.gms +++ b/modules/15_food/anthropometrics_jan18/sets.gms @@ -102,9 +102,6 @@ sets kfo_lp(kfo) Livestock food products / livst_rum,livst_pig,livst_chick, livst_egg, livst_milk / - kfo_rd(kfo) Ruminant meat and dairy food products - / livst_rum,livst_milk / - kfo_st(kfo) Staple products / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, potato,cassav_sp,sugr_cane,sugr_beet,molasses,brans,scp / @@ -148,6 +145,10 @@ sets livst_fadeoutscen15 Scenarios for changed composition of livestock products / halving2050, constant / +* The set kfo_rd can be defined in default.cfg and is used in the food substitution scenarios c15_rumdairy_scp_scen and c15_rumdairyscen + kfo_rd(kfo) Ruminant meat and dairy food products + / livst_rum,livst_milk / + fadeoutscen15 Food substitution scenarios including functional forms with targets and transition periods / constant, lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_zero_20_70, lin_50pc_20_50, lin_50pc_20_50_extend65, lin_50pc_20_50_extend80, diff --git a/modules/16_demand/sector_may15/sets.gms b/modules/16_demand/sector_may15/sets.gms index 2fc3950776..7a4dc3cc8f 100644 --- a/modules/16_demand/sector_may15/sets.gms +++ b/modules/16_demand/sector_may15/sets.gms @@ -21,6 +21,18 @@ sets kli(kap) Livestock products / livst_rum, livst_pig, livst_chick, livst_egg, livst_milk / + kli_rd(kap) Ruminant meat and dairy products + / livst_rum,livst_milk / + + kap_to_kfo_ap(kap,kfo_ap) Mapping between animal products and animal food products + /livst_rum . livst_rum + livst_pig . livst_pig + livst_chick . livst_chick + livst_egg . livst_egg + livst_milk . livst_milk + fish . fish + / + kforestry(k) forestry products / wood, woodfuel / diff --git a/modules/31_past/grasslands_apr22/input.gms b/modules/31_past/grasslands_apr22/input.gms index 0896afc475..ae18cdf7fc 100644 --- a/modules/31_past/grasslands_apr22/input.gms +++ b/modules/31_past/grasslands_apr22/input.gms @@ -11,7 +11,7 @@ scalars s31_cost_grass_prod Grasslands factor costs (USD05MER per tDM) / 1 / ; -$setglobal c31_past_suit_scen ssp370 +$setglobal c31_past_suit_scen ssp245 table f31_pastr_suitability(t_all,j,ssp_past) Areas suitable for pasture management (mio. ha) $ondelim diff --git a/modules/51_nitrogen/module.gms b/modules/51_nitrogen/module.gms index 4b530725d6..e28a27bf21 100644 --- a/modules/51_nitrogen/module.gms +++ b/modules/51_nitrogen/module.gms @@ -14,7 +14,6 @@ *' @authors Benjamin Leon Bodirsky *###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%nitrogen%" == "ipcc2006_sep16" $include "./modules/51_nitrogen/ipcc2006_sep16/realization.gms" $Ifi "%nitrogen%" == "off" $include "./modules/51_nitrogen/off/realization.gms" $Ifi "%nitrogen%" == "rescaled_jan21" $include "./modules/51_nitrogen/rescaled_jan21/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index 71dc155495..d35eb4f5a4 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -23,7 +23,8 @@ parameters im_slaughter_feed_share(t_all,i,kap,attributes) Share of feed that is incorporated in animal biomass (1) i70_livestock_productivity(t_all,i,sys) Productivity indicator for livestock production (t FM per animal per yr) im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1) - p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil domestic food demand (mio. animals per yr) + p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil food demand for ruminant meat (mio. animals per yr) + p70_milk_cow_proxy(t,i) Proxy for milk cows needed to fullfil food demand for milk (mio. animals per yr) p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1) pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1) i70_cereal_scp_fadeout(t_all,i) Cereal feed fadeout (share 0-1) to be replaced by SCP (1) diff --git a/modules/70_livestock/fbask_jan16/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index 0e14beeb88..160dae859e 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -12,25 +12,38 @@ *' biophysical pasture yields in the module [14_yields]. *' The exogenous calculation of pasture management requires information on -*' the number of cattle reared to fulfil the domestic demand for ruminant +*' changes in the number of cattle reared to fulfil the food demand for ruminant *' livestock products: p70_cattle_stock_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_rum") - /i70_livestock_productivity(t,i,"sys_beef"); + /i70_livestock_productivity(t,i,"sys_beef"); -*' The lower bound for `p70_cattle_stock_proxy` is set to 20% of initial cattle -*' stocks in 1995: +p70_milk_cow_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_milk") + /i70_livestock_productivity(t,i,"sys_dairy"); + +*' The lower bound for `p70_cattle_stock_proxy` and `p70_milk_cow_proxy` is +*' set to 20% of initial values in 1995: p70_cattle_stock_proxy(t,i)$(p70_cattle_stock_proxy(t,i) < 0.2*p70_cattle_stock_proxy("y1995",i)) = 0.2*p70_cattle_stock_proxy("y1995",i); +p70_milk_cow_proxy(t,i)$(p70_milk_cow_proxy(t,i) < 0.2*p70_milk_cow_proxy("y1995",i)) = 0.2*p70_milk_cow_proxy("y1995",i); + -*' The parameter `p70_incr_cattle` describes the changes in cattle stocks +*' The parameter `p70_incr_cattle` describes the changes in the number of cattle *' relative to the previous time step: p70_incr_cattle(t,i) = 1$(ord(t)=1) - + (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i))$(ord(t)>1); + + ( + ( ( pm_kcal_pc_initial(t,i,"livst_rum")*im_feed_baskets(t,i,"livst_rum","pasture")/fm_nutrition_attributes(t,"livst_rum","kcal") ) + / sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) ) + * (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) + + + ( ( pm_kcal_pc_initial(t,i,"livst_milk")*im_feed_baskets(t,i,"livst_milk","pasture")/fm_nutrition_attributes(t,"livst_milk","kcal") ) + / sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) ) + *(p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) + )$(ord(t)>1); *' The pasture management factor is calculated by applying a linear relationship -*' that links changes in pasture management with changes in cattle stocks: +*' that links changes in pasture management with changes in the number of cattle: if (m_year(t) <= s70_past_mngmnt_factor_fix, pm_past_mngmnt_factor(t,i) = 1; From f57b06854bd3c37de2c37a55b39890bace7d7e12 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:00:25 +0200 Subject: [PATCH 04/43] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e20a9323f3..e58eb532a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start_functions.R can now handle clusters per region flexibly - **scripts** the REMIND-MAgPIE coupling now uses renv - **41_area_equipped_for_irrigation** new AEI data (Mehta2022) replacing old Siebert data +- **70_livestock** consideration of milk demand in the calculation of the pasture management factor ### added - **scripts** New output script for reporting disaggregated land use patterns to the SEALS (Spatial Economic Allocation Landscape Simulator) downscaling model From bf3c69a39aacb778575b10b5c5409dafd65279a1 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:23:34 +0200 Subject: [PATCH 05/43] Update declarations.gms --- modules/15_food/anthropometrics_jan18/declarations.gms | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 22224c44f3..79341f3bce 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -126,7 +126,6 @@ parameters * before shock o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - p15_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock on regional level (kcal per capita per day) pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) From 1a45f11ca499b9d02c06a253530efd6d6fb5b1c9 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:24:28 +0200 Subject: [PATCH 06/43] Update declarations.gms --- modules/15_food/anthro_iso_jun22/declarations.gms | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 89a8964cf8..b4e2d6df01 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -125,7 +125,6 @@ parameters * before shock o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - p15_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock on regional level (kcal per capita per day) pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) From 351b8b529020a7b262dd796b91617e01f58d0f6a Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Fri, 14 Jul 2023 16:36:17 +0200 Subject: [PATCH 07/43] Consistent use of s15_calibrate to switch on/off calibration --- modules/15_food/anthro_iso_jun22/exodietmacro.gms | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index 9821ded778..a8a5b23e44 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -28,8 +28,7 @@ if (s15_run_diet_postprocessing = 1, p15_bmi_shr_regr(t,iso,sex,age,bmi_group15) = v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) = - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)+ - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); + p15_bmi_shr_regr(t,iso,sex,age,bmi_group15) + i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) * s15_calibrate; * The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)$(p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)<0) = 0; From 616fb6937de17bede198bac05677df6e7526f4e4 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Sun, 16 Jul 2023 22:27:16 +0200 Subject: [PATCH 08/43] Update calibration --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index 821203f355..f796720c61 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -26,7 +26,7 @@ cfg$input <- c(regional = "rev4.87_h12_magpie.tgz", cellular = "rev4.87_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.87_h12_validation.tgz", additional = "additional_data_rev4.43.tgz", - calibration = "calibration_H12_per_ton_fao_may22_glo_08Jul23.tgz") + calibration = "calibration_H12_per_ton_fao_may22_glo_14Jul23.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 45d5a3e148a1c47020e08a7e4972cf54cff1be9e Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:35:09 +0200 Subject: [PATCH 09/43] Clean-up Co-authored-by: Jan Dietrich --- modules/15_food/anthro_iso_jun22/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index 56e930f351..099e6acbfc 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -29,7 +29,7 @@ $setglobal c15_fishscen constant $setglobal c15_alcscen constant $setglobal c15_livescen constant $setglobal c15_rumdairyscen constant -$setglobal c15_rumdairy_scp_scen sigmoid_20pc_20_50 +$setglobal c15_rumdairy_scp_scen constant $setglobal c15_livescen_target constant $setglobal c15_exo_foodscen lin_zero_20_50 From 11794298cccbd8943f65c217ac4305d5ab8adc02 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Wed, 19 Jul 2023 10:42:26 +0200 Subject: [PATCH 10/43] clean up Co-authored-by: Jan Dietrich --- modules/15_food/anthropometrics_jan18/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/15_food/anthropometrics_jan18/input.gms b/modules/15_food/anthropometrics_jan18/input.gms index 895fe24a3a..bd81857867 100644 --- a/modules/15_food/anthropometrics_jan18/input.gms +++ b/modules/15_food/anthropometrics_jan18/input.gms @@ -29,7 +29,7 @@ $setglobal c15_fishscen constant $setglobal c15_alcscen constant $setglobal c15_livescen constant $setglobal c15_rumdairyscen constant -$setglobal c15_rumdairy_scp_scen sigmoid_20pc_20_50 +$setglobal c15_rumdairy_scp_scen constant $setglobal c15_livescen_target constant $setglobal c15_exo_foodscen lin_zero_20_50 From 5546be91d2a0546936884f65750b86384a848098 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:34:04 +0200 Subject: [PATCH 11/43] clean up Co-authored-by: Jan Dietrich --- modules/31_past/grasslands_apr22/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/31_past/grasslands_apr22/input.gms b/modules/31_past/grasslands_apr22/input.gms index ae18cdf7fc..0896afc475 100644 --- a/modules/31_past/grasslands_apr22/input.gms +++ b/modules/31_past/grasslands_apr22/input.gms @@ -11,7 +11,7 @@ scalars s31_cost_grass_prod Grasslands factor costs (USD05MER per tDM) / 1 / ; -$setglobal c31_past_suit_scen ssp245 +$setglobal c31_past_suit_scen ssp370 table f31_pastr_suitability(t_all,j,ssp_past) Areas suitable for pasture management (mio. ha) $ondelim From cb65b5d0e94d1d1c94b4ffcb6e5f7542e730641f Mon Sep 17 00:00:00 2001 From: Isabelle Weindl Date: Wed, 19 Jul 2023 22:41:08 +0200 Subject: [PATCH 12/43] clean up and better readability --- modules/15_food/anthro_iso_jun22/declarations.gms | 2 +- .../anthropometrics_jan18/declarations.gms | 2 +- modules/16_demand/sector_may15/sets.gms | 9 --------- modules/70_livestock/fbask_jan16/declarations.gms | 1 + modules/70_livestock/fbask_jan16/presolve.gms | 15 ++++++++------- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index b4e2d6df01..b5f7cd8ef2 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -125,7 +125,7 @@ parameters * before shock o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) + pm_kcal_pc_initial(t,i,kall) Per capita consumption in food demand model before price shock (kcal per capita per day) p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) * after price shock diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 79341f3bce..072a935f0c 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -126,7 +126,7 @@ parameters * before shock o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day) + pm_kcal_pc_initial(t,i,kall) Per capita consumption in food demand model before price shock (kcal per capita per day) p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) * after price shock diff --git a/modules/16_demand/sector_may15/sets.gms b/modules/16_demand/sector_may15/sets.gms index 7a4dc3cc8f..2f2b3f9c5c 100644 --- a/modules/16_demand/sector_may15/sets.gms +++ b/modules/16_demand/sector_may15/sets.gms @@ -24,15 +24,6 @@ sets kli_rd(kap) Ruminant meat and dairy products / livst_rum,livst_milk / - kap_to_kfo_ap(kap,kfo_ap) Mapping between animal products and animal food products - /livst_rum . livst_rum - livst_pig . livst_pig - livst_chick . livst_chick - livst_egg . livst_egg - livst_milk . livst_milk - fish . fish - / - kforestry(k) forestry products / wood, woodfuel / diff --git a/modules/70_livestock/fbask_jan16/declarations.gms b/modules/70_livestock/fbask_jan16/declarations.gms index d35eb4f5a4..c6c5851514 100644 --- a/modules/70_livestock/fbask_jan16/declarations.gms +++ b/modules/70_livestock/fbask_jan16/declarations.gms @@ -25,6 +25,7 @@ parameters im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1) p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil food demand for ruminant meat (mio. animals per yr) p70_milk_cow_proxy(t,i) Proxy for milk cows needed to fullfil food demand for milk (mio. animals per yr) + p70_cattle_feed_pc_proxy(t,i,kli_rd) Proxy for daily per capita feed demand for pasture biomass driven by demand for beef and dairy products (tDM per capita per day) p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1) pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1) i70_cereal_scp_fadeout(t_all,i) Cereal feed fadeout (share 0-1) to be replaced by SCP (1) diff --git a/modules/70_livestock/fbask_jan16/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index 160dae859e..902ad25139 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -27,19 +27,20 @@ p70_milk_cow_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_milk") p70_cattle_stock_proxy(t,i)$(p70_cattle_stock_proxy(t,i) < 0.2*p70_cattle_stock_proxy("y1995",i)) = 0.2*p70_cattle_stock_proxy("y1995",i); p70_milk_cow_proxy(t,i)$(p70_milk_cow_proxy(t,i) < 0.2*p70_milk_cow_proxy("y1995",i)) = 0.2*p70_milk_cow_proxy("y1995",i); +*' The parameter `p70_cattle_feed_pc_proxy` is a proxy for regional daily per capita +*' feed demand for pasture biomass driven by demand for beef and dairy products, +*' which is later used for weighted aggregation. +p70_cattle_feed_pc_proxy(t,i,kli_rd) = pm_kcal_pc_initial(t,i,kli_rd)*im_feed_baskets(t,i,kli_rd,"pasture")/(fm_nutrition_attributes(t,kli_rd,"kcal") * 10**6); *' The parameter `p70_incr_cattle` describes the changes in the number of cattle *' relative to the previous time step: p70_incr_cattle(t,i) = 1$(ord(t)=1) + ( - ( ( pm_kcal_pc_initial(t,i,"livst_rum")*im_feed_baskets(t,i,"livst_rum","pasture")/fm_nutrition_attributes(t,"livst_rum","kcal") ) - / sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) ) - * (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) - + - ( ( pm_kcal_pc_initial(t,i,"livst_milk")*im_feed_baskets(t,i,"livst_milk","pasture")/fm_nutrition_attributes(t,"livst_milk","kcal") ) - / sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) ) - *(p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) + ( p70_cattle_feed_pc_proxy(t,i,"livst_rum") * (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) + + + p70_cattle_feed_pc_proxy(t,i,"livst_milk") * (p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) ) + / sum(kli_rd, p70_cattle_feed_pc_proxy(t,i,kli_rd) ) )$(ord(t)>1); *' The pasture management factor is calculated by applying a linear relationship From e27a70fdab046a1bb4b834ff57a6d160a31f5e3a Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Thu, 20 Jul 2023 15:10:40 +0200 Subject: [PATCH 13/43] Added information about new interface to the respective module description --- modules/15_food/module.gms | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/15_food/module.gms b/modules/15_food/module.gms index b228f51668..6df74f2de3 100644 --- a/modules/15_food/module.gms +++ b/modules/15_food/module.gms @@ -15,7 +15,9 @@ *' agricultural commodities q15_food_demand.m to change food demand and iterates *' with MAgPIE until a common solution is found. Outputs include next to food *' demand also projections of anthropometric parameters such as body height and -*' weight distribution, as well as phyiscal activity levels. +*' weight distribution, as well as phyiscal activity levels. In addition, this +*' module also provides information about nutrition attributes of foods that can +*' be used in other modules via the interface fm_nutrition_attributes. *' @authors Benjamin Leon Bodirsky, Isabelle Weindl, Jan Philipp Dietrich *###################### R SECTION START (MODULETYPES) ########################## From 5afe4f8b2bd9d490541b946971ce06a59564fa2b Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Thu, 27 Jul 2023 13:39:13 +0200 Subject: [PATCH 14/43] fixed disaggregation inaccuracies in luscale --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index ffe0b1d813..e23f4d8f05 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,7 @@ Imports: iamc, lucode2 (>= 0.36.0), luplot, - luscale, + luscale (>= 2.27.4), lusweave, m4fsdp, madrat, From 91182529406c18324d955f1883e61df8cdd2e34a Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Thu, 27 Jul 2023 13:55:18 +0200 Subject: [PATCH 15/43] updated changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b301ae8a8..6069243ba3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- +- ### added - @@ -18,13 +18,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **70_livestock** consideration of milk demand in the calculation of the pasture management factor +- **scripts** Fixed inaccuracies and inconsistent application of SNV policies during disaggregation in luscale::interpolateAvlCroplandWeighted(), which is called in extra/disaggregation.R ## [4.6.8] - 2023-07-17 ### changed - **41_area_equipped_for_irrigation** new AEI data (Mehta2022) replacing old Siebert data -- **80_optimization** printing of solprint when solver status is 7 re-activated +- **80_optimization** printing of solprint when solver status is 7 re-activated - **scripts** start_functions.R can now handle clusters per region flexibly - **scripts** the REMIND-MAgPIE coupling now uses renv From e27bafdaf88e7662b19575096a307270b9b99910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Thu, 27 Jul 2023 16:26:38 +0200 Subject: [PATCH 16/43] magpie release 4.6.9 --- .zenodo.json | 4 ++-- CHANGELOG.md | 15 ++++----------- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 2a350b0c8b..254e507cce 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.8dev", + "version": "4.6.9", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -109,5 +109,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2023-07-17" + "publication_date": "2023-07-27" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 6069243ba3..1550497d58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,16 +5,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] - -### changed -- - -### added -- - -### removed -- +## [4.6.9] - 2023-07-27 ### fixed - **70_livestock** consideration of milk demand in the calculation of the pasture management factor @@ -49,6 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** corrected wrong names of parameters for peatland costs - **config** updated scenario configs to newest preprocessing (4.87) + ## [4.6.7] - 2023-05-10 ### changed @@ -745,7 +737,8 @@ This release version is focussed on consistency between the MAgPIE setup and the First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.8...develop +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.9...develop +[4.6.9]: https://github.com/magpiemodel/magpie/compare/v4.6.8...v4.6.9 [4.6.8]: https://github.com/magpiemodel/magpie/compare/v4.6.7...v4.6.8 [4.6.7]: https://github.com/magpiemodel/magpie/compare/v4.6.6...v4.6.7 [4.6.6]: https://github.com/magpiemodel/magpie/compare/v4.6.5...v4.6.6 diff --git a/CITATION.cff b/CITATION.cff index 5f85de2e0d..843aea845c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,8 +125,8 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.8dev -date-released: 2023-07-17 +version: 4.6.9 +date-released: 2023-07-27 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index 5f15852147..9a13bf8260 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi A framework description paper has been published in Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 -The model documentation for version 4.6.8 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.6.8/ +The model documentation for version 4.6.9 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.6.9/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -188,7 +188,7 @@ magpie@pik-potsdam.de Please contact magpie@pik-potsdam.de ## CITATION -See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.8/#how-to-cite) in the model documentation for information how to cite the model. +See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.9/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff From 6de57e6f86c74812c83cb5fa4185534e3052b0c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Thu, 27 Jul 2023 16:43:17 +0200 Subject: [PATCH 17/43] dont install full deps in GHA --- .github/workflows/test-code.yaml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-code.yaml b/.github/workflows/test-code.yaml index cad05908ee..2a3831d0ab 100644 --- a/.github/workflows/test-code.yaml +++ b/.github/workflows/test-code.yaml @@ -27,12 +27,6 @@ jobs: with: extra-repositories: https://cloud.r-project.org https://rse.pik-potsdam.de/r/packages/ - - name: Install R dependencies - uses: r-lib/actions/setup-r-dependencies@v2 - with: - packages: gms - extra-packages: gms - - name: pre-commit Hook run: source(".githooks/pre-commit") shell: Rscript {0} From 39b9097d66f22302ad5ea17082e7810eacbe1c71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Thu, 27 Jul 2023 17:03:10 +0200 Subject: [PATCH 18/43] merge master into develop --- .zenodo.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ CITATION.cff | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index 254e507cce..d04a6a0a64 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.9", + "version": "4.6.9dev", "creators": [ { "name": "Dietrich, Jan Philipp", diff --git a/CHANGELOG.md b/CHANGELOG.md index 1550497d58..4523f72d5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### changed +- + +### added +- + +### removed +- + +### fixed +- + + ## [4.6.9] - 2023-07-27 ### fixed diff --git a/CITATION.cff b/CITATION.cff index 843aea845c..8a4be0b247 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,7 +125,7 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.9 +version: 4.6.9dev date-released: 2023-07-27 repository-code: https://github.com/magpiemodel/magpie keywords: From be5771d547250f92cc7e06844072a4b2f8b3f0fb Mon Sep 17 00:00:00 2001 From: orichters Date: Wed, 2 Aug 2023 11:26:08 +0200 Subject: [PATCH 19/43] remove check_config warning about c_input_gdx_path for empty model --- CHANGELOG.md | 2 +- scripts/start_functions.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4523f72d5d..66e2501a97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ### fixed -- +- **scripts** check_config does not warn about c_input_gdx_path anymore while running empty model ## [4.6.9] - 2023-07-27 diff --git a/scripts/start_functions.R b/scripts/start_functions.R index 25de9122b7..55bda9ae88 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -244,7 +244,7 @@ start_run <- function(cfg, scenario = NULL, codeCheck = TRUE, lock_model = TRUE) # Apply scenario settings ans check configuration file for consistency if(!is.null(scenario)) cfg <- gms::setScenario(cfg,scenario) - cfg <- gms::check_config(cfg, extras = c("info", "repositories"), saveCheck = TRUE) + cfg <- gms::check_config(cfg, extras = c("info", "repositories", "gms$c_input_gdx_path"), saveCheck = TRUE) # save model version cfg$info$version <- citation::read_cff("CITATION.cff")$version From 73eee2d9b14eead2cd8b07c28dc1313d10b60807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Tue, 8 Aug 2023 12:56:04 +0200 Subject: [PATCH 20/43] faster runfolder scan --- output.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/output.R b/output.R index a3c9395412..24eec3ca94 100644 --- a/output.R +++ b/output.R @@ -35,7 +35,7 @@ library(gms) runOutputs <- function(comp=NULL, output=NULL, outputdir=NULL, submit=NULL) { choose_folder <- function(title="Please choose a folder") { # try to use find because it is significantly quicker than list.dirs - tmp <- try(system("find ./output -name 'full.gms'", intern=TRUE, ignore.stderr = TRUE), silent=TRUE) + tmp <- try(system("find ./output -path './output/*/renv' -prune -o -name 'full.gms'", intern=TRUE, ignore.stderr = TRUE), silent=TRUE) if("try-error" %in% class(tmp) || length(tmp)==0) { tmp <- base::list.dirs("./output/",recursive=TRUE) dirs <- NULL @@ -43,6 +43,7 @@ runOutputs <- function(comp=NULL, output=NULL, outputdir=NULL, submit=NULL) { if (file.exists(file.path(tmp[i],"full.gms"))) dirs <- c(dirs,sub("./output/","",tmp[i])) } } else { + tmp <- grep("/full.gms$", tmp, value = TRUE) dirs <- sub("full.gms","",sub("./output/","",tmp, fixed=TRUE), fixed=TRUE) } dirs <- sort(dirs) From f70b1cd83937480583bee18f48e525d86f3bb05d Mon Sep 17 00:00:00 2001 From: caviddhen Date: Wed, 9 Aug 2023 16:59:54 +0200 Subject: [PATCH 21/43] update input data --- CHANGELOG.md | 4 +- config/default.cfg | 10 +-- config/scenario_config.csv | 172 ++++++++++++++++++------------------- 3 files changed, 94 insertions(+), 92 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4523f72d5d..93ca1b2efd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- +- **config** update preprocessing to newest input data v4.88 with new transport costs +- **scenario_config.csv** update preprocessing to newest input data v4.88 + ### added - diff --git a/config/default.cfg b/config/default.cfg index f796720c61..3d0ab80977 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.87_h12_magpie.tgz", - cellular = "rev4.87_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.87_h12_validation.tgz", +cfg$input <- c(regional = "rev4.88_h12_magpie.tgz", + cellular = "rev4.88_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.88_h12_validation.tgz", additional = "additional_data_rev4.43.tgz", - calibration = "calibration_H12_per_ton_fao_may22_glo_14Jul23.tgz") + calibration = "calibration_H12_per_ton_fao_may22_glo_08Aug23.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, @@ -95,7 +95,7 @@ cfg$restart_landconversion_cost <- FALSE # def = FALSE # calibration factor in each calibration iteration (0-1) cfg$damping_factor_landconversion_cost <- 0.96 # def= 0.96 # Set upper limit for cropland calibration factor -cfg$cost_calib_max_landconversion_cost <- 3 # def= 3 +cfg$cost_calib_max_landconversion_cost <- 3 # def= 3 # Set lower limit for cropland calibration factor cfg$cost_calib_min_landconversion_cost <- 0.05 # def= 0.05 # Selection type of calibration factors. diff --git a/config/scenario_config.csv b/config/scenario_config.csv index c1a5b1695b..47a89897eb 100644 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,86 +1,86 @@ -;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;BASE;NPI;NDC;coupling;emulator;input;Tland;eat_lancet_diet;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn;ForestryEndo;ForestryExo;ForestryOff;frst_shock_none;frst_shock_002lin2030;frst_shock_004lin2030;frst_shock_008lin2030;frst_shock_016lin2030;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5;NGFS_o_lowdem -gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; -gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; -gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; -gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2 -gms$c15_food_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2 -gms$s15_elastic_demand;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;0;0;0;0;0;0;;;;;;;;;;;;;;;;;;; -gms$c15_rumdairy_scp_scen;;;;constant;constant;constant;constant;constant;constant;constant;sigmoid_50pc_20_50;constant;constant;;;;;;;constant;;;;;;;;;;;;;;;;;;;;;;;;; -gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c15_exo_foodscen;;;;;;;;;;lin_zero_20_50;lin_zero_20_50;lin_zero_20_50;lin_zero_20_70;;;;;;;lin_zero_20_50;lin_zero_20_50;;lin_zero_20_50;;;lin_zero_20_50;;;;;;;;;;;;;;;;;;;lin_zero_20_50 -gms$s15_exo_waste;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1 -gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;1.2;1.2;;1.2;;;1.2;;;;;;;;;;;;;;;;;;;1.2 -gms$s15_exo_diet;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1 -gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;healthy_BMI;;healthy_BMI;;;healthy_BMI;;;;;;;;;;;;;;;;;;;healthy_BMI -gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;FLX;;FLX;;;FLX;;;;;;;;;;;;;;;;;;; -gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;;;;;;;;;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070;;;;;;;;;;;;;;;;;;; -gms$c22_protect_scenario;;;;none;none;none;none;none;none;BH;none;BH_IFL;BH;;;;;;;BH;;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL;;;;;;;;;;;;;;;;;;; -gms$c22_protect_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none;BH_IFL;;;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s30_snv_shr;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;; -gms$s30_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;; -gms$s30_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;; -gms$c31_past_suit_scen;;nocc;nocc_hist;ssp126;ssp245;ssp245;ssp370;ssp460;ssp585;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ssp126;ssp126;ssp245;ssp460;ssp370;ssp585; -gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_aff_plantation;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_aff_bii_coeff;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_max_aff_area;;;;Inf;Inf;Inf;Inf;Inf;Inf;500;350;0;700;;;;;;;500;;Inf;Inf;Inf;500;500;;;;;;;;;;;;;;;;;;; -gms$c32_aff_mask;;;;noboreal;noboreal;noboreal;noboreal;noboreal;noboreal;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;onlytropical;;noboreal;noboreal;noboreal;noboreal;noboreal;;;;;;;;;;;;;;;;;;; -gms$c34_urban_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; -gms$c32_aff_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; -gms$s32_planing_horizon;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c35_ad_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; -gms$c35_aolc_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; -gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;2030;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;; -gms$s42_watdem_nonagr_scenario;;;;1;2;2;3;2;1;1;1;3;1;;;;;;;;;2;1;2;2;1;;;;;;;;;;;;;;;;;;; -gms$s42_irrig_eff_scenario;;;;2;2;2;2;2;2;3;3;3;3;;;;;;;3;;3;3;3;3;3;;;;;;;;;;;;;;;;;;; -gms$c42_env_flow_policy;;;;on;off;off;off;mixed;on;on;on;on;on;;;;;;;on;;on;on;on;on;on;;;;;;;;;;;;;;;;;;; -gms$s42_efp_targetyear;;;;2040;2040;2040;2040;2040;2040;2040;2050;2070;2050;;;;;;;2040;;2040;2040;2040;2040;2040;;;;;;;;;;;;;;;;;;; -gms$s44_target_price;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;;;;;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff_noselect;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;;;;;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;;;;;;;;;;;;;;;;;;; -gms$c55_scen_conf;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;;;; -gms$c55_scen_conf_noselect;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;ssp4;ssp4;ssp1;ssp4;ssp1;;;;;;;;;;;;;;;;;;; -gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; -gms$c56_pollutant_prices_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; -gms$s56_c_price_exp_aff;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_buffer_aff;;;;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.5;0.2;0.3;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;;;;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+_nosoil;all_nosoil;;;;;;;redd+natveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$maccs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; -gms$c60_2ndgen_biodem_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; -gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;phaseout2020;;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;;;; -gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;1;1;1;1;1;;;;;;;;;;;;;;;;;;; -gms$c60_bioenergy_subsidy;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;sdp;;ssp4;sdp;ssp4;ssp4;sdp;;;;;;;;;;;;;;;;;;; -gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;; -gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;; -gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; -gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; -gms$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; -gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; -gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;cc;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; -gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;4;4;0;;;;;;;;;;;; -gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;; -gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;; -gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;; -gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;; -gms$s35_forest_damage;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;; -gms$c32_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;; -gms$c35_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.87_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.87_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.87_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.87_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.87_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.87_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz; -gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU; -gms$c57_macc_version;;;;;;;;;;;;;;;;;;;;;;;;;;;PBL_2022;PBL_2022;PBL_2022;PBL_2022;;;;;;;;;;;;;;; -gms$c57_macc_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;Default;Optimistic;Default;Optimistic;;;;;;;;;;;;;;; -gms$s58_rewetting_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;0;1;0;1;;;;;;;;;;;;;;; +,cc,nocc,nocc_hist,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SDP,SDP-EI,SDP-RC,SDP-MC,BASE,NPI,NDC,coupling,emulator,input,Tland,eat_lancet_diet,LAMA_Inequal,LAMA_Inequal-SustDemand,LAMA_Inequal-EnvirProt,LAMA_Inequal-GHGPrice,LAMA_Sustainability,NAVIGATE_AllOff,NAVIGATE_LandSup,NAVIGATE_LandDem,NAVIGATE_AllOn,ForestryEndo,ForestryExo,ForestryOff,frst_shock_none,frst_shock_002lin2030,frst_shock_004lin2030,frst_shock_008lin2030,frst_shock_016lin2030,rcp1p9,rcp2p6,rcp4p5,rcp6p0,rcp7p0,rcp8p5,NGFS_o_lowdem +gms$c09_pop_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP1,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, +gms$c09_gdp_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SDP_EI,SDP_RC,SDP_MC,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, +gms$c09_pal_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, +gms$c15_food_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,,SSP2 +gms$c15_food_scenario_noselect,,,,,,,,,,,,,,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,,SSP2 +gms$s15_elastic_demand,,,,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,, +gms$c15_rumdairy_scp_scen,,,,constant,constant,constant,constant,constant,constant,constant,sigmoid_50pc_20_50,constant,constant,,,,,,,constant,,,,,,,,,,,,,,,,,,,,,,,,, +gms$kfo_rd,,,,,,,,,,,livst_rum,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c15_exo_foodscen,,,,,,,,,,lin_zero_20_50,lin_zero_20_50,lin_zero_20_50,lin_zero_20_70,,,,,,,lin_zero_20_50,lin_zero_20_50,,lin_zero_20_50,,,lin_zero_20_50,,,,,,,,,,,,,,,,,,,lin_zero_20_50 +gms$s15_exo_waste,,,,0,0,0,0,0,0,1,1,1,1,,,,,,,1,0,0,1,0,0,1,0,0,1,1,,,,,,,,,,,,,,,1 +gms$s15_waste_scen,,,,,,,,,,1.2,1.3,1.2,1.25,,,,,,,1.2,1.2,,1.2,,,1.2,,,,,,,,,,,,,,,,,,,1.2 +gms$s15_exo_diet,,,,0,0,0,0,0,0,1,1,1,1,,,,,,,1,1,0,1,0,0,1,0,0,1,1,,,,,,,,,,,,,,,1 +gms$c15_kcal_scen,,,,,,,,,,healthy_BMI,no_underweight,healthy_BMI,healthy_BMI,,,,,,,healthy_BMI,healthy_BMI,,healthy_BMI,,,healthy_BMI,,,,,,,,,,,,,,,,,,,healthy_BMI +gms$c15_EAT_scen,,,,,,,,,,FLX,,FLX,FLX,,,,,,,FLX,FLX,,FLX,,,FLX,,,,,,,,,,,,,,,,,,, +gms$s15_exo_monogastric,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_ruminant,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_fish,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_fruitvegnut,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_pulses,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_sugar,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_oils,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_brans,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_scp,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$s15_exo_alcohol,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$c21_trade_liberalization,,,,l908080r807070,l909090r808080,l909090r808080,l909595r809090,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l909595r809090,l908080r807070,,,,,,,,,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l908080r807070,,,,,,,,,,,,,,,,,,, +gms$c22_protect_scenario,,,,none,none,none,none,none,none,BH,none,BH_IFL,BH,,,,,,,BH,,BH_IFL,BH_IFL,BH_IFL,BH_IFL,BH_IFL,,,,,,,,,,,,,,,,,,, +gms$c22_protect_scenario_noselect,,,,,,,,,,,,,,,,,,,,,,none,none,BH_IFL,none,BH_IFL,,,,,,,,,,,,,,,,,,, +gms$c30_bioen_water,,,,rainfed,rainfed,rainfed,rainfed,rainfed,rainfed,rainfed,all,rainfed,rainfed,,,,,,,rainfed,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s30_snv_shr,,,,0,0,0,0,0,0,0,0,0,0.2,,,,,,,0,,0.2,0.2,0.2,0.2,0.2,,,,,,,,,,,,,,,,,,, +gms$s30_snv_shr_noselect,,,,,,,,,,,,,,,,,,,,,,0,0,0.2,0,0.2,,,,,,,,,,,,,,,,,,, +gms$s30_snv_scenario_target,,,,,,,,,,,,,2030,,,,,,,,,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,,,, +gms$c31_past_suit_scen,,nocc,nocc_hist,ssp126,ssp245,ssp245,ssp370,ssp460,ssp585,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ssp126,ssp126,ssp245,ssp460,ssp370,ssp585, +gms$c31_grassl_yld_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s32_aff_plantation,,,,0,0,0,0,0,0,0,1,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s32_aff_bii_coeff,,,,0,0,0,0,0,0,0,1,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s32_max_aff_area,,,,Inf,Inf,Inf,Inf,Inf,Inf,500,350,0,700,,,,,,,500,,Inf,Inf,Inf,500,500,,,,,,,,,,,,,,,,,,, +gms$c32_aff_mask,,,,noboreal,noboreal,noboreal,noboreal,noboreal,noboreal,onlytropical,onlytropical,onlytropical,onlytropical,,,,,,,onlytropical,,noboreal,noboreal,noboreal,noboreal,noboreal,,,,,,,,,,,,,,,,,,, +gms$c34_urban_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP1,SSP2,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, +gms$c32_aff_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, +gms$s32_planing_horizon,,,,50,50,50,50,50,50,50,30,50,50,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c35_ad_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, +gms$c35_aolc_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, +gms$s35_forest_damage_end,,,,2030,2050,2050,2050,2050,2030,2030,2030,2030,2030,,,,,,,2030,,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,,,, +gms$s42_watdem_nonagr_scenario,,,,1,2,2,3,2,1,1,1,3,1,,,,,,,,,2,1,2,2,1,,,,,,,,,,,,,,,,,,, +gms$s42_irrig_eff_scenario,,,,2,2,2,2,2,2,3,3,3,3,,,,,,,3,,3,3,3,3,3,,,,,,,,,,,,,,,,,,, +gms$c42_env_flow_policy,,,,on,off,off,off,mixed,on,on,on,on,on,,,,,,,on,,on,on,on,on,on,,,,,,,,,,,,,,,,,,, +gms$s42_efp_targetyear,,,,2040,2040,2040,2040,2040,2040,2040,2050,2070,2050,,,,,,,2040,,2040,2040,2040,2040,2040,,,,,,,,,,,,,,,,,,, +gms$s44_target_price,,,,0,0,0,0,0,0,0,0,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c50_scen_neff,,,,baseeff_add3_add10_add20_max75,baseeff_add3_add5_add10_max65,baseeff_add3_add5_add10_max65,baseeff_add3_add0_add0_max55,baseeff_add3_add10_add15_max75,baseeff_add3_add5_add15_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max65,baseeff_add3_add15_add25_max75,,,,,,,baseeff_add3_add15_add25_max75,,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,,,,,,,,,,,,,,,,,,, +gms$c50_scen_neff_noselect,,,,baseeff_add3_add10_add20_max75,baseeff_add3_add5_add10_max65,baseeff_add3_add5_add10_max65,baseeff_add3_add0_add0_max55,baseeff_add3_add10_add15_max75,baseeff_add3_add5_add15_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max65,baseeff_add3_add15_add25_max75,,,,,,,baseeff_add3_add15_add25_max75,,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,,,,,,,,,,,,,,,,,,, +gms$c55_scen_conf,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,ssp1,,ssp1,ssp1,ssp1,ssp1,ssp1,,,,,,,,,,,,,,,,,,, +gms$c55_scen_conf_noselect,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,ssp1,,ssp4,ssp4,ssp1,ssp4,ssp1,,,,,,,,,,,,,,,,,,, +gms$c56_pollutant_prices,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, +gms$c56_pollutant_prices_noselect,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-NPi,R21M42-SDP-NPi,R21M42-SDP-NPi,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, +gms$s56_c_price_exp_aff,,,,50,50,50,50,50,50,50,30,50,50,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s56_buffer_aff,,,,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.5,0.2,0.3,,,,,,,0.2,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c56_emis_policy,,,,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+_nosoil,all_nosoil,,,,,,,redd+natveg_nosoil,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s56_minimum_cprice,,,,,,,,,,,,,,0,0,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$maccs,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c60_2ndgen_biodem,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, +gms$c60_2ndgen_biodem_noselect,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, +gms$c60_1stgen_biodem,,,,phaseout2020,const2020,const2020,const2030,const2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,phaseout2020,,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,,,,,,,,,,,,, +gms$c60_biodem_level,,,,,,,,,,,,,,,,,1,0,,,,1,1,1,1,1,,,,,,,,,,,,,,,,,,, +gms$c60_bioenergy_subsidy,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c60_res_2ndgenBE_dem,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,sdp,ssp2,sdp,sdp,,,,,,,sdp,,ssp4,sdp,ssp4,ssp4,sdp,,,,,,,,,,,,,,,,,,, +gms$c70_feed_scen,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp5,ssp1,ssp1,,,,,,,ssp1,,ssp4,ssp1,ssp4,ssp4,ssp1,,,,,,,,,,,,,,,,,,, +gms$c_timesteps,,,,,,,,,,,,,,,,,less_TS,less_TS,,,,5year,5year,5year,5year,5year,,,,,,,,,,,,,,,,,,, +gms$c14_yields_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, +gms$c42_watdem_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, +gms$c43_watavail_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, +gms$c52_carbon_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, +gms$c59_som_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,cc,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, +gms$s32_initial_distribution,,,,,,,,,,,,,,,,,,,,,,4,4,4,4,4,,,,,4,4,0,,,,,,,,,,,, +gms$s32_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,1,0,,,,,,,,,,,, +gms$s35_secdf_distribution,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,2,0,,,,,,,,,,,, +gms$s35_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,2,0,,,,,,,,,,,, +gms$s73_timber_demand_switch,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,,,,,1,1,0,,,,,,,,,,,, +gms$s35_forest_damage,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,4,4,4,,,,,,, +gms$c32_shock_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,none,002lin2030,004lin2030,008lin2030,016lin2030,,,,,,, +gms$c35_shock_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,none,002lin2030,004lin2030,008lin2030,016lin2030,,,,,,, +input['cellular'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,rev4.88_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz,rev4.88_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz,rev4.88_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz,rev4.88_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz,rev4.88_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz,rev4.88_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz, +gms$c52_land_carbon_sink_rcp,,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RCP19,RCP26,RCP45,RCP60,RCPBU,RCPBU, +gms$c57_macc_version,,,,,,,,,,,,,,,,,,,,,,,,,,,PBL_2022,PBL_2022,PBL_2022,PBL_2022,,,,,,,,,,,,,,, +gms$c57_macc_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,Default,Optimistic,Default,Optimistic,,,,,,,,,,,,,,, +gms$s58_rewetting_switch,,,,,,,,,,,,,,,,,,,,,,,,,,,0,1,0,1,,,,,,,,,,,,,,, From e6e7ac59ce8e98368efcd6bfdd32e624c9d58e0c Mon Sep 17 00:00:00 2001 From: caviddhen Date: Wed, 9 Aug 2023 17:07:57 +0200 Subject: [PATCH 22/43] revert scenario_config csv to semicolon separators --- config/scenario_config.csv | 172 ++++++++++++++++++------------------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 47a89897eb..8fc52c3c0f 100644 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,86 +1,86 @@ -,cc,nocc,nocc_hist,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SDP,SDP-EI,SDP-RC,SDP-MC,BASE,NPI,NDC,coupling,emulator,input,Tland,eat_lancet_diet,LAMA_Inequal,LAMA_Inequal-SustDemand,LAMA_Inequal-EnvirProt,LAMA_Inequal-GHGPrice,LAMA_Sustainability,NAVIGATE_AllOff,NAVIGATE_LandSup,NAVIGATE_LandDem,NAVIGATE_AllOn,ForestryEndo,ForestryExo,ForestryOff,frst_shock_none,frst_shock_002lin2030,frst_shock_004lin2030,frst_shock_008lin2030,frst_shock_016lin2030,rcp1p9,rcp2p6,rcp4p5,rcp6p0,rcp7p0,rcp8p5,NGFS_o_lowdem -gms$c09_pop_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP1,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, -gms$c09_gdp_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SDP_EI,SDP_RC,SDP_MC,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, -gms$c09_pal_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, -gms$c15_food_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,,SSP2 -gms$c15_food_scenario_noselect,,,,,,,,,,,,,,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,,SSP2 -gms$s15_elastic_demand,,,,0,0,0,0,0,0,0,0,0,0,,,,,,,0,0,0,0,0,0,0,,,,,,,,,,,,,,,,,,, -gms$c15_rumdairy_scp_scen,,,,constant,constant,constant,constant,constant,constant,constant,sigmoid_50pc_20_50,constant,constant,,,,,,,constant,,,,,,,,,,,,,,,,,,,,,,,,, -gms$kfo_rd,,,,,,,,,,,livst_rum,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c15_exo_foodscen,,,,,,,,,,lin_zero_20_50,lin_zero_20_50,lin_zero_20_50,lin_zero_20_70,,,,,,,lin_zero_20_50,lin_zero_20_50,,lin_zero_20_50,,,lin_zero_20_50,,,,,,,,,,,,,,,,,,,lin_zero_20_50 -gms$s15_exo_waste,,,,0,0,0,0,0,0,1,1,1,1,,,,,,,1,0,0,1,0,0,1,0,0,1,1,,,,,,,,,,,,,,,1 -gms$s15_waste_scen,,,,,,,,,,1.2,1.3,1.2,1.25,,,,,,,1.2,1.2,,1.2,,,1.2,,,,,,,,,,,,,,,,,,,1.2 -gms$s15_exo_diet,,,,0,0,0,0,0,0,1,1,1,1,,,,,,,1,1,0,1,0,0,1,0,0,1,1,,,,,,,,,,,,,,,1 -gms$c15_kcal_scen,,,,,,,,,,healthy_BMI,no_underweight,healthy_BMI,healthy_BMI,,,,,,,healthy_BMI,healthy_BMI,,healthy_BMI,,,healthy_BMI,,,,,,,,,,,,,,,,,,,healthy_BMI -gms$c15_EAT_scen,,,,,,,,,,FLX,,FLX,FLX,,,,,,,FLX,FLX,,FLX,,,FLX,,,,,,,,,,,,,,,,,,, -gms$s15_exo_monogastric,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_ruminant,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_fish,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_fruitvegnut,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_pulses,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_sugar,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_oils,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_brans,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_scp,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$s15_exo_alcohol,,,,,,,,,,1,0,1,1,,,,,,,1,1,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$c21_trade_liberalization,,,,l908080r807070,l909090r808080,l909090r808080,l909595r809090,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l909595r809090,l908080r807070,,,,,,,,,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l908080r807070,,,,,,,,,,,,,,,,,,, -gms$c22_protect_scenario,,,,none,none,none,none,none,none,BH,none,BH_IFL,BH,,,,,,,BH,,BH_IFL,BH_IFL,BH_IFL,BH_IFL,BH_IFL,,,,,,,,,,,,,,,,,,, -gms$c22_protect_scenario_noselect,,,,,,,,,,,,,,,,,,,,,,none,none,BH_IFL,none,BH_IFL,,,,,,,,,,,,,,,,,,, -gms$c30_bioen_water,,,,rainfed,rainfed,rainfed,rainfed,rainfed,rainfed,rainfed,all,rainfed,rainfed,,,,,,,rainfed,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s30_snv_shr,,,,0,0,0,0,0,0,0,0,0,0.2,,,,,,,0,,0.2,0.2,0.2,0.2,0.2,,,,,,,,,,,,,,,,,,, -gms$s30_snv_shr_noselect,,,,,,,,,,,,,,,,,,,,,,0,0,0.2,0,0.2,,,,,,,,,,,,,,,,,,, -gms$s30_snv_scenario_target,,,,,,,,,,,,,2030,,,,,,,,,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,,,, -gms$c31_past_suit_scen,,nocc,nocc_hist,ssp126,ssp245,ssp245,ssp370,ssp460,ssp585,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ssp126,ssp126,ssp245,ssp460,ssp370,ssp585, -gms$c31_grassl_yld_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s32_aff_plantation,,,,0,0,0,0,0,0,0,1,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s32_aff_bii_coeff,,,,0,0,0,0,0,0,0,1,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s32_max_aff_area,,,,Inf,Inf,Inf,Inf,Inf,Inf,500,350,0,700,,,,,,,500,,Inf,Inf,Inf,500,500,,,,,,,,,,,,,,,,,,, -gms$c32_aff_mask,,,,noboreal,noboreal,noboreal,noboreal,noboreal,noboreal,onlytropical,onlytropical,onlytropical,onlytropical,,,,,,,onlytropical,,noboreal,noboreal,noboreal,noboreal,noboreal,,,,,,,,,,,,,,,,,,, -gms$c34_urban_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP1,SSP2,SSP1,,,,,,,,,SSP4,SSP1,SSP4,SSP4,SSP1,,,,,,,,,,,,,,,,,,, -gms$c32_aff_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, -gms$s32_planing_horizon,,,,50,50,50,50,50,50,50,30,50,50,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c35_ad_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, -gms$c35_aolc_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,ndc,ndc,ndc,ndc,ndc,,,,,,,,,,,,,,,,,,, -gms$s35_forest_damage_end,,,,2030,2050,2050,2050,2050,2030,2030,2030,2030,2030,,,,,,,2030,,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,,,, -gms$s42_watdem_nonagr_scenario,,,,1,2,2,3,2,1,1,1,3,1,,,,,,,,,2,1,2,2,1,,,,,,,,,,,,,,,,,,, -gms$s42_irrig_eff_scenario,,,,2,2,2,2,2,2,3,3,3,3,,,,,,,3,,3,3,3,3,3,,,,,,,,,,,,,,,,,,, -gms$c42_env_flow_policy,,,,on,off,off,off,mixed,on,on,on,on,on,,,,,,,on,,on,on,on,on,on,,,,,,,,,,,,,,,,,,, -gms$s42_efp_targetyear,,,,2040,2040,2040,2040,2040,2040,2040,2050,2070,2050,,,,,,,2040,,2040,2040,2040,2040,2040,,,,,,,,,,,,,,,,,,, -gms$s44_target_price,,,,0,0,0,0,0,0,0,0,0,0,,,,,,,0,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c50_scen_neff,,,,baseeff_add3_add10_add20_max75,baseeff_add3_add5_add10_max65,baseeff_add3_add5_add10_max65,baseeff_add3_add0_add0_max55,baseeff_add3_add10_add15_max75,baseeff_add3_add5_add15_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max65,baseeff_add3_add15_add25_max75,,,,,,,baseeff_add3_add15_add25_max75,,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,,,,,,,,,,,,,,,,,,, -gms$c50_scen_neff_noselect,,,,baseeff_add3_add10_add20_max75,baseeff_add3_add5_add10_max65,baseeff_add3_add5_add10_max65,baseeff_add3_add0_add0_max55,baseeff_add3_add10_add15_max75,baseeff_add3_add5_add15_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max75,baseeff_add3_add15_add25_max65,baseeff_add3_add15_add25_max75,,,,,,,baseeff_add3_add15_add25_max75,,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,baseeff_add3_add10_add15_max75,,,,,,,,,,,,,,,,,,, -gms$c55_scen_conf,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,ssp1,,ssp1,ssp1,ssp1,ssp1,ssp1,,,,,,,,,,,,,,,,,,, -gms$c55_scen_conf_noselect,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,ssp1,,ssp4,ssp4,ssp1,ssp4,ssp1,,,,,,,,,,,,,,,,,,, -gms$c56_pollutant_prices,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, -gms$c56_pollutant_prices_noselect,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-NPi,R21M42-SDP-NPi,R21M42-SDP-NPi,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, -gms$s56_c_price_exp_aff,,,,50,50,50,50,50,50,50,30,50,50,,,,,,,50,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s56_buffer_aff,,,,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.5,0.2,0.3,,,,,,,0.2,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c56_emis_policy,,,,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+natveg_nosoil,redd+_nosoil,all_nosoil,,,,,,,redd+natveg_nosoil,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s56_minimum_cprice,,,,,,,,,,,,,,0,0,18,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$maccs,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c60_2ndgen_biodem,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, -gms$c60_2ndgen_biodem_noselect,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,R21M42-SDP-PkBudg1000,,,,,,,,,,,,,,,,,,, -gms$c60_1stgen_biodem,,,,phaseout2020,const2020,const2020,const2030,const2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,phaseout2020,,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,,,,,,,,,,,,, -gms$c60_biodem_level,,,,,,,,,,,,,,,,,1,0,,,,1,1,1,1,1,,,,,,,,,,,,,,,,,,, -gms$c60_bioenergy_subsidy,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c60_res_2ndgenBE_dem,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,sdp,ssp2,sdp,sdp,,,,,,,sdp,,ssp4,sdp,ssp4,ssp4,sdp,,,,,,,,,,,,,,,,,,, -gms$c70_feed_scen,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp5,ssp1,ssp1,,,,,,,ssp1,,ssp4,ssp1,ssp4,ssp4,ssp1,,,,,,,,,,,,,,,,,,, -gms$c_timesteps,,,,,,,,,,,,,,,,,less_TS,less_TS,,,,5year,5year,5year,5year,5year,,,,,,,,,,,,,,,,,,, -gms$c14_yields_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, -gms$c42_watdem_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, -gms$c43_watavail_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, -gms$c52_carbon_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, -gms$c59_som_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,cc,,,cc,cc,cc,cc,cc,,,,,,,,,,,,,,,,,,, -gms$s32_initial_distribution,,,,,,,,,,,,,,,,,,,,,,4,4,4,4,4,,,,,4,4,0,,,,,,,,,,,, -gms$s32_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,1,0,,,,,,,,,,,, -gms$s35_secdf_distribution,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,2,0,,,,,,,,,,,, -gms$s35_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,2,2,2,,,,,2,2,0,,,,,,,,,,,, -gms$s73_timber_demand_switch,,,,,,,,,,,,,,,,,,,,,,1,1,1,1,1,,,,,1,1,0,,,,,,,,,,,, -gms$s35_forest_damage,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,4,4,4,4,4,,,,,,, -gms$c32_shock_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,none,002lin2030,004lin2030,008lin2030,016lin2030,,,,,,, -gms$c35_shock_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,none,002lin2030,004lin2030,008lin2030,016lin2030,,,,,,, -input['cellular'],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,rev4.88_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz,rev4.88_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz,rev4.88_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz,rev4.88_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz,rev4.88_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz,rev4.88_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz, -gms$c52_land_carbon_sink_rcp,,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,RCP19,RCP26,RCP45,RCP60,RCPBU,RCPBU, -gms$c57_macc_version,,,,,,,,,,,,,,,,,,,,,,,,,,,PBL_2022,PBL_2022,PBL_2022,PBL_2022,,,,,,,,,,,,,,, -gms$c57_macc_scenario,,,,,,,,,,,,,,,,,,,,,,,,,,,Default,Optimistic,Default,Optimistic,,,,,,,,,,,,,,, -gms$s58_rewetting_switch,,,,,,,,,,,,,,,,,,,,,,,,,,,0,1,0,1,,,,,,,,,,,,,,, +;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;BASE;NPI;NDC;coupling;emulator;input;Tland;eat_lancet_diet;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn;ForestryEndo;ForestryExo;ForestryOff;frst_shock_none;frst_shock_002lin2030;frst_shock_004lin2030;frst_shock_008lin2030;frst_shock_016lin2030;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5;NGFS_o_lowdem +gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; +gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; +gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2 +gms$c15_food_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2 +gms$s15_elastic_demand;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;0;0;0;0;0;0;;;;;;;;;;;;;;;;;;; +gms$c15_rumdairy_scp_scen;;;;constant;constant;constant;constant;constant;constant;constant;sigmoid_50pc_20_50;constant;constant;;;;;;;constant;;;;;;;;;;;;;;;;;;;;;;;;; +gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c15_exo_foodscen;;;;;;;;;;lin_zero_20_50;lin_zero_20_50;lin_zero_20_50;lin_zero_20_70;;;;;;;lin_zero_20_50;lin_zero_20_50;;lin_zero_20_50;;;lin_zero_20_50;;;;;;;;;;;;;;;;;;;lin_zero_20_50 +gms$s15_exo_waste;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1 +gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;1.2;1.2;;1.2;;;1.2;;;;;;;;;;;;;;;;;;;1.2 +gms$s15_exo_diet;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1 +gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;healthy_BMI;;healthy_BMI;;;healthy_BMI;;;;;;;;;;;;;;;;;;;healthy_BMI +gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;FLX;;FLX;;;FLX;;;;;;;;;;;;;;;;;;; +gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;;;;;;;;;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070;;;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario;;;;none;none;none;none;none;none;BH;none;BH_IFL;BH;;;;;;;BH;;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL;;;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none;BH_IFL;;;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s30_snv_shr;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;; +gms$s30_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;; +gms$s30_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;; +gms$c31_past_suit_scen;;nocc;nocc_hist;ssp126;ssp245;ssp245;ssp370;ssp460;ssp585;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ssp126;ssp126;ssp245;ssp460;ssp370;ssp585; +gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_aff_plantation;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_aff_bii_coeff;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_max_aff_area;;;;Inf;Inf;Inf;Inf;Inf;Inf;500;350;0;700;;;;;;;500;;Inf;Inf;Inf;500;500;;;;;;;;;;;;;;;;;;; +gms$c32_aff_mask;;;;noboreal;noboreal;noboreal;noboreal;noboreal;noboreal;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;onlytropical;;noboreal;noboreal;noboreal;noboreal;noboreal;;;;;;;;;;;;;;;;;;; +gms$c34_urban_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;; +gms$c32_aff_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; +gms$s32_planing_horizon;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c35_ad_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; +gms$c35_aolc_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;; +gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;2030;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;; +gms$s42_watdem_nonagr_scenario;;;;1;2;2;3;2;1;1;1;3;1;;;;;;;;;2;1;2;2;1;;;;;;;;;;;;;;;;;;; +gms$s42_irrig_eff_scenario;;;;2;2;2;2;2;2;3;3;3;3;;;;;;;3;;3;3;3;3;3;;;;;;;;;;;;;;;;;;; +gms$c42_env_flow_policy;;;;on;off;off;off;mixed;on;on;on;on;on;;;;;;;on;;on;on;on;on;on;;;;;;;;;;;;;;;;;;; +gms$s42_efp_targetyear;;;;2040;2040;2040;2040;2040;2040;2040;2050;2070;2050;;;;;;;2040;;2040;2040;2040;2040;2040;;;;;;;;;;;;;;;;;;; +gms$s44_target_price;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;;;;;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff_noselect;;;;baseeff_add3_add10_add20_max75;baseeff_add3_add5_add10_max65;baseeff_add3_add5_add10_max65;baseeff_add3_add0_add0_max55;baseeff_add3_add10_add15_max75;baseeff_add3_add5_add15_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max75;baseeff_add3_add15_add25_max65;baseeff_add3_add15_add25_max75;;;;;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;baseeff_add3_add10_add15_max75;;;;;;;;;;;;;;;;;;; +gms$c55_scen_conf;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;;;; +gms$c55_scen_conf_noselect;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;ssp4;ssp4;ssp1;ssp4;ssp1;;;;;;;;;;;;;;;;;;; +gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; +gms$c56_pollutant_prices_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; +gms$s56_c_price_exp_aff;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s56_buffer_aff;;;;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.5;0.2;0.3;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;;;;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+natveg_nosoil;redd+_nosoil;all_nosoil;;;;;;;redd+natveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$maccs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; +gms$c60_2ndgen_biodem_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;; +gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;phaseout2020;;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;;;; +gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;1;1;1;1;1;;;;;;;;;;;;;;;;;;; +gms$c60_bioenergy_subsidy;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;sdp;;ssp4;sdp;ssp4;ssp4;sdp;;;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;; +gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;; +gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; +gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; +gms$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; +gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; +gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;cc;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;; +gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;4;4;0;;;;;;;;;;;; +gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;; +gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;; +gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;; +gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;; +gms$s35_forest_damage;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;; +gms$c32_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;; +gms$c35_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;; +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.88_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.88_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.88_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.88_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.88_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.88_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz; +gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU; +gms$c57_macc_version;;;;;;;;;;;;;;;;;;;;;;;;;;;PBL_2022;PBL_2022;PBL_2022;PBL_2022;;;;;;;;;;;;;;; +gms$c57_macc_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;Default;Optimistic;Default;Optimistic;;;;;;;;;;;;;;; +gms$s58_rewetting_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;0;1;0;1;;;;;;;;;;;;;;; From e31bf54a7d6c201f509f310ad854268551011e73 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 10 Aug 2023 09:29:57 +0200 Subject: [PATCH 23/43] bugfix disaggregation_LUH2.R --- scripts/output/extra/disaggregation_LUH2.R | 142 +++++++++++---------- 1 file changed, 75 insertions(+), 67 deletions(-) diff --git a/scripts/output/extra/disaggregation_LUH2.R b/scripts/output/extra/disaggregation_LUH2.R index 0d013240de..c394a94f6d 100644 --- a/scripts/output/extra/disaggregation_LUH2.R +++ b/scripts/output/extra/disaggregation_LUH2.R @@ -200,11 +200,15 @@ gc() b <- protectedArea(gdx,level = "grid",dir=outputdir) / dimSums(land_hr, dim=3) b[is.na(b)] <- 0 -luh2 <- data.frame(matrix(nrow=3,ncol=2)) +luh2 <- data.frame(matrix(nrow=7,ncol=2)) names(luh2) <- c("LUH2","MAgPIE") -luh2[1,] <- c("primf_prot","primforest") -luh2[2,] <- c("secdf_prot","secdforest") -luh2[3,] <- c("primn_secdn_prot","other") +luh2[1,] <- c("crop_prot","crop") +luh2[2,] <- c("past_prot","past") +luh2[3,] <- c("timber_prot","forestry") +luh2[4,] <- c("primf_prot","primforest") +luh2[5,] <- c("secdf_prot","secdforest") +luh2[6,] <- c("urban_prot","urban") +luh2[7,] <- c("primn_secdn_prot","other") b <- madrat::toolAggregate(b, luh2, from="MAgPIE", to="LUH2",dim = 3) gc() if(!file.exists(paste0(out_dir,"/LUH2_protected_area.nc"))){ @@ -216,69 +220,73 @@ gc() } ####### ONLY DYNAMIC FORESTRY ON############# - -#### Wood -land_lr <- madrat::toolAggregate(dimSums(land_hr,dim=3), map_file, from = "cell",to = "cluster") - -### Wood: Harvested Area -a <- harvested_area_timber(gdx,level = "cell") -b <- a / land_lr -b <- madrat::toolAggregate(b, map_file, from = "cluster",to = "cell") -luh2 <- data.frame(matrix(nrow=4,ncol=2)) -names(luh2) <- c("LUH2","MAgPIE") -luh2[1,] <- c("timber_harv","Forestry") -luh2[2,] <- c("primf_harv","Primary forest") -luh2[3,] <- c("secdf_harv","Secondary forest") -luh2[4,] <- c("primn_secdn_harv","Other land") -b <- madrat::toolAggregate(b, luh2, from="MAgPIE", to="LUH2",dim = 3) -gc() -if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_area.nc"))){ -b <- convertLUH2(b) -gc() -write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_area.nc"),comment = "unit: fraction of grid-cell area per year") -rm(a,b) -gc() -} - -#### Wood: Yields -a <- ForestYield(gdx,level="cell") -a_fix<- new.magpie(cells_and_regions=getCells(a),years=getYears(a), - names=getNames(a)) - -# BugFix in the mean time. Strange jump from ForestYield -a_fix[,1,]<-0 -a_fix[,-1,]<-setYears(a[,2100,,invert=TRUE],getYears(a_fix[,-1,])) -a[a>500]<-a_fix[a>500] -b <- madrat::toolAggregate(a, map_file, from = "cluster",to = "cell") -luh2 <- data.frame(matrix(nrow=4,ncol=2)) -names(luh2) <- c("LUH2","MAgPIE") -luh2[1,] <- c("timber_bioh","Forestry") -luh2[2,] <- c("primf_bioh","Primary forest") -luh2[3,] <- c("secdf_bioh","Secondary forest") -luh2[4,] <- c("primn_secdn_bioh","Other land") -b <- madrat::toolAggregate(b, luh2, from="MAgPIE", to="LUH2",dim = 3) -gc() -if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_yields.nc"))){ -b <- convertLUH2(b) -gc() -write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_yields.nc"),comment = "unit: m3 per ha per year") -rm(a,b) -gc() -} - -#### Wood: Harvested Biomass Product Split -b <- TimberProductionVolumetric(gdx,level = "cell",sumSource = FALSE,sumProduct = FALSE) -b <- dimSums(b,dim=3.1) -b <- b/dimSums(b,dim=3) -getNames(b) <- c("rndwd","fulwd") -b <- madrat::toolAggregate(b, map_file, from = "cluster",to = "cell") -if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_biomass_split.nc"))){ -b <- convertLUH2(b) -gc() -write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_biomass_split.nc"),comment = "unit: fraction of wood harvest biomass") -rm(b) -gc() -} +#check for dynamic foresty +if(!is.null(harvested_area_timber(gdx,level = "cell"))) { + message("Start forestry / timber reporting") + + #### Wood + land_lr <- madrat::toolAggregate(dimSums(land_hr,dim=3), map_file, from = "cell",to = "cluster") + + ### Wood: Harvested Area + a <- harvested_area_timber(gdx,level = "cell") + b <- a / land_lr + b <- madrat::toolAggregate(b, map_file, from = "cluster",to = "cell") + luh2 <- data.frame(matrix(nrow=4,ncol=2)) + names(luh2) <- c("LUH2","MAgPIE") + luh2[1,] <- c("timber_harv","Forestry") + luh2[2,] <- c("primf_harv","Primary forest") + luh2[3,] <- c("secdf_harv","Secondary forest") + luh2[4,] <- c("primn_secdn_harv","Other land") + b <- madrat::toolAggregate(b, luh2, from="MAgPIE", to="LUH2",dim = 3) + gc() + if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_area.nc"))){ + b <- convertLUH2(b) + gc() + write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_area.nc"),comment = "unit: fraction of grid-cell area per year") + rm(a,b) + gc() + } + + #### Wood: Yields + a <- ForestYield(gdx,level="cell") + a_fix<- new.magpie(cells_and_regions=getCells(a),years=getYears(a), + names=getNames(a)) + + # BugFix in the mean time. Strange jump from ForestYield + a_fix[,1,]<-0 + a_fix[,-1,]<-setYears(a[,2100,,invert=TRUE],getYears(a_fix[,-1,])) + a[a>500]<-a_fix[a>500] + b <- madrat::toolAggregate(a, map_file, from = "cluster",to = "cell") + luh2 <- data.frame(matrix(nrow=4,ncol=2)) + names(luh2) <- c("LUH2","MAgPIE") + luh2[1,] <- c("timber_bioh","Forestry") + luh2[2,] <- c("primf_bioh","Primary forest") + luh2[3,] <- c("secdf_bioh","Secondary forest") + luh2[4,] <- c("primn_secdn_bioh","Other land") + b <- madrat::toolAggregate(b, luh2, from="MAgPIE", to="LUH2",dim = 3) + gc() + if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_yields.nc"))){ + b <- convertLUH2(b) + gc() + write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_yields.nc"),comment = "unit: m3 per ha per year") + rm(a,b) + gc() + } + + #### Wood: Harvested Biomass Product Split + b <- TimberProductionVolumetric(gdx,level = "cell",sumSource = FALSE,sumProduct = FALSE) + b <- dimSums(b,dim=3.1) + b <- b/dimSums(b,dim=3) + getNames(b) <- c("rndwd","fulwd") + b <- madrat::toolAggregate(b, map_file, from = "cluster",to = "cell") + if(!file.exists(paste0(out_dir,"/LUH2_wood_harvest_biomass_split.nc"))){ + b <- convertLUH2(b) + gc() + write.magpie(b,paste0(out_dir,"/LUH2_wood_harvest_biomass_split.nc"),comment = "unit: fraction of wood harvest biomass") + rm(b) + gc() + } +} else warning("DYNAMIC FORESTRY was NOT active in this MAgPIE run. Therefore wood harvest variables cannot be report in LUH2 format.") ####### ONLY DYNAMIC FORESTRY ON############# From 1685f1218d24b94dc025410e665c04b08b26712c Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 10 Aug 2023 09:36:48 +0200 Subject: [PATCH 24/43] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4523f72d5d..eff6751992 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ### fixed -- +- **scripts** fixed output/extra/disaggregation_LUH2.R ## [4.6.9] - 2023-07-27 From d95ceb244809d1a8355543919fd303f8f2bca36d Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 10 Aug 2023 09:45:06 +0200 Subject: [PATCH 25/43] merge with develop branch --- modules/14_yields/managementcalib_aug19/preloop.gms | 1 - modules/17_production/flexreg_apr16/declarations.gms | 2 +- modules/17_production/flexreg_apr16/presolve.gms | 4 +--- .../71_disagg_lvst/foragebased_aug18/presolve.gms | 12 ------------ .../71_disagg_lvst/foragebased_aug18/realization.gms | 1 - 5 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 modules/71_disagg_lvst/foragebased_aug18/presolve.gms diff --git a/modules/14_yields/managementcalib_aug19/preloop.gms b/modules/14_yields/managementcalib_aug19/preloop.gms index 005966b8b8..b674237a64 100644 --- a/modules/14_yields/managementcalib_aug19/preloop.gms +++ b/modules/14_yields/managementcalib_aug19/preloop.gms @@ -136,7 +136,6 @@ if ((s14_calib_ir2rf = 1), i14_yields_calib(t,j,knbe14,w); pm_yields_semi_calib(j,knbe14,w) = i14_yields_calib("y1995",j,knbe14,w); - pm_yields_semi_calib(j,"pasture",w) = i14_yields_calib("y1995",j,"pasture",w); ); *' @stop diff --git a/modules/17_production/flexreg_apr16/declarations.gms b/modules/17_production/flexreg_apr16/declarations.gms index 8187fd3fa9..235855f322 100644 --- a/modules/17_production/flexreg_apr16/declarations.gms +++ b/modules/17_production/flexreg_apr16/declarations.gms @@ -15,7 +15,7 @@ equations ; parameters -pm_prod_init(j,k) Production initialization for year 1995 (tDM per yr) +pm_prod_init(j,kcr) Production initialization for year 1995 (tDM per yr) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### diff --git a/modules/17_production/flexreg_apr16/presolve.gms b/modules/17_production/flexreg_apr16/presolve.gms index c0def1bbc7..09413ece73 100644 --- a/modules/17_production/flexreg_apr16/presolve.gms +++ b/modules/17_production/flexreg_apr16/presolve.gms @@ -8,13 +8,11 @@ pm_prod_init(j,kcr)=sum(w,fm_croparea("y1995",j,w,kcr)*pm_yields_semi_calib(j,kcr,w)); -pm_prod_init(j,"pasture")=sum(w,pm_land_start(j,"past")*pm_yields_semi_calib(j,"pasture",w)); if (ord(t) = 1, $ifthen "%c17_prod_init%" == "on" -vm_prod.l(j,kve) = pm_prod_init(j,kve); -vm_prod_reg.l(i,kve) = sum(cell(i,j), pm_prod_init(j,kve)); +vm_prod.l(j,kcr) = pm_prod_init(j,kcr); $endif ); diff --git a/modules/71_disagg_lvst/foragebased_aug18/presolve.gms b/modules/71_disagg_lvst/foragebased_aug18/presolve.gms deleted file mode 100644 index 70d4ee4a61..0000000000 --- a/modules/71_disagg_lvst/foragebased_aug18/presolve.gms +++ /dev/null @@ -1,12 +0,0 @@ -*** | (C) 2008-2023 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 - -i71_forage_cell_prod_share(j,kforage) = -* vm_prod.l(j,kforage) / (sum(cell(i,j),sum(cell2(i,j3), vm_prod.l(j3,kforage))) + 10**(-6)); - vm_prod.l(j,kforage) / (sum(cell(i,j), vm_prod_reg.l(i,kforage)) + 10**(-6)); - -* Note that $10^{-6}$ is required to avoid division by zero. diff --git a/modules/71_disagg_lvst/foragebased_aug18/realization.gms b/modules/71_disagg_lvst/foragebased_aug18/realization.gms index 5d59ae546a..11effc8e81 100644 --- a/modules/71_disagg_lvst/foragebased_aug18/realization.gms +++ b/modules/71_disagg_lvst/foragebased_aug18/realization.gms @@ -26,6 +26,5 @@ $Ifi "%phase%" == "declarations" $include "./modules/71_disagg_lvst/foragebased_ $Ifi "%phase%" == "equations" $include "./modules/71_disagg_lvst/foragebased_aug18/equations.gms" $Ifi "%phase%" == "scaling" $include "./modules/71_disagg_lvst/foragebased_aug18/scaling.gms" $Ifi "%phase%" == "preloop" $include "./modules/71_disagg_lvst/foragebased_aug18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/71_disagg_lvst/foragebased_aug18/presolve.gms" $Ifi "%phase%" == "postsolve" $include "./modules/71_disagg_lvst/foragebased_aug18/postsolve.gms" *######################## R SECTION END (PHASES) ############################### From 227449fad92434d799db4e260d3ea0f120bab776 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 10 Aug 2023 10:03:31 +0200 Subject: [PATCH 26/43] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eff6751992..1cadd2eea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ### fixed -- **scripts** fixed output/extra/disaggregation_LUH2.R +- **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. ## [4.6.9] - 2023-07-27 From c147126a504e5f1b200760c5e660b0902f6adda6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Fri, 11 Aug 2023 11:24:22 +0200 Subject: [PATCH 27/43] changelog --- CHANGELOG.md | 2 +- output.R | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4523f72d5d..b14f9bf5c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- +- **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files ### added - diff --git a/output.R b/output.R index 24eec3ca94..3e3ef4e865 100644 --- a/output.R +++ b/output.R @@ -35,7 +35,8 @@ library(gms) runOutputs <- function(comp=NULL, output=NULL, outputdir=NULL, submit=NULL) { choose_folder <- function(title="Please choose a folder") { # try to use find because it is significantly quicker than list.dirs - tmp <- try(system("find ./output -path './output/*/renv' -prune -o -name 'full.gms'", intern=TRUE, ignore.stderr = TRUE), silent=TRUE) + tmp <- try(system("find ./output -path './output/*/renv' -prune -o -name 'full.gms'", + intern=TRUE, ignore.stderr = TRUE), silent=TRUE) if("try-error" %in% class(tmp) || length(tmp)==0) { tmp <- base::list.dirs("./output/",recursive=TRUE) dirs <- NULL From 5e2f0e31f0ae75245d230c3eb7be5d5ca43bedad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Fri, 11 Aug 2023 11:31:40 +0200 Subject: [PATCH 28/43] faster github action --- .github/workflows/test-code.yaml | 5 +++-- CHANGELOG.md | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-code.yaml b/.github/workflows/test-code.yaml index 2a3831d0ab..16a3ce0a0c 100644 --- a/.github/workflows/test-code.yaml +++ b/.github/workflows/test-code.yaml @@ -18,14 +18,15 @@ jobs: env: GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Remove .Rprofile run: rm .Rprofile - uses: r-lib/actions/setup-r@v2 with: - extra-repositories: https://cloud.r-project.org https://rse.pik-potsdam.de/r/packages/ + use-public-rspm: true + extra-repositories: "https://rse.pik-potsdam.de/r/packages" - name: pre-commit Hook run: source(".githooks/pre-commit") diff --git a/CHANGELOG.md b/CHANGELOG.md index b14f9bf5c8..611a690337 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### changed - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files +- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager ### added - From 961f9bea3f6896b5f447347e65e79b7e427b216e Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Sat, 12 Aug 2023 00:32:35 +0200 Subject: [PATCH 29/43] disaggregation of land conservation --- DESCRIPTION | 2 +- scripts/output/extra/disaggregation.R | 110 ++++++++++++++++++-------- 2 files changed, 79 insertions(+), 33 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index e23f4d8f05..d1e1fc0d4e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,7 @@ Imports: iamc, lucode2 (>= 0.36.0), luplot, - luscale (>= 2.27.4), + luscale (>= 2.27.8), lusweave, m4fsdp, madrat, diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 41c2438ab2..1ddf644b92 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -28,12 +28,15 @@ map_file <- Sys.glob(file.path(outputdir, "clustermap_*.rds")) gdx <- file.path(outputdir, "fulldata.gdx") land_hr_file <- file.path(outputdir, "avl_land_full_t_0.5.mz") urban_land_hr_file <- file.path(outputdir, "f34_urbanland_0.5.mz") +wdpa_hr_file <- file.path(outputdir, "wdpa_baseline_0.5.mz") +consv_prio_hr_file <- file.path(outputdir, "consv_prio_areas_0.5.mz") +land_consv_hr_out_file <- file.path(outputdir, "cell.conservation_land_0.5.mz") land_hr_out_file <- file.path(outputdir, "cell.land_0.5.mz") land_hr_share_out_file <- file.path(outputdir, "cell.land_0.5_share.mz") croparea_hr_share_out_file <- file.path(outputdir, "cell.croparea_0.5_share.mz") land_hr_split_file <- file.path(outputdir, "cell.land_split_0.5.mz") land_hr_shr_split_file <- file.path(outputdir, "cell.land_split_0.5_share.mz") -luh_side_layers <- file.path(outputdir, "luh2_side_layers_0.5.mz") +luh_side_layers <- file.path(outputdir, "luh2_side_layers_0.5.mz") bii_hr_out_file <- file.path(outputdir, "cell.bii_0.5.mz") cfg <- gms::loadConfig(file.path(outputdir, "config.yml")) @@ -119,7 +122,9 @@ if (length(map_file) > 1) { # Prepare data for disaggregation # ======================================== +# ---------------------- # Load input data +# ---------------------- land_ini_lr <- readGDX(gdx, "f10_land", "f_land", format = "first_found")[, "y1995", ] land_lr <- land(gdx, sum = FALSE, level = "cell") land_ini_hr <- read.magpie(land_hr_file)[, "y1995", ] @@ -152,7 +157,9 @@ if (any(land_ini_hr < 0)) { land_ini_hr[which(land_ini_hr < 0, arr.ind = T)] <- 0 } -### Read in hr urban land +# ----------------------------- +# Read in hr urban land +# ----------------------------- if (cfg$gms$urban == "exo_nov21") { urban_land_hr <- read.magpie(urban_land_hr_file) ssp <- cfg$gms$c34_urban_scenario @@ -162,37 +169,77 @@ if (cfg$gms$urban == "exo_nov21") { urban_land_hr <- "static" } -### Get land conservation data -wdpa_hr <- NULL -if (file.exists(file.path(outputdir, "wdpa_baseline_0.5.mz"))) { - wdpa_hr <- file.path(outputdir, "wdpa_baseline_0.5.mz") -} -consv_prio_hr <- NULL -if (!all(c(cfg$gms$c22_protect_scenario, cfg$gms$c22_protect_scenario_noselect) %in% "none")) { - if (file.exists(file.path(outputdir, "consv_prio_areas_0.5.mz"))) { - consv_prio_all <- read.magpie(file.path(outputdir, "consv_prio_areas_0.5.mz")) - consv_prio_hr <- new.magpie( - cells = getCells(consv_prio_all), - names = getNames(consv_prio_all, dim = 2), fill = 0 - ) - iso <- readGDX(gdx, "iso") - consv_iso <- readGDX(gdx, "policy_countries22") - consv_iso <- consv_iso[consv_iso %in% getItems(consv_prio_all, dim = 1.1)] - consv_select <- cfg$gms$c22_protect_scenario - consv_noselect <- cfg$gms$c22_protect_scenario_noselect - - if (consv_noselect != "none") { - consv_prio_hr <- collapseDim(consv_prio_all[, , consv_noselect], dim = 3.1) - } - if (consv_select != "none") { - consv_prio_hr[consv_iso, , ] <- collapseDim(consv_prio_all[consv_iso, , consv_select], dim = 3.1) - } else if (consv_select == "none") { - consv_prio_hr[consv_iso, , ] <- 0 +# ---------------------------------------- +# Prepare land conservation data +# ---------------------------------------- + +land_consv_hr <- NULL +if (file.exists(wdpa_hr_file)) { + wdpa_hr <- read.magpie(wdpa_hr_file) + + # create full time series + land_consv_hr <- new.magpie(getCells(wdpa_hr), getYears(land_lr), getNames(wdpa_hr), fill = wdpa_hr[, nyears(wdpa_hr), ]) + land_consv_hr[, getYears(wdpa_hr), ] <- wdpa_hr + + if (!all(c(cfg$gms$c22_protect_scenario, cfg$gms$c22_protect_scenario_noselect) %in% "none")) { + if (file.exists(consv_prio_hr_file)) { + consv_prio_all <- read.magpie(consv_prio_hr_file) + consv_prio_hr <- new.magpie( + cells = getCells(consv_prio_all), + names = getNames(consv_prio_all, dim = 2), fill = 0 + ) + iso <- readGDX(gdx, "iso") + consv_iso <- readGDX(gdx, "policy_countries22") + consv_iso <- consv_iso[consv_iso %in% getItems(consv_prio_all, dim = 1.1)] + consv_select <- cfg$gms$c22_protect_scenario + consv_noselect <- cfg$gms$c22_protect_scenario_noselect + + if (consv_noselect != "none") { + consv_prio_hr <- collapseDim(consv_prio_all[, , consv_noselect], dim = 3.1) + } + if (consv_select != "none") { + consv_prio_hr[consv_iso, , ] <- collapseDim(consv_prio_all[consv_iso, , consv_select], dim = 3.1) + } else if (consv_select == "none") { + consv_prio_hr[consv_iso, , ] <- 0 + } + + consv_fader <- readGDX(gdx, "p22_conservation_fader", format = "first_found") + consv_prio_hr <- consv_prio_hr * consv_fader[, getYears(land_consv_hr), ] + + # add conservation priority areas + land_consv_hr <- (land_consv_hr + consv_prio_hr) + } else { + warning(paste( + "Future land conservation used in MAgPIE run but high resolution", + "conservation priority data for disaggregation not found." + )) } } + + # Due to internal constraints and compensation (e.g. NDC forest conservation) + # the actual land conservation can sometimes be smaller than the land + # conservation in the input data (this can especially happen also if + # land restoration is switched off). Therefore a scaling is applied here + land_consv_lr <- readGDX(gdx, "pm_land_conservation", react = "silent") + if (!is.null(land_consv_lr)) { + land_consv_lr <- dimSums(land_consv_lr, dim = 3) + + land_consv_hr_agg <- toolAggregate(dimSums(land_consv_hr, dim = 3), map_file, from = "cell", to = "cluster") + consv_scaling <- land_consv_lr / land_consv_hr_agg + consv_scaling[is.na(consv_scaling) | is.infinite(consv_scaling)] <- 1 + consv_scaling <- toolAggregate(consv_scaling, map_file, from = "cluster", to = "cell") + land_consv_hr <- consv_scaling * land_consv_hr + } + + .writeDisagg(land_consv_hr, land_consv_hr_out_file, + comment = "unit: Mha per grid-cell", + message = "Write outputs cell.conservation_land" + ) } -### Account for country-specific SNV shares in post-processing +# ------------------------------------------------------------- +# Account for country-specific SNV shares in post-processing +# ------------------------------------------------------------- iso <- readGDX(gdx, "iso") snv_pol_iso <- readGDX(gdx, "policy_countries30") snv_pol_select <- readGDX(gdx, "s30_snv_shr", "s30_set_aside_shr") @@ -233,8 +280,7 @@ land_hr <- interpolateAvlCroplandWeighted( snv_pol_shr = snv_pol_shr, snv_pol_fader = snv_pol_fader, urban_land_hr = urban_land_hr, - wdpa_hr = wdpa_hr, - consv_prio_hr = consv_prio_hr + land_consv_hr = land_consv_hr ) # Write output @@ -375,7 +421,7 @@ if (grepl("grass", cfg$gms$past)) { } # Sort and rename -land_ini_hr <- land_ini_hr[,,getNames(land_ini_lr)] +land_ini_hr <- land_ini_hr[, , getNames(land_ini_lr)] getSets(land_ini_hr)["d3.1"] <- "land" # Disaggregate BII values to high resolution From 3bd4d99bf37dbf624079b3e1f6155df726b735db Mon Sep 17 00:00:00 2001 From: florianh Date: Sat, 12 Aug 2023 23:05:12 +0200 Subject: [PATCH 30/43] bugfix --- scripts/output/extra/disaggregation.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 1ddf644b92..d17b8e62ad 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -438,8 +438,7 @@ land_bii_hr <- interpolateAvlCroplandWeighted( snv_pol_shr = snv_pol_shr, snv_pol_fader = snv_pol_fader, urban_land_hr = urban_land_hr, - wdpa_hr = wdpa_hr, - consv_prio_hr = consv_prio_hr, + land_consv_hr = land_consv_hr, unit = "share" ) From af93872b3edc804b3a85a827d9b44a929e6cb739 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Sun, 13 Aug 2023 02:09:06 +0200 Subject: [PATCH 31/43] reworked how land conservation is calculated in extra/disaggregation.R --- DESCRIPTION | 2 +- scripts/output/extra/disaggregation.R | 72 +++------------------------ 2 files changed, 9 insertions(+), 65 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d1e1fc0d4e..e581d4b690 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -17,7 +17,7 @@ Imports: iamc, lucode2 (>= 0.36.0), luplot, - luscale (>= 2.27.8), + luscale (>= 2.27.9), lusweave, m4fsdp, madrat, diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index d17b8e62ad..8a44b9e92d 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -29,7 +29,6 @@ gdx <- file.path(outputdir, "fulldata.gdx") land_hr_file <- file.path(outputdir, "avl_land_full_t_0.5.mz") urban_land_hr_file <- file.path(outputdir, "f34_urbanland_0.5.mz") wdpa_hr_file <- file.path(outputdir, "wdpa_baseline_0.5.mz") -consv_prio_hr_file <- file.path(outputdir, "consv_prio_areas_0.5.mz") land_consv_hr_out_file <- file.path(outputdir, "cell.conservation_land_0.5.mz") land_hr_out_file <- file.path(outputdir, "cell.land_0.5.mz") land_hr_share_out_file <- file.path(outputdir, "cell.land_0.5_share.mz") @@ -175,62 +174,7 @@ if (cfg$gms$urban == "exo_nov21") { land_consv_hr <- NULL if (file.exists(wdpa_hr_file)) { - wdpa_hr <- read.magpie(wdpa_hr_file) - - # create full time series - land_consv_hr <- new.magpie(getCells(wdpa_hr), getYears(land_lr), getNames(wdpa_hr), fill = wdpa_hr[, nyears(wdpa_hr), ]) - land_consv_hr[, getYears(wdpa_hr), ] <- wdpa_hr - - if (!all(c(cfg$gms$c22_protect_scenario, cfg$gms$c22_protect_scenario_noselect) %in% "none")) { - if (file.exists(consv_prio_hr_file)) { - consv_prio_all <- read.magpie(consv_prio_hr_file) - consv_prio_hr <- new.magpie( - cells = getCells(consv_prio_all), - names = getNames(consv_prio_all, dim = 2), fill = 0 - ) - iso <- readGDX(gdx, "iso") - consv_iso <- readGDX(gdx, "policy_countries22") - consv_iso <- consv_iso[consv_iso %in% getItems(consv_prio_all, dim = 1.1)] - consv_select <- cfg$gms$c22_protect_scenario - consv_noselect <- cfg$gms$c22_protect_scenario_noselect - - if (consv_noselect != "none") { - consv_prio_hr <- collapseDim(consv_prio_all[, , consv_noselect], dim = 3.1) - } - if (consv_select != "none") { - consv_prio_hr[consv_iso, , ] <- collapseDim(consv_prio_all[consv_iso, , consv_select], dim = 3.1) - } else if (consv_select == "none") { - consv_prio_hr[consv_iso, , ] <- 0 - } - - consv_fader <- readGDX(gdx, "p22_conservation_fader", format = "first_found") - consv_prio_hr <- consv_prio_hr * consv_fader[, getYears(land_consv_hr), ] - - # add conservation priority areas - land_consv_hr <- (land_consv_hr + consv_prio_hr) - } else { - warning(paste( - "Future land conservation used in MAgPIE run but high resolution", - "conservation priority data for disaggregation not found." - )) - } - } - - # Due to internal constraints and compensation (e.g. NDC forest conservation) - # the actual land conservation can sometimes be smaller than the land - # conservation in the input data (this can especially happen also if - # land restoration is switched off). Therefore a scaling is applied here - land_consv_lr <- readGDX(gdx, "pm_land_conservation", react = "silent") - if (!is.null(land_consv_lr)) { - land_consv_lr <- dimSums(land_consv_lr, dim = 3) - - land_consv_hr_agg <- toolAggregate(dimSums(land_consv_hr, dim = 3), map_file, from = "cell", to = "cluster") - consv_scaling <- land_consv_lr / land_consv_hr_agg - consv_scaling[is.na(consv_scaling) | is.infinite(consv_scaling)] <- 1 - consv_scaling <- toolAggregate(consv_scaling, map_file, from = "cluster", to = "cell") - land_consv_hr <- consv_scaling * land_consv_hr - } - + land_consv_hr <- protectedArea(gdx, cfg, level = "grid", dir = outputdir) .writeDisagg(land_consv_hr, land_consv_hr_out_file, comment = "unit: Mha per grid-cell", message = "Write outputs cell.conservation_land" @@ -274,13 +218,13 @@ land_hr <- interpolateAvlCroplandWeighted( x = land_lr, x_ini_lr = land_ini_lr, x_ini_hr = land_ini_hr, - avl_cropland_hr = avl_cropland_hr, map = map_file, + avl_cropland_hr = avl_cropland_hr, marginal_land = marginal_land, - snv_pol_shr = snv_pol_shr, - snv_pol_fader = snv_pol_fader, urban_land_hr = urban_land_hr, - land_consv_hr = land_consv_hr + land_consv_hr = land_consv_hr, + snv_pol_shr = snv_pol_shr, + snv_pol_fader = snv_pol_fader ) # Write output @@ -432,13 +376,13 @@ land_bii_hr <- interpolateAvlCroplandWeighted( x = land_lr, x_ini_lr = land_ini_lr, x_ini_hr = land_ini_hr, - avl_cropland_hr = avl_cropland_hr, map = map_file, + avl_cropland_hr = avl_cropland_hr, marginal_land = marginal_land, - snv_pol_shr = snv_pol_shr, - snv_pol_fader = snv_pol_fader, urban_land_hr = urban_land_hr, land_consv_hr = land_consv_hr, + snv_pol_shr = snv_pol_shr, + snv_pol_fader = snv_pol_fader, unit = "share" ) From 5fd2cccf0527238e50185312adf8f1342218e418 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 13 Aug 2023 09:17:05 +0200 Subject: [PATCH 32/43] bugfix --- scripts/output/extra/disaggregation_LUH2.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/output/extra/disaggregation_LUH2.R b/scripts/output/extra/disaggregation_LUH2.R index c394a94f6d..dba0a2affc 100644 --- a/scripts/output/extra/disaggregation_LUH2.R +++ b/scripts/output/extra/disaggregation_LUH2.R @@ -396,6 +396,7 @@ a[crop_hr tN/ha; convert from tN/ha to kgN/ha: tN/ha*1000kg/t = 1000 kgN/ha a <- (a/crop_hr)*1000 +x <- NULL if(!file.exists(paste0(out_dir,"/LUH2_Nitrogen_fertilizer.nc"))){ x <- convertLUH2(clean_magpie(collapseNames(a[,,"fertilizer"],collapsedim = 3.1))) From 84059bbb9e0dec4f28156c1cfab6121212c40542 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Mon, 14 Aug 2023 08:06:46 +0200 Subject: [PATCH 33/43] minor rework of extra/disaggregation.R --- scripts/output/extra/disaggregation.R | 81 +++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 4 deletions(-) diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 8a44b9e92d..ae5adb26b2 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -29,6 +29,7 @@ gdx <- file.path(outputdir, "fulldata.gdx") land_hr_file <- file.path(outputdir, "avl_land_full_t_0.5.mz") urban_land_hr_file <- file.path(outputdir, "f34_urbanland_0.5.mz") wdpa_hr_file <- file.path(outputdir, "wdpa_baseline_0.5.mz") +consv_prio_hr_file <- file.path(outputdir, "consv_prio_areas_0.5.mz") land_consv_hr_out_file <- file.path(outputdir, "cell.conservation_land_0.5.mz") land_hr_out_file <- file.path(outputdir, "cell.land_0.5.mz") land_hr_share_out_file <- file.path(outputdir, "cell.land_0.5_share.mz") @@ -58,7 +59,7 @@ if (length(map_file) > 1) { write.magpie(x, sub(".mz", ".nc", file), comment = comment, verbose = FALSE) } -.dissagcrop <- function(gdx, land_hr, map) { +.dissagcrop <- function(gdx, land_hr, map_file) { area <- croparea(gdx, level = "cell", products = "kcr", product_aggr = FALSE, water_aggr = FALSE @@ -71,11 +72,81 @@ if (length(map_file) > 1) { crop_shr <- setNames(crop_shr[, getYears(area_shr), "crop"], NULL) # calculate crop area as share of total cell area - area_shr_hr <- madrat::toolAggregate(area_shr, map, to = "cell") * crop_shr + area_shr_hr <- madrat::toolAggregate(area_shr, map_file, to = "cell") * crop_shr return(area_shr_hr) } -.dissagBII <- function(gdx, map, dir) { +.dissagLandConsv <- function(gdx, cfg, map_file, wdpa_hr_file, consv_prio_hr_file) { + land_consv_lr <- readGDX(gdx, "pm_land_conservation", react = "silent") + wdpa_hr <- read.magpie(wdpa_hr_file) + map <- readRDS(map_file) + + # create full time series + land_consv_hr <- new.magpie(map[, "cell"], getYears(land_consv_lr), getNames(wdpa_hr)) + land_consv_hr[, getYears(land_consv_hr), ] <- wdpa_hr[, nyears(wdpa_hr), ] + land_consv_hr[, getYears(wdpa_hr), ] <- wdpa_hr + + if (!all(c(cfg$gms$c22_protect_scenario, cfg$gms$c22_protect_scenario_noselect) %in% "none")) { + if (file.exists(consv_prio_hr_file)) { + consv_prio_all <- read.magpie(consv_prio_hr_file) + consv_prio_hr <- new.magpie( + cells_and_regions = map[, "cell"], + names = getNames(consv_prio_all, dim = 2), fill = 0 + ) + iso <- readGDX(gdx, "iso") + consv_iso <- readGDX(gdx, "policy_countries22") + consv_iso <- consv_iso[consv_iso %in% getItems(consv_prio_all, dim = 1.1)] + consv_select <- cfg$gms$c22_protect_scenario + consv_noselect <- cfg$gms$c22_protect_scenario_noselect + + if (consv_noselect != "none") { + consv_prio_hr <- collapseDim(consv_prio_all[, , consv_noselect], dim = 3.1) + } + if (consv_select != "none") { + consv_prio_hr[consv_iso, , ] <- collapseDim(consv_prio_all[consv_iso, , consv_select], dim = 3.1) + } else if (consv_select == "none") { + consv_prio_hr[consv_iso, , ] <- 0 + } + # future conservation only pertains to natveg + consv_prio_hr[, , c("crop", "past", "forestry", "urban")] <- 0 + consv_fader <- readGDX(gdx, "p22_conservation_fader", format = "first_found") + consv_prio_hr <- consv_prio_hr * consv_fader[, getYears(land_consv_hr), ] + + # add conservation priority areas + land_consv_hr <- (land_consv_hr + consv_prio_hr) + } else { + warning(paste( + "Future land conservation used in MAgPIE run but high resolution", + "conservation priority data for disaggregation not found." + )) + } + } + # Due to internal constraints and compensation (e.g. NDC forest conservation) + # the actual land conservation can sometimes be smaller than the land + # conservation in the input data (this can especially happen also if + # land restoration is switched off). Therefore a scaling is applied here separately + # for grassland and natural vegetation + natveg <- c("primforest", "secdforest", "other") + consv_sum_lr <- mbind( + dimSums(land_consv_lr[, , "past"], 3.2), + setNames(dimSums(land_consv_lr[, , natveg], dim = 3), "natveg") + ) + consv_sum_hr_agg <- mbind( + toolAggregate(land_consv_hr[, , "past"], map, from = "cell", to = "cluster"), + toolAggregate(setNames(dimSums(land_consv_hr[, , natveg], dim = 3), "natveg"), + map, + from = "cell", to = "cluster" + ) + ) + consv_scaling <- consv_sum_lr / consv_sum_hr_agg + consv_scaling[is.na(consv_scaling) | is.infinite(consv_scaling)] <- 1 + consv_scaling <- toolAggregate(consv_scaling, map, from = "cluster", to = "cell") + land_consv_hr[, , "past"] <- consv_scaling[, , "past"] * land_consv_hr[, , "past"] + land_consv_hr[, , natveg] <- consv_scaling[, , "natveg"] * land_consv_hr[, , natveg] + return(land_consv_hr) +} + +.dissagBII <- function(gdx, map_file, dir) { # Biodiversity intactness indicator (BII) at cluster level bii_lr <- BII(gdx, file = NULL, level = "cell", mode = "auto", landClass = "all", @@ -174,7 +245,9 @@ if (cfg$gms$urban == "exo_nov21") { land_consv_hr <- NULL if (file.exists(wdpa_hr_file)) { - land_consv_hr <- protectedArea(gdx, cfg, level = "grid", dir = outputdir) + land_consv_hr <- .dissagLandConsv(gdx, cfg, map_file, wdpa_hr_file, consv_prio_hr_file) + + # Write gridded conservation land .writeDisagg(land_consv_hr, land_consv_hr_out_file, comment = "unit: Mha per grid-cell", message = "Write outputs cell.conservation_land" From 159a064444990f22e03a660e2735efedfad82c59 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Wed, 16 Aug 2023 13:53:34 +0200 Subject: [PATCH 34/43] bugfix in output.R --- output.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output.R b/output.R index 3e3ef4e865..440b6d65d5 100644 --- a/output.R +++ b/output.R @@ -64,7 +64,7 @@ runOutputs <- function(comp=NULL, output=NULL, outputdir=NULL, submit=NULL) { } identifier <- tmp # PATTERN - if(length(identifier==1) && identifier==(length(dirs)+1)){ + if(length(identifier) == 1 && identifier == length(dirs) + 1) { cat("\nInsert the search pattern or the regular expression: ") pattern <- gms::getLine() id <- grep(pattern=pattern, dirs[-1], perl=TRUE) From 1c6a9d0d9f48602803649ecdce57c7f6125c22b8 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Wed, 16 Aug 2023 13:56:32 +0200 Subject: [PATCH 35/43] updated CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8bb833e3a..4e5e46ea52 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. - +- **scripts** fixed erronoeous if clause in output.R ## [4.6.9] - 2023-07-27 From e40aae556695561f3ce2053a49c59dc8beb3f98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Wed, 16 Aug 2023 14:40:29 +0200 Subject: [PATCH 36/43] magpie release 4.6.10 --- .zenodo.json | 4 ++-- CHANGELOG.md | 13 ++++--------- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index d04a6a0a64..b6d04973ab 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.9dev", + "version": "4.6.10", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -109,5 +109,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2023-07-27" + "publication_date": "2023-08-16" } diff --git a/CHANGELOG.md b/CHANGELOG.md index f8bb833e3a..bc8e38335b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,19 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [4.6.10] - 2023-08-16 ### changed - **config** update preprocessing to newest input data v4.88 with new transport costs +- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - **scenario_config.csv** update preprocessing to newest input data v4.88 - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files -- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - -### added -- - -### removed -- ### fixed - **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. @@ -755,7 +749,8 @@ This release version is focussed on consistency between the MAgPIE setup and the First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.9...develop +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.10...develop +[4.6.10]: https://github.com/magpiemodel/magpie/compare/v4.6.9...v4.6.10 [4.6.9]: https://github.com/magpiemodel/magpie/compare/v4.6.8...v4.6.9 [4.6.8]: https://github.com/magpiemodel/magpie/compare/v4.6.7...v4.6.8 [4.6.7]: https://github.com/magpiemodel/magpie/compare/v4.6.6...v4.6.7 diff --git a/CITATION.cff b/CITATION.cff index 8a4be0b247..6ea5a354d0 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,8 +125,8 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.9dev -date-released: 2023-07-27 +version: 4.6.10 +date-released: 2023-08-16 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index 9a13bf8260..f6321100fa 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi A framework description paper has been published in Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 -The model documentation for version 4.6.9 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.6.9/ +The model documentation for version 4.6.10 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.6.10/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -188,7 +188,7 @@ magpie@pik-potsdam.de Please contact magpie@pik-potsdam.de ## CITATION -See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.9/#how-to-cite) in the model documentation for information how to cite the model. +See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.10/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff From 340ae1cb24f1312dc924de3e25c96aebb0c3a3a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Wed, 16 Aug 2023 14:54:28 +0200 Subject: [PATCH 37/43] Revert "magpie release 4.6.10" This reverts commit e40aae556695561f3ce2053a49c59dc8beb3f98b. --- .zenodo.json | 4 ++-- CHANGELOG.md | 13 +++++++++---- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index b6d04973ab..d04a6a0a64 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.10", + "version": "4.6.9dev", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -109,5 +109,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2023-08-16" + "publication_date": "2023-07-27" } diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8e38335b..f8bb833e3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [4.6.10] - 2023-08-16 +## [Unreleased] ### changed - **config** update preprocessing to newest input data v4.88 with new transport costs -- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - **scenario_config.csv** update preprocessing to newest input data v4.88 - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files +- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager + +### added +- + +### removed +- ### fixed - **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. @@ -749,8 +755,7 @@ This release version is focussed on consistency between the MAgPIE setup and the First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.10...develop -[4.6.10]: https://github.com/magpiemodel/magpie/compare/v4.6.9...v4.6.10 +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.9...develop [4.6.9]: https://github.com/magpiemodel/magpie/compare/v4.6.8...v4.6.9 [4.6.8]: https://github.com/magpiemodel/magpie/compare/v4.6.7...v4.6.8 [4.6.7]: https://github.com/magpiemodel/magpie/compare/v4.6.6...v4.6.7 diff --git a/CITATION.cff b/CITATION.cff index 6ea5a354d0..8a4be0b247 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,8 +125,8 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.10 -date-released: 2023-08-16 +version: 4.6.9dev +date-released: 2023-07-27 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index f6321100fa..9a13bf8260 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi A framework description paper has been published in Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 -The model documentation for version 4.6.10 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.6.10/ +The model documentation for version 4.6.9 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.6.9/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -188,7 +188,7 @@ magpie@pik-potsdam.de Please contact magpie@pik-potsdam.de ## CITATION -See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.10/#how-to-cite) in the model documentation for information how to cite the model. +See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.9/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff From 49c8b3aa07ed31bb126f4f2b03658115ae101a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Wed, 16 Aug 2023 15:01:22 +0200 Subject: [PATCH 38/43] magpie release 4.6.10 --- .zenodo.json | 4 ++-- CHANGELOG.md | 18 +++++++----------- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 14 insertions(+), 18 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index d04a6a0a64..b6d04973ab 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.9dev", + "version": "4.6.10", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -109,5 +109,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2023-07-27" + "publication_date": "2023-08-16" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 0165d62e99..eaefd59888 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,24 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased] +## [4.6.10] - 2023-08-16 ### changed - **config** update preprocessing to newest input data v4.88 with new transport costs +- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - **scenario_config.csv** update preprocessing to newest input data v4.88 - **scripts** output.R is now faster, because it no longer searches runfolder renvs for full.gms files -- **GitHub action** the github action is now faster, because it installs binary packages from Posit Package Manager - -### added -- - -### removed -- ### fixed -- **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. -- **scripts** fixed erronoeous if clause in output.R - **scripts** check_config does not warn about c_input_gdx_path anymore while running empty model +- **scripts** fixed erronoeous if clause in output.R +- **scripts** fixed output/extra/disaggregation_LUH2.R. The script was not working any more because magpie4::protectedArea was changed to return protected area for all land types. Moreover, the script now also works for runs without dynamic forestry (default run) but with a warning message. + ## [4.6.9] - 2023-07-27 @@ -756,7 +751,8 @@ This release version is focussed on consistency between the MAgPIE setup and the First open source release of the framework. See [MAgPIE 4.0 paper](https://doi.org/10.5194/gmd-12-1299-2019) for more information. -[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.9...develop +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.6.10...develop +[4.6.10]: https://github.com/magpiemodel/magpie/compare/v4.6.9...v4.6.10 [4.6.9]: https://github.com/magpiemodel/magpie/compare/v4.6.8...v4.6.9 [4.6.8]: https://github.com/magpiemodel/magpie/compare/v4.6.7...v4.6.8 [4.6.7]: https://github.com/magpiemodel/magpie/compare/v4.6.6...v4.6.7 diff --git a/CITATION.cff b/CITATION.cff index 8a4be0b247..6ea5a354d0 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,8 +125,8 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.9dev -date-released: 2023-07-27 +version: 4.6.10 +date-released: 2023-08-16 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index 9a13bf8260..f6321100fa 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,8 @@ https://www.pik-potsdam.de/research/projects/activities/land-use-modelling/magpi A framework description paper has been published in Geoscientific Model Development (GMD): https://doi.org/10.5194/gmd-12-1299-2019 -The model documentation for version 4.6.9 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.6.9/ +The model documentation for version 4.6.10 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.6.10/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -188,7 +188,7 @@ magpie@pik-potsdam.de Please contact magpie@pik-potsdam.de ## CITATION -See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.9/#how-to-cite) in the model documentation for information how to cite the model. +See file CITATION.cff or the [How-to-Cite section](https://rse.pik-potsdam.de/doc/magpie/4.6.10/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff From 03c874ab24b3468981165835ebad94d4577bffc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20F=C3=BChrlich?= Date: Wed, 16 Aug 2023 15:50:00 +0200 Subject: [PATCH 39/43] merge master into develop --- .zenodo.json | 2 +- CHANGELOG.md | 15 +++++++++++++++ CITATION.cff | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index b6d04973ab..3d0c487ac5 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.6.10", + "version": "4.6.10dev", "creators": [ { "name": "Dietrich, Jan Philipp", diff --git a/CHANGELOG.md b/CHANGELOG.md index eaefd59888..74ad927e6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [Unreleased] + +### changed +- + +### added +- + +### removed +- + +### fixed +- + + ## [4.6.10] - 2023-08-16 ### changed diff --git a/CITATION.cff b/CITATION.cff index 6ea5a354d0..4b0388a61f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,7 +125,7 @@ authors: email: popp@pik-potsdam.de title: MAgPIE - An Open Source land-use modeling framework -version: 4.6.10 +version: 4.6.10dev date-released: 2023-08-16 repository-code: https://github.com/magpiemodel/magpie keywords: From db6dbf3818b757ffec34fb412e693093b42ed2db Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 16 Aug 2023 18:18:52 +0200 Subject: [PATCH 40/43] extended the set of years that are reported to SEALS --- scripts/output/extra/reportMAgPIE2SEALS.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/extra/reportMAgPIE2SEALS.R b/scripts/output/extra/reportMAgPIE2SEALS.R index eb4ea1dacc..9045995e17 100644 --- a/scripts/output/extra/reportMAgPIE2SEALS.R +++ b/scripts/output/extra/reportMAgPIE2SEALS.R @@ -36,5 +36,5 @@ title <- cfg$title reportLandUseForSEALS( magCellLand = "cell.land_0.5_share.nc", outFile = paste0("cell.land_0.5_SEALS_", title, ".nc"), - dir = outputdir, selectyears = c(2015, 2050) + dir = outputdir, selectyears = c(2015, 2020, 2025, 2030, 2035, 2040, 2045, 2050) ) From 68197b75f2bd6b74dcc54a36391c6e0b7a8c675d Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 16 Aug 2023 18:23:22 +0200 Subject: [PATCH 41/43] changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74ad927e6f..e363af8d22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- +- **scripts** All time steps between 2015 and 2050 are now reported to SEALS ### added - From c33ebca35b5c67635d066139a1947614332eca24 Mon Sep 17 00:00:00 2001 From: Isabelle Weindl Date: Tue, 22 Aug 2023 17:30:23 +0200 Subject: [PATCH 42/43] bugfix --- modules/70_livestock/fbask_jan16/presolve.gms | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/70_livestock/fbask_jan16/presolve.gms b/modules/70_livestock/fbask_jan16/presolve.gms index 902ad25139..fd48c144a4 100644 --- a/modules/70_livestock/fbask_jan16/presolve.gms +++ b/modules/70_livestock/fbask_jan16/presolve.gms @@ -35,13 +35,13 @@ p70_cattle_feed_pc_proxy(t,i,kli_rd) = pm_kcal_pc_initial(t,i,kli_rd)*im_feed_ba *' The parameter `p70_incr_cattle` describes the changes in the number of cattle *' relative to the previous time step: -p70_incr_cattle(t,i) = 1$(ord(t)=1) - + ( - ( p70_cattle_feed_pc_proxy(t,i,"livst_rum") * (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) - + - p70_cattle_feed_pc_proxy(t,i,"livst_milk") * (p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) ) - / sum(kli_rd, p70_cattle_feed_pc_proxy(t,i,kli_rd) ) - )$(ord(t)>1); +if (ord(t)>1, + p70_incr_cattle(t,i) = ( (p70_cattle_feed_pc_proxy(t,i,"livst_rum") + 10**(-6))* (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i)) + + (p70_cattle_feed_pc_proxy(t,i,"livst_milk") + 10**(-6)) * (p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) ) + / sum(kli_rd, p70_cattle_feed_pc_proxy(t,i,kli_rd) + 10**(-6)); +else + p70_incr_cattle(t,i) = 1; +); *' The pasture management factor is calculated by applying a linear relationship *' that links changes in pasture management with changes in the number of cattle: From 72ca3d9721d895c25912b973e35b307eac04438a Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:58:50 +0200 Subject: [PATCH 43/43] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e363af8d22..718d0efac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - ### fixed -- +- **70_livestock** fixed division by zero that could occur depending on the scenario set-up ## [4.6.10] - 2023-08-16