From 74ed9a03faf1371d0e3c1d5b0f598c4b7bf81071 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Tue, 21 May 2024 12:30:17 +0200 Subject: [PATCH 001/171] refactor selfsuff_reduced --- .../selfsuff_reduced/declarations.gms | 2 ++ .../21_trade/selfsuff_reduced/equations.gms | 24 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/modules/21_trade/selfsuff_reduced/declarations.gms b/modules/21_trade/selfsuff_reduced/declarations.gms index f6ccffef43..c139fea5dd 100644 --- a/modules/21_trade/selfsuff_reduced/declarations.gms +++ b/modules/21_trade/selfsuff_reduced/declarations.gms @@ -15,6 +15,7 @@ parameters positive variables v21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) v21_excess_prod(h,k_trade) Superregional excess production (mio. tDM per yr) + v21_prod_baseline(h,k_trade) Superregional production baseline value (mio. tDM per yr) vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) v21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) v21_import_for_feasibility(h,k_trade) Additional imports to maintain feasibility (mio. tDM per yr) @@ -23,6 +24,7 @@ positive variables equations q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) q21_notrade(h,k_notrade) Superregional production constraint of non-tradable commodities (mio. tDM per yr) + q21_prod_baseline(h,k_trade) Superregional production baseline value (mio. tDM per yr) q21_trade_reg(h,k_trade) Superregional trade balances i.e. minimum self-sufficiency ratio (1) q21_trade_reg_up(h,k_trade) Superregional trade balances i.e. maximum self-sufficiency ratio (1) q21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index e32369522a..2096f16ecb 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -24,26 +24,30 @@ *' If the trade balance reduction equals 1 (`f21_self_suff(ct,i2,k_trade) = 1`), all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. +*' Baseline value for a corridor in which the superregional production +*' can move freely based on comparative advantage. + + q21_prod_baseline(h2,k_trade).. + v21_prod_baseline(h2,k_trade) =e= + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) + v21_excess_prod(h2,k_trade)) + $(sum(ct,f21_self_suff(ct,h2,k_trade) >= 1)) + + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,f21_self_suff(ct,h2,k_trade))) + $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)); + *' Lower bound for production. q21_trade_reg(h2,k_trade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g= - ((sum(supreg(h2,i2),vm_supply(i2,k_trade)) + v21_excess_prod(h2,k_trade)) - *sum(ct,i21_trade_bal_reduction(ct,k_trade))) - $(sum(ct,f21_self_suff(ct,h2,k_trade) >= 1)) - + (sum(supreg(h2,i2),vm_supply(i2,k_trade))*sum(ct,f21_self_suff(ct,h2,k_trade)) - *sum(ct,i21_trade_bal_reduction(ct,k_trade))) - $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)) + v21_prod_baseline(h2,k_trade) + * sum(ct,i21_trade_bal_reduction(ct,k_trade)) - v21_import_for_feasibility(h2,k_trade); *' Upper bound for production. q21_trade_reg_up(h2,k_trade) .. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l= - ((sum(supreg(h2,i2),vm_supply(i2,k_trade)) + v21_excess_prod(h2,k_trade))/sum(ct,i21_trade_bal_reduction(ct,k_trade))) - $(sum(ct,f21_self_suff(ct,h2,k_trade) >= 1)) - + (sum(supreg(h2,i2),vm_supply(i2,k_trade))*sum(ct,f21_self_suff(ct,h2,k_trade))/sum(ct,i21_trade_bal_reduction(ct,k_trade))) - $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)); + v21_prod_baseline(h2,k_trade) + / sum(ct,i21_trade_bal_reduction(ct,k_trade)); *' The global excess demand of each tradable good `v21_excess_demad` equals to *' the sum over all the imports of importing regions. From 4c08628fc5fd05249e3fa379249a8e50da4e0d3e Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Tue, 21 May 2024 14:28:16 +0200 Subject: [PATCH 002/171] added changelog entry, improved comments --- CHANGELOG.md | 1 + modules/21_trade/selfsuff_reduced/equations.gms | 14 ++++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dcc35db1a..4031bd43cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **21_trade** refactor equations for enhanced readablility - **22_land_conservation and default.cfg** Added options for baseline protection - **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios - **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index 2096f16ecb..50a09eda24 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -12,19 +12,21 @@ q21_trade_glo(k_trade).. sum(i2 ,vm_prod_reg(i2,k_trade)) =g= sum(i2, vm_supply(i2,k_trade)) + sum(ct,f21_trade_balanceflow(ct,k_trade)); + *' -*' For non-tradable commodites, the regional supply should be larger or equal to the regional demand. +*' For non-tradable commodites, the superregional supply should be larger or equal to the superregional demand. q21_notrade(h2,k_notrade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_notrade)) =g= sum(supreg(h2,i2), vm_supply(i2,k_notrade)); -*' The following equation indicates the regional trade constraint for the self-sufficiency pool. -*' The share of regional demand that has to be fulfilled through the self-sufficiency pool is +*' The following equations indicate the superregional trade constraint for the self-sufficiency pool. +*' The share of superregional demand that has to be fulfilled through the self-sufficiency pool is *' determined by a trade balance reduction factor for each commodity `i21_trade_bal_reduction(ct,k_trade)` *' according to the following equations [@schmitz_trading_2012]. *' If the trade balance reduction equals 1 (`f21_self_suff(ct,i2,k_trade) = 1`), all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. -*' Baseline value for a corridor in which the superregional production +*' +*' The below equation defines the baseline value for a corridor in which the superregional production *' can move freely based on comparative advantage. q21_prod_baseline(h2,k_trade).. @@ -34,7 +36,7 @@ + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,f21_self_suff(ct,h2,k_trade))) $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)); -*' Lower bound for production. +*' Lower bound of corridor for production. q21_trade_reg(h2,k_trade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g= @@ -42,7 +44,7 @@ * sum(ct,i21_trade_bal_reduction(ct,k_trade)) - v21_import_for_feasibility(h2,k_trade); -*' Upper bound for production. +*' Upper bound of corridor for production. q21_trade_reg_up(h2,k_trade) .. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l= From 996e8e2aac943b4d3333bdebce8da54b80b640c7 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Wed, 22 May 2024 10:56:27 +0200 Subject: [PATCH 003/171] updated documentation the realization --- .../21_trade/selfsuff_reduced/equations.gms | 27 ++++++++-------- .../21_trade/selfsuff_reduced/realization.gms | 31 +++++++++++++------ 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index 50a09eda24..e3be98033a 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de *' @equations -*' In the comparative advantage pool, the only active constraint is that the global supply is larger or equal to demand. +*' In the comparative advantage pool, the main constraint is that the global supply is larger or equal to demand. *' This means that production can be freely allocated globally based on comparative advantages. q21_trade_glo(k_trade).. @@ -18,16 +18,15 @@ q21_notrade(h2,k_notrade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_notrade)) =g= sum(supreg(h2,i2), vm_supply(i2,k_notrade)); -*' The following equations indicate the superregional trade constraint for the self-sufficiency pool. -*' The share of superregional demand that has to be fulfilled through the self-sufficiency pool is +*' +*' The following equations define the production band. +*' The share of demand that has to be fulfilled through the self-sufficiency pool is *' determined by a trade balance reduction factor for each commodity `i21_trade_bal_reduction(ct,k_trade)` -*' according to the following equations [@schmitz_trading_2012]. -*' If the trade balance reduction equals 1 (`f21_self_suff(ct,i2,k_trade) = 1`), all demand enters the self-sufficiency pool. +*' [@schmitz_trading_2012]. If the trade balance reduction equals 1, all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. *' -*' The below equation defines the baseline value for a corridor in which the superregional production -*' can move freely based on comparative advantage. +*' The below equation defines the baseline value for the production band. q21_prod_baseline(h2,k_trade).. v21_prod_baseline(h2,k_trade) =e= @@ -36,7 +35,7 @@ + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,f21_self_suff(ct,h2,k_trade))) $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)); -*' Lower bound of corridor for production. +*' Lower bound for production. q21_trade_reg(h2,k_trade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g= @@ -44,7 +43,7 @@ * sum(ct,i21_trade_bal_reduction(ct,k_trade)) - v21_import_for_feasibility(h2,k_trade); -*' Upper bound of corridor for production. +*' Upper bound for production. q21_trade_reg_up(h2,k_trade) .. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l= @@ -52,7 +51,7 @@ / sum(ct,i21_trade_bal_reduction(ct,k_trade)); *' The global excess demand of each tradable good `v21_excess_demad` equals to -*' the sum over all the imports of importing regions. +*' the sum over all the imports of importing superregions. q21_excess_dem(k_trade).. v21_excess_dem(k_trade) =g= @@ -60,20 +59,22 @@ $(sum(ct,f21_self_suff(ct,h2,k_trade)) < 1)) + sum(ct,f21_trade_balanceflow(ct,k_trade)) + sum(h2, v21_import_for_feasibility(h2,k_trade)); -*' Distributing the global excess demand to exporting regions is based on regional export shares [@schmitz_trading_2012]. +*' Distributing the global excess demand to exporting superregions is based on export shares [@schmitz_trading_2012]. *' Export shares are derived from FAO data (see @schmitz_trading_2012 for details). They are 0 for importing regions. q21_excess_supply(h2,k_trade).. v21_excess_prod(h2,k_trade) =e= v21_excess_dem(k_trade)*sum(ct,f21_exp_shr(ct,h2,k_trade)); -* Trade costs are associated with exporting regions. They are dependent on net exports, trade margin, and tariffs. +* Trade costs are associated with exporting superregions. They are dependent on net exports, trade margin, and tariffs. + q21_cost_trade_reg(h2,k_trade).. v21_cost_trade_reg(h2,k_trade) =g= (i21_trade_margin(h2,k_trade) + i21_trade_tariff(h2,k_trade)) *sum(supreg(h2,i2), vm_prod_reg(i2,k_trade)-vm_supply(i2,k_trade)) + v21_import_for_feasibility(h2,k_trade) * s21_cost_import; -* Regional trade costs are the costs for each region aggregated over all the tradable commodities. +* Superregional trade costs are the costs for each region aggregated over all the tradable commodities. + q21_cost_trade(h2).. sum(supreg(h2,i2),vm_cost_trade(i2)) =e= sum(k_trade,v21_cost_trade_reg(h2,k_trade)); diff --git a/modules/21_trade/selfsuff_reduced/realization.gms b/modules/21_trade/selfsuff_reduced/realization.gms index 1e1a214358..a247a6c0f2 100644 --- a/modules/21_trade/selfsuff_reduced/realization.gms +++ b/modules/21_trade/selfsuff_reduced/realization.gms @@ -5,16 +5,27 @@ *** | MAgPIE License Exception, version 1.0 (see LICENSE file). *** | Contact: magpie@pik-potsdam.de -*' @description Within this realization, there are two ways for a region to fulfill -*' its demand for agricultural products: a self-sufficiency pool based on -*' historical region specific trade patterns, and a comparative advantage pool -*' based on most cost-efficient production. - -*' In the self-sufficiency pool, regional self-sufficiency ratios `f21_self_suff` defines -*' how much of the demand of each region `i` for each traded goods `k_trade` has to be met by domestic production. -*' Self sufficiency ratios smaller than one indicate that the region imports from the world market, -*' while self-sufficiencies greater than one indicate that the region produces for export. Trade costs, -*' inlucding trade margins and tariffs, are considered. +*' @description In this realization trade patterns defined by self-sufficiency ratios and export shares, +*' together with regional demands, establish a baseline value for the production of each product in the superregions. +*' Production is then allowed to fluctuate freely within a band around this baseline value, +*' only being enforced to maintain the condition of global production exceeding global demand. +*' The width of the production band is determined by the `i21_trade_bal_reduction` (ptb) factor. +*' +*' Effectively, this factor splits the global demand into two pools: The `ptb` share of demand goes +*' into a pool for which the origin of products is fixed by the self-sufficiency ratios and export shares. +*' This "self-sufficiency" pool thus implies minimum production levels in superregions, which are enforced by the +*' lower bounds of the production band. +*' The remaining part of the demand can be allocated more freely based on comparative advantage +*' in production of different superregions, though still being constrained a bit by the upper bounds of the production band. +*' +*' The superregional self-sufficiency ratios `f21_self_suff` define +*' how much of the demand of each superregion `h` for each traded goods `k_trade` is met by domestic production. +*' Self-sufficiency ratios smaller than one indicate that the superregion imports from the world market, +*' while self-sufficiencies greater than one indicate that the superregion produces for export. +*' The superregional export shares `f21_exp_shr` distribute the total excess demand of the importing superregions +*' to the exporting superregions. +*' +*' Trade costs, including trade margins and tariffs, are considered. *' *' ![Implementation of trade.](trade_pools.png){ width=100% } From 03930265b5fd55d4e9ffd5d8b2b1cd68190d4e11 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Wed, 22 May 2024 17:18:09 +0200 Subject: [PATCH 004/171] added sticky livestock realization --- modules/70_livestock/fbask_jan16/not_used.txt | 2 + .../fbask_jan16_sticky/declarations.gms | 61 +++++++++ .../fbask_jan16_sticky/equations.gms | 59 ++++++++ .../70_livestock/fbask_jan16_sticky/input.gms | 127 ++++++++++++++++++ .../fbask_jan16_sticky/input/files | 11 ++ .../fbask_jan16_sticky/postsolve.gms | 49 +++++++ .../fbask_jan16_sticky/preloop.gms | 88 ++++++++++++ .../fbask_jan16_sticky/presolve.gms | 92 +++++++++++++ .../fbask_jan16_sticky/realization.gms | 108 +++++++++++++++ .../70_livestock/fbask_jan16_sticky/sets.gms | 46 +++++++ modules/70_livestock/module.gms | 1 + 11 files changed, 644 insertions(+) create mode 100644 modules/70_livestock/fbask_jan16/not_used.txt create mode 100644 modules/70_livestock/fbask_jan16_sticky/declarations.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/equations.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/input.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/input/files create mode 100644 modules/70_livestock/fbask_jan16_sticky/postsolve.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/preloop.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/presolve.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/realization.gms create mode 100644 modules/70_livestock/fbask_jan16_sticky/sets.gms diff --git a/modules/70_livestock/fbask_jan16/not_used.txt b/modules/70_livestock/fbask_jan16/not_used.txt new file mode 100644 index 0000000000..c6ba37d1b9 --- /dev/null +++ b/modules/70_livestock/fbask_jan16/not_used.txt @@ -0,0 +1,2 @@ +name,type,reason +pm_interest,input,Since no capital stocks are implemented there is no need to consider interest rates. diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms new file mode 100644 index 0000000000..3a5219f12d --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -0,0 +1,61 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +positive variables + vm_dem_feed(i,kap,kall) Regional feed demand including byproducts (mio. tDM per yr) + vm_cost_prod_livst(i,factors) Livestock factor costs (mio. USD05MER per yr) + vm_cost_prod_fish(i) Fish factor costs (mio. USD05MER per yr) + v70_investment(i,kli) Investment in immobile farm capital (mio USD05MER per yr) +; + +equations + q70_feed(i,kap,kall) Regional feed demand + q70_cost_prod_liv_labor(i) Regional labor costs for livestock production + q70_cost_prod_liv_capital(i) Regional investment costs in farm capital + q70_investment(i,kli) Regional investments into farm capital + q70_cost_prod_fish(i) Regional factor input costs for fish production +; + +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 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) + i70_foddr_scp_fadeout(t_all,i) Fodder fadeout (share 0-1) to be replaced by SCP (1) + p70_country_dummy(iso) Dummy parameter indicating whether country is affected by feed scenarios (1) + p70_feedscen_region_shr(t_all,i) Weighted share of region with regards to feed scenario of countries (1) + p70_cost_share_livst(t,i,factors) Capital and labor shares of the regional factor costs for plant production for livestock (1) + p70_cost_share_calibration(i) Summation factor used to calibrate calculated capital shares with historical values (1) + i70_cost_regr(i,kap,cost_regr) Regression coefficients for livestock factor requirements (1) + i70_fac_req_livst(t_all,i,kli) Factor requirements (USD05MER per tDM) + p70_cereal_subst_fader(t_all) Cereal feed substitution with SCP fader (1) + p70_foddr_subst_fader(t_all) Foddr substitution with SCP fader (1) + p70_capital_need(t,i,kli) Capital requirements per unit of output (USD05MER per ton DM) + p70_capital(t,i,kli) Preexisting immobile capital stocks before investment (mio USD05MER) + p70_initial_1995_prod(i,kli) Initial regional production of livestock products taken from 1995 (mio ton DM) +; + + +*#################### R SECTION START (OUTPUT DECLARATIONS) #################### +parameters + ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr) + ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD05MER per yr) + ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD05MER per yr) + ov70_investment(t,i,kli,type) Investment costs in immobile farm capital (mio USD05MER per yr) + oq70_feed(t,i,kap,kall,type) Regional feed demand + oq70_cost_prod_liv_labor(t,i,type) Regional labor costs for livestock production + oq70_cost_prod_liv_capital(t,i,type) Regional investment costs for livestock production + oq70_investment(t,i,kli,type) Cellular immobile investments into farm capital (mio USD05MER) + oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production +; +*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/70_livestock/fbask_jan16_sticky/equations.gms b/modules/70_livestock/fbask_jan16_sticky/equations.gms new file mode 100644 index 0000000000..5febb63386 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/equations.gms @@ -0,0 +1,59 @@ +*** | (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 + +*' @equations + +*' Demand for different feed items is derived by multiplying the regional +*' livestock production with the respective feed baskets. Additionally, +*' inconsistencies with the FAO inventory of national feed use in the case of +*' crops as well as consideration of alternative feed sources that reduce e.g. +*' the demand for grazed biomass like scavenging and roadside grazing are +*' balanced out by the parameter `fm_feed_balanceflow`. + +q70_feed(i2,kap,kall) .. + vm_dem_feed(i2,kap,kall) =g= vm_prod_reg(i2,kap) + *sum(ct,im_feed_baskets(ct,i2,kap,kall)) + +sum(ct,fm_feed_balanceflow(ct,i2,kap,kall)); + +*' Factor requirement costs (e.g. labour, capital, but without costs for feed) +*' of livestock production depend on the amount of production and the per-unit +*' costs. For ruminant products (milk and meet), we use a regression of per-unit +*' factor costs from the GTAP database [@narayanan_gtap7_2008] and livestock +*' productivity. Here, factor costs rise with intensification. The per-unit +*' costs for non-ruminants and fish are assumed to be independent from +*' productivity trajectories for simplification. Therefore, +*' `i70_cost_regr(i,kli,"cost_regr_b")` is set to zero in the case of livestock +*' products generated in monogastric systems. + +*' To account for increased hourly labor costs and producitivity in case of an external +*' wage scenario, the total labor costs are scaled by the corresponding increase in hourly +*' labor costs and the related productivity gain from [36_employment]. + +q70_cost_prod_liv_labor(i2) .. + vm_cost_prod_livst(i2,"labor") =e= sum(kli, vm_prod_reg(i2,kli) * sum(ct, i70_fac_req_livst(ct,i2,kli))) + *sum(ct, p70_cost_share_livst(ct,i2,"labor")) + *sum(ct, (1/pm_productivity_gain_from_wages(ct,i2)) * (pm_hourly_costs(ct,i2,"scenario") / pm_hourly_costs(ct,i2,"baseline"))); + + +q70_cost_prod_fish(i2) .. + vm_cost_prod_fish(i2) =e= + vm_prod_reg(i2,"fish")*i70_cost_regr(i2,"fish","cost_regr_a"); + +*** Section implementing the "sticky" part of the realization +*' Investment costs are calculated analogously to the `sticky_feb18` realization. The costs are annuitized, +*' and corrected to make sure that the annual depreciation of the current time-step is accounted for. +q70_cost_prod_liv_capital(i2).. + vm_cost_prod_livst(i2,"capital") =e= sum(kli,v70_investment(i2,kli)) + * ((1-s70_depreciation_rate)*sum(ct,pm_interest(ct,i2)/(1+pm_interest(ct,i2))) + s70_depreciation_rate); + +*' Each livestock activity requires a certain capital stock that depends on the production. +*' The following equations make sure that new land expansion is equipped +*' with capital stock, and that depreciation of pre-existing capital is replaced. +q70_investment(i2,kli).. + v70_investment(i2,kli) =g= vm_prod_reg(i2,kli) + * sum(ct, p70_capital_need(ct,i2,kli)) + - sum(ct, p70_capital(ct,i2,kli)); diff --git a/modules/70_livestock/fbask_jan16_sticky/input.gms b/modules/70_livestock/fbask_jan16_sticky/input.gms new file mode 100644 index 0000000000..9981c2e4bb --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/input.gms @@ -0,0 +1,127 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +$setglobal c70_feed_scen ssp2 +* options: SSP: ssp1, ssp2, ssp3, ssp4, ssp5 +* SDP: SDP, SDP_EI, SDP_MC, SDP_RC +* other: constant + +* Feed substitution scenarios including functional forms, targets and transition periods +* options: constant, +* lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_50pc_20_50, lin_50pc_20_50_extend65, lin_50pc_20_50_extend80, +* lin_50pc_10_50_extend90, lin_75pc_10_50_extend90, lin_80pc_20_50, lin_80pc_20_50_extend95, lin_90pc_20_50_extend95, +* lin_99-98-90pc_20_50-60-100, sigmoid_20pc_20_50, sigmoid_50pc_20_50, sigmoid_80pc_20_50 +$setglobal c70_cereal_scp_scen constant +$setglobal c70_foddr_scp_scen constant + +$setglobal c70_fac_req_regr glo +* options: glo, reg + +scalars + s70_pyld_intercept Intercept of linear relationship determining pasture intensification (1) / 0.24 / + s70_past_mngmnt_factor_fix Year until the pasture management factor is fixed to 1 / 2005 / + s70_subst_functional_form Switch for functional form of feed substitution scenario fader (1) / 1 / + s70_feed_substitution_start Feed substitution start year / 2025 / + s70_feed_substitution_target Feed substitution target year / 2050 / + s70_cereal_scp_substitution Cereal feed substitution with SCP share (1) / 0 / + s70_foddr_scp_substitution Fodder substitution with SCP share (1) / 0 / + s70_depreciation_rate Yearly depreciation rate for capital stocks / 0.05 / + s70_multiplicator_capital_need Multiplicator for capital need in livestock production / 1 / +; + +table f70_feed_baskets(t_all,i,kap,kall,feed_scen70) Feed baskets in tDM per tDM livestock product (1) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_feed_baskets.cs3" +$offdelim; + +table fm_feed_balanceflow(t_all,i,kap,kall) Balanceflow balance difference between estimated feed baskets and FAO (mio. tDM) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_feed_balanceflow.cs3" +$offdelim; + +table f70_livestock_productivity(t_all,i,sys,feed_scen70) Productivity indicator for livestock production (t FM per animal) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_livestock_productivity.cs3" +$offdelim; + +table f70_cost_regr(kap,cost_regr) Factor requirements livestock (USD04 per tDM (A) and USD (B)) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_capit_liv_regr.csv" +$offdelim +; + +parameter f70_slaughter_feed_share(t_all,i,kap,attributes,feed_scen70) Share of feed that is incorprated in animal biomass (1) +/ +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_slaughter_feed_share.cs4" +$offdelim +/ +; + +parameter f70_pyld_slope_reg(i) Regional slope of linear relationship determining pasture intensification (1) +/ +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_pyld_slope_reg.cs4" +$offdelim +/; + +parameter f70_cap_share_reg(share_regr) Parameters for regression +/ +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_cap_share_reg.csv" +$offdelim +/ +; + +table f70_hist_cap_share(t_all,i) Historical capital share +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_cap_share.csv" +$offdelim +; + +table f70_hist_factor_costs_livst(t_all,i,kli) Historical factor costs in livestock production (mio. USD05MER) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_factor_costs_livst.cs3" +$offdelim +; + +table f70_hist_prod_livst(t_all,i,kli,attributes) Historical production quantity of livestock products (mio. t) +$ondelim +$include "./modules/70_livestock/fbask_jan16_sticky/input/f70_hist_prod_livst.cs3" +$offdelim +; + +* Set-switch for countries affected by country-specific exogenous diet scenario +* Default: all iso countries selected +sets + scen_countries70(iso) countries to be affected by selected feed sceanrio / + ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, + ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, + BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, + BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, + CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL, + COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU, + DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP, + EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR, + GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC, + GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV, + HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL, + ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM, + KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE, + LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA, + MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG, + MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM, + NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU, + NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL, + PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS, + RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE, + SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN, + SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK, + TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, + UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, + VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / +; diff --git a/modules/70_livestock/fbask_jan16_sticky/input/files b/modules/70_livestock/fbask_jan16_sticky/input/files new file mode 100644 index 0000000000..ca00704e44 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/input/files @@ -0,0 +1,11 @@ +* list of files that are required here +f70_feed_baskets.cs3 +f70_feed_balanceflow.cs3 +f70_livestock_productivity.cs3 +f70_capit_liv_regr.csv +f70_slaughter_feed_share.cs4 +f70_pyld_slope_reg.cs4 +f70_cap_share_reg.csv +f70_hist_cap_share.csv +f70_hist_factor_costs_livst.cs3 +f70_hist_prod_livst.cs3 diff --git a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms new file mode 100644 index 0000000000..cb862b38bb --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms @@ -0,0 +1,49 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' Capital update from the last investment +p70_capital(t+1,i,kli) = p70_capital(t,i,kli) + v70_investment.l(i,kli); + +*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### + ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"marginal") = vm_cost_prod_livst.m(i,factors); + ov_cost_prod_fish(t,i,"marginal") = vm_cost_prod_fish.m(i); + ov70_investment(t,i,kli,"marginal") = v70_investment.m(i,kli); + oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"marginal") = q70_cost_prod_liv_labor.m(i); + oq70_cost_prod_liv_capital(t,i,"marginal") = q70_cost_prod_liv_capital.m(i); + oq70_investment(t,i,kli,"marginal") = q70_investment.m(i,kli); + oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i); + ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"level") = vm_cost_prod_livst.l(i,factors); + ov_cost_prod_fish(t,i,"level") = vm_cost_prod_fish.l(i); + ov70_investment(t,i,kli,"level") = v70_investment.l(i,kli); + oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"level") = q70_cost_prod_liv_labor.l(i); + oq70_cost_prod_liv_capital(t,i,"level") = q70_cost_prod_liv_capital.l(i); + oq70_investment(t,i,kli,"level") = q70_investment.l(i,kli); + oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i); + ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"upper") = vm_cost_prod_livst.up(i,factors); + ov_cost_prod_fish(t,i,"upper") = vm_cost_prod_fish.up(i); + ov70_investment(t,i,kli,"upper") = v70_investment.up(i,kli); + oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"upper") = q70_cost_prod_liv_labor.up(i); + oq70_cost_prod_liv_capital(t,i,"upper") = q70_cost_prod_liv_capital.up(i); + oq70_investment(t,i,kli,"upper") = q70_investment.up(i,kli); + oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i); + ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"lower") = vm_cost_prod_livst.lo(i,factors); + ov_cost_prod_fish(t,i,"lower") = vm_cost_prod_fish.lo(i); + ov70_investment(t,i,kli,"lower") = v70_investment.lo(i,kli); + oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"lower") = q70_cost_prod_liv_labor.lo(i); + oq70_cost_prod_liv_capital(t,i,"lower") = q70_cost_prod_liv_capital.lo(i); + oq70_investment(t,i,kli,"lower") = q70_investment.lo(i,kli); + oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i); +*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### + diff --git a/modules/70_livestock/fbask_jan16_sticky/preloop.gms b/modules/70_livestock/fbask_jan16_sticky/preloop.gms new file mode 100644 index 0000000000..1d8248a79d --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/preloop.gms @@ -0,0 +1,88 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de +loop(t_all, + if(m_year(t_all) <= sm_fix_SSP2, + im_slaughter_feed_share(t_all,i,kap,attributes) = f70_slaughter_feed_share(t_all,i,kap,attributes,"ssp2"); + i70_livestock_productivity(t_all,i,sys) = f70_livestock_productivity(t_all,i,sys,"ssp2"); + im_feed_baskets(t_all,i,kap,kall) = f70_feed_baskets(t_all,i,kap,kall,"ssp2"); + else + im_slaughter_feed_share(t_all,i,kap,attributes) = f70_slaughter_feed_share(t_all,i,kap,attributes,"%c70_feed_scen%"); + i70_livestock_productivity(t_all,i,sys) = f70_livestock_productivity(t_all,i,sys,"%c70_feed_scen%"); + im_feed_baskets(t_all,i,kap,kall) = f70_feed_baskets(t_all,i,kap,kall,"%c70_feed_scen%"); + ); +); + +* set default livestock productivity to avoid division of zero in presolve.gms +i70_livestock_productivity(t_all,i,sys)$(i70_livestock_productivity(t_all,i,sys)=0) = 0.02; + +* Switch to determine countries for which feed substitution scenarios shall be applied. +* In the default case, the food scenario affects all countries when activated. +p70_country_dummy(iso) = 0; +p70_country_dummy(scen_countries70) = 1; + + +* Because MAgPIE is not run at country-level, but at region level, a region +* share is calculated that translates the countries' influence to regional level. +* Countries are weighted by their population size. +p70_feedscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p70_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); + + +if (s70_subst_functional_form = 1, + + m_linear_time_interpol(p70_cereal_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_cereal_scp_substitution); + m_linear_time_interpol(p70_foddr_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_foddr_scp_substitution); + +elseif s70_subst_functional_form = 2, + + m_sigmoid_time_interpol(p70_cereal_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_cereal_scp_substitution); + m_sigmoid_time_interpol(p70_foddr_subst_fader,s70_feed_substitution_start,s70_feed_substitution_target,0,s70_foddr_scp_substitution); + +); + +* Feed substitution scenarios including functional forms, targets and transition periods +* Note: p70_feedscen_region_shr(t,i) is 1 in the default case) +i70_cereal_scp_fadeout(t_all,i) = 1 - p70_feedscen_region_shr(t_all,i)*p70_cereal_subst_fader(t_all); +i70_foddr_scp_fadeout(t_all,i) = 1 - p70_feedscen_region_shr(t_all,i)*p70_foddr_subst_fader(t_all); + + +*** Substitution of cereal feed (kcer70) with single-cell protein (SCP) based on Nr +* Before the substitution, kcer70 is converted from DM to Nr +* using fm_attributes("nr",kcer70). +* After the substitution of kcer70 with SCP (1-i70_cereal_scp_fadeout), SCP is converted +* back DM fm_attributes("nr","scp"). +im_feed_baskets(t_all,i,kap,"scp") = im_feed_baskets(t_all,i,kap,"scp") + + sum(kcer70, im_feed_baskets(t_all,i,kap,kcer70) * (1-i70_cereal_scp_fadeout(t_all,i)) * + fm_attributes("nr",kcer70)) / fm_attributes("nr","scp"); +im_feed_baskets(t_all,i,kap,kcer70) = + im_feed_baskets(t_all,i,kap,kcer70) * i70_cereal_scp_fadeout(t_all,i); + +*** Substitution of foddr feed with single-cell protein (SCP) based on Nr +* Before the substitution, foddr is converted from DM to Nr +* using fm_attributes("nr","foddr"). +* After the substitution of foddr with SCP (1-i70_foddr_scp_fadeout), SCP is converted +* back DM fm_attributes("nr","scp"). +im_feed_baskets(t_all,i,kap,"scp") = im_feed_baskets(t_all,i,kap,"scp") + + (im_feed_baskets(t_all,i,kap,"foddr") * (1-i70_foddr_scp_fadeout(t_all,i)) * + fm_attributes("nr","foddr")) / fm_attributes("nr","scp"); +im_feed_baskets(t_all,i,kap,"foddr") = + im_feed_baskets(t_all,i,kap,"foddr") * i70_foddr_scp_fadeout(t_all,i); + + +*** choosing between reginal and global factor requirements +$if "%c70_fac_req_regr%" == "glo" i70_cost_regr(i,kli,"cost_regr_a") = f70_cost_regr(kli,"cost_regr_a"); +$if "%c70_fac_req_regr%" == "reg" i70_cost_regr(i,kli,"cost_regr_a") = sum(t_past$(ord(t_past) eq card(t_past)), (f70_hist_factor_costs_livst(t_past,i,kli) / f70_hist_prod_livst(t_past,i,kli,"dm")) - f70_cost_regr(kli,"cost_regr_b") * sum(sys_to_kli(sys,kli),i70_livestock_productivity(t_past,i,sys))); + +i70_cost_regr(i,"fish",cost_regr) = f70_cost_regr("fish",cost_regr); +i70_cost_regr(i,kap,"cost_regr_b") = f70_cost_regr(kap,"cost_regr_b"); + +i70_fac_req_livst(t_all,i,kli) = i70_cost_regr(i,kli,"cost_regr_b") * sum(sys_to_kli(sys,kli), i70_livestock_productivity(t_all,i,sys)) + i70_cost_regr(i,kli,"cost_regr_a"); +* use historic livestock factor requirements for t_past if regional switch is on. Once regression has been updated this could also be included for global factor requirements +$if "%c70_fac_req_regr%" == "reg" i70_fac_req_livst(t_all,i,kli)$(m_year(t_all) <= sum(t_past$(ord(t_past) eq card(t_past)), m_year(t_past)) and m_year(t_all) > 1990) = (f70_hist_factor_costs_livst(t_all,i,kli) / f70_hist_prod_livst(t_all,i,kli,"dm")); + +*** Section implementing the "sticky" part of the realization +* Get the initial production from the historic data +p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); \ No newline at end of file diff --git a/modules/70_livestock/fbask_jan16_sticky/presolve.gms b/modules/70_livestock/fbask_jan16_sticky/presolve.gms new file mode 100644 index 0000000000..528f02b6f4 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/presolve.gms @@ -0,0 +1,92 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + + +*' @code +*' This realization of the livestock module also estimates an exogenous +*' pasture management factor `pm_past_mngmnt_factor` that is used to scale +*' biophysical pasture yields in the module [14_yields]. + +*' The exogenous calculation of pasture management requires information on +*' 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"); + +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_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: + +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: + +if (m_year(t) <= s70_past_mngmnt_factor_fix, + pm_past_mngmnt_factor(t,i) = 1; +else + pm_past_mngmnt_factor(t,i) = ( (s70_pyld_intercept + f70_pyld_slope_reg(i)*p70_incr_cattle(t,i)**(5/(m_year(t)-m_year(t-1))) + )**((m_year(t)-m_year(t-1))/5) )*pm_past_mngmnt_factor(t-1,i); + ); + +*' @stop + +p70_cost_share_calibration(i) = f70_hist_cap_share("y2010",i)-(f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso("y2010",iso)))+f70_cap_share_reg("intercept")); + +if (m_year(t)<2010, + p70_cost_share_livst(t,i,"capital") = f70_hist_cap_share(t,i); + p70_cost_share_livst(t,i,"labor") = 1 - f70_hist_cap_share(t,i); + +elseif (m_year(t)>=2010), + p70_cost_share_livst(t,i,"capital") = f70_cap_share_reg("slope")*log10(sum(i_to_iso(i,iso),im_gdp_pc_ppp_iso(t,iso)))+f70_cap_share_reg("intercept")+p70_cost_share_calibration(i); + p70_cost_share_livst(t,i,"labor") = 1 - p70_cost_share_livst(t,i,"capital"); +); + + +*** Section implementing the "sticky" part of the realization +*' The capital need per unit of production is based on the capital share of the factor requirements, +*' as well as the interest and the depreciation rates, analogously to the `sticky_feb18` realization. +*' In addition `s70_multiplicator_capital_need` can be used to increase the capital need. + +p70_capital_need(t,i,kli) = i70_fac_req_livst(t,i,kli) + * p70_cost_share_livst(t,i,"capital") + / (pm_interest(t,i)+s70_depreciation_rate) + * s70_multiplicator_capital_need; + +if (ord(t) = 1, + +*' Estimate capital stock based on initial production. + + p70_capital(t,i,kli) = p70_capital_need(t,i,kli) * p70_initial_1995_prod(i,kli); + +else + +*' Update of existing stocks due to depreciation + + p70_capital(t,i,kli) = p70_capital(t,i,kli) * (1-s70_depreciation_rate)**(m_timestep_length); + +); diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms new file mode 100644 index 0000000000..e293d21386 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -0,0 +1,108 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +*' @description The fbask_jan16_sticky realization of the livestock module is based on +*' the fbask_jan16 realization, and only differs from it by implementing capital stocks +*' as introduced in the `sticky_feb18` factor cost module realization. +*' +*' The methodology of fbask_jan16 is described in @weindl_livestock_2017 and +*' @weindl_livestock_2017-1. An important part of the feed demand calculations +*' is conducted outside of the core MAgPIE-GAMS code. Livestock products +*' (ruminant meat, whole-milk, pork, poultry meat and eggs) are supplied by five +*' animal food systems (beef cattle, dairy cattle, pigs, broilers and laying +*' hens). The parameterization of the livestock sector in the initial year is +*' consistent with FAO statistics regarding livestock production, livestock +*' productivity and concentrate feed use. + +*' The fbask_jan16 realization requires regional and product-specific feed +*' baskets that are calculated by a set of preprocessing routines outside of the +*' MAgPIE-GAMS code. Following the methodology of @wirsenius_human_2000, feed +*' conversion (total feed input per product output in dry matter) and feed +*' baskets (demand for different feed types per product output in dry matter) +*' are derived by compiling system-specific feed energy balances. For the +*' establishment of these balances, we apply feed energy requirements per output, +*' as estimated by wirsenius_human_2000 for each animal function and animal food +*' system. These estimates are based on standardized bio-energetic equations and +*' include the minimum energy requirements for maintenance, growth, lactation, +*' reproduction and other basic biological functions of the animals. Moreover, +*' they comprise a general allowance for basic activity and temperature effects. + +*' By distributing the available feed at country level to animal food systems +*' according to their feed energy demand and dividing resulting dry matter feed +*' use by the production volume of the respective systems, we obtain both +*' estimates for feed conversion and feed baskets across different animal food +*' systems and countries. + +*' To facilitate projections of feed conversion and feed baskets, we create +*' regression models with livestock productivity (annual production per animal +*' [ton fresh matter/animal/year]) as predictor, which permit the construction +*' of livestock feeding scenarios. Currently, feeding scenarios are derived +*' based on exogenous livestock productivity scenarios consistent with the +*' storylines of the Shared Socioeconomic Pathways (SSPs). For beef cattle, pigs +*' and broilers, livestock productivity is defined as meat production per +*' animals in stock (e.g. total cattle herd) and for dairy cattle and laying hen +*' as milk or egg production per producing animals (e.g. milk cows). + +*' A power function is used to describe the functional relation between feed +*' conversion and livestock productivity: + +*' ![Relationship between feed conversion and livestock productivity +*' [@weindl_livestock_2017].](feed_conv.jpg){ width=100% } + +*' In the case of feed composition, we use an additional proxy parameter in our +*' analysis. What type of biomass is used to feed animals is to a certain extent +*' influenced by universal aspects (e.g. the need for more energy-rich feed at +*' higher productivity levels), whereas other aspects are strongly influenced by +*' geographical location (e.g. availability and costs of permanent pasture +*' compared to cropland feed, agro-ecological and climatic conditions that +*' favour selected feed items; socio-cultural determinants etc.). For cattle +*' systems the proxy (climate-zone specific factor) was determined by +*' calculating the share of the national population living in arid and cold +*' climate zones. + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for beef cattle systems +*' [@weindl_livestock_2017].](feed_comp_beef.jpg){ width=60% } + +*' ![Relationship between the share of crop residues, occasional feed and grazed +*' biomass in feed baskets and livestock productivity for diary cattle systems +*' [@weindl_livestock_2017].](feed_comp_dairy.jpg){ width=60% } + +*' These relationships between feed baskets and livestock productivity are used +*' to construct feeding scenarios that reflect the narratives of the SSPs. The +*' resulting feed baskets enter the MAgPIE model as scenario-dependent input data +*' and are crucial for the feed demand calculations in the livestock module. + +*' +*' In this realization the capital share of livestock production cost does not have +*' to be paid every timestep, but is fulfilled by having a corresponding capital stock, +*' which mostly persists across timesteps. +*' This means that the production becomes cheaper in regions with +*' higher capital shares and existing corresponding capital stocks, +*' wich makes the livestock production "stick" to some degree to existing levels. +*' Another effect is that production increases are more likely to occure regions +*' of more capital intensive livestock systems with established stocks. +*' +*' The realization is based on the `sticky_feb18` factor cost realization, but +*' also differs from it in some ways. At the creation time the main differences where: +*' 1. capital stocks are on the regional level not on cluster level +*' 2. no differentiation of mobile and immobile captital - all captital stocks are immobile +*' +*' @limitations Intensification of livestock production and related changes in +*' livestock feeding are modelled exogenously. Therefore, the livestock sector +*' does not endogenously respond to demand and climate shocks and policies, e.g. +*' targeting climate protection. + +*####################### R SECTION START (PHASES) ############################## +$Ifi "%phase%" == "sets" $include "./modules/70_livestock/fbask_jan16_sticky/sets.gms" +$Ifi "%phase%" == "declarations" $include "./modules/70_livestock/fbask_jan16_sticky/declarations.gms" +$Ifi "%phase%" == "input" $include "./modules/70_livestock/fbask_jan16_sticky/input.gms" +$Ifi "%phase%" == "equations" $include "./modules/70_livestock/fbask_jan16_sticky/equations.gms" +$Ifi "%phase%" == "preloop" $include "./modules/70_livestock/fbask_jan16_sticky/preloop.gms" +$Ifi "%phase%" == "presolve" $include "./modules/70_livestock/fbask_jan16_sticky/presolve.gms" +$Ifi "%phase%" == "postsolve" $include "./modules/70_livestock/fbask_jan16_sticky/postsolve.gms" +*######################## R SECTION END (PHASES) ############################### diff --git a/modules/70_livestock/fbask_jan16_sticky/sets.gms b/modules/70_livestock/fbask_jan16_sticky/sets.gms new file mode 100644 index 0000000000..2382b598f7 --- /dev/null +++ b/modules/70_livestock/fbask_jan16_sticky/sets.gms @@ -0,0 +1,46 @@ +*** | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +*** | authors, and contributors see CITATION.cff file. This file is part +*** | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +*** | AGPL-3.0, you are granted additional permissions described in the +*** | MAgPIE License Exception, version 1.0 (see LICENSE file). +*** | Contact: magpie@pik-potsdam.de + +sets + + cost_regr Cost regression parameters + /cost_regr_a,cost_regr_b/ + + share_regr regression parameters for capital share calculation + /slope, intercept/ + + feed_scen70 scenarios + / ssp1, ssp2, ssp3, ssp4, ssp5, constant, + SDP, SDP_EI, SDP_MC, SDP_RC / + + sys Livestock production systems + /sys_pig, sys_beef, sys_chicken, sys_hen, sys_dairy/ + + sys_meat(sys) Livestock meat production systems + /sys_pig, sys_beef, sys_chicken/ + + sys_nonmeat(sys) Livestock non-meat production systems + /sys_hen, sys_dairy/ + + + sys_to_kli(sys,kli) Mapping between livestock producton systems and livestock products + /sys_pig . livst_pig + sys_beef . livst_rum + sys_chicken . livst_chick + sys_hen . livst_egg + sys_dairy .livst_milk + / + + kcer70(kall) Cereals + / tece, maiz, trce, rice_pro / + + fadeoutscen70 Feed 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, + lin_50pc_10_50_extend90, lin_75pc_10_50_extend90, lin_80pc_20_50, lin_80pc_20_50_extend95, lin_90pc_20_50_extend95, + lin_99-98-90pc_20_50-60-100, sigmoid_20pc_20_50, sigmoid_50pc_20_50, sigmoid_80pc_20_50 / +; diff --git a/modules/70_livestock/module.gms b/modules/70_livestock/module.gms index e3275b943b..6706c76329 100644 --- a/modules/70_livestock/module.gms +++ b/modules/70_livestock/module.gms @@ -24,4 +24,5 @@ *###################### R SECTION START (MODULETYPES) ########################## $Ifi "%livestock%" == "fbask_jan16" $include "./modules/70_livestock/fbask_jan16/realization.gms" +$Ifi "%livestock%" == "fbask_jan16_sticky" $include "./modules/70_livestock/fbask_jan16_sticky/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ From e8208bf373d5471bc331cd0e3183c8033c8d9bbb Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Wed, 22 May 2024 17:40:43 +0200 Subject: [PATCH 005/171] improved documentation --- .../70_livestock/fbask_jan16_sticky/realization.gms | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/realization.gms b/modules/70_livestock/fbask_jan16_sticky/realization.gms index e293d21386..b65ae629c8 100644 --- a/modules/70_livestock/fbask_jan16_sticky/realization.gms +++ b/modules/70_livestock/fbask_jan16_sticky/realization.gms @@ -80,17 +80,17 @@ *' *' In this realization the capital share of livestock production cost does not have *' to be paid every timestep, but is fulfilled by having a corresponding capital stock, -*' which mostly persists across timesteps. +*' which mostly persists across timesteps. (See `s70_depreciation_rate`) *' This means that the production becomes cheaper in regions with *' higher capital shares and existing corresponding capital stocks, -*' wich makes the livestock production "stick" to some degree to existing levels. -*' Another effect is that production increases are more likely to occure regions -*' of more capital intensive livestock systems with established stocks. +*' which makes the livestock production "stick" to some degree to existing levels. +*' Another effect is that production increases are more likely to occur in regions +*' of more capital intensive livestock systems with already established stocks. *' *' The realization is based on the `sticky_feb18` factor cost realization, but *' also differs from it in some ways. At the creation time the main differences where: *' 1. capital stocks are on the regional level not on cluster level -*' 2. no differentiation of mobile and immobile captital - all captital stocks are immobile +*' 2. no differentiation of mobile and immobile capital - all capital stocks are immobile *' *' @limitations Intensification of livestock production and related changes in *' livestock feeding are modelled exogenously. Therefore, the livestock sector From 7239af1f48128d54b449ca5289b4dbfa775da19e Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Thu, 23 May 2024 13:37:04 +0200 Subject: [PATCH 006/171] updated default.cfg and changelog --- CHANGELOG.md | 1 + config/default.cfg | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3b75a1cb3..6189f3facc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **70_livestock** added realization `fbask_jan16_sticky` - **22_land_conservation and default.cfg** Added options for baseline protection - **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios - **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios diff --git a/config/default.cfg b/config/default.cfg index f4ec0404f4..d51079889b 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1816,6 +1816,7 @@ cfg$gms$s62_midpoint_dem_bioplastic <- 2050 # def = 2050 # ***--------------------- 70_livestock ----------------------------------- # * (fbask_jan16): default feed basket realization +# * (fbask_jan16_sticky): feed basket realization using captial stocks as in sticky_feb18 cfg$gms$livestock <- "fbask_jan16" # def = fbask_jan16 # * Year until the pasture management factor is fixed to 1 @@ -1850,6 +1851,9 @@ cfg$gms$s70_feed_substitution_target <- 2050 # def = 2050 # * for consistency. cfg$gms$c70_fac_req_regr <- "glo" # def = glo +# Settings only for realization `fbask_jan16_sticky` +cfg$gms$s70_multiplicator_capital_need <- 1 # def = 1 + # ***--------------------- 71_disagg_lvst ----------------------------------- # * (off): default # * (foragebased_aug18): Disaggregation of livestock to cells From 1ba2f7e65fa797f5416f3e1c5819ee4a087de952 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Fri, 24 May 2024 15:41:01 +0200 Subject: [PATCH 007/171] use macro instead of new variable --- core/macros.gms | 7 +++++++ .../selfsuff_reduced/declarations.gms | 2 -- .../21_trade/selfsuff_reduced/equations.gms | 20 +++++-------------- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/core/macros.gms b/core/macros.gms index 0103e94c73..91e59050a5 100644 --- a/core/macros.gms +++ b/core/macros.gms @@ -114,3 +114,10 @@ $macro m58_LandLeft(pclandFull,setFull,vland,pcland) \ (sum(&&setFull,pclandFull(j2,&&setFull)) \ - sum(manPeat58_alias$(not sameas(manPeat58_alias,manPeat58)),vland(j2,manPeat58_alias)) \ - sum(manPeat58_alias$(sameas(manPeat58_alias,manPeat58)),pcland(j2,manPeat58_alias))) + +* macro for trade module +$macro baseline_production(supply, excess_prod, self_suff) \ + ((sum(supreg(h2,i2),supply(i2,k_trade)) + excess_prod(h2,k_trade)) \ + $((sum(ct,self_suff(ct,h2,k_trade)) >= 1)) \ + + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,self_suff(ct,h2,k_trade))) \ + $((sum(ct,self_suff(ct,h2,k_trade)) < 1))) \ No newline at end of file diff --git a/modules/21_trade/selfsuff_reduced/declarations.gms b/modules/21_trade/selfsuff_reduced/declarations.gms index c139fea5dd..f6ccffef43 100644 --- a/modules/21_trade/selfsuff_reduced/declarations.gms +++ b/modules/21_trade/selfsuff_reduced/declarations.gms @@ -15,7 +15,6 @@ parameters positive variables v21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) v21_excess_prod(h,k_trade) Superregional excess production (mio. tDM per yr) - v21_prod_baseline(h,k_trade) Superregional production baseline value (mio. tDM per yr) vm_cost_trade(i) Regional trade costs (mio. USD05MER per yr) v21_cost_trade_reg(h,k_trade) Superregional trade costs for each tradable commodity (mio. USD05MER per yr) v21_import_for_feasibility(h,k_trade) Additional imports to maintain feasibility (mio. tDM per yr) @@ -24,7 +23,6 @@ positive variables equations q21_trade_glo(k_trade) Global production constraint (mio. tDM per yr) q21_notrade(h,k_notrade) Superregional production constraint of non-tradable commodities (mio. tDM per yr) - q21_prod_baseline(h,k_trade) Superregional production baseline value (mio. tDM per yr) q21_trade_reg(h,k_trade) Superregional trade balances i.e. minimum self-sufficiency ratio (1) q21_trade_reg_up(h,k_trade) Superregional trade balances i.e. maximum self-sufficiency ratio (1) q21_excess_dem(k_trade) Global excess demand (mio. tDM per yr) diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index e3be98033a..18798e62c6 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -25,30 +25,20 @@ *' [@schmitz_trading_2012]. If the trade balance reduction equals 1, all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. -*' -*' The below equation defines the baseline value for the production band. - - q21_prod_baseline(h2,k_trade).. - v21_prod_baseline(h2,k_trade) =e= - (sum(supreg(h2,i2),vm_supply(i2,k_trade)) + v21_excess_prod(h2,k_trade)) - $(sum(ct,f21_self_suff(ct,h2,k_trade) >= 1)) - + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,f21_self_suff(ct,h2,k_trade))) - $(sum(ct,f21_self_suff(ct,h2,k_trade) < 1)); - *' Lower bound for production. q21_trade_reg(h2,k_trade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g= - v21_prod_baseline(h2,k_trade) - * sum(ct,i21_trade_bal_reduction(ct,k_trade)) - - v21_import_for_feasibility(h2,k_trade); + baseline_production(vm_supply, v21_excess_prod, f21_self_suff) + * sum(ct,i21_trade_bal_reduction(ct,k_trade)) + - v21_import_for_feasibility(h2,k_trade); *' Upper bound for production. q21_trade_reg_up(h2,k_trade) .. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l= - v21_prod_baseline(h2,k_trade) - / sum(ct,i21_trade_bal_reduction(ct,k_trade)); + baseline_production(vm_supply, v21_excess_prod, f21_self_suff) + / sum(ct,i21_trade_bal_reduction(ct,k_trade)); *' The global excess demand of each tradable good `v21_excess_demad` equals to *' the sum over all the imports of importing superregions. From 20a966f04d740e85080dfd632d6dab6fc886d4b7 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Fri, 24 May 2024 16:09:03 +0200 Subject: [PATCH 008/171] minor updates in documentation --- modules/21_trade/selfsuff_reduced/equations.gms | 5 +++-- modules/21_trade/selfsuff_reduced/realization.gms | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index 18798e62c6..e02fe74a6b 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -24,6 +24,7 @@ *' determined by a trade balance reduction factor for each commodity `i21_trade_bal_reduction(ct,k_trade)` *' [@schmitz_trading_2012]. If the trade balance reduction equals 1, all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. +*' Note that `baseline_production` is a macro defined in core/macros.gms. *' Lower bound for production. @@ -50,7 +51,7 @@ + sum(ct,f21_trade_balanceflow(ct,k_trade)) + sum(h2, v21_import_for_feasibility(h2,k_trade)); *' Distributing the global excess demand to exporting superregions is based on export shares [@schmitz_trading_2012]. -*' Export shares are derived from FAO data (see @schmitz_trading_2012 for details). They are 0 for importing regions. +*' Export shares are derived from FAO data (see @schmitz_trading_2012 for details). They are 0 for importing superregions. q21_excess_supply(h2,k_trade).. v21_excess_prod(h2,k_trade) =e= @@ -64,7 +65,7 @@ *sum(supreg(h2,i2), vm_prod_reg(i2,k_trade)-vm_supply(i2,k_trade)) + v21_import_for_feasibility(h2,k_trade) * s21_cost_import; -* Superregional trade costs are the costs for each region aggregated over all the tradable commodities. +* Superregional trade costs are the costs for each superregion aggregated over all the tradable commodities. q21_cost_trade(h2).. sum(supreg(h2,i2),vm_cost_trade(i2)) =e= sum(k_trade,v21_cost_trade_reg(h2,k_trade)); diff --git a/modules/21_trade/selfsuff_reduced/realization.gms b/modules/21_trade/selfsuff_reduced/realization.gms index a247a6c0f2..b44e087013 100644 --- a/modules/21_trade/selfsuff_reduced/realization.gms +++ b/modules/21_trade/selfsuff_reduced/realization.gms @@ -14,12 +14,12 @@ *' Effectively, this factor splits the global demand into two pools: The `ptb` share of demand goes *' into a pool for which the origin of products is fixed by the self-sufficiency ratios and export shares. *' This "self-sufficiency" pool thus implies minimum production levels in superregions, which are enforced by the -*' lower bounds of the production band. +*' lower bound of the production band. *' The remaining part of the demand can be allocated more freely based on comparative advantage *' in production of different superregions, though still being constrained a bit by the upper bounds of the production band. *' *' The superregional self-sufficiency ratios `f21_self_suff` define -*' how much of the demand of each superregion `h` for each traded goods `k_trade` is met by domestic production. +*' how much of the demand of each superregion `h` for each traded good `k_trade` is met by domestic production. *' Self-sufficiency ratios smaller than one indicate that the superregion imports from the world market, *' while self-sufficiencies greater than one indicate that the superregion produces for export. *' The superregional export shares `f21_exp_shr` distribute the total excess demand of the importing superregions From 147dcf2f0070e0610fd046557fdeb9520e39ea72 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 14:07:31 +0200 Subject: [PATCH 009/171] added output report with corresponding r markdown --- scripts/output/projects/MAgPIE_EU_report.R | 3 + .../projects/MAgPIE_EU_report_notebook.Rmd | 249 ++++++++++++++++++ 2 files changed, 252 insertions(+) create mode 100644 scripts/output/projects/MAgPIE_EU_report.R create mode 100644 scripts/output/projects/MAgPIE_EU_report_notebook.Rmd diff --git a/scripts/output/projects/MAgPIE_EU_report.R b/scripts/output/projects/MAgPIE_EU_report.R new file mode 100644 index 0000000000..dae269932a --- /dev/null +++ b/scripts/output/projects/MAgPIE_EU_report.R @@ -0,0 +1,3 @@ +readArgs("outputdir") +rmarkdown::render("./scripts/output/projects/MAgPIE_EU_report_notebook.Rmd", + output_dir = paste0(outputdir, "/validation")) diff --git a/scripts/output/projects/MAgPIE_EU_report_notebook.Rmd b/scripts/output/projects/MAgPIE_EU_report_notebook.Rmd new file mode 100644 index 0000000000..3af76a13c7 --- /dev/null +++ b/scripts/output/projects/MAgPIE_EU_report_notebook.Rmd @@ -0,0 +1,249 @@ +--- +title: "Compare MAgPIE EU with LUH Data" +output: + html_document: + df_print: paged + code_folding: hide +--- + + +This output report validates spatial pattern of the EU regions against LUH2v2 data. + +# Setup and read data +```{r, setup, include=FALSE} +knitr::opts_knit$set(root.dir = dirname(dirname(dirname(getwd())))) +``` + +```{r load-libraries, echo = T, results = 'hide', message=FALSE, warning=FALSE} +# setup working dir and packages, read outputdir +readArgs("outputdir") +library(madrat) +library(mrcommons) +library(magpie4) + +library(ggplot2) +library(plotly) +library(gridExtra) +library(patchwork) + +library(dplyr) +library(tidyr) +library(stringr) +``` + +```{r} +print(paste0("Script started for output directory: ", outputdir)) +``` + +```{r read-data, echo = T, results = 'hide', message = FALSE, warning = FALSE} +compareYears <- c(1995, 2000, 2005, 2010) +# ----- Read model output and luh2v2 data, process and bind them to a validation object ----- +#### load and process reference data to match with model data +luh2v2 <- calcOutput("LanduseInitialisation", aggregate = FALSE, cellular = TRUE, + nclasses = "seven", cells = "lpjmlcell") +luh2v2 <- luh2v2[, compareYears, ] +# add subdimension for reference data +getNames(luh2v2) <- paste0(getNames(luh2v2), ".ref") + +#### load and process model data to match with reference data +path2landoutput <- file.path(outputdir, "cell.land_0.5.mz") +cellLand <- read.magpie(path2landoutput) +cellLand <- cellLand[, compareYears, ] +# add subdimension for model data +getNames(cellLand) <- paste0(getNames(cellLand), ".mod") +load(file.path(outputdir, "spatial_header.rda")) + +##### bind model and reference data +validationObj <- mbind(cellLand, luh2v2) + +##### extract EU countries +mapping <- toolGetMapping("regionmappingH12.csv") +countriesEU <- mapping$CountryCode[mapping$RegionCode == "EUR"] +``` + + +# Plot data + +```{r, load-plot-functions, echo = T, results = 'hide'} +# ----- Create a plotting functions ----- +convertToWideDataframe <- function(magclassObj) { + as.data.frame(magclassObj) %>% + pivot_wider(names_from = "Data2", values_from = "Value") +} + +subsetCountryCluster <- function(magclassObj, countries) { + magclassObj[intersect(countries, getItems(magclassObj, split=TRUE)[[1]][[1]]), , ] +} + +# combines a scatter plot with maps such that facets are aligned +plotCombined <- function(validationObj) { + # create the plots + p1 <- plotScatter(validationObj) + p2 <- plotMaps(validationObj) + + # combine and align the plots using patchwork + combinedPlot <- p1 / p2 + + # print the combined plot + print(combinedPlot) +} + +# create scatter plot +plotScatter <- function(validationObj) { + validationObj <- toolCoord2Isocell(validationObj, "lpjcell") + validationObj <- subsetCountryCluster(validationObj, countriesEU) + + ### Create quality measure dataframe with RMSE, MAE a.o. + qualityMeasuresDf <- NULL # list of dataframes, one for each year + numericYears <- as.numeric(gsub("y", "", getItems(validationObj, 2))) + for (year in numericYears) { + # get a vector with the quality measures + qualityMeasures <- luplot::qualityMeasure( + validationObj[, year, "mod"], validationObj[, year, "ref"], + measures = c("Willmott", "Willmott refined", "Nash Sutcliffe", "RMSE", "MAE") + ) + + # Create text for the year facet + text <- "" + for (i in seq_along(qualityMeasures)) { + text <- paste0(text, stringr::str_trunc(names(qualityMeasures)[i], 12, ellipsis = "."), + " : ", qualityMeasures[i], "\n") + } + + # Create df for that year + qualityMeasuresDf[[year]] <- data.frame( + Year = year, + text = text + ) + } + qualityMeasBinded <- dplyr::bind_rows(qualityMeasuresDf) # bind all year dataframes + + # Create the plot with facets + validationDF <- convertToWideDataframe(validationObj) + + p <- ggplot(validationDF, + aes(x = mod, y = ref, reg = Region, cell = Cell, relativeErr = (mod - ref) / ref)) + + geom_point(size = 0.5) + + geom_abline(color = "#663939", size = 1.5) + + facet_wrap(~ Year, scales = "free", ncol = 4) + # Create facets based on 'Year' + labs(x = "MAgPIE output", y = "luh2v2") + + theme(panel.background = element_rect(fill = "gray55"), + panel.grid.major = element_line(color = "gray62"), + panel.grid.minor = element_line(color = "grey58")) + + # Add quality measure text + p <- p + geom_text(x = 0, y = Inf, aes(label = text), color = "#ffb5b5", # bright color contrasting dark background + hjust = 0, vjust = 1.1, nudge_x = 10, size = 2.6, family = "sans", fontface = "bold", + data = qualityMeasBinded, inherit.aes = FALSE) + + return(p) +} + +# create maps +plotMaps <- function(validationObj) { + # create a ggplot object using luplot + relErr <- (validationObj[, , paste0("mod")] - validationObj[, , paste0("ref")]) / + (validationObj[, , paste0("ref")]) + + p <- luplot::plotmap2(relErr, + legend_range = c(-2, 2), legendname = "relative\n diff \n to \n LUH2v2", ncol = 4, + midcol = "#ffffff", lowcol = "blue", highcol = "red", midpoint = 0, + title = "" + ) + + # adjust the plot + p <- p + coord_sf(xlim = c(-10, 40), ylim = c(35, 70)) + facet_wrap(~ Year, ncol = 4) + + theme(aspect.ratio = 1, legend.title = element_text(size = 8)) + + p <- p + guides(fill = guide_colorbar(barheight = 5, barwidth = 0.2)) + return(p) +} + +# create and interactive scatterplot for eu countries of a year +plotInteractiveSub <- function(validationObj, year) { + p <- plotScatter(validationObj[, year, ]) + + p <- p + ggtitle(paste0("EU Countries ", year)) + p <- plotly::ggplotly(p) + p +} +``` + +## crop +```{r crop,message=FALSE, warning=FALSE, out.width="100%"} +type <- "crop" +plotCombined(validationObj[, , type]) +``` + +```{r crop2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## pasture +```{r past,message=FALSE, warning=FALSE, out.width="100%"} +type <- "past" +plotCombined(validationObj[, , type]) +``` + +```{r past2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## forestry +```{r forestry,message=FALSE, warning=FALSE, out.width="100%"} +type <- "forestry" +plotCombined(validationObj[, , type]) +``` + +```{r forestry2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## primforest +```{r primforest,message=FALSE, warning=FALSE, out.width="100%"} +type <- "primforest" +plotCombined(validationObj[, , type]) +``` + +```{r primforest2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## secdforest +```{r secdforest,message=FALSE, warning=FALSE, out.width="100%"} +type <- "secdforest" +plotCombined(validationObj[, , type]) +``` + +```{r secdforest2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## urban + +```{r urban,message=FALSE, warning=FALSE, out.width="100%"} +type <- "urban" +plotCombined(validationObj[, , type]) +``` + +```{r urban2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` + +## other +```{r other, message=FALSE, warning=FALSE, out.width="100%"} +type <- "other" +plotCombined(validationObj[, , type]) +``` + +```{r other2, message=FALSE, warning=FALSE, fig.align="center"} +plotInteractiveSub(validationObj[, , type], 2010) +``` From eec7b46dd0e8e8c6bcd7386e7ea6310a8a748faf Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 14:57:33 +0200 Subject: [PATCH 010/171] renamed report --- scripts/output/projects/{MAgPIE_EU_report.R => EU_report.R} | 2 +- .../projects/{MAgPIE_EU_report_notebook.Rmd => EU_report.Rmd} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename scripts/output/projects/{MAgPIE_EU_report.R => EU_report.R} (53%) rename scripts/output/projects/{MAgPIE_EU_report_notebook.Rmd => EU_report.Rmd} (100%) diff --git a/scripts/output/projects/MAgPIE_EU_report.R b/scripts/output/projects/EU_report.R similarity index 53% rename from scripts/output/projects/MAgPIE_EU_report.R rename to scripts/output/projects/EU_report.R index dae269932a..d8b2126a24 100644 --- a/scripts/output/projects/MAgPIE_EU_report.R +++ b/scripts/output/projects/EU_report.R @@ -1,3 +1,3 @@ readArgs("outputdir") -rmarkdown::render("./scripts/output/projects/MAgPIE_EU_report_notebook.Rmd", +rmarkdown::render("./scripts/output/projects/EU_report.Rmd", output_dir = paste0(outputdir, "/validation")) diff --git a/scripts/output/projects/MAgPIE_EU_report_notebook.Rmd b/scripts/output/projects/EU_report.Rmd similarity index 100% rename from scripts/output/projects/MAgPIE_EU_report_notebook.Rmd rename to scripts/output/projects/EU_report.Rmd From 8b0fe3bda3a0abb1f5550ee5e7a7bf6a73d09da8 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 14:59:14 +0200 Subject: [PATCH 011/171] added changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b558901db8..6690fd6cda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **35_natveg** `vm_land(j2,"forestry")` included in NPI/NDC constraint `q35_min_forest` ### added +- **scripts** added Magpie EU report `EU_report.R` that uses `EU_report.Rmd` - **default.cfg** added cropland growth constraint `cfg$gms$s30_annual_max_growth` - **default.cfg** added technical cost for missing BII increase `cfg$gms$s44_cost_bii_missing` - **default.cfg** added settings for new price-driven bioenergy realization `1st2ndgen_priced_feb24`: `cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix`, `cfg$gms$c60_bioenergy_subsidy_fix_SSP2`, `s60_bioenergy_gj_price_1st`, From 48917e7c6319cbbe93465c6197648be6fb84dc38 Mon Sep 17 00:00:00 2001 From: DavidhoPIK <101278418+DavidhoPIK@users.noreply.github.com> Date: Mon, 27 May 2024 15:05:10 +0200 Subject: [PATCH 012/171] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6690fd6cda..457320063d 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/). - **35_natveg** `vm_land(j2,"forestry")` included in NPI/NDC constraint `q35_min_forest` ### added -- **scripts** added Magpie EU report `EU_report.R` that uses `EU_report.Rmd` +- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` - **default.cfg** added cropland growth constraint `cfg$gms$s30_annual_max_growth` - **default.cfg** added technical cost for missing BII increase `cfg$gms$s44_cost_bii_missing` - **default.cfg** added settings for new price-driven bioenergy realization `1st2ndgen_priced_feb24`: `cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix`, `cfg$gms$c60_bioenergy_subsidy_fix_SSP2`, `s60_bioenergy_gj_price_1st`, From a963021d59bc11ecef8d3813b23f90b0ce9b0a0c Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 16:35:02 +0200 Subject: [PATCH 013/171] moved changelog entry to added --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6189f3facc..3006273180 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed -- **70_livestock** added realization `fbask_jan16_sticky` - **22_land_conservation and default.cfg** Added options for baseline protection - **15_food, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying food substitution scenarios and exogeneous food intake scenarios - **70_livestock, default.cfg and scenario_config.csv** changed fader setup and introduced new switches for specifying feed substitution with SCP scenarios @@ -17,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** start/test_runs.R added 2 more test runs from FSEC ### added +- **70_livestock** added realization `fbask_jan16_sticky` - **default.cfg** added cropland growth constraint `cfg$gms$s30_annual_max_growth` - **default.cfg** added technical cost for missing BII increase `cfg$gms$s44_cost_bii_missing` - **default.cfg** added settings for new price-driven bioenergy realization `1st2ndgen_priced_feb24`: `cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix`, `cfg$gms$c60_bioenergy_subsidy_fix_SSP2`, `s60_bioenergy_gj_price_1st`, From 32e2b079579b721b340d0ca18c74dec89b413aa9 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 27 May 2024 16:38:18 +0200 Subject: [PATCH 014/171] added R generated updated of sections of modules --- .../fbask_jan16_sticky/declarations.gms | 18 ++--- .../fbask_jan16_sticky/postsolve.gms | 72 +++++++++---------- .../fbask_jan16_sticky/preloop.gms | 2 +- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/modules/70_livestock/fbask_jan16_sticky/declarations.gms b/modules/70_livestock/fbask_jan16_sticky/declarations.gms index 3a5219f12d..87bfd6c37e 100644 --- a/modules/70_livestock/fbask_jan16_sticky/declarations.gms +++ b/modules/70_livestock/fbask_jan16_sticky/declarations.gms @@ -48,14 +48,14 @@ parameters *#################### R SECTION START (OUTPUT DECLARATIONS) #################### parameters - ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr) - ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD05MER per yr) - ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD05MER per yr) - ov70_investment(t,i,kli,type) Investment costs in immobile farm capital (mio USD05MER per yr) - oq70_feed(t,i,kap,kall,type) Regional feed demand - oq70_cost_prod_liv_labor(t,i,type) Regional labor costs for livestock production - oq70_cost_prod_liv_capital(t,i,type) Regional investment costs for livestock production - oq70_investment(t,i,kli,type) Cellular immobile investments into farm capital (mio USD05MER) - oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production + ov_dem_feed(t,i,kap,kall,type) Regional feed demand including byproducts (mio. tDM per yr) + ov_cost_prod_livst(t,i,factors,type) Livestock factor costs (mio. USD05MER per yr) + ov_cost_prod_fish(t,i,type) Fish factor costs (mio. USD05MER per yr) + ov70_investment(t,i,kli,type) Investment in immobile farm capital (mio USD05MER per yr) + oq70_feed(t,i,kap,kall,type) Regional feed demand + oq70_cost_prod_liv_labor(t,i,type) Regional labor costs for livestock production + oq70_cost_prod_liv_capital(t,i,type) Regional investment costs in farm capital + oq70_investment(t,i,kli,type) Regional investments into farm capital + oq70_cost_prod_fish(t,i,type) Regional factor input costs for fish production ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms index cb862b38bb..f1607d9519 100644 --- a/modules/70_livestock/fbask_jan16_sticky/postsolve.gms +++ b/modules/70_livestock/fbask_jan16_sticky/postsolve.gms @@ -9,41 +9,41 @@ p70_capital(t+1,i,kli) = p70_capital(t,i,kli) + v70_investment.l(i,kli); *#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall); - ov_cost_prod_livst(t,i,factors,"marginal") = vm_cost_prod_livst.m(i,factors); - ov_cost_prod_fish(t,i,"marginal") = vm_cost_prod_fish.m(i); - ov70_investment(t,i,kli,"marginal") = v70_investment.m(i,kli); - oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall); - oq70_cost_prod_liv_labor(t,i,"marginal") = q70_cost_prod_liv_labor.m(i); - oq70_cost_prod_liv_capital(t,i,"marginal") = q70_cost_prod_liv_capital.m(i); - oq70_investment(t,i,kli,"marginal") = q70_investment.m(i,kli); - oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i); - ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall); - ov_cost_prod_livst(t,i,factors,"level") = vm_cost_prod_livst.l(i,factors); - ov_cost_prod_fish(t,i,"level") = vm_cost_prod_fish.l(i); - ov70_investment(t,i,kli,"level") = v70_investment.l(i,kli); - oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall); - oq70_cost_prod_liv_labor(t,i,"level") = q70_cost_prod_liv_labor.l(i); - oq70_cost_prod_liv_capital(t,i,"level") = q70_cost_prod_liv_capital.l(i); - oq70_investment(t,i,kli,"level") = q70_investment.l(i,kli); - oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i); - ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall); - ov_cost_prod_livst(t,i,factors,"upper") = vm_cost_prod_livst.up(i,factors); - ov_cost_prod_fish(t,i,"upper") = vm_cost_prod_fish.up(i); - ov70_investment(t,i,kli,"upper") = v70_investment.up(i,kli); - oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall); - oq70_cost_prod_liv_labor(t,i,"upper") = q70_cost_prod_liv_labor.up(i); - oq70_cost_prod_liv_capital(t,i,"upper") = q70_cost_prod_liv_capital.up(i); - oq70_investment(t,i,kli,"upper") = q70_investment.up(i,kli); - oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i); - ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall); - ov_cost_prod_livst(t,i,factors,"lower") = vm_cost_prod_livst.lo(i,factors); - ov_cost_prod_fish(t,i,"lower") = vm_cost_prod_fish.lo(i); - ov70_investment(t,i,kli,"lower") = v70_investment.lo(i,kli); - oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall); - oq70_cost_prod_liv_labor(t,i,"lower") = q70_cost_prod_liv_labor.lo(i); - oq70_cost_prod_liv_capital(t,i,"lower") = q70_cost_prod_liv_capital.lo(i); - oq70_investment(t,i,kli,"lower") = q70_investment.lo(i,kli); - oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i); + ov_dem_feed(t,i,kap,kall,"marginal") = vm_dem_feed.m(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"marginal") = vm_cost_prod_livst.m(i,factors); + ov_cost_prod_fish(t,i,"marginal") = vm_cost_prod_fish.m(i); + ov70_investment(t,i,kli,"marginal") = v70_investment.m(i,kli); + oq70_feed(t,i,kap,kall,"marginal") = q70_feed.m(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"marginal") = q70_cost_prod_liv_labor.m(i); + oq70_cost_prod_liv_capital(t,i,"marginal") = q70_cost_prod_liv_capital.m(i); + oq70_investment(t,i,kli,"marginal") = q70_investment.m(i,kli); + oq70_cost_prod_fish(t,i,"marginal") = q70_cost_prod_fish.m(i); + ov_dem_feed(t,i,kap,kall,"level") = vm_dem_feed.l(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"level") = vm_cost_prod_livst.l(i,factors); + ov_cost_prod_fish(t,i,"level") = vm_cost_prod_fish.l(i); + ov70_investment(t,i,kli,"level") = v70_investment.l(i,kli); + oq70_feed(t,i,kap,kall,"level") = q70_feed.l(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"level") = q70_cost_prod_liv_labor.l(i); + oq70_cost_prod_liv_capital(t,i,"level") = q70_cost_prod_liv_capital.l(i); + oq70_investment(t,i,kli,"level") = q70_investment.l(i,kli); + oq70_cost_prod_fish(t,i,"level") = q70_cost_prod_fish.l(i); + ov_dem_feed(t,i,kap,kall,"upper") = vm_dem_feed.up(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"upper") = vm_cost_prod_livst.up(i,factors); + ov_cost_prod_fish(t,i,"upper") = vm_cost_prod_fish.up(i); + ov70_investment(t,i,kli,"upper") = v70_investment.up(i,kli); + oq70_feed(t,i,kap,kall,"upper") = q70_feed.up(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"upper") = q70_cost_prod_liv_labor.up(i); + oq70_cost_prod_liv_capital(t,i,"upper") = q70_cost_prod_liv_capital.up(i); + oq70_investment(t,i,kli,"upper") = q70_investment.up(i,kli); + oq70_cost_prod_fish(t,i,"upper") = q70_cost_prod_fish.up(i); + ov_dem_feed(t,i,kap,kall,"lower") = vm_dem_feed.lo(i,kap,kall); + ov_cost_prod_livst(t,i,factors,"lower") = vm_cost_prod_livst.lo(i,factors); + ov_cost_prod_fish(t,i,"lower") = vm_cost_prod_fish.lo(i); + ov70_investment(t,i,kli,"lower") = v70_investment.lo(i,kli); + oq70_feed(t,i,kap,kall,"lower") = q70_feed.lo(i,kap,kall); + oq70_cost_prod_liv_labor(t,i,"lower") = q70_cost_prod_liv_labor.lo(i); + oq70_cost_prod_liv_capital(t,i,"lower") = q70_cost_prod_liv_capital.lo(i); + oq70_investment(t,i,kli,"lower") = q70_investment.lo(i,kli); + oq70_cost_prod_fish(t,i,"lower") = q70_cost_prod_fish.lo(i); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/70_livestock/fbask_jan16_sticky/preloop.gms b/modules/70_livestock/fbask_jan16_sticky/preloop.gms index 1d8248a79d..1e223d4a72 100644 --- a/modules/70_livestock/fbask_jan16_sticky/preloop.gms +++ b/modules/70_livestock/fbask_jan16_sticky/preloop.gms @@ -85,4 +85,4 @@ $if "%c70_fac_req_regr%" == "reg" i70_fac_req_livst(t_all,i,kli)$(m_year(t_all) *** Section implementing the "sticky" part of the realization * Get the initial production from the historic data -p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); \ No newline at end of file +p70_initial_1995_prod(i,kli) = f70_hist_prod_livst("y1995",i,kli,"dm"); From 0c6897fe5cd0adf8ad4c83856c1a09b95200e47d Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Tue, 28 May 2024 10:36:05 +0200 Subject: [PATCH 015/171] =?UTF-8?q?added=20David=20H=C3=B6tten=20as=20auth?= =?UTF-8?q?or?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CITATION.cff | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CITATION.cff b/CITATION.cff index dfdfa23a75..051c1c18dc 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -125,6 +125,11 @@ authors: affiliation: "Potsdam Institute for Climate Impact Research" email: janstein@pik-potsdam.de + - family-names: Hötten + given-names: David + affiliation: "Potsdam Institute for Climate Impact Research" + email: davidho@pik-potsdam.de + - family-names: Lotze-Campen given-names: Hermann orcid: https://orcid.org/0000-0002-0003-5508 From 94ab66ac512ac0ce100db996e5f9413033ccb4b1 Mon Sep 17 00:00:00 2001 From: DavidhoPIK <101278418+DavidhoPIK@users.noreply.github.com> Date: Tue, 28 May 2024 10:42:45 +0200 Subject: [PATCH 016/171] Minor update of comment in EU_report.Rmd --- scripts/output/projects/EU_report.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/projects/EU_report.Rmd b/scripts/output/projects/EU_report.Rmd index 3af76a13c7..88afd2d1ad 100644 --- a/scripts/output/projects/EU_report.Rmd +++ b/scripts/output/projects/EU_report.Rmd @@ -6,7 +6,7 @@ output: code_folding: hide --- + This output report validates spatial pattern of the EU regions against LUH2v2 data. -# Setup and read data +# Setup data and plot functions ```{r, setup, include=FALSE} knitr::opts_knit$set(root.dir = dirname(dirname(dirname(getwd())))) ``` @@ -45,15 +47,15 @@ print(paste0("Script started for output directory: ", outputdir)) ```{r read-data, echo = T, results = 'hide', message = FALSE, warning = FALSE} compareYears <- c(1995, 2000, 2005, 2010) -# ----- Read model output and luh2v2 data, process and bind them to a validation object ----- -#### load and process reference data to match with model data +# ----- Read and process model output and luh2v2 data; then bind data to a validation object ----- +# load and process reference data to match with model data luh2v2 <- calcOutput("LanduseInitialisation", aggregate = FALSE, cellular = TRUE, nclasses = "seven", cells = "lpjmlcell") luh2v2 <- luh2v2[, compareYears, ] # add subdimension for reference data getNames(luh2v2) <- paste0(getNames(luh2v2), ".ref") -#### load and process model data to match with reference data +# load and process model data to match with reference data path2landoutput <- file.path(outputdir, "cell.land_0.5.mz") cellLand <- read.magpie(path2landoutput) cellLand <- cellLand[, compareYears, ] @@ -61,29 +63,28 @@ cellLand <- cellLand[, compareYears, ] getNames(cellLand) <- paste0(getNames(cellLand), ".mod") load(file.path(outputdir, "spatial_header.rda")) -##### bind model and reference data +# bind model and reference data validationObj <- mbind(cellLand, luh2v2) -##### extract EU countries +# get EU countries mapping <- toolGetMapping("regionmappingH12.csv") countriesEU <- mapping$CountryCode[mapping$RegionCode == "EUR"] ``` - -# Plot data - ```{r, load-plot-functions, echo = T, results = 'hide'} # ----- Create a plotting functions ----- +# helper function to convert magclass obj to wide dataframe convertToWideDataframe <- function(magclassObj) { as.data.frame(magclassObj) %>% pivot_wider(names_from = "Data2", values_from = "Value") } +# helper function to subset all cluster of a country subsetCountryCluster <- function(magclassObj, countries) { magclassObj[intersect(countries, getItems(magclassObj, split=TRUE)[[1]][[1]]), , ] } -# combines a scatter plot with maps such that facets are aligned +# function combines a scatter plot with maps such that facets are aligned plotCombined <- function(validationObj) { # create the plots p1 <- plotScatter(validationObj) @@ -96,12 +97,12 @@ plotCombined <- function(validationObj) { print(combinedPlot) } -# create scatter plot +# create scatter plot for eu countries faceted by year plotScatter <- function(validationObj) { validationObj <- toolCoord2Isocell(validationObj, "lpjcell") validationObj <- subsetCountryCluster(validationObj, countriesEU) - ### Create quality measure dataframe with RMSE, MAE a.o. + # create quality measure dataframe with RMSE, MAE a.o. qualityMeasuresDf <- NULL # list of dataframes, one for each year numericYears <- as.numeric(gsub("y", "", getItems(validationObj, 2))) for (year in numericYears) { @@ -111,14 +112,14 @@ plotScatter <- function(validationObj) { measures = c("Willmott", "Willmott refined", "Nash Sutcliffe", "RMSE", "MAE") ) - # Create text for the year facet + # create text for the year facet text <- "" for (i in seq_along(qualityMeasures)) { text <- paste0(text, stringr::str_trunc(names(qualityMeasures)[i], 12, ellipsis = "."), " : ", qualityMeasures[i], "\n") } - # Create df for that year + # create dataframe for that year qualityMeasuresDf[[year]] <- data.frame( Year = year, text = text @@ -126,7 +127,7 @@ plotScatter <- function(validationObj) { } qualityMeasBinded <- dplyr::bind_rows(qualityMeasuresDf) # bind all year dataframes - # Create the plot with facets + # create the plot with facets validationDF <- convertToWideDataframe(validationObj) p <- ggplot(validationDF, @@ -139,7 +140,7 @@ plotScatter <- function(validationObj) { panel.grid.major = element_line(color = "gray62"), panel.grid.minor = element_line(color = "grey58")) - # Add quality measure text + # add quality measure text p <- p + geom_text(x = 0, y = Inf, aes(label = text), color = "#ffb5b5", # bright color contrasting dark background hjust = 0, vjust = 1.1, nudge_x = 10, size = 2.6, family = "sans", fontface = "bold", data = qualityMeasBinded, inherit.aes = FALSE) @@ -147,7 +148,7 @@ plotScatter <- function(validationObj) { return(p) } -# create maps +# create EU maps faceted by year plotMaps <- function(validationObj) { # create a ggplot object using luplot relErr <- (validationObj[, , paste0("mod")] - validationObj[, , paste0("ref")]) / @@ -167,16 +168,17 @@ plotMaps <- function(validationObj) { return(p) } -# create and interactive scatterplot for eu countries of a year +# create an interactive scatterplot for eu countries of a year plotInteractiveSub <- function(validationObj, year) { p <- plotScatter(validationObj[, year, ]) - p <- p + ggtitle(paste0("EU Countries ", year)) p <- plotly::ggplotly(p) - p + return(p) } ``` +# Plot data + ## crop ```{r crop,message=FALSE, warning=FALSE, out.width="100%"} type <- "crop" From a2990871f86893b9093e60fc7341dd807e148f73 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 17 Jun 2024 09:04:44 +0200 Subject: [PATCH 019/171] rephrased and corrected module documentation --- core/macros.gms | 2 +- modules/21_trade/selfsuff_reduced/realization.gms | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/macros.gms b/core/macros.gms index 91e59050a5..1f91732a92 100644 --- a/core/macros.gms +++ b/core/macros.gms @@ -120,4 +120,4 @@ $macro baseline_production(supply, excess_prod, self_suff) \ ((sum(supreg(h2,i2),supply(i2,k_trade)) + excess_prod(h2,k_trade)) \ $((sum(ct,self_suff(ct,h2,k_trade)) >= 1)) \ + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,self_suff(ct,h2,k_trade))) \ - $((sum(ct,self_suff(ct,h2,k_trade)) < 1))) \ No newline at end of file + $((sum(ct,self_suff(ct,h2,k_trade)) < 1))) diff --git a/modules/21_trade/selfsuff_reduced/realization.gms b/modules/21_trade/selfsuff_reduced/realization.gms index b44e087013..99bb7c06ab 100644 --- a/modules/21_trade/selfsuff_reduced/realization.gms +++ b/modules/21_trade/selfsuff_reduced/realization.gms @@ -6,7 +6,7 @@ *** | Contact: magpie@pik-potsdam.de *' @description In this realization trade patterns defined by self-sufficiency ratios and export shares, -*' together with regional demands, establish a baseline value for the production of each product in the superregions. +*' together with regional demands, establish a baseline value for the production of traded products in the superregions. *' Production is then allowed to fluctuate freely within a band around this baseline value, *' only being enforced to maintain the condition of global production exceeding global demand. *' The width of the production band is determined by the `i21_trade_bal_reduction` (ptb) factor. @@ -16,7 +16,7 @@ *' This "self-sufficiency" pool thus implies minimum production levels in superregions, which are enforced by the *' lower bound of the production band. *' The remaining part of the demand can be allocated more freely based on comparative advantage -*' in production of different superregions, though still being constrained a bit by the upper bounds of the production band. +*' in production of different superregions, though still being constrained by the upper bounds of the production band. *' *' The superregional self-sufficiency ratios `f21_self_suff` define *' how much of the demand of each superregion `h` for each traded good `k_trade` is met by domestic production. @@ -25,7 +25,7 @@ *' The superregional export shares `f21_exp_shr` distribute the total excess demand of the importing superregions *' to the exporting superregions. *' -*' Trade costs, including trade margins and tariffs, are considered. +*' Trade costs are the sum of trade margins (international transport costs) and trade tariffs. *' *' ![Implementation of trade.](trade_pools.png){ width=100% } From f0cee84304cd0968e2cc38959c4d306c64f7f345 Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Mon, 17 Jun 2024 09:15:58 +0200 Subject: [PATCH 020/171] renamed macro to comply with naming convention --- core/macros.gms | 2 +- modules/21_trade/selfsuff_reduced/equations.gms | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/macros.gms b/core/macros.gms index 1f91732a92..2ee55d7c47 100644 --- a/core/macros.gms +++ b/core/macros.gms @@ -116,7 +116,7 @@ $macro m58_LandLeft(pclandFull,setFull,vland,pcland) \ - sum(manPeat58_alias$(sameas(manPeat58_alias,manPeat58)),pcland(j2,manPeat58_alias))) * macro for trade module -$macro baseline_production(supply, excess_prod, self_suff) \ +$macro m21_baseline_production(supply, excess_prod, self_suff) \ ((sum(supreg(h2,i2),supply(i2,k_trade)) + excess_prod(h2,k_trade)) \ $((sum(ct,self_suff(ct,h2,k_trade)) >= 1)) \ + (sum(supreg(h2,i2),vm_supply(i2,k_trade)) * sum(ct,self_suff(ct,h2,k_trade))) \ diff --git a/modules/21_trade/selfsuff_reduced/equations.gms b/modules/21_trade/selfsuff_reduced/equations.gms index e02fe74a6b..ce789e0cc0 100644 --- a/modules/21_trade/selfsuff_reduced/equations.gms +++ b/modules/21_trade/selfsuff_reduced/equations.gms @@ -24,13 +24,13 @@ *' determined by a trade balance reduction factor for each commodity `i21_trade_bal_reduction(ct,k_trade)` *' [@schmitz_trading_2012]. If the trade balance reduction equals 1, all demand enters the self-sufficiency pool. *' If it equals 0, all demand enters the comparative advantage pool. -*' Note that `baseline_production` is a macro defined in core/macros.gms. +*' Note that `m21_baseline_production` is a macro defined in core/macros.gms. *' Lower bound for production. q21_trade_reg(h2,k_trade).. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =g= - baseline_production(vm_supply, v21_excess_prod, f21_self_suff) + m21_baseline_production(vm_supply, v21_excess_prod, f21_self_suff) * sum(ct,i21_trade_bal_reduction(ct,k_trade)) - v21_import_for_feasibility(h2,k_trade); @@ -38,7 +38,7 @@ q21_trade_reg_up(h2,k_trade) .. sum(supreg(h2,i2),vm_prod_reg(i2,k_trade)) =l= - baseline_production(vm_supply, v21_excess_prod, f21_self_suff) + m21_baseline_production(vm_supply, v21_excess_prod, f21_self_suff) / sum(ct,i21_trade_bal_reduction(ct,k_trade)); *' The global excess demand of each tradable good `v21_excess_demad` equals to From 760397b968e4583e886192e75deb1886b7aed47c Mon Sep 17 00:00:00 2001 From: Jake Tommey Date: Thu, 20 Jun 2024 14:56:29 +0200 Subject: [PATCH 021/171] 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 da8ee56059..a721129a86 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.8.1", + "version": "4.8.1dev", "creators": [ { "name": "Dietrich, Jan Philipp", diff --git a/CHANGELOG.md b/CHANGELOG.md index d13f633d75..d1e6472618 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,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.8.1] - 2024-06-19 ### changed diff --git a/CITATION.cff b/CITATION.cff index 0b1d746a7e..bc9e6d709f 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -151,7 +151,7 @@ abstract: The *Model of Agricultural Production and its Impact on the Environmen exogenously given population in 10 food energy categories, based on regional diets. Future trends in food demand are derived from a cross-country regression analysis, based on future scenarios on GDP and population growth. -version: 4.8.1 +version: 4.8.1dev date-released: 2024-06-19 repository-code: https://github.com/magpiemodel/magpie keywords: From 773ace41ed54694d5c6e22a6d557a2463bcf9e5f Mon Sep 17 00:00:00 2001 From: David Hoetten Date: Fri, 21 Jun 2024 10:50:40 +0200 Subject: [PATCH 022/171] removed creation of validation subfolder --- scripts/output/projects/EU_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/projects/EU_report.R b/scripts/output/projects/EU_report.R index d8b2126a24..0eec8d917d 100644 --- a/scripts/output/projects/EU_report.R +++ b/scripts/output/projects/EU_report.R @@ -1,3 +1,3 @@ readArgs("outputdir") rmarkdown::render("./scripts/output/projects/EU_report.Rmd", - output_dir = paste0(outputdir, "/validation")) + output_dir = outputdir) From c26b75f839fbd6c8db9fb4ed105e5465b5eaaa51 Mon Sep 17 00:00:00 2001 From: DavidhoPIK <101278418+DavidhoPIK@users.noreply.github.com> Date: Fri, 21 Jun 2024 11:56:27 +0200 Subject: [PATCH 023/171] corrected type --- config/default.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/default.cfg b/config/default.cfg index dea1e9fa64..8113d8b4e3 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1905,7 +1905,7 @@ cfg$gms$s62_midpoint_dem_bioplastic <- 2050 # def = 2050 # ***--------------------- 70_livestock ----------------------------------- # * (fbask_jan16): default feed basket realization -# * (fbask_jan16_sticky): feed basket realization using captial stocks as in sticky_feb18 +# * (fbask_jan16_sticky): feed basket realization using capital stocks as in sticky_feb18 cfg$gms$livestock <- "fbask_jan16" # def = fbask_jan16 # * Year until the pasture management factor is fixed to 1 From 2a8defcf3964b761a33db7a6aea6c311351effa6 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 13:35:29 +0200 Subject: [PATCH 024/171] rds_report check --- CHANGELOG.md | 1 + DESCRIPTION | 3 ++- scripts/output/rds_report.R | 11 +++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c38f4392c..90765b0b7b 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/). ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` - **70_livestock** added realization `fbask_jan16_sticky` +- **script** check of variables needed in piamInterfaces in report_rds.R ### removed - diff --git a/DESCRIPTION b/DESCRIPTION index ba76854991..88cdfb4567 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -22,13 +22,14 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.3.10), + magpie4 (>= 2.5.6), MagpieNCGains, magpiesets, mip, mrcommons, patchwork, piamenv (>= 0.3.4), + piamInterfaces, quitte, raster, remulator, diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 4dfefd03fa..d0a3aebc32 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -17,6 +17,7 @@ library(magpie4) library(lucode2) library(quitte) library(gms) +library(piamInterfaces) options("magclass.verbosity" = 1) ############################# BASIC CONFIGURATION ############################# @@ -35,6 +36,16 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) + +for (mapping in c("AR6", "NAVIGATE")) { + missingVariables <- setdiff(getMappingVariables(mapping,"M"),getNames(report,dim="variable")) + if (length(missingVariables) > 0) { + warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", + "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", + paste(missingVariables, collapse = ",\n- "), "\n") + } +} + write.report(report, file = mif) q <- as.quitte(report) if(all(is.na(q$value))) stop("No values in reporting!") From ead3de4ad6f936858eafa122f7c3984fa8df0432 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 13:54:28 +0200 Subject: [PATCH 025/171] bugfix --- DESCRIPTION | 1 + scripts/output/rds_report.R | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 88cdfb4567..3e994e25e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -30,6 +30,7 @@ Imports: patchwork, piamenv (>= 0.3.4), piamInterfaces, + piamutils, quitte, raster, remulator, diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index d0a3aebc32..dc660d5e5a 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -17,7 +17,8 @@ library(magpie4) library(lucode2) library(quitte) library(gms) -library(piamInterfaces) +library(piamInterfaces) +library(piamutils) options("magclass.verbosity" = 1) ############################# BASIC CONFIGURATION ############################# @@ -39,6 +40,7 @@ report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE")) { missingVariables <- setdiff(getMappingVariables(mapping,"M"),getNames(report,dim="variable")) + missingVariables <- deletePlus(missingVariables) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", From 790e82920b60289ce031873f78ddd3a241e66aa7 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 14:04:28 +0200 Subject: [PATCH 026/171] bugfix --- scripts/output/rds_report.R | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index dc660d5e5a..df83de3662 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -39,8 +39,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE")) { - missingVariables <- setdiff(getMappingVariables(mapping,"M"),getNames(report,dim="variable")) - missingVariables <- deletePlus(missingVariables) + missingVariables <- setdiff(deletePlus(getMappingVariables(mapping,"M")),getNames(report,dim="variable")) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", From f0ffea51268b5d53e6cee05dab090dcc6b736c29 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 14:22:41 +0200 Subject: [PATCH 027/171] bugfix --- scripts/output/rds_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index df83de3662..5616b2f0dc 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -39,7 +39,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE")) { - missingVariables <- setdiff(deletePlus(getMappingVariables(mapping,"M")),getNames(report,dim="variable")) + missingVariables <- sort(setdiff(getMappingVariables(mapping,"M"),unique(deletePlus(getNames(report,dim="variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", From 8e400c9ddd0c056d817b43a8d229790f79df565a Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 14:31:30 +0200 Subject: [PATCH 028/171] bugfix --- scripts/output/rds_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 5616b2f0dc..a01f7beffd 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -39,7 +39,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) for (mapping in c("AR6", "NAVIGATE")) { - missingVariables <- sort(setdiff(getMappingVariables(mapping,"M"),unique(deletePlus(getNames(report,dim="variable"))))) + missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", From 836d518220b7c7be5f6a0c2e3f62782aed3d179b Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 15:16:56 +0200 Subject: [PATCH 029/171] added SHAPE --- scripts/output/rds_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index a01f7beffd..07d86e7f69 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -38,7 +38,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) -for (mapping in c("AR6", "NAVIGATE")) { +for (mapping in c("AR6", "NAVIGATE", "SHAPE")) { missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", From 612ce8e9f202d604e602fa18c8202858adfcfab8 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 15:53:28 +0200 Subject: [PATCH 030/171] added AR6_MAgPIE and AgMIP --- scripts/output/rds_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 07d86e7f69..539e813ca9 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -38,7 +38,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) -for (mapping in c("AR6", "NAVIGATE", "SHAPE")) { +for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE", "AgMIP")) { missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", From 2dfff7f9082ed5d09230d7c050c1efc2869fb633 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 16:46:12 +0200 Subject: [PATCH 031/171] update agmip --- scripts/output/projects/agmip_report.R | 11 +++++++++++ scripts/output/rds_report.R | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/output/projects/agmip_report.R b/scripts/output/projects/agmip_report.R index 23d42af202..df59d49730 100644 --- a/scripts/output/projects/agmip_report.R +++ b/scripts/output/projects/agmip_report.R @@ -15,6 +15,8 @@ library(magpie4) library(lucode2) library(quitte) library(gms) +library(piamInterfaces) +library(piamutils) options("magclass.verbosity" = 1) ############################# BASIC CONFIGURATION ############################# @@ -31,6 +33,15 @@ rds <- paste0(outputdir, "/agmip_report.rds") report <- getReportAgMIP(gdx, scenario = cfg$title, dir = outputdir) +for (mapping in c("AgMIP")) { + missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) + if (length(missingVariables) > 0) { + warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", + "for mapping ", mapping, ", but cannot be found in the MAgPIE report.\nPlease either fix in magpie4 or adjust the mapping in piamInterfaces.\n- ", + paste(missingVariables, collapse = ",\n- "), "\n") + } +} + ### regional aggregation write.report(report, file = mif, skipempty = FALSE) saveRDS(as.quitte(report), file = rds) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 539e813ca9..9b182e8ddb 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -38,7 +38,7 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" report <- getReport(gdx, scenario = cfg$title, dir = outputdir) -for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE", "AgMIP")) { +for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { missingVariables <- sort(setdiff(unique(deletePlus(getMappingVariables(mapping,"M"))),unique(deletePlus(getNames(report,dim="variable"))))) if (length(missingVariables) > 0) { warning("# The following ", length(missingVariables), " variables are expected in the piamInterfaces package ", From 0f48ca6cc636ac0268eadddb933ddd556553c86f Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 17:51:24 +0200 Subject: [PATCH 032/171] piamInterface version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3e994e25e6..ab960bac8f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,7 +29,7 @@ Imports: mrcommons, patchwork, piamenv (>= 0.3.4), - piamInterfaces, + piamInterfaces (>= 0.20.7), piamutils, quitte, raster, From e7223c016b1c0a367e9066f7586a41ab91790351 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 21 Jun 2024 19:00:03 +0200 Subject: [PATCH 033/171] bugfix GLO World --- scripts/output/rds_report.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 9b182e8ddb..e02197b0b3 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -49,6 +49,7 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { write.report(report, file = mif) q <- as.quitte(report) +q <- droplevels(q) if(all(is.na(q$value))) stop("No values in reporting!") saveRDS(q, file = rds, version = 2) From 0c0bc8c6ae892d59a914c9113bbb3c427ad79b09 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Mon, 24 Jun 2024 09:55:58 +0200 Subject: [PATCH 034/171] bugfix in start.R and output.R --- CHANGELOG.md | 2 +- output.R | 6 +++--- start.R | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c38f4392c..790609b3d0 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** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. ## [4.8.1] - 2024-06-19 diff --git a/output.R b/output.R index e4775c7104..dd098406e2 100644 --- a/output.R +++ b/output.R @@ -114,9 +114,9 @@ runOutputs <- function(comp=NULL, output=NULL, outputdir=NULL, submit=NULL) { sys.source(script,envir=tmp.env) rm(tmp.env) } else { - slurmModes <- yaml::read_yaml(slurmModes)$slurmjobs - if(submit %in% names(slurmModes)) { - command <- slurmModes[submit] + slurm <- yaml::read_yaml(slurmModes)$slurmjobs + if(submit %in% names(slurm)) { + command <- slurm[submit] command <- gsub("%NAME", rout_name, command) command <- gsub("%SCRIPT", rCommand, command) message(command) diff --git a/start.R b/start.R index bb80b4c220..a04a090b69 100644 --- a/start.R +++ b/start.R @@ -64,9 +64,9 @@ runOutputs <- function(runscripts=NULL, submit=NULL) { sys.source(script,envir=tmp.env) rm(tmp.env) } else { - slurmModes <- yaml::read_yaml(slurmModes)$slurmjobs - if(submit %in% names(slurmModes)) { - command <- slurmModes[submit] + slurm <- yaml::read_yaml(slurmModes)$slurmjobs + if(submit %in% names(slurm)) { + command <- slurm[submit] command <- gsub("%NAME", name, command) command <- gsub("%SCRIPT", script, command) message(command) From b3487aa4e99528ce378310f1feab5acf5e104993 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 24 Jun 2024 17:30:30 +0200 Subject: [PATCH 035/171] updated start scripts and config for EAT project --- config/scenario_config.csv | 8 +- scripts/start/projects/project_EAT2p0.R | 77 ++++++++----------- .../start/projects/project_EAT2p0_DeepDive.R | 72 +++-------------- 3 files changed, 46 insertions(+), 111 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 8a2870327f..9d1ee34016 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -2,7 +2,7 @@ gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;;;coup2110 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;;;;;;;;;SDP;SDP;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;SDP;SDP;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; gms$s12_interest_lic;;;;;;;;;;;;;;;;;;;;;;0.06;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s12_interest_hic;;;;;;;;;;;;;;;;;;;;;;0.04;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c13_tccost;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;high @@ -44,13 +44,13 @@ gms$c22_protect_scenario_noselect;;;;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none; gms$s29_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$s29_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;; gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;rainfed;all;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;rainfed;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; gms$s30_annual_max_growth;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.02 gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c32_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;;; -gms$s32_aff_plantation;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;0;;;;;;;;;;;;;;;;;;;;;;;;; +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;;;;;;;;;;;;;;;;;;;; @@ -102,4 +102,4 @@ gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;ssp1;;;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.109_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.109_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.109_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.109_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.109_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; -magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax-rem-5.mif;;;;;;;;;;;;;;;;;;;;;;;;; +magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 1c4aadc720..f6b971a9ce 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -28,14 +28,16 @@ cfg$force_download <- TRUE # Special outputs required for Deep Dive cfg$qos <- "standby_maxMem_dayMax" -cfg$output <- c("output_check", - # "extra/highres", # do manually on last magpie run - "extra/disaggregation", - # "projects/FSEC_nitrogenPollution", # do manually on last (high-res) magpie run - # "projects/FSEC_water", # do manually on last (high-res) magpie run - # add output file: pb_report (magpie (special mif created by getReportPBindicators & remind mif (REMIND_generic_scenName.mif)) - "rds_report", - "projects/agmip_report") +cfg$output <- c( + "output_check", + # "extra/highres", # do manually on last magpie run + "extra/disaggregation", + # "projects/FSEC_nitrogenPollution", # do manually on last (high-res) magpie run + # "projects/FSEC_water", # do manually on last (high-res) magpie run + "agmip_report", + # add output file: pb_report (magpie (special mif created by getReportPBindicators & remind mif (REMIND_generic_scenName.mif)) + "rds_report" +) ####################### # SCENARIO DEFINITION # @@ -54,8 +56,8 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) bau <- function(cfg) { ### General settings ### # For impacts of CC on labor: - cfg$gms$factor_costs <- "sticky_labor" # @Alex/Edna/Florian: Should we use this one? - cfg$gms$labor_prod <- "exo" + cfg$gms$factor_costs <- "sticky_labor" + cfg$gms$labor_prod <- "exo" cfg$gms$c37_labor_rcp <- "rcp585" # Note: the effect of labor impacts is very low in MAgPIE and we don't have the # Nelson data implemented. We therefore use the existing data from LAMACLIMA @@ -63,26 +65,27 @@ bau <- function(cfg) { ### Components for Decomposition ### # Diets: exogenous EATLancet diet - cfg$gms$s15_exo_diet <- 0 # default + cfg$gms$s15_exo_diet <- 0 # default + cfg$gms$c09_pal_scenario <- "SSP2" # default cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0) - cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) + cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) # Waste: half food waste - cfg$gms$s15_exo_waste <- 0 # default - cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) + cfg$gms$s15_exo_waste <- 0 # default + cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) # Default interest rate (for default productivity) - cfg$gms$s12_interest_lic <- 0.1 # default - cfg$gms$s12_interest_hic <- 0.04 # default + cfg$gms$s12_interest_lic <- 0.1 # default + cfg$gms$s12_interest_hic <- 0.04 # default # Default livestock productivity cfg$gms$c70_feed_scen <- "ssp2" # Mitigation: no mitigation beyond NPI (NPI already set in setScenario) - cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default + cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default cfg$path_to_report_ghgprices <- NA - cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default + cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default cfg$path_to_report_bioenergy <- NA - cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default + cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input['cellular'] <- "rev4.109_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.109_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } @@ -90,8 +93,8 @@ bau <- function(cfg) { ### Diet component ## # Globally achieves EL2 diet by 2050 diet <- function(cfg) { - # Transition towards EL2 food intake recommendations until 2050 - cfg$gms$s15_exo_diet <- 3 + # EAT Lancet dietary recommendations + cfg$gms$s15_exo_diet <- 3 # Physical inactivity levels are reduced to 0 from 2020 to 2050 cfg$gms$c09_pal_scenario <- "SDP" @@ -116,7 +119,7 @@ prod <- function(cfg) { # Reduction (halving) of food loss and waste waste <- function(cfg) { # Waste: half food waste - cfg$gms$s15_exo_waste <- 1 + cfg$gms$s15_exo_waste <- 1 cfg$gms$s15_waste_scen <- 1.2 return(cfg) } @@ -124,31 +127,19 @@ waste <- function(cfg) { ### Mitigation component ## # Adds mitigation and land-use policies consistent with 1.5C by 2050 to BAU # Note on our implementation: -# We use a GHG pricing pathway based on a peak budget of 500 with overshoot +# We use a GHG pricing pathway based on a peak budget of 650 with overshoot # starting from 2020. -# Please note that with the diet shift, a lower ghg price would be necessary. -# However, to be consistent with the other models and for the decomposition -# scenarios to be "additive", we choose to use the same ghg price for all scenarios -# where miti is active. -# Reference: Humpenöder, F., Popp, A., Merfort, L., Luderer, G., Weindl, I., Bodirsky, B., Stevanović, M., Klein, D., Rodrigues, R., Bauer, N., Dietrich, J., Lotze-Campen, H., & Rockström, J. (2023). Data repository - Dietary shifts increase the feasibility of 1.5°C pathways (Version 1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.8328217 miti <- function(cfg) { # Mitigation: consistent with 1.5C considering diet change - cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_default/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-5/REMIND_generic_C_SSP2EU-DSPkB500-noDS-rem-5.mif" + # To Do: update to iteration 5! + cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" cfg$gms$c56_pollutant_prices <- "coupling" - cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_default/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-5/REMIND_generic_C_SSP2EU-DSPkB500-noDS-rem-5.mif" - cfg$gms$c60_2ndgen_biodem <- "coupling" + cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" + cfg$gms$c60_2ndgen_biodem <- "coupling" return(cfg) } -### RCP 2.6 ### -# Decomposition Scenario. Apply lower climate impacts based on RCP 2.6 to BAU using GFDL climate model. -rcp26 <- function(cfg) { - cfg$input["cellular"] <- "rev4.99_h12_05fd702e_cellularmagpie_c200_GFDL-ESM4-ssp126_lpjml-8e6c5eb1.tgz" - return(cfg) -} - - ################# # SCENARIO RUNS # ################# @@ -200,7 +191,6 @@ cfg$title <- "BAU_RCP26" cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # scenario settings cfg <- bau(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) # BAU_NoCC # @@ -245,7 +235,6 @@ cfg <- miti(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) # ELM_Diet # @@ -258,7 +247,6 @@ cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) # ELM_PROD # @@ -271,7 +259,6 @@ cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- waste(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) # ELM_WAST # @@ -284,7 +271,6 @@ cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) # ELM_RCP70 # @@ -323,5 +309,4 @@ cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) -cfg <- rcp26(cfg = cfg) start_run(cfg, codeCheck = FALSE) diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index e12c14a980..a9b700eb10 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -38,12 +38,12 @@ cfg$output <- c( "rds_report", "runBlackmagicc" # add output file: pb_report (magpie (special mif created by getReportPBindicators & remind mif (REMIND_generic_scenName.mif)) - ) # Set path to own coupled runs: -path2NPIrun <- "/p/projects/magpie/users/beier/EL2_DeepDive_default/remind/output/C_SSP2EU-NPi-rem-5/REMIND_generic_C_SSP2EU-NPi-rem-5.mif" -path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_default/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" +path2NPIrun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-NPi-rem-5/REMIND_generic_C_SSP2EU-NPi-rem-5.mif" +path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" + ####################### # SCENARIO DEFINITION # @@ -65,11 +65,11 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) bau <- function(cfg) { ### Components for Decomposition ### # Diets: exogenous EATLancet diet - cfg$gms$s15_exo_diet <- 0 # default + cfg$gms$s15_exo_diet <- 0 # default cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0) - cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) + cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) # Waste: half food waste - cfg$gms$s15_exo_waste <- 0 # default + cfg$gms$s15_exo_waste <- 0 # default cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) # Default interest rate (for default productivity) cfg$gms$s12_interest_lic <- 0.1 # default @@ -77,11 +77,11 @@ bau <- function(cfg) { # Default livestock productivity cfg$gms$c70_feed_scen <- "ssp2" # default # Mitigation: no mitigation beyond NPi - cfg$gms$c56_emis_policy <- "none" + cfg$gms$c56_emis_policy <- "none" cfg$path_to_report_ghgprices <- path2NPIrun cfg$gms$c56_pollutant_prices <- "coupling" cfg$path_to_report_bioenergy <- path2NPIrun - cfg$gms$c60_2ndgen_biodem <- "coupling" + cfg$gms$c60_2ndgen_biodem <- "coupling" # Setting REMIND scenario for blackmagicc cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" @@ -99,19 +99,6 @@ diet <- function(cfg) { return(cfg) } -### Productivity component ## -# High productivity growth rate similar to productivity trends -# associated with SSP1 (e.g., PRD 1 in Stehfest et al.) -prod <- function(cfg) { - # Higher endogenous productivity achieved through lower interest rates - # representing more trust and therefore easier investments - cfg$gms$s12_interest_lic <- 0.06 - cfg$gms$s12_interest_hic <- 0.04 - # Livestock productivity follows SSP1 - cfg$gms$c70_feed_scen <- "ssp1" - return(cfg) -} - ### Waste component ## # Reduction (halving) of food loss and waste waste <- function(cfg) { @@ -252,16 +239,6 @@ cfg <- miti(cfg = cfg) cfg$gms$c56_emis_policy <- "ecoSysProtOff" start_run(cfg, codeCheck = FALSE) - -# BAU + EL2-Diet # -# PHD components: -# (1e) Productivity -#cfg$title <- "BAU_Prod" -#cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -#cfg <- bau(cfg = cfg) -#cfg <- prod(cfg = cfg) -#start_run(cfg, codeCheck = FALSE) - # (1f) Waste cfg$title <- "BAU_Waste" cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) @@ -281,27 +258,10 @@ cfg$title <- "BAU_Dem" cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) -### Single measure Decomposition ### -# (2a) MITI_NDC # -# All production-side land-based mitigation measures and demand-side mitigation (diet change), but no NDCs -#cfg$title <- "MITI_NDC" -# standard setting, but with NDC for miti -#cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NDC", "EL2_default")) -# BAU settings -#cfg <- bau(cfg = cfg) -# Mitigation (CO2, non-CO2, bioenergy) -#cfg <- miti(cfg = cfg) -# PHD (diet, prod, waste) -#cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) -#cfg <- waste(cfg = cfg) -#start_run(cfg, codeCheck = FALSE) - # MITI_Bioenergy (mitigation - bioenergy) # # (2b) CO2 and non-CO2 pricing and demand-side mitigation (diet change), but no bioenergy demand from REMIND cfg$title <- "MITI_Bioenergy" @@ -315,7 +275,6 @@ cfg$gms$c60_2ndgen_biodem <- "coupling" cfg$path_to_report_bioenergy <- path2NPIrun # PHD cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -332,7 +291,6 @@ cfg <- miti(cfg = cfg) cfg$gms$c56_emis_policy <- "ecoSysProtAll_agMgmtOff" # PHD cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -349,7 +307,6 @@ cfg <- miti(cfg = cfg) cfg$gms$c56_emis_policy <- "ecoSysProtOff" # PHD cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -362,7 +319,6 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # PHD (diet, prod, waste) cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -375,9 +331,8 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation (CO2, non-CO2, bioenergy) cfg <- miti(cfg = cfg) -# PHD (diet, prod, waste) +# PHD (diet, waste) cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) start_run(cfg, codeCheck = FALSE) # MITI_Diet # @@ -389,8 +344,7 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation (CO2, non-CO2, bioenergy) cfg <- miti(cfg = cfg) -# PHD (diet, prod, waste) -#cfg <- prod(cfg = cfg) +# PHD (diet, waste) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -414,7 +368,6 @@ cfg <- bau(cfg = cfg) cfg <- bioenergy(cfg = cfg) # Demand-side change (diet, waste) cfg <- diet(cfg = cfg) -# cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -426,7 +379,6 @@ cfg <- bau(cfg = cfg) cfg <- priceNonCO2(cfg = cfg) # Demand-side change (diet, waste) cfg <- diet(cfg = cfg) -# cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -438,7 +390,6 @@ cfg <- bau(cfg = cfg) cfg <- priceCO2(cfg = cfg) # Demand-side change (diet, waste) cfg <- diet(cfg = cfg) -# cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -452,8 +403,7 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation (CO2, non-CO2, bioenergy) cfg <- miti(cfg = cfg) -# PHD (diet, prod, waste) +# PHD (diet, waste) cfg <- diet(cfg = cfg) -#cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) From 1e7ed7a3940c3e4b371d5e3c4ef588d03a62ddf3 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 24 Jun 2024 17:59:54 +0200 Subject: [PATCH 036/171] switched to sticky_labor for all EAT runs in config --- config/scenario_config.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 9d1ee34016..e78eb2a378 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -65,7 +65,7 @@ gms$c35_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004li gms$s35_forest_damage;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;;; gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; -gms$factor_costs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sticky_feb18 +gms$factor_costs;;;;;;;;;;;;;;;;;;;;;;sticky_labor;sticky_labor;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;sticky_feb18 gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; 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;;;;;;;;;;;;;;;;;;;; From c4c211467101a3677e669cbc0794a7b16d17ee30 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 26 Jun 2024 10:40:43 +0200 Subject: [PATCH 037/171] added potential forest area as output --- config/default.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/config/default.cfg b/config/default.cfg index d01a222b1b..48137f2839 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -2098,6 +2098,7 @@ cfg$files2export$start <- c("input/info.txt", "modules/50_nr_soil_budget/input/f50_NitrogenFixationRateNatural_0.5.mz", "modules/50_nr_soil_budget/input/f50_AtmosphericDepositionRates_0.5.mz", "input/f34_urbanland_0.5.mz", + "modules/35_natveg/input/pot_forest_area_0.5.mz", "input/spatial_header.rda", "scripts/run_submit/submit.R", "scripts/run_submit/submit_*.sh", From df8c227214c1b91607f7d59cef50c11e728f9464 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 27 Jun 2024 10:49:31 +0200 Subject: [PATCH 038/171] bugfixes and clean up of EAT2p0 scripts and config --- config/scenario_config.csv | 10 +-- scripts/start/projects/project_EAT2p0.R | 22 ++--- .../start/projects/project_EAT2p0_DeepDive.R | 89 +++++-------------- 3 files changed, 36 insertions(+), 85 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index e78eb2a378..e173c6db02 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -80,11 +80,11 @@ gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;; gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU;; 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;;;;;none;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c56_pollutant_prices_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;none;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c56_pollutant_prices_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi gms$s56_c_price_exp_aff;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s56_buffer_aff;;;;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.2;0.3;;;;;;;0.5;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;;;;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;reddnatveg_nosoil;;;;none;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;;;;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;reddnatveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c56_mute_ghgprices_until;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y2020 gms$c57_macc_version;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PBL_2022;PBL_2022;PBL_2022;PBL_2022;;;;;;;;;;;;;;;; @@ -93,8 +93,8 @@ gms$s58_rewetting_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0;1;0;1;;;;;;;;;;;;;;;; gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; gms$maccs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$bioenergy;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1st2ndgen_priced_feb24 -gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;none;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c60_2ndgen_biodem_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;none;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c60_2ndgen_biodem_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index f6b971a9ce..29b112649d 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -56,8 +56,8 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) bau <- function(cfg) { ### General settings ### # For impacts of CC on labor: - cfg$gms$factor_costs <- "sticky_labor" - cfg$gms$labor_prod <- "exo" + cfg$gms$factor_costs <- "sticky_labor" + cfg$gms$labor_prod <- "exo" cfg$gms$c37_labor_rcp <- "rcp585" # Note: the effect of labor impacts is very low in MAgPIE and we don't have the # Nelson data implemented. We therefore use the existing data from LAMACLIMA @@ -65,24 +65,24 @@ bau <- function(cfg) { ### Components for Decomposition ### # Diets: exogenous EATLancet diet - cfg$gms$s15_exo_diet <- 0 # default + cfg$gms$s15_exo_diet <- 0 # default cfg$gms$c09_pal_scenario <- "SSP2" # default - cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0) - cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) + cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0) + cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) # Waste: half food waste - cfg$gms$s15_exo_waste <- 0 # default - cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) + cfg$gms$s15_exo_waste <- 0 # default + cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) # Default interest rate (for default productivity) cfg$gms$s12_interest_lic <- 0.1 # default cfg$gms$s12_interest_hic <- 0.04 # default # Default livestock productivity - cfg$gms$c70_feed_scen <- "ssp2" + cfg$gms$c70_feed_scen <- "ssp2" # Mitigation: no mitigation beyond NPI (NPI already set in setScenario) - cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default + cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default cfg$path_to_report_ghgprices <- NA cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default cfg$path_to_report_bioenergy <- NA - cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default + cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change cfg$input["cellular"] <- "rev4.109_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" @@ -135,7 +135,7 @@ miti <- function(cfg) { cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" cfg$gms$c56_pollutant_prices <- "coupling" cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" - cfg$gms$c60_2ndgen_biodem <- "coupling" + cfg$gms$c60_2ndgen_biodem <- "coupling" return(cfg) } diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index a9b700eb10..b36cc00949 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -41,7 +41,6 @@ cfg$output <- c( ) # Set path to own coupled runs: -path2NPIrun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-NPi-rem-5/REMIND_generic_C_SSP2EU-NPi-rem-5.mif" path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" @@ -76,12 +75,12 @@ bau <- function(cfg) { cfg$gms$s12_interest_hic <- 0.04 # default # Default livestock productivity cfg$gms$c70_feed_scen <- "ssp2" # default - # Mitigation: no mitigation beyond NPi - cfg$gms$c56_emis_policy <- "none" - cfg$path_to_report_ghgprices <- path2NPIrun - cfg$gms$c56_pollutant_prices <- "coupling" - cfg$path_to_report_bioenergy <- path2NPIrun - cfg$gms$c60_2ndgen_biodem <- "coupling" + # Mitigation: no mitigation beyond NPI + cfg$gms$c56_emis_policy <- "redd+natveg_nosoil" # default + cfg$path_to_report_ghgprices <- NA + cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-NPi" # default + cfg$path_to_report_bioenergy <- NA + cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Setting REMIND scenario for blackmagicc cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" @@ -118,7 +117,7 @@ miti <- function(cfg) { cfg$path_to_report_ghgprices <- path2MitigationRun cfg$gms$c56_pollutant_prices <- "coupling" cfg$path_to_report_bioenergy <- path2MitigationRun - cfg$gms$c60_2ndgen_biodem <- "coupling" + cfg$gms$c60_2ndgen_biodem <- "coupling" # ecoSysProtAll: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; All CH4 and N2O emis), cfg$gms$c56_emis_policy <- "ecoSysProtAll" @@ -209,8 +208,9 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -cfg$gms$c60_2ndgen_biodem <- "coupling" -cfg$path_to_report_bioenergy <- path2NPIrun +cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default +cfg$path_to_report_bioenergy <- NA + start_run(cfg, codeCheck = FALSE) # BAU_MITI - non-CO2 # @@ -222,7 +222,8 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -# ecoSysProtAll_agMgmtOff: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management) +# ecoSysProtAll_agMgmtOff: +# (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management) cfg$gms$c56_emis_policy <- "ecoSysProtAll_agMgmtOff" start_run(cfg, codeCheck = FALSE) @@ -235,24 +236,11 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -# ecoSysProtOff: (All CH4 and N2O emis except peatland), +# ecoSysProtOff: +# (All CH4 and N2O emis except peatland), cfg$gms$c56_emis_policy <- "ecoSysProtOff" start_run(cfg, codeCheck = FALSE) -# (1f) Waste -cfg$title <- "BAU_Waste" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -cfg <- bau(cfg = cfg) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - -# (1g) Diet change -cfg$title <- "BAU_Diet" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -cfg <- bau(cfg = cfg) -cfg <- diet(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # (1e,f,g) Demand-side options (Diet+Waste) by 2050 cfg$title <- "BAU_Dem" cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) @@ -261,7 +249,6 @@ cfg <- diet(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) - # MITI_Bioenergy (mitigation - bioenergy) # # (2b) CO2 and non-CO2 pricing and demand-side mitigation (diet change), but no bioenergy demand from REMIND cfg$title <- "MITI_Bioenergy" @@ -271,8 +258,8 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -cfg$gms$c60_2ndgen_biodem <- "coupling" -cfg$path_to_report_bioenergy <- path2NPIrun +cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default +cfg$path_to_report_bioenergy <- NA # PHD cfg <- diet(cfg = cfg) cfg <- waste(cfg = cfg) @@ -287,7 +274,8 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -# ecoSysProtAll_agMgmtOff: (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management) +# ecoSysProtAll_agMgmtOff: +# (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management) cfg$gms$c56_emis_policy <- "ecoSysProtAll_agMgmtOff" # PHD cfg <- diet(cfg = cfg) @@ -303,51 +291,14 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -# ecoSysProtOff: (All CH4 and N2O emis except peatland), +# ecoSysProtOff: +# (All CH4 and N2O emis except peatland), cfg$gms$c56_emis_policy <- "ecoSysProtOff" # PHD cfg <- diet(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) -# MITI_MITI # -# (2a,b,c,d) All demand-side mitigation (PHD, but no other miti measures) -cfg$title <- "MITI_Miti" -# standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -# BAU settings -cfg <- bau(cfg = cfg) -# PHD (diet, prod, waste) -cfg <- diet(cfg = cfg) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - -# MITI_Waste # -# (2f) All production-side land-based mitigation measures and demand-side mitigation without Waste -cfg$title <- "MITI_Waste" -# standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -# BAU settings -cfg <- bau(cfg = cfg) -# Mitigation (CO2, non-CO2, bioenergy) -cfg <- miti(cfg = cfg) -# PHD (diet, waste) -cfg <- diet(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - -# MITI_Diet # -# (2g) All production-side land-based mitigation measures and demand-side mitigation without Diet -cfg$title <- "MITI_Diet" -# standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) -# BAU settings -cfg <- bau(cfg = cfg) -# Mitigation (CO2, non-CO2, bioenergy) -cfg <- miti(cfg = cfg) -# PHD (diet, waste) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # MITI_PHD (mitigation - PHD) # # (2e,f,g) All production-side land-based mitigation measures, but no demand-side mitigation cfg$title <- "MITI_Dem" From dfe8cd400ae7869a2f9b47134b08925df12a6b0a Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 28 Jun 2024 13:58:43 +0200 Subject: [PATCH 039/171] update merge_report and rds_report --- scripts/output/merge_report.R | 23 ++++++++++------------- scripts/output/rds_report.R | 5 +++++ scripts/output/rds_report_iso.R | 6 ++++++ 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/scripts/output/merge_report.R b/scripts/output/merge_report.R index aa4856e781..18dbe5b583 100644 --- a/scripts/output/merge_report.R +++ b/scripts/output/merge_report.R @@ -30,27 +30,24 @@ if(!exists("source_include")) { cat("\nStarting output generation\n") missing <- NULL +out <- NULL -if(file.exists("output/report_all.mif")) file.rename("output/report_all.mif","output/report_all.bak") +if(file.exists("output/report_all.rds")) file.rename("output/report_all.rds","output/report_all_bak.rds") +if(file.exists("output/report_all.mif")) file.rename("output/report_all.mif","output/report_all_bak.mif") for (i in 1:length(outputdir)) { print(paste("Processing",outputdir[i])) - #gdx file - rep<-file.path(outputdir[i],"report.mif") + rep<-file.path(outputdir[i],"report.rds") if(file.exists(rep)) { - #get scenario name - cfg <- gms::loadConfig(file.path(outputdir[i], "config.yml")) - scen <- cfg$title - #read-in reporting file - a <- read.report(rep,as.list = FALSE) - getNames(a,dim=1) <- scen - #add to reporting mif file - write.report(a,file="output/report_all.mif",append=TRUE,ndigit = 4,skipempty = FALSE) + a <- readRDS(rep) + out <- rbind(out,a) } else missing <- c(missing,outputdir[i]) } + +saveRDS(out,file="output/report_all.rds") +write.mif(out,"output/report_all.mif") + if (!is.null(missing)) { cat("\nList of folders with missing report.mif\n") print(missing) } - -if(file.exists("output/report_all.mif")) saveRDS(read.quitte("output/report_all.mif"),file = "output/report_all.rds") diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index e02197b0b3..6bec3dbaaf 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -48,8 +48,13 @@ for (mapping in c("AR6", "NAVIGATE", "SHAPE", "AR6_MAgPIE")) { } write.report(report, file = mif) + q <- as.quitte(report) +# as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes q <- droplevels(q) +levels(q$region)[levels(q$region) == "GLO"] <- "World" +q$region <- factor(q$region,levels = sort(levels(q$region))) + if(all(is.na(q$value))) stop("No values in reporting!") saveRDS(q, file = rds, version = 2) diff --git a/scripts/output/rds_report_iso.R b/scripts/output/rds_report_iso.R index c219588316..52cf2aa574 100644 --- a/scripts/output/rds_report_iso.R +++ b/scripts/output/rds_report_iso.R @@ -31,7 +31,13 @@ rds_iso <- paste0(outputdir, "/report_iso.rds") ############################################################################### report <- getReportIso(gdx, scenario = cfg$title, dir = outputdir) + q <- as.quitte(report) +# as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes +q <- droplevels(q) +levels(q$region)[levels(q$region) == "GLO"] <- "World" +q$region <- factor(q$region,levels = sort(levels(q$region))) + if (all(is.na(q$value))) { stop("No values in reporting!") } From 26d30d0096183bd227be9c6584ea8fb267f8082a Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 28 Jun 2024 14:05:02 +0200 Subject: [PATCH 040/171] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f043ba2247..852c8f1161 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### changed - **21_trade** refactor equations for enhanced readablility and improve documentation +- **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` From dd54179a1ffd90a56d91528d382d4ce188ed22c5 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 28 Jun 2024 15:12:54 +0200 Subject: [PATCH 041/171] added consumption for non-ag water abstractions --- config/default.cfg | 6 ++--- .../agr_sector_aug13/declarations.gms | 24 +++++++++---------- .../agr_sector_aug13/presolve.gms | 4 ++-- .../all_sectors_aug13/input.gms | 4 ++-- .../all_sectors_aug13/presolve.gms | 16 ++++++------- .../all_sectors_aug13/sets.gms | 3 +++ 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 48137f2839..fae3f8a393 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.109_h12_magpie.tgz", - cellular = "rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.109_h12_validation.tgz", +cfg$input <- c(regional = "rev4.110wcons_h12_magpie.tgz", + cellular = "rev4.110wcons_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "WARNINGS40_rev4.110wcons_h12_validation.tgz", additional = "additional_data_rev4.51.tgz", calibration = "calibration_H12_26Mar24.tgz") diff --git a/modules/42_water_demand/agr_sector_aug13/declarations.gms b/modules/42_water_demand/agr_sector_aug13/declarations.gms index b719d383f0..c4a2326d97 100644 --- a/modules/42_water_demand/agr_sector_aug13/declarations.gms +++ b/modules/42_water_demand/agr_sector_aug13/declarations.gms @@ -6,18 +6,18 @@ *** | Contact: magpie@pik-potsdam.de parameters - i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) - ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) - i42_env_flows(t,j) Environmental flow requirements if a protection policy is in place (mio. m^3) - i42_env_flows_base(t,j) Environmental flow requirements if no protection policy is in place (mio. m^3) - ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) - i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) - p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) - p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) - p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) - p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) - ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) - i42_watdem_total(t,j,watdem_ineldo) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) + i42_wat_req_k(t,j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) + ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per year (m^3) + Livestock demand per ton (m^3) + i42_env_flows(t,j) Environmental flow requirements if a protection policy is in place (mio. m^3) + i42_env_flows_base(t,j) Environmental flow requirements if no protection policy is in place (mio. m^3) + ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) + i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) + p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) + p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) + p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) + p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) + ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) + i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) ; equations diff --git a/modules/42_water_demand/agr_sector_aug13/presolve.gms b/modules/42_water_demand/agr_sector_aug13/presolve.gms index 91107677f3..42b824cdad 100644 --- a/modules/42_water_demand/agr_sector_aug13/presolve.gms +++ b/modules/42_water_demand/agr_sector_aug13/presolve.gms @@ -40,8 +40,8 @@ vm_watdem.fx("electricity",j) = 0; vm_watdem.fx("domestic",j) = 0; * Fill non-agricultural water demand parameter of entire year for post-processing -i42_watdem_total(t,j,watdem_ineldo) = 0; -i42_watdem_total(t,j,"manufacturing") = sum(wat_src, im_wat_avail(t,wat_src,j)) * s42_reserved_fraction; +i42_watdem_total(t,j,watdem_ineldo,wtype) = 0; +i42_watdem_total(t,j,"manufacturing","withdrawal") = sum(wat_src, im_wat_avail(t,wat_src,j)) * s42_reserved_fraction; * Country switch to determine countries for which EFP holds. * In the default case, the EFP affects all countries when activated. diff --git a/modules/42_water_demand/all_sectors_aug13/input.gms b/modules/42_water_demand/all_sectors_aug13/input.gms index e5823ca67f..5d32a8a32d 100644 --- a/modules/42_water_demand/all_sectors_aug13/input.gms +++ b/modules/42_water_demand/all_sectors_aug13/input.gms @@ -92,7 +92,7 @@ $include "./modules/42_water_demand/input/f42_wat_req_fao.csv" $offdelim /; -table f42_watdem_ineldo(t_all,j,scen_watdem_nonagr,watdem_ineldo) Manufacturing electricity and domestic water demand under different socioeconomic scenarios in the growing period (mio. m^3) +table f42_watdem_ineldo(t_all,j,scen_watdem_nonagr,watdem_ineldo,wtype) Manufacturing electricity and domestic water demand under different socioeconomic scenarios in the growing period (mio. m^3) $ondelim $include "./modules/42_water_demand/input/watdem_nonagr_grper.cs3" $offdelim @@ -100,7 +100,7 @@ $offdelim m_fillmissingyears(f42_watdem_ineldo,"j,scen_watdem_nonagr,watdem_ineldo"); * This input is not used within MAgPIE, but necessary for the postprocessing -table f42_watdem_ineldo_total(t_all,j,scen_watdem_nonagr,watdem_ineldo) Manufacturing electricity and domestic water demand under different socioeconomic scenarios in the entire year (mio. m^3) +table f42_watdem_ineldo_total(t_all,j,scen_watdem_nonagr,watdem_ineldo,wtype) Manufacturing electricity and domestic water demand under different socioeconomic scenarios in the entire year (mio. m^3) $ondelim $if exist "./modules/42_water_demand/input/watdem_nonagr_total.cs3" $include "./modules/42_water_demand/input/watdem_nonagr_total.cs3" $offdelim diff --git a/modules/42_water_demand/all_sectors_aug13/presolve.gms b/modules/42_water_demand/all_sectors_aug13/presolve.gms index baa83ee407..f6009fca16 100644 --- a/modules/42_water_demand/all_sectors_aug13/presolve.gms +++ b/modules/42_water_demand/all_sectors_aug13/presolve.gms @@ -38,18 +38,18 @@ if ((s42_pumping = 1), * Water withdrawals in manufacturing, electricity, domestic, ecosystem * depends on the socioeconomic scenario if (m_year(t) <= sm_fix_SSP2, - vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp2",watdem_ineldo); - i42_watdem_total(t,j,watdem_ineldo) = f42_watdem_ineldo_total(t,j,"ssp2",watdem_ineldo); + vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp2",watdem_ineldo,"withdrawal"); + i42_watdem_total(t,j,watdem_ineldo,wtype) = f42_watdem_ineldo_total(t,j,"ssp2",watdem_ineldo,wtype); else if ((s42_watdem_nonagr_scenario = 1), - vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp1",watdem_ineldo); - i42_watdem_total(t,j,watdem_ineldo) = f42_watdem_ineldo_total(t,j,"ssp1",watdem_ineldo); + vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp1",watdem_ineldo,"withdrawal"); + i42_watdem_total(t,j,watdem_ineldo,wtype) = f42_watdem_ineldo_total(t,j,"ssp1",watdem_ineldo,wtype); Elseif (s42_watdem_nonagr_scenario = 2), - vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp2",watdem_ineldo); - i42_watdem_total(t,j,watdem_ineldo) = f42_watdem_ineldo_total(t,j,"ssp2",watdem_ineldo); + vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp2",watdem_ineldo,"withdrawal"); + i42_watdem_total(t,j,watdem_ineldo,wtype) = f42_watdem_ineldo_total(t,j,"ssp2",watdem_ineldo,wtype); Elseif (s42_watdem_nonagr_scenario = 3), - vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp3",watdem_ineldo); - i42_watdem_total(t,j,watdem_ineldo) = f42_watdem_ineldo_total(t,j,"ssp3",watdem_ineldo); + vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp3",watdem_ineldo,"withdrawal"); + i42_watdem_total(t,j,watdem_ineldo,wtype) = f42_watdem_ineldo_total(t,j,"ssp3",watdem_ineldo,wtype); ); ); diff --git a/modules/42_water_demand/all_sectors_aug13/sets.gms b/modules/42_water_demand/all_sectors_aug13/sets.gms index 2b3a9b3112..f78e81a806 100644 --- a/modules/42_water_demand/all_sectors_aug13/sets.gms +++ b/modules/42_water_demand/all_sectors_aug13/sets.gms @@ -21,4 +21,7 @@ sets scen42_to_dev(scen42,dev) Mapping between EFP and economic development status / off . (lic, mic) on . (hic) / + + wtype Water abstraction type + / consumption, withdrawal / ; From cdbe7d0a43dbedddafdca434f56d237c77294a5e Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 28 Jun 2024 15:56:00 +0200 Subject: [PATCH 042/171] bugfix: domain violation --- modules/42_water_demand/all_sectors_aug13/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/42_water_demand/all_sectors_aug13/input.gms b/modules/42_water_demand/all_sectors_aug13/input.gms index 5d32a8a32d..b5448d5b1c 100644 --- a/modules/42_water_demand/all_sectors_aug13/input.gms +++ b/modules/42_water_demand/all_sectors_aug13/input.gms @@ -105,7 +105,7 @@ $ondelim $if exist "./modules/42_water_demand/input/watdem_nonagr_total.cs3" $include "./modules/42_water_demand/input/watdem_nonagr_total.cs3" $offdelim ; -m_fillmissingyears(f42_watdem_ineldo_total,"j,scen_watdem_nonagr,watdem_ineldo"); +m_fillmissingyears(f42_watdem_ineldo_total,"j,scen_watdem_nonagr,watdem_ineldo,wtype"); parameter f42_env_flows(t_all,j) Environmental flow requirements from LPJ and Smakhtin algorithm (mio. m^3) From edcbc6e68eb69ac215ab69c538989624b51eb0b3 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 28 Jun 2024 16:14:10 +0200 Subject: [PATCH 043/171] bugfix: domain violation 2 --- modules/42_water_demand/all_sectors_aug13/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/42_water_demand/all_sectors_aug13/input.gms b/modules/42_water_demand/all_sectors_aug13/input.gms index b5448d5b1c..ba297acdfd 100644 --- a/modules/42_water_demand/all_sectors_aug13/input.gms +++ b/modules/42_water_demand/all_sectors_aug13/input.gms @@ -97,7 +97,7 @@ $ondelim $include "./modules/42_water_demand/input/watdem_nonagr_grper.cs3" $offdelim ; -m_fillmissingyears(f42_watdem_ineldo,"j,scen_watdem_nonagr,watdem_ineldo"); +m_fillmissingyears(f42_watdem_ineldo,"j,scen_watdem_nonagr,watdem_ineldo,wtype"); * This input is not used within MAgPIE, but necessary for the postprocessing table f42_watdem_ineldo_total(t_all,j,scen_watdem_nonagr,watdem_ineldo,wtype) Manufacturing electricity and domestic water demand under different socioeconomic scenarios in the entire year (mio. m^3) From fdeb7c7fa878572edf990363c9a1eeb80c93e2fe Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 28 Jun 2024 16:28:02 +0200 Subject: [PATCH 044/171] bugfix: domain violation 3 --- .../all_sectors_aug13/declarations.gms | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/42_water_demand/all_sectors_aug13/declarations.gms b/modules/42_water_demand/all_sectors_aug13/declarations.gms index 42c836dfc6..e94a089e6a 100644 --- a/modules/42_water_demand/all_sectors_aug13/declarations.gms +++ b/modules/42_water_demand/all_sectors_aug13/declarations.gms @@ -6,18 +6,18 @@ *** | Contact: magpie@pik-potsdam.de parameters - i42_wat_req_k(t_all,j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) - ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) - i42_env_flows(t,j) Environmental flow requirements in case of policy (mio m^3) - i42_env_flows_base(t,j) Environmental flow requirements in case of no policy (mio m^3) - ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) - i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) - p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) - p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) - p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) - p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) - ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) - i42_watdem_total(t,j,watdem_ineldo) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) + i42_wat_req_k(t_all,j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) + ic42_wat_req_k(j,k) LPJmL annual water demand for irrigation per ha per yr and livestock demand per ton per yr (m^3) + i42_env_flows(t,j) Environmental flow requirements in case of policy (mio m^3) + i42_env_flows_base(t,j) Environmental flow requirements in case of no policy (mio m^3) + ic42_env_flow_policy(i) Determines whether environmental flow protection is enforced in the current time step (1) + i42_env_flow_policy(t,i) Determines whether environmental flow protection is enforced (1) + p42_efp(t_all,scen42) Determines whether environmental flow protection is enforced and its fading in of environmental flow policy (1) + p42_efp_fader(t_all) Determines the fading in of environmental flow policy (1) + p42_country_dummy(iso) Dummy parameter indicating whether country is affected by EFP (1) + p42_EFP_region_shr(t_all,i) Weighted share of region with regards to EFP (1) + ic42_pumping_cost(i) Parameter to capture values for pumping costs in a particular time step (USD05MER per m^3) + i42_watdem_total(t,j,watdem_ineldo,wtype) Non-agricultural water demand for entire year used in post-processing (mio. m^3 per yr) ; equations From ca305765a7c986ab3f413e919ffb4aeef9aea4f8 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 28 Jun 2024 16:40:35 +0200 Subject: [PATCH 045/171] add wtype as set --- modules/42_water_demand/agr_sector_aug13/sets.gms | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/42_water_demand/agr_sector_aug13/sets.gms b/modules/42_water_demand/agr_sector_aug13/sets.gms index 78f20947c5..fdd9a670be 100644 --- a/modules/42_water_demand/agr_sector_aug13/sets.gms +++ b/modules/42_water_demand/agr_sector_aug13/sets.gms @@ -18,4 +18,7 @@ sets scen42_to_dev(scen42,dev) Mapping between EFP and economic development status / off . (lic, mic) on . (hic) / + + wtype Water abstraction type + / consumption, withdrawal / ; From c49f7eeeaac7a2ca53adcfa5004a77649c5c40b3 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 1 Jul 2024 12:20:59 +0200 Subject: [PATCH 046/171] set all EL2_Default switches to default to ensure that not overwritten by scenario settings in start script --- config/scenario_config.csv | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index e173c6db02..8ccb0a6e8c 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -3,26 +3,26 @@ gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;5year;5year;5year;5year;5y 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;;;;;;;;;SDP;SDP;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_lic;;;;;;;;;;;;;;;;;;;;;;0.06;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_hic;;;;;;;;;;;;;;;;;;;;;;0.04;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_lic;;;;;;;;;;;;;;;;;;;;;;0.06;0.1;0.1;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_hic;;;;;;;;;;;;;;;;;;;;;;0.04;0.04;0.04;;;;;;;;;;;;;;;;;;;;;;;;; gms$c13_tccost;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;high gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;;nocc gms$food;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;anthropometrics_jan18 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;0;0;;;;;;;;;;;;;;;;;;;; +gms$s15_elastic_demand;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;;;;;;;;;;;;;; gms$s15_rumdairy_scp_substitution;;;;0;0;0;0;0;0;0;0.5;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s15_food_substitution_start;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;livst_rum,livst_milk -gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2020;2025;2020;2020;;;2020;;;2020;;;;;;;;;;;;;;;;;;;2020; -gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;2050;2050;;;2050;;;2050;;;;;;;;;;;;;;;;;;;2050; -gms$s15_exo_waste;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;1;1;;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; +gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; +gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; +gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2020;2025;2025;2025;2025;;2020;;;2020;;;;;;;;;;;;;;;;;;;2020; +gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;2050;2050;2050;;2050;;;2050;;;;;;;;;;;;;;;;;;;2050; +gms$s15_exo_waste;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;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;;;1.2;;;;;;;;;;;;;;;;;;;1.2; -gms$s15_exo_diet;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;3;3;;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; +gms$s15_exo_diet;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;3;3;0;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;;;healthy_BMI;;;;;;;;;;;;;;;;;;;healthy_BMI; gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;FLX;FLX;FLX;;;FLX;;;FLX;;;;;;;;;;;;;;;;;;;; gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; @@ -99,7 +99,7 @@ gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;ph 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;;ssp1;;;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.109_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.109_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.109_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.109_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.109_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;;;;;;;;;;;;;;;;;;;;;;;;; From 5fd020a9617e13fd9d29685ebee55a561e2e22c3 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 1 Jul 2024 12:27:04 +0200 Subject: [PATCH 047/171] bugfix start script: bau setting for pal should be ssp2 --- scripts/start/projects/project_EAT2p0_DeepDive.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index b36cc00949..3cdfc2fb1e 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -67,6 +67,7 @@ bau <- function(cfg) { cfg$gms$s15_exo_diet <- 0 # default cfg$gms$c15_kcal_scen <- "healthy_BMI" # default (but not active b/c of s15_exo_diet = 0) cfg$gms$c15_EAT_scen <- "FLX" # default (but not active b/c of s15_exo_diet = 0) + cfg$gms$c09_pal_scenario <- "SSP2" # default # Waste: half food waste cfg$gms$s15_exo_waste <- 0 # default cfg$gms$s15_waste_scen <- 1.2 # default (but not active b/c of s15_exo_waste = 0) From 268806395f96ac66b98e54c00b8f7fb13ea6b4f5 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 4 Jul 2024 12:50:54 +0200 Subject: [PATCH 048/171] updated preprocessing and paths --- config/default.cfg | 6 +++--- config/scenario_config.csv | 2 +- scripts/start/projects/project_EAT2p0.R | 10 +++++++--- scripts/start/projects/project_EAT2p0_DeepDive.R | 8 ++++++-- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index d26ce0a3bd..578648c370 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.110wcons_h12_magpie.tgz", - cellular = "rev4.110wcons_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "WARNINGS40_rev4.110wcons_h12_validation.tgz", +cfg$input <- c(regional = "rev4.111_h12_magpie.tgz", + cellular = "rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.111_h12_validation.tgz", additional = "additional_data_rev4.51.tgz", calibration = "calibration_H12_26Mar24.tgz") diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 8ccb0a6e8c..2950358282 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -102,4 +102,4 @@ gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;; gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.109_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.109_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.109_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.109_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.109_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; -magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif;;;;;;;;;;;;;;;;;;;;;;;;; +magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 29b112649d..8262d17445 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -54,6 +54,10 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # RCP/GCM: 7p0 shocks on crops, livestock, labor # Trade: BAU bau <- function(cfg) { + + # obtain settings from default config + source("config/default.cfg") + ### General settings ### # For impacts of CC on labor: cfg$gms$factor_costs <- "sticky_labor" @@ -85,7 +89,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Climate Change - cfg$input["cellular"] <- "rev4.109_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" + cfg$input["cellular"] <- "rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz" return(cfg) } @@ -132,9 +136,9 @@ waste <- function(cfg) { miti <- function(cfg) { # Mitigation: consistent with 1.5C considering diet change # To Do: update to iteration 5! - cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" + cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8.mif" cfg$gms$c56_pollutant_prices <- "coupling" - cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-4.mif" + cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8.mif" cfg$gms$c60_2ndgen_biodem <- "coupling" return(cfg) diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 3cdfc2fb1e..30513ffa51 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -41,7 +41,7 @@ cfg$output <- c( ) # Set path to own coupled runs: -path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" +path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-8.mif" ####################### @@ -62,6 +62,10 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) # RCP/GCM: 7p0 shocks on crops, livestock, labor # Trade: BAU bau <- function(cfg) { + + # obtain settings from default config + source("config/default.cfg") + cfg$gms$factor_costs <- "sticky_labor" ### Components for Decomposition ### # Diets: exogenous EATLancet diet cfg$gms$s15_exo_diet <- 0 # default @@ -84,7 +88,7 @@ bau <- function(cfg) { cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-NPi" # default # Setting REMIND scenario for blackmagicc - cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-5.mif" + cfg$magicc_emis_scen <- "REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif" return(cfg) } From 8243a66ef4ae5ea347a6c7fb53bcfc1818d3b5fe Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 4 Jul 2024 22:39:24 +0200 Subject: [PATCH 049/171] bugfix related to config in start scripts of EL2 --- scripts/start/projects/project_EAT2p0.R | 3 --- scripts/start/projects/project_EAT2p0_DeepDive.R | 2 -- 2 files changed, 5 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 8262d17445..1390ae334b 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -55,9 +55,6 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # Trade: BAU bau <- function(cfg) { - # obtain settings from default config - source("config/default.cfg") - ### General settings ### # For impacts of CC on labor: cfg$gms$factor_costs <- "sticky_labor" diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 30513ffa51..ee4984fb07 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -63,8 +63,6 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) # Trade: BAU bau <- function(cfg) { - # obtain settings from default config - source("config/default.cfg") cfg$gms$factor_costs <- "sticky_labor" ### Components for Decomposition ### # Diets: exogenous EATLancet diet From 0a9e9a79da84d199837889bf37864681725859c4 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 5 Jul 2024 10:25:42 +0200 Subject: [PATCH 050/171] updated all preprocessing input vectors in configs --- config/scenario_config.csv | 2 +- config/scenario_fsec.csv | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 2950358282..e30616b994 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -101,5 +101,5 @@ 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;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.109_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.109_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.109_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.109_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.109_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; diff --git a/config/scenario_fsec.csv b/config/scenario_fsec.csv index 9bf407fa60..f986caf4c6 100644 --- a/config/scenario_fsec.csv +++ b/config/scenario_fsec.csv @@ -76,9 +76,9 @@ gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.109_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.109_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.109_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.109_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.109_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.109_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.109_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.109_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.109_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.111_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.111_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.111_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['additional'];additional_data_rev4.51.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; From 87902af2e9cbf06d397073cd054bb45c0608dd3f Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 5 Jul 2024 10:29:59 +0200 Subject: [PATCH 051/171] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 852c8f1161..b5a1be749a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` - **70_livestock** added realization `fbask_jan16_sticky` - **script** check of variables needed in piamInterfaces in report_rds.R +- **42_water_demand** added water abstraction type dimension for non-ag uses ### removed - From df4d28c14cdc01ecf7ea54faca0b58cab066d56b Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 5 Jul 2024 11:00:19 +0200 Subject: [PATCH 052/171] bugfix in agmip_report call in start script --- scripts/start/projects/project_EAT2p0.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 1390ae334b..21960617eb 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -34,7 +34,7 @@ cfg$output <- c( "extra/disaggregation", # "projects/FSEC_nitrogenPollution", # do manually on last (high-res) magpie run # "projects/FSEC_water", # do manually on last (high-res) magpie run - "agmip_report", + "projects/agmip_report", # add output file: pb_report (magpie (special mif created by getReportPBindicators & remind mif (REMIND_generic_scenName.mif)) "rds_report" ) From 170a117d1665ea842c1a9e9cecadaa22b587d41b Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 5 Jul 2024 15:11:27 +0200 Subject: [PATCH 053/171] fixed typo --- modules/42_water_demand/all_sectors_aug13/presolve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/42_water_demand/all_sectors_aug13/presolve.gms b/modules/42_water_demand/all_sectors_aug13/presolve.gms index f6009fca16..db3266e241 100644 --- a/modules/42_water_demand/all_sectors_aug13/presolve.gms +++ b/modules/42_water_demand/all_sectors_aug13/presolve.gms @@ -36,7 +36,7 @@ if ((s42_pumping = 1), * Water withdrawals in manufacturing, electricity, domestic, ecosystem -* depends on the socioeconomic scenario +* depend on the socioeconomic scenario if (m_year(t) <= sm_fix_SSP2, vm_watdem.fx(watdem_ineldo,j) = f42_watdem_ineldo(t,j,"ssp2",watdem_ineldo,"withdrawal"); i42_watdem_total(t,j,watdem_ineldo,wtype) = f42_watdem_ineldo_total(t,j,"ssp2",watdem_ineldo,wtype); From eb23e004ff85057b7179c826279fa9d7cdd5d399 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 8 Jul 2024 11:21:22 +0200 Subject: [PATCH 054/171] added default column to config for clean up --- config/default.cfg | 4 +- config/scenario_config.csv | 210 ++++++++++++++++++------------------- 2 files changed, 107 insertions(+), 107 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 578648c370..5d388701f2 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -997,7 +997,7 @@ cfg$gms$s32_est_cost_natveg <- 2000 # def = 2000 # * such that the total plantation area remains constant. # * 2 = "Endogenous" scenario. Harvest from plantations including age-class shifting # * All plantations are harvested at rotation age. Plantation establishment is endogenous. -cfg$gms$s32_hvarea = 2 # def = 2 +cfg$gms$s32_hvarea <- 2 # def = 2 # Type of rotation length selection criteria # * ("mean_annual_increment") = Harvesting when the average annual increment is maximum @@ -1012,7 +1012,7 @@ cfg$gms$c32_rot_calc_type <- "current_annual_increment" # * ("004lin2030") Disturbance applied to 0p4 percent per year linear phase-in over 20yrs from 0 in 2030 # * ("008lin2030") Disturbance applied to 0p8 percent per year linear phase-in over 20yrs from 0 in 2030 # * ("016lin2030") Disturbance applied to 1p6 percent per year linear phase-in over 20yrs from 0 in 2030 -cfg$gms$c32_shock_scenario = "none" # def = "none" +cfg$gms$c32_shock_scenario <- "none" # def = "none" # ***--------------------- 34_urban --------------------------------------- # * 34_urban includes urban land diff --git a/config/scenario_config.csv b/config/scenario_config.csv index e30616b994..4b696bf993 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,105 +1,105 @@ -;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;EL2_PHD;EL2_Demand;EL2_default;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;GENIE_SCP -gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;;;coup2110 -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;;;;;;;;;SDP;SDP;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_lic;;;;;;;;;;;;;;;;;;;;;;0.06;0.1;0.1;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_hic;;;;;;;;;;;;;;;;;;;;;;0.04;0.04;0.04;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c13_tccost;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;high -gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;;nocc -gms$food;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;anthropometrics_jan18 -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;0;0;0;;;;;;;;;;;;;;;;;;;; -gms$s15_rumdairy_scp_substitution;;;;0;0;0;0;0;0;0;0.5;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_start;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;livst_rum,livst_milk -gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2020;2025;2025;2025;2025;;2020;;;2020;;;;;;;;;;;;;;;;;;;2020; -gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;2050;2050;2050;;2050;;;2050;;;;;;;;;;;;;;;;;;;2050; -gms$s15_exo_waste;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;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;;;1.2;;;;;;;;;;;;;;;;;;;1.2; -gms$s15_exo_diet;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;3;3;0;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;;;healthy_BMI;;;;;;;;;;;;;;;;;;;healthy_BMI; -gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;FLX;FLX;FLX;;;FLX;;;FLX;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_roots;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;1;0;0;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;1;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_alc_scen;0.014;;;;;;;;;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c20_scp_type;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;hydrogen -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$s29_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$s29_snv_shr_noselect;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;rainfed;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s30_annual_max_growth;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.02 -gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c32_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; -gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; -gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;;; -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$c35_pot_forest_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;2030;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; -gms$c35_shock_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; -gms$s35_forest_damage;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;;; -gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; -gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; -gms$factor_costs;;;;;;;;;;;;;;;;;;;;;;sticky_labor;sticky_labor;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;sticky_feb18 -gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -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$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$s44_target_price;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s44_cost_bii_missing;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000000 -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$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU;; -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;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c56_pollutant_prices_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$s56_c_price_exp_aff;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_buffer_aff;;;;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.2;0.3;;;;;;;0.5;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;;;;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;reddnatveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_mute_ghgprices_until;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y2020 -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;;;;;;;;;;;;;;;; -gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$maccs;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$bioenergy;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1st2ndgen_priced_feb24 -gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c60_2ndgen_biodem_noselect;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;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;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; -gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; -magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; +;default;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_v1;eat_lancet_diet_v2;EL2_PHD;EL2_Demand;EL2_default;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;GENIE_SCP +gms$c_timesteps;coup2100;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;;;coup2110 +gms$c09_pop_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; +gms$c09_gdp_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;SDP;SDP;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_lic;0.1;;;;;;;;;;;;;;;;;;;;;;;0.06;0.1;0.1;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_hic;0.04;;;;;;;;;;;;;;;;;;;;;;;0.04;0.04;0.04;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c13_tccost;medium;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;high +gms$c14_yields_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;;nocc +gms$food;anthro_iso_jun22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;anthropometrics_jan18 +gms$c15_food_scenario;SSP2;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2; +gms$c15_food_scenario_noselect;SSP2;;;;;;;;;;;;;;;;;;;;;;;;;;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;0;0;0;0;;;;;;;;;;;;;;;;;;;; +gms$s15_rumdairy_scp_substitution;0;;;;0;0;0;0;0;0;0;0.5;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s15_food_subst_functional_form;1;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_start;2025;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_target;2050;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$kfo_rd;livst_rum;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;livst_rum,livst_milk +gms$s15_exo_foodscen_convergence;1;;;;;;;;;;1;1;1;1;;;;;;;1;1;;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; +gms$s15_exo_foodscen_functional_form;1;;;;;;;;;;1;1;1;1;;;;;;;1;1;;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; +gms$s15_exo_foodscen_start;2025;;;;;;;;;;2020;2020;2020;2020;;;;;;;2020;2025;;2025;2025;2025;;2020;;;2020;;;;;;;;;;;;;;;;;;;2020; +gms$s15_exo_foodscen_target;2050;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;;2050;2050;2050;;2050;;;2050;;;;;;;;;;;;;;;;;;;2050; +gms$s15_exo_waste;0;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;;1;1;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; +gms$s15_waste_scen;1.2;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;1.2;1.2;;1.2;1.2;;;1.2;;;1.2;;;;;;;;;;;;;;;;;;;1.2; +gms$s15_exo_diet;0;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;;3;3;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; +gms$c15_kcal_scen;healthy_BMI;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;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;FLX;;;FLX;;;FLX;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_monogastric;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_ruminant;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_fish;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_fruitvegnut;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_roots;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_pulses;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_sugar;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_oils;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_brans;0;;;;;;;;;;1;0;1;1;;;;;;;1;1;;0;0;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_scp;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_alcohol;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$s15_alc_scen;0;;;;;;;;;;;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c20_scp_type;sugar;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;hydrogen +gms$c21_trade_liberalization;l909090r808080;;;;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;none;BH;none;BH_IFL;BH;;;;;;;BH;;;;;;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL;;;;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario_noselect;none;;;;;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none;BH_IFL;;;;;;;;;;;;;;;;;;;; +gms$s29_snv_shr;0;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;;;;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;;; +gms$s29_snv_shr_noselect;0;;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;; +gms$s29_snv_scenario_target;2050;;;;;;;;;;;;;2030;;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;rainfed;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;;rainfed;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s30_annual_max_growth;Inf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.02 +gms$c31_grassl_yld_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c32_shock_scenario;none;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; +gms$s32_initial_distribution;1;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; +gms$s32_hvarea;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;;; +gms$s32_aff_plantation;0;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_aff_bii_coeff;0;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_max_aff_area;Inf;;;;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;noboreal;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;onlytropical;;;;;;noboreal;noboreal;noboreal;noboreal;noboreal;;;;;;;;;;;;;;;;;;;; +gms$c34_urban_scenario;SSP2;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; +gms$c32_aff_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; +gms$s32_planing_horizon;50;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c35_ad_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; +gms$c35_aolc_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; +gms$c35_pot_forest_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; +gms$s35_forest_damage;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;;; +gms$s35_forest_damage_end;2050;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;2030;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; +gms$c35_shock_scenario;none;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; +gms$s35_secdf_distribution;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; +gms$s35_hvarea;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; +gms$factor_costs;per_ton_fao_may22;;;;;;;;;;;;;;;;;;;;;;;sticky_labor;sticky_labor;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;sticky_feb18 +gms$c42_watdem_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; +gms$s42_watdem_nonagr_scenario;2;;;;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;2;3;3;3;3;;;;;;;3;;;;;;3;3;3;3;3;;;;;;;;;;;;;;;;;;;; +gms$c42_env_flow_policy;off;;;;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;2040;2050;2070;2050;;;;;;;2040;;;;;;2040;2040;2040;2040;2040;;;;;;;;;;;;;;;;;;;; +gms$c43_watavail_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; +gms$s44_cost_bii_missing;1000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000000 +gms$s44_target_price;0;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff;baseeff_add3_add5_add10_max65;;;;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_add5_add10_max65;;;;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$c52_carbon_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; +gms$c52_land_carbon_sink_rcp;RCPBU;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU;; +gms$c55_scen_conf;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;;;;;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;;;;; +gms$c55_scen_conf_noselect;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;;;;;ssp4;ssp4;ssp1;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; +gms$c56_pollutant_prices;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$s56_c_price_exp_aff;50;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s56_buffer_aff;0.5;;;;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.2;0.3;;;;;;;0.5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;reddnatveg_nosoil;;;;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;reddnatveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s56_minimum_cprice;0;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c56_mute_ghgprices_until;y2030;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y2020 +gms$maccs;on_aug22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c57_macc_version;PBL_2022;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PBL_2022;PBL_2022;PBL_2022;PBL_2022;;;;;;;;;;;;;;;; +gms$c57_macc_scenario;Default;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Default;Optimistic;Default;Optimistic;;;;;;;;;;;;;;;; +gms$s58_rewetting_switch;Inf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0;1;0;1;;;;;;;;;;;;;;;; +gms$c59_som_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; +gms$bioenergy;1stgen_priced_dec18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1st2ndgen_priced_feb24 +gms$c60_1stgen_biodem;const2020;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;phaseout2020;;;;;;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;;;;;phaseout2020 +gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi +gms$c60_biodem_level;1;;;;;;;;;;;;;;;;;1;0;;;;;;;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; +gms$c60_bioenergy_subsidy;300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_res_2ndgenBE_dem;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;sdp;;;;;;ssp4;sdp;ssp4;ssp4;sdp;;;;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; +gms$s73_timber_demand_switch;1stgen_priced_dec18;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; +magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; From 4b9955fb36a70c0e7a01d93dc1c2d8e0dc85c4ad Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 8 Jul 2024 11:43:49 +0200 Subject: [PATCH 055/171] renamed fsec scenario config to new convention --- config/scenario_fsec.csv | 84 ---------------------------------------- scripts/projects/fsec.R | 2 +- 2 files changed, 1 insertion(+), 85 deletions(-) delete mode 100644 config/scenario_fsec.csv diff --git a/config/scenario_fsec.csv b/config/scenario_fsec.csv deleted file mode 100644 index f986caf4c6..0000000000 --- a/config/scenario_fsec.csv +++ /dev/null @@ -1,84 +0,0 @@ -;FSEC;population;institutions;energy;bioplastics;capitalSubst;minWage;noUnderweight;halfOverweight;fruitsNutsVegSeeds;monogastrics;ruminants;pulses;processed;fish;waste;awms;livestock;cropefficiency;nueMAC;riceMAC;biodiversity;fairTrade;timberCities;REDDaff;REDD;landscapeElements;landSharing;landSparing;waterSparing;peatland;soil;allDiet;allDietAndWaste;allEnvPrice;allEmisPrice;SSP1;SSP2;SSP3;SSP4;SSP5;RCP19;RCP26;RCP34;RCP45;RCP60;RCP70;RCP85;SDPenergy;labor8p5;labor1p9 -gms$c09_pop_scenario;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c09_gdp_scenario;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c09_pal_scenario;;;SDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_lic;;;0.06;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_hic;;;0.04;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$food;anthro_iso_jun22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s14_use_yield_calib;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s14_minimum_wood_yield;10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_waste;;;;;;;;0;0;0;0;0;0;0;0;1;;;;;;;;;;;;;;;;;0;1;;;;;;;;;;;;;;;;; -gms$s15_exo_diet;;;;;;;;1;1;1;1;1;1;1;1;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$c15_kcal_scen;;;;;;;;no_underweight;half_overweight;endo;endo;endo;endo;endo;endo;endo;;;;;;;;;;;;;;;;;no_underweight_half_overweight;no_underweight_half_overweight;;;;;;;;;;;;;;;;; -gms$c15_EAT_scen;;;;;;;;FLX;FLX;FLX;FLX;FLX;FLX;FLX;FLX;FLX;;;;;;;;;;;;;;;;;FLX;FLX;;;;;;;;;;;;;;;;; -gms$s15_exo_monogastric;;;;;;;;0;0;0;1;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_ruminant;;;;;;;;0;0;0;0;1;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_fish;;;;;;;;0;0;0;0;0;0;0;1;0;;;;;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;; -gms$s15_exo_fruitvegnut;;;;;;;;0;0;1;0;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_roots;;;;;;;;0;0;1;0;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_pulses;;;;;;;;0;0;0;0;0;1;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_sugar;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_oils;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_scp;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_exo_alcohol;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; -gms$s15_alc_scen;0.014;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c15_food_scenario;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c21_trade_liberalization;;;;;;;;;;;;;;;;;;;;;;;l908080r807070;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s21_trade_bal_damper;0.65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c22_protect_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;BH_IFL;;;;;;;;;;;;;;;;;;;;;; -gms$croparea;detail_apr24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c30_rotation_rules;FSEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c30_rotation_incentives;default;;;;;;;;;;;;;;;;;;;;;;;;;;;agroecology;;;;;;;;;;;;;;;;;;;;;;; -gms$s30_implementation;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s30_rotation_scenario_target;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;; -gms$c29_marginal_land;q33_marginal;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_scenario_target;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_shr;;;;;;;;;;;;;;;;;;;;;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;; -gms$past;endo_jun13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c32_aff_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c32_aff_mask;;;;;;;;;;;;;;;;;;;;;;;;;onlytropical;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_max_aff_area;;;;;;;;;;;;;;;;;;;;;;;;;500;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c34_urban_scenario;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c35_ad_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c35_aolc_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s35_forest_damage_end;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;2050;2050;2050;2050;;;;;;;;;; -gms$s35_secdf_distribution;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s36_minimum_wage;0;;;;;;3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$factor_costs;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$labor_prod;off;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;exo;exo -gms$c37_labor_rcp;rcp119;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rcp585;rcp119 -gms$c38_fac_req;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s38_target_labor_share;0;;;;;0.8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s42_watdem_nonagr_scenario;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c42_env_flow_policy;off;;;;;;;;;;;;;;;;;;;;;;;;;;;;;on;;;;;;;;;;;;;;;;;;;;; -gms$s42_efp_startyear;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2025;;;;;;;;;;;;;;;;;;;;; -gms$s42_efp_targetyear;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;; -gms$s44_bii_lower_bound;;;;;;;;;;;;;;;;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c44_bii_decrease;;;;;;;;;;;;;;;;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$nitrogen;rescaled_jan21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff;;;baseeff_add3_add10_add20_max75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff_noselect;;;baseeff_add3_add10_add20_max75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c52_land_carbon_sink_rcp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP34;RCP45;RCP60;RCPBU;RCPBU;;; -gms$c55_scen_conf;;;;;;;;;;;;;;;;;GoodPractice;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;none;;;;;;;;;;;;;;;;;;sdp_cropeff;;;;;;sdp_redd;sdp_redd;;;;;sdp_peatland;sdp_soil;;;sdp_redd_soil_peat;sdp_all;;;;;;;;;;;;;;; -gms$c56_pollutant_prices;R21M42-SSP2-PkBudg1300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_c_price_induced_aff;0;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s57_maxmac_n_soil;-1;;;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s57_maxmac_ch4_rice;-1;;;;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s57_maxmac_ch4_entferm;-1;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s57_maxmac_ch4_awms;-1;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s58_rewetting_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Inf;;;;;;;;;;;;;;;;;;;; -gms$som;cellpool_aug16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c60_2ndgen_biodem;R21M42-SSP2-NDC;;;R21M42-SSP2-PkBudg900;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;R21M42-SDP-PkBudg900;; -gms$c60_res_2ndgenBE_dem;;;;sdp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['cellular'];rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.111_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; -input['regional'];rev4.111_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['validation'];rev4.111_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['additional'];additional_data_rev4.51.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/scripts/projects/fsec.R b/scripts/projects/fsec.R index 0924c3f579..0449a6028b 100644 --- a/scripts/projects/fsec.R +++ b/scripts/projects/fsec.R @@ -200,7 +200,7 @@ fsecScenario <- function(scenario) { ) # Assign selected scenario to cfg cfg <- setScenario(cfg, x[[scenario]]$standard) - cfg <- setScenario(cfg, x[[scenario]]$fsec, scenario_config = "config/scenario_fsec.csv") + cfg <- setScenario(cfg, x[[scenario]]$fsec, scenario_config = "config/projects/scenario_config_fsec.csv") # Download gridded population data gms::download_unpack(input = "FSEC_populationScenarios_v2_22-08-22.tgz", From 7f338f5a7027377052cf93915f33e7a16bbf1fe1 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 8 Jul 2024 12:11:44 +0200 Subject: [PATCH 056/171] bugfix in default settings --- config/scenario_config.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 4b696bf993..1e48441f79 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -100,6 +100,6 @@ gms$c60_biodem_level;1;;;;;;;;;;;;;;;;;1;0;;;;;;;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; gms$c60_bioenergy_subsidy;300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; gms$c60_res_2ndgenBE_dem;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;sdp;;;;;;ssp4;sdp;ssp4;ssp4;sdp;;;;;;;;;;;;;;;;;;;; gms$c70_feed_scen;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; -gms$s73_timber_demand_switch;1stgen_priced_dec18;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; +gms$s73_timber_demand_switch;1;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; From 57a8a2bf9254c8fdf5064c8b638ba8dbda18102f Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 8 Jul 2024 13:31:11 +0200 Subject: [PATCH 057/171] added new project specific config files --- config/projects/scenario_config_el2.csv | 11 ++++ config/projects/scenario_config_fsec.csv | 84 ++++++++++++++++++++++++ config/projects/scenario_config_lama.csv | 39 +++++++++++ 3 files changed, 134 insertions(+) create mode 100644 config/projects/scenario_config_el2.csv create mode 100644 config/projects/scenario_config_fsec.csv create mode 100644 config/projects/scenario_config_lama.csv diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv new file mode 100644 index 0000000000..7bbc0a9b8f --- /dev/null +++ b/config/projects/scenario_config_el2.csv @@ -0,0 +1,11 @@ +;default;EL2_PHD;EL2_Demand;EL2_default +gms$c09_pal_scenario;SSP2;SDP;SDP;SSP2 +gms$s12_interest_lic;0.1;0.06;0.1;0.1 +gms$s12_interest_hic;0.04;0.04;0.04;0.04 +gms$s15_exo_waste;0;1;1;0 +gms$s15_waste_scen;1.2;1.2;1.2;1.2 +gms$s15_exo_diet;0;3;3;0 +gms$factor_costs;per_ton_fao_may22;sticky_labor;sticky_labor;sticky_labor +gms$c70_feed_scen;ssp2;ssp1;ssp2;ssp2 +input['cellular'];;rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +magicc_emis_scen;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_fsec.csv b/config/projects/scenario_config_fsec.csv new file mode 100644 index 0000000000..f986caf4c6 --- /dev/null +++ b/config/projects/scenario_config_fsec.csv @@ -0,0 +1,84 @@ +;FSEC;population;institutions;energy;bioplastics;capitalSubst;minWage;noUnderweight;halfOverweight;fruitsNutsVegSeeds;monogastrics;ruminants;pulses;processed;fish;waste;awms;livestock;cropefficiency;nueMAC;riceMAC;biodiversity;fairTrade;timberCities;REDDaff;REDD;landscapeElements;landSharing;landSparing;waterSparing;peatland;soil;allDiet;allDietAndWaste;allEnvPrice;allEmisPrice;SSP1;SSP2;SSP3;SSP4;SSP5;RCP19;RCP26;RCP34;RCP45;RCP60;RCP70;RCP85;SDPenergy;labor8p5;labor1p9 +gms$c09_pop_scenario;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c09_gdp_scenario;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;;;SDP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_lic;;;0.06;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s12_interest_hic;;;0.04;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$food;anthro_iso_jun22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s14_use_yield_calib;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s14_minimum_wood_yield;10;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s15_exo_waste;;;;;;;;0;0;0;0;0;0;0;0;1;;;;;;;;;;;;;;;;;0;1;;;;;;;;;;;;;;;;; +gms$s15_exo_diet;;;;;;;;1;1;1;1;1;1;1;1;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$c15_kcal_scen;;;;;;;;no_underweight;half_overweight;endo;endo;endo;endo;endo;endo;endo;;;;;;;;;;;;;;;;;no_underweight_half_overweight;no_underweight_half_overweight;;;;;;;;;;;;;;;;; +gms$c15_EAT_scen;;;;;;;;FLX;FLX;FLX;FLX;FLX;FLX;FLX;FLX;FLX;;;;;;;;;;;;;;;;;FLX;FLX;;;;;;;;;;;;;;;;; +gms$s15_exo_monogastric;;;;;;;;0;0;0;1;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_ruminant;;;;;;;;0;0;0;0;1;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_fish;;;;;;;;0;0;0;0;0;0;0;1;0;;;;;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;; +gms$s15_exo_fruitvegnut;;;;;;;;0;0;1;0;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_roots;;;;;;;;0;0;1;0;0;0;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_pulses;;;;;;;;0;0;0;0;0;1;0;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_sugar;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_oils;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_scp;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_exo_alcohol;;;;;;;;0;0;0;0;0;0;1;0;0;;;;;;;;;;;;;;;;;1;1;;;;;;;;;;;;;;;;; +gms$s15_alc_scen;0.014;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c15_food_scenario;;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c21_trade_liberalization;;;;;;;;;;;;;;;;;;;;;;;l908080r807070;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s21_trade_bal_damper;0.65;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario;;;;;;;;;;;;;;;;;;;;;;;;;;;;;BH_IFL;;;;;;;;;;;;;;;;;;;;;; +gms$croparea;detail_apr24;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c30_rotation_rules;FSEC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c30_rotation_incentives;default;;;;;;;;;;;;;;;;;;;;;;;;;;;agroecology;;;;;;;;;;;;;;;;;;;;;;; +gms$s30_implementation;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s30_rotation_scenario_target;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;; +gms$c29_marginal_land;q33_marginal;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rainfed;;;;;;;;;;;;;;;;;;;;; +gms$s29_snv_scenario_target;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;; +gms$s29_snv_shr;;;;;;;;;;;;;;;;;;;;;;;;;;;0.2;;;;;;;;;;;;;;;;;;;;;;;; +gms$past;endo_jun13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c32_aff_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c32_aff_mask;;;;;;;;;;;;;;;;;;;;;;;;;onlytropical;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_max_aff_area;;;;;;;;;;;;;;;;;;;;;;;;;500;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c34_urban_scenario;;SSP1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c35_ad_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c35_aolc_policy;ndc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s35_forest_damage_end;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;2050;2050;2050;2050;;;;;;;;;; +gms$s35_secdf_distribution;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s36_minimum_wage;0;;;;;;3;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$factor_costs;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$labor_prod;off;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;exo;exo +gms$c37_labor_rcp;rcp119;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rcp585;rcp119 +gms$c38_fac_req;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s38_target_labor_share;0;;;;;0.8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s42_watdem_nonagr_scenario;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c42_env_flow_policy;off;;;;;;;;;;;;;;;;;;;;;;;;;;;;;on;;;;;;;;;;;;;;;;;;;;; +gms$s42_efp_startyear;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2025;;;;;;;;;;;;;;;;;;;;; +gms$s42_efp_targetyear;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;; +gms$s44_bii_lower_bound;;;;;;;;;;;;;;;;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c44_bii_decrease;;;;;;;;;;;;;;;;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$nitrogen;rescaled_jan21;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff;;;baseeff_add3_add10_add20_max75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c50_scen_neff_noselect;;;baseeff_add3_add10_add20_max75;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c52_land_carbon_sink_rcp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP34;RCP45;RCP60;RCPBU;RCPBU;;; +gms$c55_scen_conf;;;;;;;;;;;;;;;;;GoodPractice;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;none;;;;;;;;;;;;;;;;;;sdp_cropeff;;;;;;sdp_redd;sdp_redd;;;;;sdp_peatland;sdp_soil;;;sdp_redd_soil_peat;sdp_all;;;;;;;;;;;;;;; +gms$c56_pollutant_prices;R21M42-SSP2-PkBudg1300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s56_c_price_induced_aff;0;;;;;;;;;;;;;;;;;;;;;;;;1;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s57_maxmac_n_soil;-1;;;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s57_maxmac_ch4_rice;-1;;;;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s57_maxmac_ch4_entferm;-1;;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s57_maxmac_ch4_awms;-1;;;;;;;;;;;;;;;;201;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s58_rewetting_switch;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Inf;;;;;;;;;;;;;;;;;;;; +gms$som;cellpool_aug16;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_2ndgen_biodem;R21M42-SSP2-NDC;;;R21M42-SSP2-PkBudg900;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;R21M42-SDP-PkBudg900;; +gms$c60_res_2ndgenBE_dem;;;;sdp;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s62_max_dem_bioplastic;0;;;;400;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c70_fac_req_regr;reg;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;;;;;;;;;;;;;;;;;;ssp1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c73_build_demand;;;;;;;;;;;;;;;;;;;;;;;;50pc;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['cellular'];rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_FSEC_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;;rev4.111_FSEC_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_FSEC_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;;; +input['regional'];rev4.111_FSEC_magpie.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['validation'];rev4.111_FSEC_validation.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['additional'];additional_data_rev4.51.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +input['calibration'];calibration_FSEC_26Mar24.tgz;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +magicc_emis_scen;bjoernAR6_C_SSP2-NDC.mif;;;bjoernAR6_C_SSP2-PkBudg900.mif;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;bjoernAR6_C_SSP1-NDC.mif;;;;;;;;;;;;bjoernAR6_C_RemSDP-900-MagSSP1.mif;; diff --git a/config/projects/scenario_config_lama.csv b/config/projects/scenario_config_lama.csv new file mode 100644 index 0000000000..86c8aea9dd --- /dev/null +++ b/config/projects/scenario_config_lama.csv @@ -0,0 +1,39 @@ +;default;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability +gms$c_timesteps;coup2100;5year;5year;5year;5year;5year +gms$c09_pop_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c09_gdp_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c09_pal_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c15_food_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c15_food_scenario_noselect;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$s15_exo_foodscen_start;2025;;2020;;;2020 +gms$s15_exo_foodscen_target;2050;;2050;;;2050 +gms$s15_exo_waste;0;0;1;0;0;1 +gms$s15_waste_scen;1.2;1.2;1.2;1.2;1.2;1.2 +gms$s15_exo_diet;0;0;1;0;0;1 +gms$s15_exo_brans;0;1;1;1;1;1 +gms$c21_trade_liberalization;l909090r808080;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070 +gms$c22_protect_scenario;none;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL +gms$c22_protect_scenario_noselect;none;none;none;BH_IFL;none;BH_IFL +gms$s29_snv_shr;0;0.2;0.2;0.2;0.2;0.2 +gms$s29_snv_shr_noselect;0;0;0;0.2;0;0.2 +gms$s29_snv_scenario_target;2050;2030;2030;2030;2030;2030 +gms$s32_max_aff_area;Inf;Inf;Inf;Inf;500;500 +gms$c34_urban_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c32_aff_policy;npi;ndc;ndc;ndc;ndc;ndc +gms$c35_ad_policy;npi;ndc;ndc;ndc;ndc;ndc +gms$c35_aolc_policy;npi;ndc;ndc;ndc;ndc;ndc +gms$s35_forest_damage_end;2050;2030;2030;2030;2030;2030 +gms$s42_watdem_nonagr_scenario;2;2;1;2;2;1 +gms$s42_irrig_eff_scenario;2;3;3;3;3;3 +gms$c42_env_flow_policy;off;on;on;on;on;on +gms$c50_scen_neff;baseeff_add3_add5_add10_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 +gms$c50_scen_neff_noselect;baseeff_add3_add5_add10_max65;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;ssp2;ssp1;ssp1;ssp1;ssp1;ssp1 +gms$c55_scen_conf_noselect;ssp2;ssp4;ssp4;ssp1;ssp4;ssp1 +gms$c56_pollutant_prices;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_1stgen_biodem;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020 +gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_res_2ndgenBE_dem;ssp2;ssp4;sdp;ssp4;ssp4;sdp +gms$c70_feed_scen;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1 From 1a502a2cfa89c5e7f63d2eb3db8cd86cd5fc9812 Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Mon, 8 Jul 2024 14:21:21 +0200 Subject: [PATCH 058/171] add genie and navigate project configs --- config/projects/scenario_config_geniescp.csv | 16 ++++++++++++++++ config/projects/scenario_config_navigate.csv | 6 ++++++ 2 files changed, 22 insertions(+) create mode 100644 config/projects/scenario_config_geniescp.csv create mode 100644 config/projects/scenario_config_navigate.csv diff --git a/config/projects/scenario_config_geniescp.csv b/config/projects/scenario_config_geniescp.csv new file mode 100644 index 0000000000..5d12d8cb46 --- /dev/null +++ b/config/projects/scenario_config_geniescp.csv @@ -0,0 +1,16 @@ +,"GENIE_SCP" +"gms$c_timesteps","coup2110" +"gms$c13_tccost","high" +"gms$c14_yields_scenario","nocc" +"gms$food","anthropometrics_jan18" +"gms$c20_scp_type","hydrogen" +"gms$s30_annual_max_growth","0.02" +"gms$factor_costs","sticky_feb18" +"gms$s44_cost_bii_missing",10000000 +"gms$c56_pollutant_prices","R32M46-SSP2EU-NPi" +"gms$c56_pollutant_prices_noselect","R32M46-SSP2EU-NPi" +"gms$c56_mute_ghgprices_until","y2020" +"gms$bioenergy","1st2ndgen_priced_feb24" +"gms$c60_1stgen_biodem","phaseout2020" +"gms$c60_2ndgen_biodem","R32M46-SSP2EU-NPi" +"gms$c60_2ndgen_biodem_noselect","R32M46-SSP2EU-NPi" diff --git a/config/projects/scenario_config_navigate.csv b/config/projects/scenario_config_navigate.csv new file mode 100644 index 0000000000..bf5afd55a3 --- /dev/null +++ b/config/projects/scenario_config_navigate.csv @@ -0,0 +1,6 @@ +,"NAVIGATE_AllOff","NAVIGATE_LandSup","NAVIGATE_LandDem","NAVIGATE_AllOn" +"gms$s15_exo_waste",0,0,1,1 +"gms$s15_exo_diet",0,0,1,1 +"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 12a8f9c3160a3d7e6be569d5af183a1f672a7f33 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 8 Jul 2024 15:37:56 +0200 Subject: [PATCH 059/171] include option that makes feasibility easier --- scripts/start/projects/project_EAT2p0.R | 3 +++ scripts/start/projects/project_EAT2p0_DeepDive.R | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 21960617eb..f824c99ad0 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -55,6 +55,9 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # Trade: BAU bau <- function(cfg) { + # for feasibility + cfg$gms$s80_optfile <- 1 + ### General settings ### # For impacts of CC on labor: cfg$gms$factor_costs <- "sticky_labor" diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index ee4984fb07..0feea6e5a6 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -63,6 +63,9 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) # Trade: BAU bau <- function(cfg) { + # for feasibility + cfg$gms$s80_optfile <- 1 + cfg$gms$factor_costs <- "sticky_labor" ### Components for Decomposition ### # Diets: exogenous EATLancet diet From ee4ee6839f115f48df3d50f27ee2387a5a61070c Mon Sep 17 00:00:00 2001 From: David Klein Date: Tue, 9 Jul 2024 14:24:16 +0200 Subject: [PATCH 060/171] Use 'find' instead of 'ls' to create the list of all MAgPIE reportings available in the results archive for shinyresults Explanation https://www.baeldung.com/linux/argument-list-too-long-error --- scripts/output/rds_report.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/rds_report.R b/scripts/output/rds_report.R index 6bec3dbaaf..2b3dea3f0e 100644 --- a/scripts/output/rds_report.R +++ b/scripts/output/rds_report.R @@ -77,6 +77,6 @@ if(file.exists(runstatistics) & dir.exists(resultsarchive)) { saveRDS(q, file = paste0(resultsarchive, "/", stats$id, ".rds"), version = 2) cwd <- getwd() setwd(resultsarchive) - system("ls 1*.rds > files") + system("find -type f -name '1*.rds' -printf '%f\n' | sort > fileListForShinyresults") setwd(cwd) } From 17fcff8797fbd089523b031478e4b5d66f1ed2db Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Tue, 9 Jul 2024 17:28:52 +0200 Subject: [PATCH 061/171] added configs for frst_shock, gcs and ngfs --- .../projects/scenario_config_frst_shock.csv | 4 ++++ config/projects/scenario_config_gcs.csv | 24 +++++++++++++++++++ config/projects/scenario_config_ngfs.csv | 11 +++++++++ 3 files changed, 39 insertions(+) create mode 100755 config/projects/scenario_config_frst_shock.csv create mode 100755 config/projects/scenario_config_gcs.csv create mode 100755 config/projects/scenario_config_ngfs.csv diff --git a/config/projects/scenario_config_frst_shock.csv b/config/projects/scenario_config_frst_shock.csv new file mode 100755 index 0000000000..8640d126b1 --- /dev/null +++ b/config/projects/scenario_config_frst_shock.csv @@ -0,0 +1,4 @@ +;frst_shock_none;frst_shock_002lin2030;frst_shock_004lin2030;frst_shock_008lin2030;frst_shock_016lin2030 +gms$c32_shock_scenario;none;002lin2030;004lin2030;008lin2030;016lin2030 +gms$s35_forest_damage;4;4;4;4;4 +gms$c35_shock_scenario;none;002lin2030;004lin2030;008lin2030;016lin2030 diff --git a/config/projects/scenario_config_gcs.csv b/config/projects/scenario_config_gcs.csv new file mode 100755 index 0000000000..9548161ebf --- /dev/null +++ b/config/projects/scenario_config_gcs.csv @@ -0,0 +1,24 @@ +;Tland +gms$s15_exo_foodscen_start;2020 +gms$s15_exo_foodscen_target;2050 +gms$s15_exo_waste;1 +gms$s15_waste_scen;1.2 +gms$s15_exo_diet;1 +gms$c15_kcal_scen;healthy_BMI +gms$c15_EAT_scen;FLX +gms$s15_exo_brans;1 +gms$c22_protect_scenario;BH +gms$c22_protect_scenario_noselect;none +gms$s32_max_aff_area;500 +gms$c32_aff_mask;onlytropical +gms$s35_forest_damage_end;2030 +gms$s42_irrig_eff_scenario;3 +gms$c42_env_flow_policy;on +gms$s42_efp_targetyear;2040 +gms$c50_scen_neff;baseeff_add3_add15_add25_max75 +gms$c50_scen_neff_noselect;baseeff_add3_add15_add25_max75 +gms$c55_scen_conf;ssp1 +gms$c55_scen_conf_noselect;ssp1 +gms$c60_1stgen_biodem;phaseout2020 +gms$c60_res_2ndgenBE_dem;sdp +gms$c70_feed_scen;ssp1 diff --git a/config/projects/scenario_config_ngfs.csv b/config/projects/scenario_config_ngfs.csv new file mode 100755 index 0000000000..3780bba98f --- /dev/null +++ b/config/projects/scenario_config_ngfs.csv @@ -0,0 +1,11 @@ +;NGFS_o_lowdem +gms$c15_food_scenario;SSP2 +gms$c15_food_scenario_noselect;SSP2 +gms$s15_exo_foodscen_convergence;1 +gms$s15_exo_foodscen_functional_form;1 +gms$s15_exo_foodscen_start;2020 +gms$s15_exo_foodscen_target;2050 +gms$s15_exo_waste;1 +gms$s15_waste_scen;1.2 +gms$s15_exo_diet;1 +gms$c15_kcal_scen;healthy_BMI From a2f554cd0166ecb0bc3500b281b10e942f9f5995 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Tue, 9 Jul 2024 17:29:31 +0200 Subject: [PATCH 062/171] first cleaning of scenario config + added configs for geniescp and navigate --- config/projects/scenario_config_geniescp.csv | 13 +++++++++++++ config/projects/scenario_config_navigate.csv | 9 +++++++++ 2 files changed, 22 insertions(+) create mode 100755 config/projects/scenario_config_geniescp.csv create mode 100755 config/projects/scenario_config_navigate.csv diff --git a/config/projects/scenario_config_geniescp.csv b/config/projects/scenario_config_geniescp.csv new file mode 100755 index 0000000000..4902fb5b9a --- /dev/null +++ b/config/projects/scenario_config_geniescp.csv @@ -0,0 +1,13 @@ +;GENIE_SCP +gms$c_timesteps;coup2110 +gms$c13_tccost;high +gms$c14_yields_scenario;nocc +gms$food;anthropometrics_jan18 +gms$kfo_rd;livst_rum,livst_milk +gms$c20_scp_type;hydrogen +gms$s30_annual_max_growth;0.02 +gms$factor_costs;sticky_feb18 +gms$s44_cost_bii_missing;10000000 +gms$c56_mute_ghgprices_until;y2020 +gms$bioenergy;1st2ndgen_priced_feb24 +gms$c60_1stgen_biodem;phaseout2020 diff --git a/config/projects/scenario_config_navigate.csv b/config/projects/scenario_config_navigate.csv new file mode 100755 index 0000000000..553cddc404 --- /dev/null +++ b/config/projects/scenario_config_navigate.csv @@ -0,0 +1,9 @@ +;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn +gms$s15_exo_waste;0;0;1;1 +gms$s15_waste_scen;1.2;1.2;1.2;1.2 +gms$s15_exo_diet;0;0;1;1 +gms$c15_kcal_scen;healthy_BMI;healthy_BMI;healthy_BMI;healthy_BMI +gms$c15_EAT_scen;FLX;FLX;FLX;FLX +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 2c6cb02dc186a5f7fd91352b482526a71bcec963 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 10 Jul 2024 10:05:44 +0200 Subject: [PATCH 063/171] Revert "first cleaning of scenario config + added configs for geniescp and navigate" This reverts commit a2f554cd0166ecb0bc3500b281b10e942f9f5995. --- config/projects/scenario_config_geniescp.csv | 13 ------------- config/projects/scenario_config_navigate.csv | 9 --------- 2 files changed, 22 deletions(-) delete mode 100755 config/projects/scenario_config_geniescp.csv delete mode 100755 config/projects/scenario_config_navigate.csv diff --git a/config/projects/scenario_config_geniescp.csv b/config/projects/scenario_config_geniescp.csv deleted file mode 100755 index 4902fb5b9a..0000000000 --- a/config/projects/scenario_config_geniescp.csv +++ /dev/null @@ -1,13 +0,0 @@ -;GENIE_SCP -gms$c_timesteps;coup2110 -gms$c13_tccost;high -gms$c14_yields_scenario;nocc -gms$food;anthropometrics_jan18 -gms$kfo_rd;livst_rum,livst_milk -gms$c20_scp_type;hydrogen -gms$s30_annual_max_growth;0.02 -gms$factor_costs;sticky_feb18 -gms$s44_cost_bii_missing;10000000 -gms$c56_mute_ghgprices_until;y2020 -gms$bioenergy;1st2ndgen_priced_feb24 -gms$c60_1stgen_biodem;phaseout2020 diff --git a/config/projects/scenario_config_navigate.csv b/config/projects/scenario_config_navigate.csv deleted file mode 100755 index 553cddc404..0000000000 --- a/config/projects/scenario_config_navigate.csv +++ /dev/null @@ -1,9 +0,0 @@ -;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn -gms$s15_exo_waste;0;0;1;1 -gms$s15_waste_scen;1.2;1.2;1.2;1.2 -gms$s15_exo_diet;0;0;1;1 -gms$c15_kcal_scen;healthy_BMI;healthy_BMI;healthy_BMI;healthy_BMI -gms$c15_EAT_scen;FLX;FLX;FLX;FLX -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 885235444a97cd95ec4f5f9ef8d02884cd08db11 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 10 Jul 2024 10:16:09 +0200 Subject: [PATCH 064/171] removed default columns from project configs --- config/projects/scenario_config_el2.csv | 22 +++---- config/projects/scenario_config_lama.csv | 78 ++++++++++++------------ 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index 7bbc0a9b8f..74556d0e9b 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -1,11 +1,11 @@ -;default;EL2_PHD;EL2_Demand;EL2_default -gms$c09_pal_scenario;SSP2;SDP;SDP;SSP2 -gms$s12_interest_lic;0.1;0.06;0.1;0.1 -gms$s12_interest_hic;0.04;0.04;0.04;0.04 -gms$s15_exo_waste;0;1;1;0 -gms$s15_waste_scen;1.2;1.2;1.2;1.2 -gms$s15_exo_diet;0;3;3;0 -gms$factor_costs;per_ton_fao_may22;sticky_labor;sticky_labor;sticky_labor -gms$c70_feed_scen;ssp2;ssp1;ssp2;ssp2 -input['cellular'];;rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; -magicc_emis_scen;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif +;EL2_PHD;EL2_Demand;EL2_default +gms$c09_pal_scenario;SDP;SDP;SSP2 +gms$s12_interest_lic;0.06;0.1;0.1 +gms$s12_interest_hic;0.04;0.04;0.04 +gms$s15_exo_waste;1;1;0 +gms$s15_waste_scen;1.2;1.2;1.2 +gms$s15_exo_diet;3;3;0 +gms$factor_costs;sticky_labor;sticky_labor;sticky_labor +gms$c70_feed_scen;ssp1;ssp2;ssp2 +input['cellular'];rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; +magicc_emis_scen;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif diff --git a/config/projects/scenario_config_lama.csv b/config/projects/scenario_config_lama.csv index 86c8aea9dd..7cc24c1ba6 100644 --- a/config/projects/scenario_config_lama.csv +++ b/config/projects/scenario_config_lama.csv @@ -1,39 +1,39 @@ -;default;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability -gms$c_timesteps;coup2100;5year;5year;5year;5year;5year -gms$c09_pop_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$c09_gdp_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$c09_pal_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$c15_food_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$c15_food_scenario_noselect;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$s15_exo_foodscen_start;2025;;2020;;;2020 -gms$s15_exo_foodscen_target;2050;;2050;;;2050 -gms$s15_exo_waste;0;0;1;0;0;1 -gms$s15_waste_scen;1.2;1.2;1.2;1.2;1.2;1.2 -gms$s15_exo_diet;0;0;1;0;0;1 -gms$s15_exo_brans;0;1;1;1;1;1 -gms$c21_trade_liberalization;l909090r808080;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070 -gms$c22_protect_scenario;none;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL -gms$c22_protect_scenario_noselect;none;none;none;BH_IFL;none;BH_IFL -gms$s29_snv_shr;0;0.2;0.2;0.2;0.2;0.2 -gms$s29_snv_shr_noselect;0;0;0;0.2;0;0.2 -gms$s29_snv_scenario_target;2050;2030;2030;2030;2030;2030 -gms$s32_max_aff_area;Inf;Inf;Inf;Inf;500;500 -gms$c34_urban_scenario;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1 -gms$c32_aff_policy;npi;ndc;ndc;ndc;ndc;ndc -gms$c35_ad_policy;npi;ndc;ndc;ndc;ndc;ndc -gms$c35_aolc_policy;npi;ndc;ndc;ndc;ndc;ndc -gms$s35_forest_damage_end;2050;2030;2030;2030;2030;2030 -gms$s42_watdem_nonagr_scenario;2;2;1;2;2;1 -gms$s42_irrig_eff_scenario;2;3;3;3;3;3 -gms$c42_env_flow_policy;off;on;on;on;on;on -gms$c50_scen_neff;baseeff_add3_add5_add10_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 -gms$c50_scen_neff_noselect;baseeff_add3_add5_add10_max65;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;ssp2;ssp1;ssp1;ssp1;ssp1;ssp1 -gms$c55_scen_conf_noselect;ssp2;ssp4;ssp4;ssp1;ssp4;ssp1 -gms$c56_pollutant_prices;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 -gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 -gms$c60_1stgen_biodem;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020 -gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 -gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 -gms$c60_res_2ndgenBE_dem;ssp2;ssp4;sdp;ssp4;ssp4;sdp -gms$c70_feed_scen;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1 +;LAMA_Inequal;LAMA_Inequal-SustDemand;LAMA_Inequal-EnvirProt;LAMA_Inequal-GHGPrice;LAMA_Sustainability +gms$c_timesteps;5year;5year;5year;5year;5year +gms$c09_pop_scenario;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c09_gdp_scenario;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c09_pal_scenario;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c15_food_scenario;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c15_food_scenario_noselect;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$s15_exo_foodscen_start;;2020;;;2020 +gms$s15_exo_foodscen_target;;2050;;;2050 +gms$s15_exo_waste;0;1;0;0;1 +gms$s15_waste_scen;1.2;1.2;1.2;1.2;1.2 +gms$s15_exo_diet;0;1;0;0;1 +gms$s15_exo_brans;1;1;1;1;1 +gms$c21_trade_liberalization;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l908080r807070 +gms$c22_protect_scenario;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL +gms$c22_protect_scenario_noselect;none;none;BH_IFL;none;BH_IFL +gms$s29_snv_shr;0.2;0.2;0.2;0.2;0.2 +gms$s29_snv_shr_noselect;0;0;0.2;0;0.2 +gms$s29_snv_scenario_target;2030;2030;2030;2030;2030 +gms$s32_max_aff_area;Inf;Inf;Inf;500;500 +gms$c34_urban_scenario;SSP4;SSP1;SSP4;SSP4;SSP1 +gms$c32_aff_policy;ndc;ndc;ndc;ndc;ndc +gms$c35_ad_policy;ndc;ndc;ndc;ndc;ndc +gms$c35_aolc_policy;ndc;ndc;ndc;ndc;ndc +gms$s35_forest_damage_end;2030;2030;2030;2030;2030 +gms$s42_watdem_nonagr_scenario;2;1;2;2;1 +gms$s42_irrig_eff_scenario;3;3;3;3;3 +gms$c42_env_flow_policy;on;on;on;on;on +gms$c50_scen_neff;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_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;ssp1;ssp1;ssp1;ssp1 +gms$c55_scen_conf_noselect;ssp4;ssp4;ssp1;ssp4;ssp1 +gms$c56_pollutant_prices;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c56_pollutant_prices_noselect;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_1stgen_biodem;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020 +gms$c60_2ndgen_biodem;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_2ndgen_biodem_noselect;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000 +gms$c60_res_2ndgenBE_dem;ssp4;sdp;ssp4;ssp4;sdp +gms$c70_feed_scen;ssp4;ssp1;ssp4;ssp4;ssp1 From 1460d2aa7fb0bc3877a4e449c077369a1b87e2e3 Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 10 Jul 2024 15:27:51 +0200 Subject: [PATCH 065/171] Add oil and sugar needed as ingredient for MP/scp production as additional demand. --- modules/15_food/anthropometrics_jan18/presolve.gms | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 9e2c7bab32..b23b4e698f 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -439,6 +439,10 @@ p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + i15_protein_to_kcal_ratio(t,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); +* Add oil and sugar needed as ingredient for MP/scp production as additional demand. +* Based on the assumption of globally homogenous products. +p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + p15_kcal_pc_calibrated(t,i,"scp") * s15_unit_of_oil_per_unit_of_scp_in_kcal +p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + p15_kcal_pc_calibrated(t,i,"scp") * s15_unit_of_sugar_per_unit_of_scp_in_kcal * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. * Optional substitution with plant-based products depending on s15_livescen_target_subst. From d58e86db228bff9d638207ae810a77d4bc2fc109 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 11 Jul 2024 09:43:22 +0200 Subject: [PATCH 066/171] Fader GHG policy country --- .../price_aug22/declarations.gms | 4 +++ modules/56_ghg_policy/price_aug22/input.gms | 35 ++++++++++++++++++- modules/56_ghg_policy/price_aug22/preloop.gms | 20 +++++++++++ 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/modules/56_ghg_policy/price_aug22/declarations.gms b/modules/56_ghg_policy/price_aug22/declarations.gms index 346ff1afb8..5ea44733bc 100644 --- a/modules/56_ghg_policy/price_aug22/declarations.gms +++ b/modules/56_ghg_policy/price_aug22/declarations.gms @@ -12,6 +12,10 @@ parameters pc56_c_price_induced_aff Helper for fixing C price driven afforestation to zero for historic time steps (binary) p56_region_price_shr(t_all,i) GHG price share of the region (1) p56_country_dummy(iso) Dummy parameter indicating whether country is affected by selected GHG policy (1) + p56_region_fader_shr(t_all,i) GHG policy fader share of the region (1) + p56_country_dummy2(iso) Dummy parameter indicating whether country is affected by selected GHG policy fader (1) + p56_fader(t_all) GHG policy fader (1) + p56_fader_reg(t_all,i) GHG policy fader (1) ; equations diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index 2b1d1f6c82..75127ec261 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -8,7 +8,8 @@ * Set-switch for countries affected by regional ghg policy * Default: all iso countries selected sets - policy_countries56(iso) countries to be affected by ghg policy / ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, + policy_countries56(iso) countries to be affected by ghg policy / + ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, @@ -33,6 +34,34 @@ sets TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / + + fader_countries56(iso) countries to be affected by ghg policy fader / + ABW,AFG,AGO,AIA,ALA,ALB,AND,ARE,ARG,ARM, + ASM,ATA,ATF,ATG,AUS,AUT,AZE,BDI,BEL,BEN, + BES,BFA,BGD,BGR,BHR,BHS,BIH,BLM,BLR,BLZ, + BMU,BOL,BRA,BRB,BRN,BTN,BVT,BWA,CAF,CAN, + CCK,CHN,CHE,CHL,CIV,CMR,COD,COG,COK,COL, + COM,CPV,CRI,CUB,CUW,CXR,CYM,CYP,CZE,DEU, + DJI,DMA,DNK,DOM,DZA,ECU,EGY,ERI,ESH,ESP, + EST,ETH,FIN,FJI,FLK,FRA,FRO,FSM,GAB,GBR, + GEO,GGY,GHA,GIB,GIN,GLP,GMB,GNB,GNQ,GRC, + GRD,GRL,GTM,GUF,GUM,GUY,HKG,HMD,HND,HRV, + HTI,HUN,IDN,IMN,IND,IOT,IRL,IRN,IRQ,ISL, + ISR,ITA,JAM,JEY,JOR,JPN,KAZ,KEN,KGZ,KHM, + KIR,KNA,KOR,KWT,LAO,LBN,LBR,LBY,LCA,LIE, + LKA,LSO,LTU,LUX,LVA,MAC,MAF,MAR,MCO,MDA, + MDG,MDV,MEX,MHL,MKD,MLI,MLT,MMR,MNE,MNG, + MNP,MOZ,MRT,MSR,MTQ,MUS,MWI,MYS,MYT,NAM, + NCL,NER,NFK,NGA,NIC,NIU,NLD,NOR,NPL,NRU, + NZL,OMN,PAK,PAN,PCN,PER,PHL,PLW,PNG,POL, + PRI,PRK,PRT,PRY,PSE,PYF,QAT,REU,ROU,RUS, + RWA,SAU,SDN,SEN,SGP,SGS,SHN,SJM,SLB,SLE, + SLV,SMR,SOM,SPM,SRB,SSD,STP,SUR,SVK,SVN, + SWE,SWZ,SXM,SYC,SYR,TCA,TCD,TGO,THA,TJK, + TKL,TKM,TLS,TON,TTO,TUN,TUR,TUV,TWN,TZA, + UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, + VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / + ; scalars @@ -46,6 +75,10 @@ scalars s56_counter counter for C price interpolation (1) / 0 / s56_timesteps number of time steps for C price interpolation (1) / 0 / s56_offset helper for C price interpolation (1) / 0 / + s56_ghgprice_fader Switch for GHG policy fader (1=on 0=off) / 1 / + s56_fader_start start year of GHG policy fade-in (1) / 2025 / + s56_fader_target target year of GHG policy fade-in (1) / 2050 / + s56_fader_functional_form blub / 1 / ; $setglobal c56_pollutant_prices R32M46-SSP2EU-NPi diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index 89c67e6844..43b19677a2 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -21,6 +21,16 @@ p56_country_dummy(policy_countries56) = 1; * Countries are weighted by their population size. p56_region_price_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_dummy(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); +****** Regional fader share for ghg policy fader of selective countries: +* Country switch to determine countries for which ghg policy fader shall be applied. +* In the default case, the ghg policy fader affects all countries when activated. +p56_country_dummy2(iso) = 0; +p56_country_dummy2(fader_countries56) = 1; +* Because MAgPIE is not run at country-level, but at region level, a region +* share is calculated that translates the countries' influence to regional level. +* Countries are weighted by their population size. +p56_region_fader_shr(t_all,i) = sum(i_to_iso(i,iso), p56_country_dummy2(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); + ****select ghg prices $ifthen "%c56_pollutant_prices%" == "coupling" im_pollutant_prices(t_all,i,pollutants,emis_source) = f56_pollutant_prices_coupling(t_all,i,pollutants); @@ -58,6 +68,16 @@ im_pollutant_prices(t_all,i,"co2_c",emis_source) = im_pollutant_prices(t_all,i," ***multiply GHG prices with development state to account for institutional requirements needed for implementing a GHG pricing scheme im_pollutant_prices(t_all,i,pollutants,emis_source)$(s56_ghgprice_devstate_scaling = 1) = im_pollutant_prices(t_all,i,pollutants,emis_source)*im_development_state(t_all,i); +if (s56_fader_functional_form = 1, + m_linear_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,1); +elseif s56_fader_functional_form = 2, + m_sigmoid_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,1); +); + +***build and apply temporal fader for GHG policy +p56_fader_reg(t_all,i) = p56_fader(t_all) * p56_region_fader_shr(t_all,i) + p56_fader(t_all) * (1-p56_region_fader_shr(t_all,i)); +im_pollutant_prices(t_all,i,pollutants,emis_source)$(s56_ghgprice_fader = 1) = im_pollutant_prices(t_all,i,pollutants,emis_source) * p56_fader_reg(t_all,i); + ***GHG emission policy im_pollutant_prices(t_all,i,pollutants,emis_source) = im_pollutant_prices(t_all,i,pollutants,emis_source) * f56_emis_policy("%c56_emis_policy%",pollutants,emis_source); From 7fb19d7f5ff6a9734e749a7473b39490395240d6 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 11 Jul 2024 12:36:24 +0200 Subject: [PATCH 067/171] partial commit to save work --- .../anthropometrics_jan18/declarations.gms | 8 +++++- .../anthropometrics_jan18/presolve.gms | 26 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 9e9b66bacf..5989a5949e 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -141,6 +141,7 @@ parameters p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) + p15_kcal_pc_calibrated_scp(t,i,kfo_rd) p15_kcal_pc_calibrated_orig(t,i,kfo) Auxiliary parameter for per capita food consumption - basis for convergence into waste and diet scenarios (kcal per capita per day) p15_kcal_pc_calibrated_livestock_orig(t,i) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_calibrated_rumdairy_orig(t,i) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) @@ -180,7 +181,12 @@ parameters ; scalars - s15_year Current year as integer value (yr) /2000/ + s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.5 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 5 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.5 / + s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 9 / + s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 4 / + s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4 / ; *' @code diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index b23b4e698f..3bda4daef6 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -434,15 +434,31 @@ i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein")/fm_ * 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 * back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). + +p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = +p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * + i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + - sum(kfo_rd, p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * - i15_protein_to_kcal_ratio(t,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); + sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); + p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); -* Add oil and sugar needed as ingredient for MP/scp production as additional demand. +* Add oil and sugar needed as ingredient for scp-based production of milk as additional demand. * Based on the assumption of globally homogenous products. -p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + p15_kcal_pc_calibrated(t,i,"scp") * s15_unit_of_oil_per_unit_of_scp_in_kcal -p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + p15_kcal_pc_calibrated(t,i,"scp") * s15_unit_of_sugar_per_unit_of_scp_in_kcal +* Plant oil and sugar demands as ingredients for milk production using single cell protein +* are calculated based on the ratio of fat or sugar to protein in cow milk. +* This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. +* Cow milk content is chosen as the dominant source of milk produced globally. +p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + +*sugar +*p15_unit_of_sugar_per_unit_of_scp_in_kcal("livst_milk") = (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*p15_unit_of_sugar_per_unit_of_scp_in_kcal("livst_rum") = 0; +p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. * Optional substitution with plant-based products depending on s15_livescen_target_subst. From 3679f7dae6aded7d10d3148edcdd5b69ac18fd5e Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 12 Jul 2024 10:00:41 +0200 Subject: [PATCH 068/171] Add oil and sugar needed as ingredient for MP/scp production as additional demand. --- CHANGELOG.md | 1 + literature.bib | 27 ++++++++++ .../15_food/anthro_iso_jun22/declarations.gms | 8 ++- .../15_food/anthro_iso_jun22/exodietmacro.gms | 44 ++++++++++++---- .../anthropometrics_jan18/declarations.gms | 14 +++--- .../anthropometrics_jan18/intersolve.gms | 42 ++++++++++++---- .../anthropometrics_jan18/presolve.gms | 50 ++++++++++--------- 7 files changed, 133 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a1be749a..7bd1007149 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 - **21_trade** refactor equations for enhanced readablility and improve documentation - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. +- **15_food** revision of SCP implementation for milk. Added demand for plant oil and sugar as ingredients for milk production using single cell protein. ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/literature.bib b/literature.bib index 7f64577c5a..9a2cf51ab1 100644 --- a/literature.bib +++ b/literature.bib @@ -1639,3 +1639,30 @@ @dataset{buchhorn_copernicus_2020 url = {https://doi.org/10.5281/zenodo.3939050}, version = {V3.0.1} } + +@book{muehlhoff_milk_2013, + address = {Rome}, + title = {Milk and dairy products in human nutrition}, + isbn = {978-92-5-107863-1}, + language = {en}, + publisher = {Food and Agriculture Organization of the United Nations}, + editor = {Muehlhoff, Ellen and Bennett, Anthony and MacMahon, Deirdre and {Food and Agriculture Organization of the United Nations}}, + year = {2013}, + note = {OCLC: ocn865477080}, + keywords = {Analysis, Dairy products in human nutrition, Milk, Milk in human nutrition}, + file = {Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:/Users/flo/Zotero/storage/CLD8RP2I/Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:application/pdf}, +} + +@book{fao_food_2004, + address = {Rome}, + series = {{FAO} food and nutrition paper}, + title = {Food energy: methods of analysis and conversion factors ; report of a technical workshop, {Rome}, 3 - 6 {December} 2002}, + isbn = {978-92-5-105014-9}, + shorttitle = {Food energy}, + language = {en}, + number = {77}, + publisher = {Food and Agriculture Organization of the United Nations}, + editor = {{FAO}}, + year = {2004}, + file = {FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:/Users/flo/Zotero/storage/ZSY5VYYI/FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:application/pdf}, +} diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index b5ced7926f..eb676ff09c 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -140,6 +140,7 @@ parameters p15_kcal_pc_iso_livestock_orig(t,iso) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_iso_rumdairy_orig(t,iso) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) p15_kcal_pc_iso_plant_orig(t,iso) Auxiliary parameter for per capita plant-based food consumption - basis for scenarios of livestock food substitution (kcal per capita per day) + p15_kcal_pc_iso_scp(t,iso,kfo_rd) Per capita consumption of SCP in food demand model after price shock on country level (kcal per capita per day) p15_livestock_kcal_structure_orig(t,iso,kfo_lp) Auxiliary parameter for livestock kcal structure - basis for scenarios of livestock food substitution (1) p15_rumdairy_kcal_structure_orig(t,iso,kfo_rd) Auxiliary parameter for ruminant and dairy kcal structure - basis for scenarios of ruminant-based food substitution (1) p15_plant_kcal_structure_orig(t,iso,kfo_pp) Auxiliary parameter for plant-based food kcal structure - basis for scenarios of livestock food substitution (1) @@ -183,7 +184,12 @@ parameters ; scalars - s15_year Current year as integer value (yr) / 2000 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.3 / + s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 8.79 / + s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 3.87 / + s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4.27 / ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index afe911c6ef..ee2916f6fe 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -105,17 +105,39 @@ if (s15_run_diet_postprocessing = 1, *(p15_kcal_pc_iso_plant_orig(t,iso) + 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) = 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 -* back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). - p15_kcal_pc_iso(t,iso,"scp") = p15_kcal_pc_iso(t,iso,"scp") + - sum(kfo_rd, p15_kcal_pc_iso(t,iso,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,iso)) * - i15_protein_to_kcal_ratio(t,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); - p15_kcal_pc_iso(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * i15_rumdairy_scp_fadeout(t,iso); - +*' @code +*' Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day: +*' +*' 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 +*' back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). +*' +*' Protein to kcal ratio: +i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); +*' +*' Increase of single-cell protein (SCP): +p15_kcal_pc_iso_scp(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,iso)) * + i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); +p15_kcal_pc_iso(t,iso,"scp") = p15_kcal_pc_iso(t,iso,"scp") + sum(kfo_rd, p15_kcal_pc_iso_scp(t,iso,kfo_rd)); +*' +*' Reduction of ruminant meat and dairy products (kfo_rd): +p15_kcal_pc_iso(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * i15_rumdairy_scp_fadeout(t,iso); +*' +*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' are calculated based on the ratio of fat or sugar to protein in cow milk. +*' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. +*' Cow milk content is chosen as the dominant source of milk produced globally. +*' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 +*' +p15_kcal_pc_iso(t,iso,"oils") = p15_kcal_pc_iso(t,iso,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*' +p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*' +*' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. * Optional substitution with plant-based products depending on s15_livescen_target_subst. diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 5989a5949e..b3a0b8e2fe 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -141,7 +141,7 @@ parameters p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) - p15_kcal_pc_calibrated_scp(t,i,kfo_rd) + p15_kcal_pc_calibrated_scp(t,i,kfo_rd) Calibrated per capita consumption of SCP in food demand model after price shock (kcal per capita per day) p15_kcal_pc_calibrated_orig(t,i,kfo) Auxiliary parameter for per capita food consumption - basis for convergence into waste and diet scenarios (kcal per capita per day) p15_kcal_pc_calibrated_livestock_orig(t,i) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_calibrated_rumdairy_orig(t,i) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) @@ -181,12 +181,12 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.5 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 5 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.5 / - s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 9 / - s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 4 / - s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.3 / + s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 8.79 / + s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 3.87 / + s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4.27 / ; *' @code diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 7f4376c9f5..6d975d1627 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -221,17 +221,39 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) *(p15_kcal_pc_calibrated_plant_orig(t,i) + 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) = 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 -* back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). -p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + - sum(kfo_rd, p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * - i15_protein_to_kcal_ratio(t,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); +*' @code +*' Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day: +*' +*' 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 +*' back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). +*' +*' Protein to kcal ratio: +i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); +*' +*' Increase of single-cell protein (SCP): +p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * + i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); +p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); +*' +*' Reduction of ruminant meat and dairy products (kfo_rd): p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); - +*' +*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' are calculated based on the ratio of fat or sugar to protein in cow milk. +*' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. +*' Cow milk content is chosen as the dominant source of milk produced globally. +*' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 +*' +p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*' +p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*' +*' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. * Optional substitution with plant-based products depending on s15_livescen_target_subst. diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 3bda4daef6..e8fef478e6 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -428,37 +428,39 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) *(p15_kcal_pc_calibrated_plant_orig(t,i) + 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) = 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 -* back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). - -p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = -p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * - i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); -p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + - sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); - +*' @code +*' Substitution of ruminant meat and dairy products (kfo_rd) with single-cell protein (SCP) based on protein/cap/day: +*' +*' 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 +*' back to kcal/cap/day using i15_protein_to_kcal_ratio(t,"scp"). +*' +*' Protein to kcal ratio: +i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); +*' +*' Increase of single-cell protein (SCP): +p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * + i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); +p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); +*' +*' Reduction of ruminant meat and dairy products (kfo_rd): p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); - -* Add oil and sugar needed as ingredient for scp-based production of milk as additional demand. -* Based on the assumption of globally homogenous products. -* Plant oil and sugar demands as ingredients for milk production using single cell protein -* are calculated based on the ratio of fat or sugar to protein in cow milk. -* This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. -* Cow milk content is chosen as the dominant source of milk produced globally. +*' +*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' are calculated based on the ratio of fat or sugar to protein in cow milk. +*' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. +*' Cow milk content is chosen as the dominant source of milk produced globally. +*' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 +*' p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); - -*sugar -*p15_unit_of_sugar_per_unit_of_scp_in_kcal("livst_milk") = (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); -*p15_unit_of_sugar_per_unit_of_scp_in_kcal("livst_rum") = 0; +*' p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); +*' +*' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. * Optional substitution with plant-based products depending on s15_livescen_target_subst. From 94d3965dc5f9d53f19f4d8b2d39658a7ab639849 Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Fri, 12 Jul 2024 12:26:40 +0200 Subject: [PATCH 069/171] add mail-type FAIL --- scripts/run_submit/submit_medium.sh | 2 +- scripts/run_submit/submit_priority.sh | 2 +- scripts/run_submit/submit_priority_maxMem.sh | 2 +- scripts/run_submit/submit_short.sh | 2 +- scripts/run_submit/submit_short_maxMem.sh | 2 +- scripts/run_submit/submit_standby.sh | 2 +- scripts/run_submit/submit_standby_dayMax.sh | 2 +- scripts/run_submit/submit_standby_maxMem.sh | 2 +- scripts/run_submit/submit_standby_maxMem_dayMax.sh | 2 +- scripts/slurmOutput.yml | 8 ++++---- scripts/slurmStart.yml | 6 +++--- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/run_submit/submit_medium.sh b/scripts/run_submit/submit_medium.sh index a8d81b7deb..bedbe5db04 100644 --- a/scripts/run_submit/submit_medium.sh +++ b/scripts/run_submit/submit_medium.sh @@ -3,7 +3,7 @@ #SBATCH --qos=medium #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 Rscript submit.R diff --git a/scripts/run_submit/submit_priority.sh b/scripts/run_submit/submit_priority.sh index 052080501f..33c8496d5e 100644 --- a/scripts/run_submit/submit_priority.sh +++ b/scripts/run_submit/submit_priority.sh @@ -3,7 +3,7 @@ #SBATCH --qos=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 Rscript submit.R diff --git a/scripts/run_submit/submit_priority_maxMem.sh b/scripts/run_submit/submit_priority_maxMem.sh index 286be68440..ae58b9695f 100644 --- a/scripts/run_submit/submit_priority_maxMem.sh +++ b/scripts/run_submit/submit_priority_maxMem.sh @@ -3,7 +3,7 @@ #SBATCH --qos=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 #SBATCH --mem-per-cpu=0 diff --git a/scripts/run_submit/submit_short.sh b/scripts/run_submit/submit_short.sh index fb89bdaf15..4e7b6edfc1 100644 --- a/scripts/run_submit/submit_short.sh +++ b/scripts/run_submit/submit_short.sh @@ -3,7 +3,7 @@ #SBATCH --qos=short #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 Rscript submit.R diff --git a/scripts/run_submit/submit_short_maxMem.sh b/scripts/run_submit/submit_short_maxMem.sh index b11c9e62a0..2016794e79 100644 --- a/scripts/run_submit/submit_short_maxMem.sh +++ b/scripts/run_submit/submit_short_maxMem.sh @@ -3,7 +3,7 @@ #SBATCH --qos=short #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 #SBATCH --mem-per-cpu=0 diff --git a/scripts/run_submit/submit_standby.sh b/scripts/run_submit/submit_standby.sh index c508d0bdec..f0bff32339 100644 --- a/scripts/run_submit/submit_standby.sh +++ b/scripts/run_submit/submit_standby.sh @@ -3,7 +3,7 @@ #SBATCH --qos=standby #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 Rscript submit.R diff --git a/scripts/run_submit/submit_standby_dayMax.sh b/scripts/run_submit/submit_standby_dayMax.sh index 80a981279a..d7836390d1 100644 --- a/scripts/run_submit/submit_standby_dayMax.sh +++ b/scripts/run_submit/submit_standby_dayMax.sh @@ -3,7 +3,7 @@ #SBATCH --qos=standby #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 #SBATCH --time=24:00:00 diff --git a/scripts/run_submit/submit_standby_maxMem.sh b/scripts/run_submit/submit_standby_maxMem.sh index dcfcd12169..23b0999431 100644 --- a/scripts/run_submit/submit_standby_maxMem.sh +++ b/scripts/run_submit/submit_standby_maxMem.sh @@ -3,7 +3,7 @@ #SBATCH --qos=standby #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 #SBATCH --mem-per-cpu=0 diff --git a/scripts/run_submit/submit_standby_maxMem_dayMax.sh b/scripts/run_submit/submit_standby_maxMem_dayMax.sh index 0af5490672..ac3ba4d307 100644 --- a/scripts/run_submit/submit_standby_maxMem_dayMax.sh +++ b/scripts/run_submit/submit_standby_maxMem_dayMax.sh @@ -3,7 +3,7 @@ #SBATCH --qos=standby #SBATCH --job-name=mag-run #SBATCH --output=slurm.log -#SBATCH --mail-type=END +#SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 #SBATCH --mem-per-cpu=0 #SBATCH --time=24:00:00 diff --git a/scripts/slurmOutput.yml b/scripts/slurmOutput.yml index 950328816e..f493010be1 100644 --- a/scripts/slurmOutput.yml +++ b/scripts/slurmOutput.yml @@ -1,5 +1,5 @@ slurmjobs: - SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" - SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" - SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority" - SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=0 --cpus-per-task=16" + SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" + SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" + SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority" + SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=0 --cpus-per-task=16" diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index 513adadf2e..8040e4a28c 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: - SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" - SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" - SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" + SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" + SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" + SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From 691ec016397a082c6bf496736e40e58c88aa496e Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 15 Jul 2024 09:44:32 +0200 Subject: [PATCH 070/171] revision of units and scalar names --- modules/15_food/anthro_iso_jun22/declarations.gms | 12 ++++++------ modules/15_food/anthro_iso_jun22/exodietmacro.gms | 4 ++-- .../15_food/anthropometrics_jan18/declarations.gms | 12 ++++++------ modules/15_food/anthropometrics_jan18/intersolve.gms | 4 ++-- modules/15_food/anthropometrics_jan18/presolve.gms | 4 ++-- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index eb676ff09c..19771c0301 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -184,12 +184,12 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.3 / - s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 8.79 / - s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 3.87 / - s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4.27 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g) / 3.3 / + s15_scp_fat_to_kcal_milk conversion factor (kcal per gram of fat) / 8.79 / + s15_scp_sugar_to_kcal_milk conversion factor (kcal per gram of sugar) / 3.87 / + s15_scp_protein_to_kcal_milk conversion factor (kcal per gram of protein) / 4.27 / ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index ee2916f6fe..53ee660413 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -131,11 +131,11 @@ p15_kcal_pc_iso(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * i15_rumdairy_scp *' p15_kcal_pc_iso(t,iso,"oils") = p15_kcal_pc_iso(t,iso,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index b3a0b8e2fe..6c9b96f2a2 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -181,12 +181,12 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (mass per 100g milk) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (mass per 100g milk) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (mass per 100g milk) / 3.3 / - s15_scp_fat_to_kcal conversion factor (kcal per gram of fat) / 8.79 / - s15_scp_sugar_to_kcal conversion factor (kcal per gram of sugar) / 3.87 / - s15_scp_protein_to_kcal conversion factor (kcal per gram of protein) / 4.27 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g) / 3.3 / + s15_scp_fat_to_kcal_milk conversion factor (kcal per gram of fat) / 8.79 / + s15_scp_sugar_to_kcal_milk conversion factor (kcal per gram of sugar) / 3.87 / + s15_scp_protein_to_kcal_milk conversion factor (kcal per gram of protein) / 4.27 / ; *' @code diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 6d975d1627..6ed845bf20 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -247,11 +247,11 @@ p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_ru *' p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index e8fef478e6..15d0b6b2ab 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -454,11 +454,11 @@ p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_ru *' p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal); + * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); *' *' @stop From ace41f68dd1e6cc0e992da66062b283c1f4a5496 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Mon, 15 Jul 2024 09:46:39 +0200 Subject: [PATCH 071/171] updated to iteration 12 --- scripts/start/projects/project_EAT2p0.R | 4 ++-- scripts/start/projects/project_EAT2p0_DeepDive.R | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index f824c99ad0..7408842a52 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -136,9 +136,9 @@ waste <- function(cfg) { miti <- function(cfg) { # Mitigation: consistent with 1.5C considering diet change # To Do: update to iteration 5! - cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8.mif" + cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif" cfg$gms$c56_pollutant_prices <- "coupling" - cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-8.mif" + cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif" cfg$gms$c60_2ndgen_biodem <- "coupling" return(cfg) diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 0feea6e5a6..41df408aee 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -41,7 +41,7 @@ cfg$output <- c( ) # Set path to own coupled runs: -path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-8/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-8.mif" +path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif" ####################### From 6907c6160e4b0bd9c7e3b6339c0d1c635dd2a5ae Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 15 Jul 2024 09:55:06 +0200 Subject: [PATCH 072/171] replace tabs with spaces --- literature.bib | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/literature.bib b/literature.bib index 9a2cf51ab1..0dc54e8265 100644 --- a/literature.bib +++ b/literature.bib @@ -1641,28 +1641,28 @@ @dataset{buchhorn_copernicus_2020 } @book{muehlhoff_milk_2013, - address = {Rome}, - title = {Milk and dairy products in human nutrition}, - isbn = {978-92-5-107863-1}, - language = {en}, - publisher = {Food and Agriculture Organization of the United Nations}, - editor = {Muehlhoff, Ellen and Bennett, Anthony and MacMahon, Deirdre and {Food and Agriculture Organization of the United Nations}}, - year = {2013}, - note = {OCLC: ocn865477080}, - keywords = {Analysis, Dairy products in human nutrition, Milk, Milk in human nutrition}, - file = {Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:/Users/flo/Zotero/storage/CLD8RP2I/Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:application/pdf}, + address = {Rome}, + title = {Milk and dairy products in human nutrition}, + isbn = {978-92-5-107863-1}, + language = {en}, + publisher = {Food and Agriculture Organization of the United Nations}, + editor = {Muehlhoff, Ellen and Bennett, Anthony and MacMahon, Deirdre and {Food and Agriculture Organization of the United Nations}}, + year = {2013}, + note = {OCLC: ocn865477080}, + keywords = {Analysis, Dairy products in human nutrition, Milk, Milk in human nutrition}, + file = {Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:/Users/flo/Zotero/storage/CLD8RP2I/Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:application/pdf}, } @book{fao_food_2004, - address = {Rome}, - series = {{FAO} food and nutrition paper}, - title = {Food energy: methods of analysis and conversion factors ; report of a technical workshop, {Rome}, 3 - 6 {December} 2002}, - isbn = {978-92-5-105014-9}, - shorttitle = {Food energy}, - language = {en}, - number = {77}, - publisher = {Food and Agriculture Organization of the United Nations}, - editor = {{FAO}}, - year = {2004}, - file = {FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:/Users/flo/Zotero/storage/ZSY5VYYI/FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:application/pdf}, + address = {Rome}, + series = {{FAO} food and nutrition paper}, + title = {Food energy: methods of analysis and conversion factors ; report of a technical workshop, {Rome}, 3 - 6 {December} 2002}, + isbn = {978-92-5-105014-9}, + shorttitle = {Food energy}, + language = {en}, + number = {77}, + publisher = {Food and Agriculture Organization of the United Nations}, + editor = {{FAO}}, + year = {2004}, + file = {FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:/Users/flo/Zotero/storage/ZSY5VYYI/FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:application/pdf}, } From f7ea2a9dfded2d476953bbabdabb29853a132c81 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 16 Jul 2024 15:00:01 +0200 Subject: [PATCH 073/171] revision scp-based milk --- modules/15_food/anthro_iso_jun22/declarations.gms | 11 ++++------- modules/15_food/anthro_iso_jun22/exodietmacro.gms | 15 +++++++-------- .../anthropometrics_jan18/declarations.gms | 11 ++++------- .../15_food/anthropometrics_jan18/intersolve.gms | 15 +++++++-------- .../15_food/anthropometrics_jan18/presolve.gms | 15 +++++++-------- 5 files changed, 29 insertions(+), 38 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 19771c0301..61bea53043 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -140,7 +140,7 @@ parameters p15_kcal_pc_iso_livestock_orig(t,iso) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_iso_rumdairy_orig(t,iso) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) p15_kcal_pc_iso_plant_orig(t,iso) Auxiliary parameter for per capita plant-based food consumption - basis for scenarios of livestock food substitution (kcal per capita per day) - p15_kcal_pc_iso_scp(t,iso,kfo_rd) Per capita consumption of SCP in food demand model after price shock on country level (kcal per capita per day) + p15_protein_pc_iso_scp(t,iso,kfo_rd) Per capita consumption of SCP in food demand model after price shock on country level (protein per capita per day) p15_livestock_kcal_structure_orig(t,iso,kfo_lp) Auxiliary parameter for livestock kcal structure - basis for scenarios of livestock food substitution (1) p15_rumdairy_kcal_structure_orig(t,iso,kfo_rd) Auxiliary parameter for ruminant and dairy kcal structure - basis for scenarios of ruminant-based food substitution (1) p15_plant_kcal_structure_orig(t,iso,kfo_pp) Auxiliary parameter for plant-based food kcal structure - basis for scenarios of livestock food substitution (1) @@ -184,12 +184,9 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g) / 3.3 / - s15_scp_fat_to_kcal_milk conversion factor (kcal per gram of fat) / 8.79 / - s15_scp_sugar_to_kcal_milk conversion factor (kcal per gram of sugar) / 3.87 / - s15_scp_protein_to_kcal_milk conversion factor (kcal per gram of protein) / 4.27 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g wet matter) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index 53ee660413..d87504492d 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -116,26 +116,25 @@ if (s15_run_diet_postprocessing = 1, i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); *' *' Increase of single-cell protein (SCP): -p15_kcal_pc_iso_scp(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,iso)) * - i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); -p15_kcal_pc_iso(t,iso,"scp") = p15_kcal_pc_iso(t,iso,"scp") + sum(kfo_rd, p15_kcal_pc_iso_scp(t,iso,kfo_rd)); +p15_protein_pc_iso_scp(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,iso)) * i15_protein_to_kcal_ratio(t,kfo_rd); +p15_kcal_pc_iso(t,iso,"scp") = p15_kcal_pc_iso(t,iso,"scp") + sum(kfo_rd, p15_protein_pc_iso_scp(t,iso,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); *' *' Reduction of ruminant meat and dairy products (kfo_rd): p15_kcal_pc_iso(t,iso,kfo_rd) = p15_kcal_pc_iso(t,iso,kfo_rd) * i15_rumdairy_scp_fadeout(t,iso); *' -*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' Plant oil and sugar demands as ingredients for animal-free milk alternative production using single cell protein *' are calculated based on the ratio of fat or sugar to protein in cow milk. *' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. *' Cow milk content is chosen as the dominant source of milk produced globally. *' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 *' p15_kcal_pc_iso(t,iso,"oils") = p15_kcal_pc_iso(t,iso,"oils") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_fat_per_milk * fm_nutrition_attributes(t,"oils", "kcal"); *' p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_iso_scp(t,iso,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 6c9b96f2a2..e68c8c1492 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -141,7 +141,7 @@ parameters p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) - p15_kcal_pc_calibrated_scp(t,i,kfo_rd) Calibrated per capita consumption of SCP in food demand model after price shock (kcal per capita per day) + p15_protein_pc_scp(t,i,kfo_rd) Calibrated per capita consumption of SCP in food demand model after price shock (protein per capita per day) p15_kcal_pc_calibrated_orig(t,i,kfo) Auxiliary parameter for per capita food consumption - basis for convergence into waste and diet scenarios (kcal per capita per day) p15_kcal_pc_calibrated_livestock_orig(t,i) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_calibrated_rumdairy_orig(t,i) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) @@ -181,12 +181,9 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g) / 3.3 / - s15_scp_fat_to_kcal_milk conversion factor (kcal per gram of fat) / 8.79 / - s15_scp_sugar_to_kcal_milk conversion factor (kcal per gram of sugar) / 3.87 / - s15_scp_protein_to_kcal_milk conversion factor (kcal per gram of protein) / 4.27 / + s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / + s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g wet matter) / 4.7 / + s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / ; *' @code diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 6ed845bf20..05b69dcd8c 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -232,26 +232,25 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); *' *' Increase of single-cell protein (SCP): -p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * - i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); -p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); +p15_protein_pc_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * i15_protein_to_kcal_ratio(t,kfo_rd); +p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_protein_pc_scp(t,i,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); *' *' Reduction of ruminant meat and dairy products (kfo_rd): p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); *' -*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' Plant oil and sugar demands as ingredients for animal-free milk alternative production using single cell protein *' are calculated based on the ratio of fat or sugar to protein in cow milk. *' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. *' Cow milk content is chosen as the dominant source of milk produced globally. *' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 *' p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_fat_per_milk * fm_nutrition_attributes(t,"oils", "kcal"); *' p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 15d0b6b2ab..3cdb5ceebc 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -439,26 +439,25 @@ p15_kcal_pc_calibrated(t,i,kfo_pp) = p15_plant_kcal_structure_orig(t,i,kfo_pp) i15_protein_to_kcal_ratio(t,kfo) = fm_nutrition_attributes(t,kfo,"protein") / fm_nutrition_attributes(t,kfo,"kcal"); *' *' Increase of single-cell protein (SCP): -p15_kcal_pc_calibrated_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * - i15_protein_to_kcal_ratio(t,kfo_rd) / i15_protein_to_kcal_ratio(t,"scp"); -p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_kcal_pc_calibrated_scp(t,i,kfo_rd)); +p15_protein_pc_scp(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * (1-i15_rumdairy_scp_fadeout(t,i)) * i15_protein_to_kcal_ratio(t,kfo_rd); +p15_kcal_pc_calibrated(t,i,"scp") = p15_kcal_pc_calibrated(t,i,"scp") + sum(kfo_rd, p15_protein_pc_scp(t,i,kfo_rd)) / i15_protein_to_kcal_ratio(t,"scp"); *' *' Reduction of ruminant meat and dairy products (kfo_rd): p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_kcal_pc_calibrated(t,i,kfo_rd) * i15_rumdairy_scp_fadeout(t,i); *' -*' Plant oil and sugar demands as ingredients for milk production using single cell protein +*' Plant oil and sugar demands as ingredients for animal-free milk alternative production using single cell protein *' are calculated based on the ratio of fat or sugar to protein in cow milk. *' This ratio is typically reported on a mass basis, but the ratio is converted here to be based on caloric content. *' Cow milk content is chosen as the dominant source of milk produced globally. *' Data sources: @muehlhoff_milk_2013 and @fao_food_2004 *' p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_fat_per_milk * s15_scp_fat_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_fat_per_milk * fm_nutrition_attributes(t,"oils", "kcal"); *' p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") - + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_kcal_pc_calibrated_scp(t,i,kfo_rd)) - * (s15_scp_sugar_per_milk * s15_scp_sugar_to_kcal_milk) / (s15_scp_protein_per_milk * s15_scp_protein_to_kcal_milk); + + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / + s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); *' *' @stop From ae1dfc378eaf3618fb97b3c480743b949f03b986 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:07:43 +0200 Subject: [PATCH 074/171] Clean-up of main scenario_config.csv --- config/scenario_config.csv | 181 ++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 105 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 1e48441f79..7733fca14d 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,105 +1,76 @@ -;default;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_v1;eat_lancet_diet_v2;EL2_PHD;EL2_Demand;EL2_default;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;GENIE_SCP -gms$c_timesteps;coup2100;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;5year;5year;5year;5year;5year;;;;;;;;;;;;;;;;;;;;coup2110 -gms$c09_pop_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$c09_gdp_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$c09_pal_scenario;SSP2;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;SDP;SDP;SSP2;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_lic;0.1;;;;;;;;;;;;;;;;;;;;;;;0.06;0.1;0.1;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s12_interest_hic;0.04;;;;;;;;;;;;;;;;;;;;;;;0.04;0.04;0.04;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c13_tccost;medium;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;high -gms$c14_yields_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;;nocc -gms$food;anthro_iso_jun22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;anthropometrics_jan18 -gms$c15_food_scenario;SSP2;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;SSP2; -gms$c15_food_scenario_noselect;SSP2;;;;;;;;;;;;;;;;;;;;;;;;;;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;0;0;0;0;;;;;;;;;;;;;;;;;;;; -gms$s15_rumdairy_scp_substitution;0;;;;0;0;0;0;0;0;0;0.5;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_subst_functional_form;1;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_start;2025;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s15_food_substitution_target;2050;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$kfo_rd;livst_rum;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;livst_rum,livst_milk -gms$s15_exo_foodscen_convergence;1;;;;;;;;;;1;1;1;1;;;;;;;1;1;;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_functional_form;1;;;;;;;;;;1;1;1;1;;;;;;;1;1;;1;1;1;;1;;;1;;;;;;;;;;;;;;;;;;;1; -gms$s15_exo_foodscen_start;2025;;;;;;;;;;2020;2020;2020;2020;;;;;;;2020;2025;;2025;2025;2025;;2020;;;2020;;;;;;;;;;;;;;;;;;;2020; -gms$s15_exo_foodscen_target;2050;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;;2050;2050;2050;;2050;;;2050;;;;;;;;;;;;;;;;;;;2050; -gms$s15_exo_waste;0;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;0;;1;1;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; -gms$s15_waste_scen;1.2;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;1.2;1.2;;1.2;1.2;;;1.2;;;1.2;;;;;;;;;;;;;;;;;;;1.2; -gms$s15_exo_diet;0;;;;0;0;0;0;0;0;1;1;1;1;;;;;;;1;1;;3;3;0;0;1;0;0;1;0;0;1;1;;;;;;;;;;;;;;;1; -gms$c15_kcal_scen;healthy_BMI;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;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;FLX;;;FLX;;;FLX;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_monogastric;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_ruminant;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fish;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_fruitvegnut;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_roots;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_pulses;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_sugar;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_oils;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_brans;0;;;;;;;;;;1;0;1;1;;;;;;;1;1;;0;0;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_scp;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_exo_alcohol;1;;;;;;;;;;1;0;1;1;;;;;;;1;1;;1;1;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$s15_alc_scen;0;;;;;;;;;;;;;;;;;;;;;;;0;0;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c20_scp_type;sugar;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;hydrogen -gms$c21_trade_liberalization;l909090r808080;;;;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;none;BH;none;BH_IFL;BH;;;;;;;BH;;;;;;BH_IFL;BH_IFL;BH_IFL;BH_IFL;BH_IFL;;;;;;;;;;;;;;;;;;;; -gms$c22_protect_scenario_noselect;none;;;;;;;;;;;;;;;;;;;;;;;;;;none;none;BH_IFL;none;BH_IFL;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_shr;0;;;;0;0;0;0;0;0;0;0;0;0.2;;;;;;;0;;;;;;0.2;0.2;0.2;0.2;0.2;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_shr_noselect;0;;;;;;;;;;;;;;;;;;;;;;;;;;0;0;0.2;0;0.2;;;;;;;;;;;;;;;;;;;; -gms$s29_snv_scenario_target;2050;;;;;;;;;;;;;2030;;;;;;;;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; -gms$c30_bioen_water;rainfed;;;;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;rainfed;all;rainfed;rainfed;;;;;;;rainfed;;;;rainfed;rainfed;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s30_annual_max_growth;Inf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0.02 -gms$c31_grassl_yld_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c32_shock_scenario;none;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; -gms$s32_initial_distribution;1;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; -gms$s32_hvarea;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;1;0;;;;;;;;;;;;; -gms$s32_aff_plantation;0;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_aff_bii_coeff;0;;;;0;0;0;0;0;0;0;1;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s32_max_aff_area;Inf;;;;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;noboreal;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;onlytropical;;;;;;noboreal;noboreal;noboreal;noboreal;noboreal;;;;;;;;;;;;;;;;;;;; -gms$c34_urban_scenario;SSP2;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;;;;;SSP4;SSP1;SSP4;SSP4;SSP1;;;;;;;;;;;;;;;;;;;; -gms$c32_aff_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; -gms$s32_planing_horizon;50;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c35_ad_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; -gms$c35_aolc_policy;npi;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;ndc;ndc;ndc;ndc;ndc;;;;;;;;;;;;;;;;;;;; -gms$c35_pot_forest_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$s35_forest_damage;2;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4;4;4;4;4;;;;;;;; -gms$s35_forest_damage_end;2050;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;2030;;;;;;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;;;;; -gms$c35_shock_scenario;none;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;none;002lin2030;004lin2030;008lin2030;016lin2030;;;;;;;; -gms$s35_secdf_distribution;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; -gms$s35_hvarea;2;;;;;;;;;;;;;;;;;;;;;;;;;;2;2;2;2;2;;;;;2;2;0;;;;;;;;;;;;; -gms$factor_costs;per_ton_fao_may22;;;;;;;;;;;;;;;;;;;;;;;sticky_labor;sticky_labor;sticky_labor;;;;;;;;;;;;;;;;;;;;;;;;;sticky_feb18 -gms$c42_watdem_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$s42_watdem_nonagr_scenario;2;;;;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;2;3;3;3;3;;;;;;;3;;;;;;3;3;3;3;3;;;;;;;;;;;;;;;;;;;; -gms$c42_env_flow_policy;off;;;;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;2040;2050;2070;2050;;;;;;;2040;;;;;;2040;2040;2040;2040;2040;;;;;;;;;;;;;;;;;;;; -gms$c43_watavail_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$s44_cost_bii_missing;1000000;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;10000000 -gms$s44_target_price;0;;;;0;0;0;0;0;0;0;0;0;0;;;;;;;0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c50_scen_neff;baseeff_add3_add5_add10_max65;;;;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_add5_add10_max65;;;;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$c52_carbon_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$c52_land_carbon_sink_rcp;RCPBU;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU;; -gms$c55_scen_conf;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;;;;;ssp1;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;;;;; -gms$c55_scen_conf_noselect;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;ssp1;;;;;;ssp4;ssp4;ssp1;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; -gms$c56_pollutant_prices;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-NPi;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$s56_c_price_exp_aff;50;;;;50;50;50;50;50;50;50;30;50;50;;;;;;;50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_buffer_aff;0.5;;;;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.5;0.2;0.3;;;;;;;0.5;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_emis_policy;reddnatveg_nosoil;;;;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;reddnatveg_nosoil;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$s56_minimum_cprice;0;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c56_mute_ghgprices_until;y2030;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;y2020 -gms$maccs;on_aug22;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c57_macc_version;PBL_2022;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;PBL_2022;PBL_2022;PBL_2022;PBL_2022;;;;;;;;;;;;;;;; -gms$c57_macc_scenario;Default;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Default;Optimistic;Default;Optimistic;;;;;;;;;;;;;;;; -gms$s58_rewetting_switch;Inf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0;1;0;1;;;;;;;;;;;;;;;; -gms$c59_som_scenario;cc;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;cc;cc;cc;cc;cc;;;;;;;;;;;;;;;;;;;; -gms$bioenergy;1stgen_priced_dec18;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1st2ndgen_priced_feb24 -gms$c60_1stgen_biodem;const2020;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;phaseout2020;;;;;;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;;;;;phaseout2020 -gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;R21M42-SDP-PkBudg1000;;;;;;;;;;;;;;;;;;;;R32M46-SSP2EU-NPi -gms$c60_biodem_level;1;;;;;;;;;;;;;;;;;1;0;;;;;;;;1;1;1;1;1;;;;;;;;;;;;;;;;;;;; -gms$c60_bioenergy_subsidy;300;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -gms$c60_res_2ndgenBE_dem;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;sdp;;;;;;ssp4;sdp;ssp4;ssp4;sdp;;;;;;;;;;;;;;;;;;;; -gms$c70_feed_scen;ssp2;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;ssp1;;;ssp1;ssp2;ssp2;ssp4;ssp1;ssp4;ssp4;ssp1;;;;;;;;;;;;;;;;;;;; -gms$s73_timber_demand_switch;1;;;;;;;;;;;;;;;;;;;;;;;;;;1;1;1;1;1;;;;;1;1;0;;;;;;;;;;;;; -input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz;; -magicc_emis_scen;;;;;;;;;;;;;;;;;;;;;;;;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_DeepDive_noNDC-rem-12.mif;;;;;;;;;;;;;;;;;;;;;;;;; +,cc,nocc,nocc_hist,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SDP,SDP-EI,SDP-RC,SDP-MC,BASE,NPI,NDC,coupling,emulator,input,eat_lancet_diet_v1,eat_lancet_diet_v2,ForestryEndo,ForestryExo,ForestryOff,rcp1p9,rcp2p6,rcp4p5,rcp6p0,rcp7p0,rcp8p5 +gms$c_timesteps,,,,,,,,,,,,,,,,,less_TS,less_TS,,,,,,,,,,,, +gms$c09_pop_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP1,SSP1,SSP1,,,,,,,,,,,,,,,,, +gms$c09_gdp_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SDP_EI,SDP_RC,SDP_MC,,,,,,,,,,,,,,,,, +gms$c09_pal_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,,,,,,,,, +gms$c14_yields_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c15_food_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,,,,,,,,, +gms$s15_rumdairy_scp_substitution,,,,,,,,,,0,0.5,0,0,,,,,,,,,,,,,,,,, +gms$s15_food_subst_functional_form,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,, +gms$s15_food_substitution_start,,,,,,,,,,,2020,,,,,,,,,,,,,,,,,,, +gms$s15_food_substitution_target,,,,,,,,,,,2050,,,,,,,,,,,,,,,,,,, +gms$kfo_rd,,,,,,,,,,,livst_rum,,,,,,,,,,,,,,,,,,, +gms$s15_exo_foodscen_convergence,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_foodscen_functional_form,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_foodscen_start,,,,,,,,,,2020,2020,2020,2020,,,,,,,2025,,,,,,,,,, +gms$s15_exo_foodscen_target,,,,,,,,,,2050,2050,2050,2070,,,,,,,2050,,,,,,,,,, +gms$s15_exo_waste,,,,,,,,,,1,1,1,1,,,,,,,,,,,,,,,,, +gms$s15_waste_scen,,,,,,,,,,1.2,1.3,1.2,1.25,,,,,,,,,,,,,,,,, +gms$s15_exo_diet,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, +gms$c15_kcal_scen,,,,,,,,,,healthy_BMI,no_underweight,healthy_BMI,healthy_BMI,,,,,,,healthy_BMI,,,,,,,,,, +gms$c15_EAT_scen,,,,,,,,,,FLX,,FLX,FLX,,,,,,,FLX,,,,,,,,,, +gms$s15_exo_monogastric,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_ruminant,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_fish,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_fruitvegnut,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_roots,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_pulses,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_sugar,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_oils,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_brans,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_scp,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$s15_exo_alcohol,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, +gms$c21_trade_liberalization,,,,l908080r807070,l909090r808080,l909090r808080,l909595r809090,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l909595r809090,l908080r807070,,,,,,,,,,,,,,,,, +gms$c22_protect_scenario,,,,,,,,,,BH,none,BH_IFL,BH,,,,,,,,,,,,,,,,, +gms$s29_snv_shr,,,,,,,,,,0,0,0,0.2,,,,,,,,,,,,,,,,, +gms$s29_snv_scenario_target,,,,,,,,,,,,,2030,,,,,,,,,,,,,,,,, +gms$c30_bioen_water,,,,,,,,,,rainfed,all,rainfed,rainfed,,,,,,,,,,,,,,,,, +gms$c31_grassl_yld_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s32_initial_distribution,,,,,,,,,,,,,,,,,,,,,,1,1,0,,,,,, +gms$s32_hvarea,,,,,,,,,,,,,,,,,,,,,,2,1,0,,,,,, +gms$s32_aff_plantation,,,,,,,,,,0,1,0,0,,,,,,,,,,,,,,,,, +gms$s32_aff_bii_coeff,,,,,,,,,,0,1,0,0,,,,,,,,,,,,,,,,, +gms$s32_max_aff_area,,,,,,,,,,500,350,0,700,,,,,,,,,,,,,,,,, +gms$c32_aff_mask,,,,,,,,,,onlytropical,onlytropical,onlytropical,onlytropical,,,,,,,,,,,,,,,,, +gms$c34_urban_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP1,SSP2,SSP1,,,,,,,,,,,,,,,,, +gms$c32_aff_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, +gms$s32_planing_horizon,,,,,,,,,,50,30,50,50,,,,,,,,,,,,,,,,, +gms$c35_ad_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, +gms$c35_aolc_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, +gms$c35_pot_forest_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s35_forest_damage_end,,,,2030,2050,2050,2050,2050,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,, +gms$s35_secdf_distribution,,,,,,,,,,,,,,,,,,,,,,2,2,0,,,,,, +gms$s35_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,0,,,,,, +gms$c42_watdem_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$s42_watdem_nonagr_scenario,,,,1,2,2,3,2,1,1,1,3,1,,,,,,,,,,,,,,,,, +gms$s42_irrig_eff_scenario,,,,,,,,,,3,3,3,3,,,,,,,,,,,,,,,,, +gms$c42_env_flow_policy,,,,on,off,off,off,mixed,on,on,on,on,on,,,,,,,,,,,,,,,,, +gms$s42_efp_targetyear,,,,,,,,,,2040,2050,2070,2050,,,,,,,,,,,,,,,,, +gms$c43_watavail_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +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,,,,,,,,,,,,,,,,, +gms$c52_carbon_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c52_land_carbon_sink_rcp,,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,RCP19,RCP26,RCP45,RCP60,RCPBU,RCPBU +gms$c55_scen_conf,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,,,,,,,,,,, +gms$c56_pollutant_prices,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,,,,,,,,, +gms$s56_c_price_exp_aff,,,,,,,,,,50,30,50,50,,,,,,,,,,,,,,,,, +gms$s56_buffer_aff,,,,,,,,,,0.5,0.5,0.2,0.3,,,,,,,,,,,,,,,,, +gms$c56_emis_policy,,,,,,,,,,reddnatveg_nosoil,reddnatveg_nosoil,redd_nosoil,all_nosoil,,,,,,,,,,,,,,,,, +gms$s56_minimum_cprice,,,,,,,,,,,,,,0,0,18,,,,,,,,,,,,,, +gms$c59_som_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, +gms$c60_1stgen_biodem,,,,phaseout2020,const2020,const2020,const2030,const2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,,,,,,,,,,, +gms$c60_2ndgen_biodem,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,,,,,,,,, +gms$c60_biodem_level,,,,,,,,,,,,,,,,,1,0,,,,,,,,,,,, +gms$c60_res_2ndgenBE_dem,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,sdp,ssp2,sdp,sdp,,,,,,,,,,,,,,,,, +gms$c70_feed_scen,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp5,ssp1,ssp1,,,,,,,,,,,,,,,,, +gms$s73_timber_demand_switch,,,,,,,,,,,,,,,,,,,,,,1,1,0,,,,,, +input['cellular'],,,,,,,,,,,,,,,,,,,,,,,,,rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz,rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz,rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz,rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz,rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz,rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz From 9433a2cef127575df959a16b52270a3b48207819 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Tue, 16 Jul 2024 17:10:41 +0200 Subject: [PATCH 075/171] Update scenario_config.csv --- config/scenario_config.csv | 152 ++++++++++++++++++------------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 7733fca14d..307d3c0c6a 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -1,76 +1,76 @@ -,cc,nocc,nocc_hist,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SDP,SDP-EI,SDP-RC,SDP-MC,BASE,NPI,NDC,coupling,emulator,input,eat_lancet_diet_v1,eat_lancet_diet_v2,ForestryEndo,ForestryExo,ForestryOff,rcp1p9,rcp2p6,rcp4p5,rcp6p0,rcp7p0,rcp8p5 -gms$c_timesteps,,,,,,,,,,,,,,,,,less_TS,less_TS,,,,,,,,,,,, -gms$c09_pop_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP1,SSP1,SSP1,,,,,,,,,,,,,,,,, -gms$c09_gdp_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SDP_EI,SDP_RC,SDP_MC,,,,,,,,,,,,,,,,, -gms$c09_pal_scenario,,,,SSP1,SSP2,SSP2EU,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,,,,,,,,, -gms$c14_yields_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c15_food_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP2,SSP1,SSP1,,,,,,,,,,,,,,,,, -gms$s15_rumdairy_scp_substitution,,,,,,,,,,0,0.5,0,0,,,,,,,,,,,,,,,,, -gms$s15_food_subst_functional_form,,,,,,,,,,,2,,,,,,,,,,,,,,,,,,, -gms$s15_food_substitution_start,,,,,,,,,,,2020,,,,,,,,,,,,,,,,,,, -gms$s15_food_substitution_target,,,,,,,,,,,2050,,,,,,,,,,,,,,,,,,, -gms$kfo_rd,,,,,,,,,,,livst_rum,,,,,,,,,,,,,,,,,,, -gms$s15_exo_foodscen_convergence,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_foodscen_functional_form,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_foodscen_start,,,,,,,,,,2020,2020,2020,2020,,,,,,,2025,,,,,,,,,, -gms$s15_exo_foodscen_target,,,,,,,,,,2050,2050,2050,2070,,,,,,,2050,,,,,,,,,, -gms$s15_exo_waste,,,,,,,,,,1,1,1,1,,,,,,,,,,,,,,,,, -gms$s15_waste_scen,,,,,,,,,,1.2,1.3,1.2,1.25,,,,,,,,,,,,,,,,, -gms$s15_exo_diet,,,,,,,,,,1,1,1,1,,,,,,,1,,,,,,,,,, -gms$c15_kcal_scen,,,,,,,,,,healthy_BMI,no_underweight,healthy_BMI,healthy_BMI,,,,,,,healthy_BMI,,,,,,,,,, -gms$c15_EAT_scen,,,,,,,,,,FLX,,FLX,FLX,,,,,,,FLX,,,,,,,,,, -gms$s15_exo_monogastric,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_ruminant,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_fish,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_fruitvegnut,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_roots,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_pulses,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_sugar,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_oils,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_brans,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_scp,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$s15_exo_alcohol,,,,,,,,,,1,0,1,1,,,,,,,1,,,,,,,,,, -gms$c21_trade_liberalization,,,,l908080r807070,l909090r808080,l909090r808080,l909595r809090,l908080r807070,l908080r807070,l908080r807070,l908080r807070,l909595r809090,l908080r807070,,,,,,,,,,,,,,,,, -gms$c22_protect_scenario,,,,,,,,,,BH,none,BH_IFL,BH,,,,,,,,,,,,,,,,, -gms$s29_snv_shr,,,,,,,,,,0,0,0,0.2,,,,,,,,,,,,,,,,, -gms$s29_snv_scenario_target,,,,,,,,,,,,,2030,,,,,,,,,,,,,,,,, -gms$c30_bioen_water,,,,,,,,,,rainfed,all,rainfed,rainfed,,,,,,,,,,,,,,,,, -gms$c31_grassl_yld_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s32_initial_distribution,,,,,,,,,,,,,,,,,,,,,,1,1,0,,,,,, -gms$s32_hvarea,,,,,,,,,,,,,,,,,,,,,,2,1,0,,,,,, -gms$s32_aff_plantation,,,,,,,,,,0,1,0,0,,,,,,,,,,,,,,,,, -gms$s32_aff_bii_coeff,,,,,,,,,,0,1,0,0,,,,,,,,,,,,,,,,, -gms$s32_max_aff_area,,,,,,,,,,500,350,0,700,,,,,,,,,,,,,,,,, -gms$c32_aff_mask,,,,,,,,,,onlytropical,onlytropical,onlytropical,onlytropical,,,,,,,,,,,,,,,,, -gms$c34_urban_scenario,,,,SSP1,SSP2,SSP2,SSP3,SSP4,SSP5,SSP1,SSP1,SSP2,SSP1,,,,,,,,,,,,,,,,, -gms$c32_aff_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, -gms$s32_planing_horizon,,,,,,,,,,50,30,50,50,,,,,,,,,,,,,,,,, -gms$c35_ad_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, -gms$c35_aolc_policy,,,,,,,,,,,,,,none,npi,ndc,,,,,,,,,,,,,, -gms$c35_pot_forest_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s35_forest_damage_end,,,,2030,2050,2050,2050,2050,2030,2030,2030,2030,2030,,,,,,,,,,,,,,,,, -gms$s35_secdf_distribution,,,,,,,,,,,,,,,,,,,,,,2,2,0,,,,,, -gms$s35_hvarea,,,,,,,,,,,,,,,,,,,,,,2,2,0,,,,,, -gms$c42_watdem_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$s42_watdem_nonagr_scenario,,,,1,2,2,3,2,1,1,1,3,1,,,,,,,,,,,,,,,,, -gms$s42_irrig_eff_scenario,,,,,,,,,,3,3,3,3,,,,,,,,,,,,,,,,, -gms$c42_env_flow_policy,,,,on,off,off,off,mixed,on,on,on,on,on,,,,,,,,,,,,,,,,, -gms$s42_efp_targetyear,,,,,,,,,,2040,2050,2070,2050,,,,,,,,,,,,,,,,, -gms$c43_watavail_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -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,,,,,,,,,,,,,,,,, -gms$c52_carbon_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c52_land_carbon_sink_rcp,,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,RCP19,RCP26,RCP45,RCP60,RCPBU,RCPBU -gms$c55_scen_conf,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp1,ssp1,ssp1,,,,,,,,,,,,,,,,, -gms$c56_pollutant_prices,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,,,,,,,,, -gms$s56_c_price_exp_aff,,,,,,,,,,50,30,50,50,,,,,,,,,,,,,,,,, -gms$s56_buffer_aff,,,,,,,,,,0.5,0.5,0.2,0.3,,,,,,,,,,,,,,,,, -gms$c56_emis_policy,,,,,,,,,,reddnatveg_nosoil,reddnatveg_nosoil,redd_nosoil,all_nosoil,,,,,,,,,,,,,,,,, -gms$s56_minimum_cprice,,,,,,,,,,,,,,0,0,18,,,,,,,,,,,,,, -gms$c59_som_scenario,cc,nocc,nocc_hist,,,,,,,,,,,,,,,,,,,,,,,,,,, -gms$c60_1stgen_biodem,,,,phaseout2020,const2020,const2020,const2030,const2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,phaseout2020,,,,,,,,,,,,,,,,, -gms$c60_2ndgen_biodem,,,,,,,,,,,,,,,,,coupling,emulator,coupling,,,,,,,,,,, -gms$c60_biodem_level,,,,,,,,,,,,,,,,,1,0,,,,,,,,,,,, -gms$c60_res_2ndgenBE_dem,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,sdp,ssp2,sdp,sdp,,,,,,,,,,,,,,,,, -gms$c70_feed_scen,,,,ssp1,ssp2,ssp2,ssp3,ssp4,ssp5,ssp1,ssp5,ssp1,ssp1,,,,,,,,,,,,,,,,, -gms$s73_timber_demand_switch,,,,,,,,,,,,,,,,,,,,,,1,1,0,,,,,, -input['cellular'],,,,,,,,,,,,,,,,,,,,,,,,,rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz,rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz,rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz,rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz,rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz,rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz +;cc;nocc;nocc_hist;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SDP;SDP-EI;SDP-RC;SDP-MC;BASE;NPI;NDC;coupling;emulator;input;eat_lancet_diet_v1;eat_lancet_diet_v2;ForestryEndo;ForestryExo;ForestryOff;rcp1p9;rcp2p6;rcp4p5;rcp6p0;rcp7p0;rcp8p5 +gms$c_timesteps;;;;;;;;;;;;;;;;;less_TS;less_TS;;;;;;;;;;;; +gms$c09_pop_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP1;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$c09_gdp_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SDP_EI;SDP_RC;SDP_MC;;;;;;;;;;;;;;;;; +gms$c09_pal_scenario;;;;SSP1;SSP2;SSP2EU;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$c14_yields_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c15_food_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP2;SSP1;SSP1;;;;;;;;;;;;;;;;; +gms$s15_rumdairy_scp_substitution;;;;;;;;;;0;0.5;0;0;;;;;;;;;;;;;;;;; +gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_start;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;; +gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;; +gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;; +gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2025;;;;;;;;;; +gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;;;;;;;;;; +gms$s15_exo_waste;;;;;;;;;;1;1;1;1;;;;;;;;;;;;;;;;; +gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;;;;;;;;;;; +gms$s15_exo_diet;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; +gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;;;;;;;;;; +gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;;;;;;;;;; +gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_roots;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;;;;;;;;;;;;;;;;; +gms$c22_protect_scenario;;;;;;;;;;BH;none;BH_IFL;BH;;;;;;;;;;;;;;;;; +gms$s29_snv_shr;;;;;;;;;;0;0;0;0.2;;;;;;;;;;;;;;;;; +gms$s29_snv_scenario_target;;;;;;;;;;;;;2030;;;;;;;;;;;;;;;;; +gms$c30_bioen_water;;;;;;;;;;rainfed;all;rainfed;rainfed;;;;;;;;;;;;;;;;; +gms$c31_grassl_yld_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s32_initial_distribution;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; +gms$s32_hvarea;;;;;;;;;;;;;;;;;;;;;;2;1;0;;;;;; +gms$s32_aff_plantation;;;;;;;;;;0;1;0;0;;;;;;;;;;;;;;;;; +gms$s32_aff_bii_coeff;;;;;;;;;;0;1;0;0;;;;;;;;;;;;;;;;; +gms$s32_max_aff_area;;;;;;;;;;500;350;0;700;;;;;;;;;;;;;;;;; +gms$c32_aff_mask;;;;;;;;;;onlytropical;onlytropical;onlytropical;onlytropical;;;;;;;;;;;;;;;;; +gms$c34_urban_scenario;;;;SSP1;SSP2;SSP2;SSP3;SSP4;SSP5;SSP1;SSP1;SSP2;SSP1;;;;;;;;;;;;;;;;; +gms$c32_aff_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$s32_planing_horizon;;;;;;;;;;50;30;50;50;;;;;;;;;;;;;;;;; +gms$c35_ad_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$c35_aolc_policy;;;;;;;;;;;;;;none;npi;ndc;;;;;;;;;;;;;; +gms$c35_pot_forest_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s35_forest_damage_end;;;;2030;2050;2050;2050;2050;2030;2030;2030;2030;2030;;;;;;;;;;;;;;;;; +gms$s35_secdf_distribution;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; +gms$s35_hvarea;;;;;;;;;;;;;;;;;;;;;;2;2;0;;;;;; +gms$c42_watdem_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$s42_watdem_nonagr_scenario;;;;1;2;2;3;2;1;1;1;3;1;;;;;;;;;;;;;;;;; +gms$s42_irrig_eff_scenario;;;;;;;;;;3;3;3;3;;;;;;;;;;;;;;;;; +gms$c42_env_flow_policy;;;;on;off;off;off;mixed;on;on;on;on;on;;;;;;;;;;;;;;;;; +gms$s42_efp_targetyear;;;;;;;;;;2040;2050;2070;2050;;;;;;;;;;;;;;;;; +gms$c43_watavail_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +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;;;;;;;;;;;;;;;;; +gms$c52_carbon_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c52_land_carbon_sink_rcp;;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;RCP19;RCP26;RCP45;RCP60;RCPBU;RCPBU +gms$c55_scen_conf;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp1;ssp1;ssp1;;;;;;;;;;;;;;;;; +gms$c56_pollutant_prices;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; +gms$s56_c_price_exp_aff;;;;;;;;;;50;30;50;50;;;;;;;;;;;;;;;;; +gms$s56_buffer_aff;;;;;;;;;;0.5;0.5;0.2;0.3;;;;;;;;;;;;;;;;; +gms$c56_emis_policy;;;;;;;;;;reddnatveg_nosoil;reddnatveg_nosoil;redd_nosoil;all_nosoil;;;;;;;;;;;;;;;;; +gms$s56_minimum_cprice;;;;;;;;;;;;;;0;0;18;;;;;;;;;;;;;; +gms$c59_som_scenario;cc;nocc;nocc_hist;;;;;;;;;;;;;;;;;;;;;;;;;;; +gms$c60_1stgen_biodem;;;;phaseout2020;const2020;const2020;const2030;const2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;phaseout2020;;;;;;;;;;;;;;;;; +gms$c60_2ndgen_biodem;;;;;;;;;;;;;;;;;coupling;emulator;coupling;;;;;;;;;;; +gms$c60_biodem_level;;;;;;;;;;;;;;;;;1;0;;;;;;;;;;;; +gms$c60_res_2ndgenBE_dem;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;sdp;ssp2;sdp;sdp;;;;;;;;;;;;;;;;; +gms$c70_feed_scen;;;;ssp1;ssp2;ssp2;ssp3;ssp4;ssp5;ssp1;ssp5;ssp1;ssp1;;;;;;;;;;;;;;;;; +gms$s73_timber_demand_switch;;;;;;;;;;;;;;;;;;;;;;1;1;0;;;;;; +input['cellular'];;;;;;;;;;;;;;;;;;;;;;;;;rev4.111_h12_0bd54110_cellularmagpie_c200_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1.tgz;rev4.111_h12_6819938d_cellularmagpie_c200_MRI-ESM2-0-ssp126_lpjml-8e6c5eb1.tgz;rev4.111_h12_1b5c3817_cellularmagpie_c200_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1.tgz;rev4.111_h12_3c888fa5_cellularmagpie_c200_MRI-ESM2-0-ssp460_lpjml-8e6c5eb1.tgz;rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz;rev4.111_h12_09a63995_cellularmagpie_c200_MRI-ESM2-0-ssp585_lpjml-8e6c5eb1.tgz From cabe83370ba493f5a9ea6ee211063ef746976055 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 17 Jul 2024 09:19:44 +0200 Subject: [PATCH 076/171] updated Eat Lancet columns and Eat Lancet project config --- config/projects/scenario_config_el2.csv | 12 +++++++++ config/scenario_config.csv | 33 +++++++++++++------------ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/config/projects/scenario_config_el2.csv b/config/projects/scenario_config_el2.csv index 74556d0e9b..a1f87bde9b 100644 --- a/config/projects/scenario_config_el2.csv +++ b/config/projects/scenario_config_el2.csv @@ -5,6 +5,18 @@ gms$s12_interest_hic;0.04;0.04;0.04 gms$s15_exo_waste;1;1;0 gms$s15_waste_scen;1.2;1.2;1.2 gms$s15_exo_diet;3;3;0 +gms$s15_exo_monogastric;1;1;1 +gms$s15_exo_ruminant;1;1;1 +gms$s15_exo_fish;1;1;1 +gms$s15_exo_fruitvegnut;1;1;1 +gms$s15_exo_roots;1;1;1 +gms$s15_exo_pulses;1;1;1 +gms$s15_exo_sugar;1;1;1 +gms$s15_exo_oils;1;1;1 +gms$s15_exo_brans;0;0;0 +gms$s15_exo_scp;1;1;1 +gms$s15_exo_alcohol;1;1;1 +gms$s15_alc_scen;0;0;0 gms$factor_costs;sticky_labor;sticky_labor;sticky_labor gms$c70_feed_scen;ssp1;ssp2;ssp2 input['cellular'];rev4.111EL2_h12_c6a7458f_cellularmagpie_c200_IPSL-CM6A-LR-ssp370_lpjml-8e6c5eb1.tgz;; diff --git a/config/scenario_config.csv b/config/scenario_config.csv index 307d3c0c6a..afe1469f1b 100755 --- a/config/scenario_config.csv +++ b/config/scenario_config.csv @@ -10,26 +10,27 @@ gms$s15_food_subst_functional_form;;;;;;;;;;;2;;;;;;;;;;;;;;;;;;; gms$s15_food_substitution_start;;;;;;;;;;;2020;;;;;;;;;;;;;;;;;;; gms$s15_food_substitution_target;;;;;;;;;;;2050;;;;;;;;;;;;;;;;;;; gms$kfo_rd;;;;;;;;;;;livst_rum;;;;;;;;;;;;;;;;;;; -gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2025;;;;;;;;;; -gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;;;;;;;;;; +gms$s15_exo_foodscen_convergence;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_foodscen_functional_form;;;;;;;;;;1;1;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_foodscen_start;;;;;;;;;;2020;2020;2020;2020;;;;;;;2025;2025;;;;;;;;; +gms$s15_exo_foodscen_target;;;;;;;;;;2050;2050;2050;2070;;;;;;;2050;2050;;;;;;;;; gms$s15_exo_waste;;;;;;;;;;1;1;1;1;;;;;;;;;;;;;;;;; gms$s15_waste_scen;;;;;;;;;;1.2;1.3;1.2;1.25;;;;;;;;;;;;;;;;; -gms$s15_exo_diet;;;;;;;;;;1;1;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_diet;;;;;;;;;;1;1;1;1;;;;;;;1;3;;;;;;;;; gms$c15_kcal_scen;;;;;;;;;;healthy_BMI;no_underweight;healthy_BMI;healthy_BMI;;;;;;;healthy_BMI;;;;;;;;;; gms$c15_EAT_scen;;;;;;;;;;FLX;;FLX;FLX;;;;;;;FLX;;;;;;;;;; -gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_roots;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; -gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;;;;;;;;;; +gms$s15_exo_monogastric;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_ruminant;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_fish;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_fruitvegnut;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_roots;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_pulses;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_sugar;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_oils;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_brans;;;;;;;;;;1;0;1;1;;;;;;;1;0;;;;;;;;; +gms$s15_exo_scp;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_exo_alcohol;;;;;;;;;;1;0;1;1;;;;;;;1;1;;;;;;;;; +gms$s15_alc_scen;;;;;;;;;;;;;;;;;;;;0.014;0;;;;;;;;; gms$c21_trade_liberalization;;;;l908080r807070;l909090r808080;l909090r808080;l909595r809090;l908080r807070;l908080r807070;l908080r807070;l908080r807070;l909595r809090;l908080r807070;;;;;;;;;;;;;;;;; gms$c22_protect_scenario;;;;;;;;;;BH;none;BH_IFL;BH;;;;;;;;;;;;;;;;; gms$s29_snv_shr;;;;;;;;;;0;0;0;0.2;;;;;;;;;;;;;;;;; From 4811f8e53167415acdf13ff8918e9737afd83c13 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 17 Jul 2024 14:21:08 +0200 Subject: [PATCH 077/171] adjusted start scripts for LAMA and EAT --- .../start/projects/project_EAT2p0_DeepDive.R | 55 +++++++++++++------ .../start/projects/project_LAMACLIMA_WP4.R | 31 +++++++---- 2 files changed, 56 insertions(+), 30 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index ee4984fb07..9c751de753 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -47,7 +47,9 @@ path2MitigationRun <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remin ####################### # SCENARIO DEFINITION # ####################### -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") + # Note: The climate change impacts setting differs from the global AgMIP model comparision set-up. # We do not include climate change impacts in the coupled REMIND-MAgPIE runs for the PB Deep Dive # because we focus exclusively on the mitigation aspect without climate change impacts. @@ -163,14 +165,16 @@ priceNonCO2 <- function(cfg) { # BAU # # Business as usual scenario based on SSP2 (NPis) cfg$title <- "BAU_NPi" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) start_run(cfg, codeCheck = FALSE) # (1b) BAU + Bioenergy # # Decomposition Scenario. Adds bioenergy demand from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "BAU_Bioenergy" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- bioenergy(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -178,7 +182,8 @@ start_run(cfg, codeCheck = FALSE) # (1c) BAU + NonCO2 pricing in land sector # # Decomposition Scenario. Adds non-CO2 pricing with ghg price from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "BAU_NonCO2" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- priceNonCO2(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -186,7 +191,8 @@ start_run(cfg, codeCheck = FALSE) # (1d) BAU + pricing of CO2 in land sector # # Decomposition Scenario. Adds CO2 pricing on land-use change emissions with ghg price from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "BAU_CO2" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- priceCO2(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -195,7 +201,8 @@ start_run(cfg, codeCheck = FALSE) # All production-side land-based mitigation measures cfg$title <- "BAU_Miti" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation (CO2, non-CO2, bioenergy) @@ -206,7 +213,8 @@ start_run(cfg, codeCheck = FALSE) # (1e) CO2 and non-CO2 pricing, but no bioenergy demand from REMIND cfg$title <- "BAUMITI_Bioenergy" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -220,7 +228,8 @@ start_run(cfg, codeCheck = FALSE) # (1f) CO2 pricing and bioenergy demand from REMIND, but no non-CO2 pricing in land-system cfg$title <- "BAUMITI_nonCO2" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -234,7 +243,8 @@ start_run(cfg, codeCheck = FALSE) # (1g) non-CO2 pricing and bioenergy demand from REMIND, but no CO2 pricing in land-system cfg$title <- "BAUMITI_CO2" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -246,7 +256,8 @@ start_run(cfg, codeCheck = FALSE) # (1e,f,g) Demand-side options (Diet+Waste) by 2050 cfg$title <- "BAU_Dem" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- waste(cfg = cfg) @@ -256,7 +267,8 @@ start_run(cfg, codeCheck = FALSE) # (2b) CO2 and non-CO2 pricing and demand-side mitigation (diet change), but no bioenergy demand from REMIND cfg$title <- "MITI_Bioenergy" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -272,7 +284,8 @@ start_run(cfg, codeCheck = FALSE) # (2c) CO2 pricing and bioenergy demand from REMIND and demand-side mitigation (diet change), but no non-CO2 pricing in land-system cfg$title <- "MITI_nonCO2" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -289,7 +302,8 @@ start_run(cfg, codeCheck = FALSE) # (2d) non-CO2 pricing and bioenergy demand from REMIND and demand-side mitigation (diet change), but no CO2 pricing in land-system cfg$title <- "MITI_CO2" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -306,7 +320,8 @@ start_run(cfg, codeCheck = FALSE) # (2e,f,g) All production-side land-based mitigation measures, but no demand-side mitigation cfg$title <- "MITI_Dem" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation @@ -317,7 +332,8 @@ start_run(cfg, codeCheck = FALSE) # (3b) Demand-side change + Bioenergy # # Decomposition Scenario with demand-side changes. Adds bioenergy demand from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "DEM_Bioenergy" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- bioenergy(cfg = cfg) # Demand-side change (diet, waste) @@ -328,7 +344,8 @@ start_run(cfg, codeCheck = FALSE) # (3c) Demand-side + NonCO2 pricing in land sector # # Decomposition Scenario with demand-side changes. Adds non-CO2 pricing with ghg price from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "DEM_NonCO2" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- priceNonCO2(cfg = cfg) # Demand-side change (diet, waste) @@ -339,7 +356,8 @@ start_run(cfg, codeCheck = FALSE) # (3d) Demand-side + pricing of CO2 in land sector # # Decomposition Scenario with demand-side changes. Adds CO2 pricing on land-use change emissions with ghg price from coupled run with land-use policies consistent with 1.5C by 2050 to BAU cfg$title <- "DEM_CO2" -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") cfg <- bau(cfg = cfg) cfg <- priceCO2(cfg = cfg) # Demand-side change (diet, waste) @@ -352,7 +370,8 @@ start_run(cfg, codeCheck = FALSE) # All production-side land-based mitigation measures and demand-side mitigation (diet change) cfg$title <- "MITI_All" # standard setting, but with NDC for miti -cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) +cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # BAU settings cfg <- bau(cfg = cfg) # Mitigation (CO2, non-CO2, bioenergy) diff --git a/scripts/start/projects/project_LAMACLIMA_WP4.R b/scripts/start/projects/project_LAMACLIMA_WP4.R index a3b87fdc5f..28ad81f9ac 100644 --- a/scripts/start/projects/project_LAMACLIMA_WP4.R +++ b/scripts/start/projects/project_LAMACLIMA_WP4.R @@ -44,8 +44,10 @@ cfg$qos <- "priority_maxMem" #### Main scenarios ### Global Sustainability, largely based on SDP -cfg$title <- paste(prefix,"Sustainability",sep="_") -cfg <- setScenario(cfg,c("LAMA_Sustainability","rcp1p9")) +cfg$title <- paste(prefix, "Sustainability", sep = "_") +cfg <- setScenario(cfg, c("rcp1p9")) +cfg <- setScenario(cfg, c("LAMA_Sustainability"), scenario_config = "config/projects/config_lama.csv") + cfg$gms$policy_countries30 <- all_iso_countries cfg$gms$policy_countries22 <- all_iso_countries cfg$gms$EFP_countries <- all_iso_countries @@ -55,8 +57,9 @@ cfg$gms$policy_countries56 <- all_iso_countries start_run(cfg,codeCheck=FALSE) ### Global Inequality, largely based on SSP4 -cfg$title <- paste(prefix,"Inequality",sep="_") -cfg <- setScenario(cfg,c("LAMA_Inequal","rcp1p9")) +cfg$title <- paste(prefix, "Inequality", sep = "_") +cfg <- setScenario(cfg, c("rcp1p9")) +cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -68,8 +71,9 @@ start_run(cfg,codeCheck=FALSE) #### Sensitivity scenarios ### LAMA_Inequal-SustDemand -cfg$title <- paste(prefix,"Inequality-SustDemand",sep="_") -cfg <- setScenario(cfg,c("LAMA_Inequal-SustDemand","rcp1p9")) +cfg$title <- paste(prefix, "Inequality-SustDemand", sep = "_") +cfg <- setScenario(cfg, c("rcp1p9")) +cfg <- setScenario(cfg, c("LAMA_Inequal-SustDemand"), scenario_config = "config/projects/config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -79,8 +83,9 @@ cfg$gms$policy_countries56 <- oecd90andEU start_run(cfg,codeCheck=FALSE) ### LAMA_Inequal-EnvirProt -cfg$title <- paste(prefix,"Inequality-EnvirProt",sep="_") -cfg <- setScenario(cfg,c("LAMA_Inequal-EnvirProt","rcp1p9")) +cfg$title <- paste(prefix, "Inequality-EnvirProt", sep = "_") +cfg <- setScenario(cfg, c("rcp1p9")) +cfg <- setScenario(cfg, c("LAMA_Inequal-EnvirProt"), scenario_config = "config/projects/config_lama.csv") cfg$gms$policy_countries30 <- all_iso_countries cfg$gms$policy_countries22 <- all_iso_countries cfg$gms$EFP_countries <- all_iso_countries @@ -90,8 +95,9 @@ cfg$gms$policy_countries56 <- oecd90andEU start_run(cfg,codeCheck=FALSE) ### LAMA_Inequal-GHGPrice -cfg$title <- paste(prefix,"Inequality-GHGPrice",sep="_") -cfg <- setScenario(cfg,c("LAMA_Inequal-GHGPrice","rcp1p9")) +cfg$title <- paste(prefix, "Inequality-GHGPrice", sep = "_") +cfg <- setScenario(cfg, c("rcp1p9")) +cfg <- setScenario(cfg, c("LAMA_Inequal-GHGPrice"), scenario_config = "config/projects/config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -101,8 +107,9 @@ cfg$gms$policy_countries56 <- all_iso_countries start_run(cfg,codeCheck=FALSE) ### Global Inequality with higher climate impacts -cfg$title <- paste(prefix,"Inequality-rcp7p0",sep="_") -cfg <- setScenario(cfg,c("LAMA_Inequal","rcp7p0")) +cfg$title <- paste(prefix, "Inequality-rcp7p0", sep = "_") +cfg <- setScenario(cfg, c("rcp7p0")) +cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU From 782375b53033f423d4ac62fedc6399db858e4175 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 17 Jul 2024 14:25:08 +0200 Subject: [PATCH 078/171] updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a1be749a..efcc173109 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 - **21_trade** refactor equations for enhanced readablility and improve documentation - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. +- **scripts** split scenario_config into project-specific configs ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` From 829ed16bbc3cf97ebd16fd6eadb93526201a6e48 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 17 Jul 2024 15:02:49 +0200 Subject: [PATCH 079/171] replace , with ; in navigate config --- config/projects/scenario_config_navigate.csv | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/config/projects/scenario_config_navigate.csv b/config/projects/scenario_config_navigate.csv index bf5afd55a3..30225cba3a 100644 --- a/config/projects/scenario_config_navigate.csv +++ b/config/projects/scenario_config_navigate.csv @@ -1,6 +1,6 @@ -,"NAVIGATE_AllOff","NAVIGATE_LandSup","NAVIGATE_LandDem","NAVIGATE_AllOn" -"gms$s15_exo_waste",0,0,1,1 -"gms$s15_exo_diet",0,0,1,1 -"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 +;"NAVIGATE_AllOff";"NAVIGATE_LandSup";"NAVIGATE_LandDem";"NAVIGATE_AllOn" +"gms$s15_exo_waste";0;0;1;1 +"gms$s15_exo_diet";0;0;1;1 +"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 138494242fbff138881c78c3e877f166b1421e1a Mon Sep 17 00:00:00 2001 From: Kristine Karstens Date: Wed, 17 Jul 2024 17:49:23 +0200 Subject: [PATCH 080/171] bugfix quotes --- config/projects/scenario_config_geniescp.csv | 32 ++++++++++---------- config/projects/scenario_config_navigate.csv | 12 ++++---- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config/projects/scenario_config_geniescp.csv b/config/projects/scenario_config_geniescp.csv index 5d12d8cb46..04c5088b79 100644 --- a/config/projects/scenario_config_geniescp.csv +++ b/config/projects/scenario_config_geniescp.csv @@ -1,16 +1,16 @@ -,"GENIE_SCP" -"gms$c_timesteps","coup2110" -"gms$c13_tccost","high" -"gms$c14_yields_scenario","nocc" -"gms$food","anthropometrics_jan18" -"gms$c20_scp_type","hydrogen" -"gms$s30_annual_max_growth","0.02" -"gms$factor_costs","sticky_feb18" -"gms$s44_cost_bii_missing",10000000 -"gms$c56_pollutant_prices","R32M46-SSP2EU-NPi" -"gms$c56_pollutant_prices_noselect","R32M46-SSP2EU-NPi" -"gms$c56_mute_ghgprices_until","y2020" -"gms$bioenergy","1st2ndgen_priced_feb24" -"gms$c60_1stgen_biodem","phaseout2020" -"gms$c60_2ndgen_biodem","R32M46-SSP2EU-NPi" -"gms$c60_2ndgen_biodem_noselect","R32M46-SSP2EU-NPi" +;GENIE_SCP +gms$c_timesteps;coup2110 +gms$c13_tccost;high +gms$c14_yields_scenario;nocc +gms$food;anthropometrics_jan18 +gms$c20_scp_type;hydrogen +gms$s30_annual_max_growth;0.02 +gms$factor_costs;sticky_feb18 +gms$s44_cost_bii_missing;10000000 +gms$c56_pollutant_prices;R32M46-SSP2EU-NPi +gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi +gms$c56_mute_ghgprices_until;y2020 +gms$bioenergy;1st2ndgen_priced_feb24 +gms$c60_1stgen_biodem;phaseout2020 +gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi +gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi diff --git a/config/projects/scenario_config_navigate.csv b/config/projects/scenario_config_navigate.csv index 30225cba3a..de112a2a6c 100644 --- a/config/projects/scenario_config_navigate.csv +++ b/config/projects/scenario_config_navigate.csv @@ -1,6 +1,6 @@ -;"NAVIGATE_AllOff";"NAVIGATE_LandSup";"NAVIGATE_LandDem";"NAVIGATE_AllOn" -"gms$s15_exo_waste";0;0;1;1 -"gms$s15_exo_diet";0;0;1;1 -"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 +;NAVIGATE_AllOff;NAVIGATE_LandSup;NAVIGATE_LandDem;NAVIGATE_AllOn +gms$s15_exo_waste;0;0;1;1 +gms$s15_exo_diet;0;0;1;1 +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 03cac2ce3cb021409e72e8703fd2ab5d6bdef252 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Thu, 18 Jul 2024 12:41:43 +0200 Subject: [PATCH 081/171] added out of bounds check --- CHANGELOG.md | 1 + scripts/output/extra/out_of_bounds_check.R | 59 ++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 scripts/output/extra/out_of_bounds_check.R diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a1be749a..25c7b89f3a 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/). ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` +- **script** added out of bounds check as output script - **70_livestock** added realization `fbask_jan16_sticky` - **script** check of variables needed in piamInterfaces in report_rds.R - **42_water_demand** added water abstraction type dimension for non-ag uses diff --git a/scripts/output/extra/out_of_bounds_check.R b/scripts/output/extra/out_of_bounds_check.R new file mode 100644 index 0000000000..6ec819be2d --- /dev/null +++ b/scripts/output/extra/out_of_bounds_check.R @@ -0,0 +1,59 @@ +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# -------------------------------------------------------------- +# description: checks variables for constraint violations +# comparison script: TRUE +# --------------------------------------------------------------- + +######################### +#### check obb #### +######################### +# Version 1.0, Florian Humpenoeder +# +library(gdx) +library(lucode2) +library(magpie4) + +options(error=function()traceback(2)) + +############################# BASIC CONFIGURATION ############################# +if(!exists("source_include")) { + outputdir <- file.path("output/",list.dirs("output/", full.names = FALSE, recursive = FALSE)) + #Define arguments that can be read from command line + lucode2::readArgs("outputdir") +} +############################################################################### +cat("\nStarting output generation\n") + +out <- NULL +missing <- NULL + +for (i in 1:length(outputdir)) { + print(paste("Processing",outputdir[i])) + gdx<-file.path(outputdir[i],"fulldata.gdx") + if(file.exists(gdx)) { + x <- readGDX(gdx, "ov*", types="parameters", field = "All") + for(i in names(x)) { + print(i) + try(z <- where(x[[i]][,,"level"] < x[[i]][,,"lower"] | x[[i]][,,"level"] > x[[i]][,,"upper"])$true, silent = TRUE) + if(exists("z")) { + if (length(z$individual) > 0) { + #print(x[[i]][z$regions,z$years,]) + for (r in z$regions) { + for (y in z$years) { + print(paste(i,r,y)) + print(x[[i]][r,y,]) + } + } + #print(x[[i]][z$regions,z$years,]) + } + rm(z) + } + } + } +} From feaa8d149d7f7247278d48843eb1996508df0ea5 Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:50:46 +0200 Subject: [PATCH 082/171] Update project_GCS.R --- scripts/start/projects/project_GCS.R | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/start/projects/project_GCS.R b/scripts/start/projects/project_GCS.R index a9bc2fff2e..55c3943e4f 100644 --- a/scripts/start/projects/project_GCS.R +++ b/scripts/start/projects/project_GCS.R @@ -54,7 +54,8 @@ start_run(cfg,codeCheck=FALSE) ### SSP2-Tland NDC rcp2p6 ########################## cfg$title <- "SSP2-Tland_NDC_rcp2p6" -cfg <- setScenario(cfg,c("SSP2","Tland","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg,c("SSP2","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg, c("Tland"), scenario_config = "config/projects/scenario_config_gcs.csv") start_run(cfg,codeCheck=FALSE) ### SSP1 NDC rcp2p6 ########################## @@ -93,14 +94,16 @@ start_run(cfg,codeCheck=FALSE) ### SSP2-Tland with climate policy parametrized from R21M42-SSP2-PkBudg900 cfg$title <- "SSP2-Tland_ssp2pkbudg900_rcp2p6" -cfg <- setScenario(cfg,c("SSP2","Tland","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg,c("SSP2","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg, c("Tland"), scenario_config = "config/projects/scenario_config_gcs.csv") cfg$gms$c56_pollutant_prices <- "R21M42-SSP2-PkBudg900" cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP2-PkBudg900" start_run(cfg,codeCheck=FALSE) ### SSP2-Tland with climate policy parametrized from R21M42-SDP-PkBudg1000 cfg$title <- "SSP2-Tland_sdppkbudg1000_rcp2p6" -cfg <- setScenario(cfg,c("SSP2","Tland","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg,c("SSP2","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg, c("Tland"), scenario_config = "config/projects/scenario_config_gcs.csv") cfg$gms$c56_pollutant_prices <- "R21M42-SDP-PkBudg1000" cfg$gms$c60_2ndgen_biodem <- "R21M42-SDP-PkBudg1000" start_run(cfg,codeCheck=FALSE) @@ -114,14 +117,16 @@ start_run(cfg,codeCheck=FALSE) ### SSP1-Tland with climate policy parametrized from R21M42-SSP1-PkBudg900 cfg$title <- "SSP1-Tland_ssp1pkbudg900_rcp2p6" -cfg <- setScenario(cfg,c("SSP1","Tland","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg,c("SSP1","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg, c("Tland"), scenario_config = "config/projects/scenario_config_gcs.csv") cfg$gms$c56_pollutant_prices <- "R21M42-SSP1-PkBudg900" cfg$gms$c60_2ndgen_biodem <- "R21M42-SSP1-PkBudg900" start_run(cfg,codeCheck=FALSE) ### SSP1-Tland with climate policy parametrized from R21M42-SDP-PkBudg1000 cfg$title <- "SSP1-Tland_sdppkbudg1000_rcp2p6" -cfg <- setScenario(cfg,c("SSP1","Tland","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg,c("SSP1","NDC","cc","rcp2p6")) +cfg <- setScenario(cfg, c("Tland"), scenario_config = "config/projects/scenario_config_gcs.csv") cfg$gms$c56_pollutant_prices <- "R21M42-SDP-PkBudg1000" cfg$gms$c60_2ndgen_biodem <- "R21M42-SDP-PkBudg1000" start_run(cfg,codeCheck=FALSE) From 67035cfee800594e34bf40f6895b53675efe6e8c Mon Sep 17 00:00:00 2001 From: David Klein Date: Thu, 18 Jul 2024 14:54:30 +0200 Subject: [PATCH 083/171] Change the logic used to decide whether bioenergy demand and ghg prices are read from a REMIND report: Decide individually for demand and price whether they are read from a report. Previously, they were only read if a path was given for both, or if a path was only given for bioenergy. --- scripts/start_functions.R | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/scripts/start_functions.R b/scripts/start_functions.R index 1ce4a2f9c5..9211c8c96c 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -300,12 +300,11 @@ start_run <- function(cfg, scenario = NULL, codeCheck = TRUE, lock_model = TRUE) message("done.") } - # If reports for both bioenergy and GHG prices are available convert them - # to MAgPIE input, save to the respective input folders, and use it as input - if (!is.na(cfg$path_to_report_bioenergy) & !is.na(cfg$path_to_report_ghgprices)) { - getReportData(cfg$path_to_report_bioenergy, cfg$path_to_report_ghgprices) - cfg <- gms::setScenario(cfg,"coupling") - } + # If available (i.e. paths are set) extract bioenergy and/or GHG prices + # from REMIND report and save them to the respective input folders + # Please note: For them to be used by the model, either the 'coupling' scenario + # must be selected or the corresponding switches must be set individually. + getReportData(cfg$path_to_report_bioenergy, cfg$path_to_report_ghgprices) # update all parameters which contain the levels and marginals # of all variables and equations @@ -594,17 +593,21 @@ getReportData <- function(path_to_report_bioenergy, path_to_report_ghgprices = N return(mag) } - # read REMIND report - message("Reading bioenergy_demand from ", path_to_report_bioenergy) - mag <- .readAndPrepare(path_to_report_bioenergy) - - .bioenergyDemand(mag) - - # write emission files, if specified use path_to_report_ghgprices instead of the bioenergy report - if (is.na(path_to_report_ghgprices)) { - message("Reading ghg prices from the same file (", path_to_report_bioenergy, ")") - .emissionPrices(mag) - } else { + # if paths are provided, read bioenergy demand and ghg prices from REMIND reports + if (!is.na(path_to_report_bioenergy)) { + message("Reading bioenergy_demand from ", path_to_report_bioenergy) + mag <- .readAndPrepare(path_to_report_bioenergy) + .bioenergyDemand(mag) + + if (path_to_report_ghgprices %in% path_to_report_bioenergy) { + message("Reading ghg prices from the same file (", path_to_report_bioenergy, ")") + .emissionPrices(mag) + } + } + + # read ghg prices from another REMIND report because path_to_report_bioenergy + # is different from path_to_report_ghgprices (including NA) + if (!is.na(path_to_report_ghgprices) && ! path_to_report_ghgprices %in% path_to_report_bioenergy) { message("Reading ghg prices from ", path_to_report_ghgprices) ghgmag <- .readAndPrepare(path_to_report_ghgprices) .emissionPrices(ghgmag) From bb4be69cccd9b681206f9f25ec1cd6b56e24356b Mon Sep 17 00:00:00 2001 From: Jan Steinhauser Date: Thu, 18 Jul 2024 15:12:50 +0200 Subject: [PATCH 084/171] Update GENIE project files --- ...geniescp.csv => scenario_config_genie.csv} | 14 ++++- scripts/start/projects/GENIE_0_default.R | 3 +- scripts/start/projects/GENIE_2_bm-priced.R | 13 ++--- scripts/start/projects/GENIE_3_bm-demand.R | 13 ++--- scripts/start/projects/GENIE_4_feedback.R | 53 +++++++++---------- 5 files changed, 48 insertions(+), 48 deletions(-) rename config/projects/{scenario_config_geniescp.csv => scenario_config_genie.csv} (59%) diff --git a/config/projects/scenario_config_geniescp.csv b/config/projects/scenario_config_genie.csv similarity index 59% rename from config/projects/scenario_config_geniescp.csv rename to config/projects/scenario_config_genie.csv index 04c5088b79..bd86fd965a 100644 --- a/config/projects/scenario_config_geniescp.csv +++ b/config/projects/scenario_config_genie.csv @@ -1,11 +1,22 @@ -;GENIE_SCP +;GENIE_SCP gms$c_timesteps;coup2110 +gms$sm_fix_SSP2;2020 +gms$sm_fix_cc;2020 gms$c13_tccost;high gms$c14_yields_scenario;nocc gms$food;anthropometrics_jan18 +gms$kfo_rd;livst_rum,livst_milk +gms$s15_food_subst_functional_form;2 gms$c20_scp_type;hydrogen +gms$s21_trade_tariff_startyear;2020 +gms$s22_conservation_start;2020 +gms$s22_conservation_target;2030 gms$s30_annual_max_growth;0.02 +gms$s32_hvarea;0 +gms$s35_hvarea;0 gms$factor_costs;sticky_feb18 +gms$s38_startyear_labor_substitution;2020 +gms$s42_efp_startyear;2020 gms$s44_cost_bii_missing;10000000 gms$c56_pollutant_prices;R32M46-SSP2EU-NPi gms$c56_pollutant_prices_noselect;R32M46-SSP2EU-NPi @@ -14,3 +25,4 @@ gms$bioenergy;1st2ndgen_priced_feb24 gms$c60_1stgen_biodem;phaseout2020 gms$c60_2ndgen_biodem;R32M46-SSP2EU-NPi gms$c60_2ndgen_biodem_noselect;R32M46-SSP2EU-NPi +gms$s73_timber_demand_switch;0 diff --git a/scripts/start/projects/GENIE_0_default.R b/scripts/start/projects/GENIE_0_default.R index 41df4836f4..248e67bfa6 100644 --- a/scripts/start/projects/GENIE_0_default.R +++ b/scripts/start/projects/GENIE_0_default.R @@ -36,8 +36,9 @@ cfg$input <- c(regional = "rev4.96_26df900e_magpie.tgz", cfg$output <- c("output_check", "rds_report") +#load config presetswrite it before starting the run. preset <- "GENIE_SCP" -cfg <- setScenario(cfg, c(preset)) #load config presets +cfg <- setScenario(cfg, c(preset), scenario_config = "config/projects/scenario_config_genie.csv") ### Identifier and folder ############################################### diff --git a/scripts/start/projects/GENIE_2_bm-priced.R b/scripts/start/projects/GENIE_2_bm-priced.R index a1988aa30f..e58c1b485d 100644 --- a/scripts/start/projects/GENIE_2_bm-priced.R +++ b/scripts/start/projects/GENIE_2_bm-priced.R @@ -36,11 +36,13 @@ cfg$input <- c(regional = "rev4.96_26df900e_magpie.tgz", cfg$output <- c("output_check", "rds_report") +#load config presetswrite it before starting the run. preset <- "GENIE_SCP" -cfg <- setScenario(cfg, c(preset)) #load config presetswrite it before starting the run. +cfg <- setScenario(cfg, c(preset), scenario_config = "config/projects/scenario_config_genie.csv") cfg$force_replace <- FALSE cfg$qos <- "priority" +cfg$partition <- "priority" ### Identifier and folder ############################################### @@ -81,13 +83,8 @@ for (bl in blV) { preflag <- paste0("MP", str_pad(mp, 2, pad = "0"), "BI", str_pad(bl * 100, 2, pad = "0")) cfg$results_folder <- paste("output", identifierFlag, preflag, ":title:", sep = "/") cfg$info$flag2 <- preflag - - if (mp != 0){ - m = 100 - mp - cfg$gms$c15_rumdairy_scp_scen <- paste0("sigmoid_", m, "pc_25_50") - } else { - cfg$gms$c15_rumdairy_scp_scen <- "constant" - } + + cfg$gms$s15_rumdairy_scp_substitution <- mp / 100 for (be in beV) { cfg$gms$s60_bioenergy_gj_price_1st <- be diff --git a/scripts/start/projects/GENIE_3_bm-demand.R b/scripts/start/projects/GENIE_3_bm-demand.R index 624e75c7be..5bca4b0229 100644 --- a/scripts/start/projects/GENIE_3_bm-demand.R +++ b/scripts/start/projects/GENIE_3_bm-demand.R @@ -36,11 +36,12 @@ cfg$input <- c(regional = "rev4.96_26df900e_magpie.tgz", cfg$output <- c("output_check", "extra/disaggregation", "rds_report") +#load config presetswrite it before starting the run. preset <- "GENIE_SCP" -cfg <- setScenario(cfg, c(preset)) #load config presetswrite it before starting the run. +cfg <- setScenario(cfg, c(preset), scenario_config = "config/projects/scenario_config_genie.csv") cfg$force_replace <- TRUE -cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby" ### Identifier and folder ############################################### @@ -81,13 +82,7 @@ for (bl in blV) { cfg$gms$c22_protect_scenario <- pa for (mp in mpV) { - - if (mp != 0){ - m = 100 - mp - cfg$gms$c15_rumdairy_scp_scen <- paste0("sigmoid_", m, "pc_25_50") - } else { - cfg$gms$c15_rumdairy_scp_scen <- "constant" - } + cfg$gms$s15_rumdairy_scp_substitution <- mp / 100 preflag <- paste0("MP", str_pad(mp, 2, pad = "0"), "BI", str_pad(bl * 100, 2, pad = "0") diff --git a/scripts/start/projects/GENIE_4_feedback.R b/scripts/start/projects/GENIE_4_feedback.R index 6a95f562e0..1fa097a562 100644 --- a/scripts/start/projects/GENIE_4_feedback.R +++ b/scripts/start/projects/GENIE_4_feedback.R @@ -36,8 +36,9 @@ cfg$input <- c(regional = "rev4.96_26df900e_magpie.tgz", cfg$output <- c("output_check", "extra/disaggregation", "rds_report") +#load config presetswrite it before starting the run. preset <- "GENIE_SCP" -cfg <- setScenario(cfg, c(preset)) #load config presetswrite it before starting the run. +cfg <- setScenario(cfg, c(preset), scenario_config = "config/projects/scenario_config_genie.csv") cfg$force_replace <- FALSE @@ -77,35 +78,29 @@ for (bl in blV) { cfg$gms$c22_protect_scenario <- pa for (mp in mpV) { + cfg$gms$s15_rumdairy_scp_substitution <- mp / 100 - if (mp != 0){ - m = 100 - mp - cfg$gms$c15_rumdairy_scp_scen <- paste0("sigmoid_", m, "pc_25_50") - } else { - cfg$gms$c15_rumdairy_scp_scen <- "constant" - } - - preflag <- paste0("MP", str_pad(mp, 2, pad = "0"), - "BD", bd, "BI", str_pad(bl * 100, 2, pad = "0") - ) - cfg$results_folder <- paste( - # "output", identifierFlag, preflag, ":title:", sep = "/" - "output", identifierFlag, ":title:", sep = "/" - ) - - n <- "Feedback_step13_400f" - m <- n - cfg$gms$c60_2ndgen_biodem <- n - cfg$gms$c56_pollutant_prices <- m - - - ############################################## - #runflag <- paste("feedback", f_flag, sep = "_") - runflag <- paste0(m, "") - - cfg$title <- paste0(preflag, runflag) - - start_run(cfg, codeCheck = FALSE) + preflag <- paste0("MP", str_pad(mp, 2, pad = "0"), + "BD", bd, "BI", str_pad(bl * 100, 2, pad = "0") + ) + cfg$results_folder <- paste( + # "output", identifierFlag, preflag, ":title:", sep = "/" + "output", identifierFlag, ":title:", sep = "/" + ) + + n <- "Feedback_step13_400f" + m <- n + cfg$gms$c60_2ndgen_biodem <- n + cfg$gms$c56_pollutant_prices <- m + + + ############################################## + #runflag <- paste("feedback", f_flag, sep = "_") + runflag <- paste0(m, "") + + cfg$title <- paste0(preflag, runflag) + + start_run(cfg, codeCheck = FALSE) } # MP replacement From 3954d3fc9df61d081f823a10f3dfd5c01507c03f Mon Sep 17 00:00:00 2001 From: David Klein Date: Thu, 18 Jul 2024 15:35:07 +0200 Subject: [PATCH 085/171] Add entry to CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b5a1be749a..741c0afbba 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 - **21_trade** refactor equations for enhanced readablility and improve documentation - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. +- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` From dd74dd497c0d553ea3386b7ce82b4cc3f2081600 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 18 Jul 2024 15:52:26 +0200 Subject: [PATCH 086/171] added optional fat for scp-based meat alternatives --- CHANGELOG.md | 2 +- config/default.cfg | 4 ++ literature.bib | 43 ++++++++++++++++++- .../15_food/anthro_iso_jun22/declarations.gms | 8 ++-- .../15_food/anthro_iso_jun22/exodietmacro.gms | 26 ++++++++++- modules/15_food/anthro_iso_jun22/input.gms | 1 + .../anthropometrics_jan18/declarations.gms | 8 ++-- .../15_food/anthropometrics_jan18/input.gms | 1 + .../anthropometrics_jan18/intersolve.gms | 26 ++++++++++- .../anthropometrics_jan18/presolve.gms | 26 ++++++++++- 10 files changed, 133 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7bd1007149..604fe65b91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### changed - **21_trade** refactor equations for enhanced readablility and improve documentation - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. -- **15_food** revision of SCP implementation for milk. Added demand for plant oil and sugar as ingredients for milk production using single cell protein. +- **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/config/default.cfg b/config/default.cfg index 578648c370..ffac245f93 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -397,6 +397,10 @@ cfg$gms$s15_rumdairy_substitution <- 0 # def = 0 # * options: "livst_rum,livst_milk", "livst_rum" or "livst_milk" cfg$gms$kfo_rd <- "livst_rum" #def = livst_rum +# * Switch for supplemental fat needed as ingredient for scp-based meat alternatives +# * options: 0 (=off), 1 (=on) +cfg$gms$s15_scp_supplement_fat_meat <- 0 # def = 0 + # * Convergence of livestock food calorie supply towards a kcal/cap/day target with or w/o substitution. # * The functional form and the start and target years of the food substitution can be specified below. # * options: 0 = no converge, 1 = convergence to target diff --git a/literature.bib b/literature.bib index 0dc54e8265..b2bd1e8991 100644 --- a/literature.bib +++ b/literature.bib @@ -1650,7 +1650,6 @@ @book{muehlhoff_milk_2013 year = {2013}, note = {OCLC: ocn865477080}, keywords = {Analysis, Dairy products in human nutrition, Milk, Milk in human nutrition}, - file = {Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:/Users/flo/Zotero/storage/CLD8RP2I/Muehlhoff et al. - 2013 - Milk and dairy products in human nutrition.pdf:application/pdf}, } @book{fao_food_2004, @@ -1664,5 +1663,45 @@ @book{fao_food_2004 publisher = {Food and Agriculture Organization of the United Nations}, editor = {{FAO}}, year = {2004}, - file = {FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:/Users/flo/Zotero/storage/ZSY5VYYI/FAO - 2004 - Food energy methods of analysis and conversion fa.pdf:application/pdf}, +} + + +@article{mazac_novelfoods_2022, + title = {Incorporation of novel foods in {European} diets can reduce global warming potential, water use and land use by over 80\%}, + volume = {3}, + copyright = {2022 The Author(s), under exclusive licence to Springer Nature Limited}, + issn = {2662-1355}, + url = {https://www.nature.com/articles/s43016-022-00489-9}, + doi = {10.1038/s43016-022-00489-9}, + abstract = {Global food systems face the challenge of providing healthy and adequate nutrition through sustainable means, which is exacerbated by climate change and increasing protein demand by the world’s growing population. Recent advances in novel food production technologies demonstrate potential solutions for improving the sustainability of food systems. Yet, diet-level comparisons are lacking and are needed to fully understand the environmental impacts of incorporating novel foods in diets. Here we estimate the possible reductions in global warming potential, water use and land use by replacing animal-source foods with novel or plant-based foods in European diets. Using a linear programming model, we optimized omnivore, vegan and novel food diets for minimum environmental impacts with nutrition and feasible consumption constraints. Replacing animal-source foods in current diets with novel foods reduced all environmental impacts by over 80\% and still met nutrition and feasible consumption constraints.}, + language = {en}, + number = {4}, + urldate = {2022-04-26}, + journal = {Nature Food}, + author = {Mazac, Rachel and Meinilä, Jelena and Korkalo, Liisa and Järviö, Natasha and Jalava, Mika and Tuomisto, Hanna L.}, + month = apr, + year = {2022}, + note = {Number: 4 + Publisher: Nature Publishing Group}, + keywords = {Environmental impact, Nutrition}, + pages = {286--293}, +} + + +@article{jarvio_LCA_MP_2021, + title = {An attributional life cycle assessment of microbial protein production: {A} case study on using hydrogen-oxidizing bacteria}, + volume = {776}, + issn = {0048-9697}, + shorttitle = {An attributional life cycle assessment of microbial protein production}, + url = {https://www.sciencedirect.com/science/article/pii/S0048969721008317}, + doi = {10.1016/j.scitotenv.2021.145764}, + abstract = {Novel food production technologies are being developed to address the challenges of securing sustainable and healthy nutrition for the growing global population. This study assessed the environmental impacts of microbial protein (MP) produced by autotrophic hydrogen-oxidizing bacteria (HOB). Data was collected from a company currently producing MP using HOB (hereafter simply referred to as MP) on a small-scale. Earlier studies have performed an environmental assessment of MP on a theoretical basis but no study yet has used empirical data. An attributional life cycle assessment (LCA) with a cradle-to-gate approach was used to quantify global warming potential (GWP), land use, freshwater and marine eutrophication potential, water scarcity, human (non-)carcinogenic toxicity, and the cumulative energy demand (CED) of MP production in Finland. A Monte Carlo analysis was performed to assess uncertainties while a sensitivity analysis was used to explore the impacts of alternative production options and locations. The results were compared with animal- and plant-based protein sources for human consumption as well as protein sources for feed. Electricity consumption had the highest contribution to environmental impacts. Therefore, the source of energy had a substantial impact on the results. MP production using hydropower as an energy source yielded 87.5\% lower GWP compared to using the average Finnish electricity mix. In comparison with animal-based protein sources for food production, MP had 53–100\% lower environmental impacts depending on the reference product and the source of energy assumed for MP production. When compared with plant-based protein sources for food production, MP had lower land and water use requirements, and eutrophication potential but GWP was reduced only if low-emission energy sources were used. Compared to protein sources for feed production, MP production often resulted in lower environmental impact for GWP (FHE), land use, and eutrophication and acidification potential, but generally caused high water scarcity and required more energy.}, + language = {en}, + urldate = {2022-02-16}, + journal = {Science of The Total Environment}, + author = {Järviö, Natasha and Maljanen, Netta-Leena and Kobayashi, Yumi and Ryynänen, Toni and Tuomisto, Hanna L.}, + month = jul, + year = {2021}, + keywords = {LCA, Food, Hydrogen-oxidizing bacteria, Cellular agriculture, Microbial protein}, + pages = {145764}, } diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 61bea53043..be844a4d37 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -184,9 +184,11 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g wet matter) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / + s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / + s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / + s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / + s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (g fat per 100 g dry weight) / 5 / + s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (g fat per g protein) / 0.66 / ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index d87504492d..22f8d39843 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -135,7 +135,31 @@ p15_kcal_pc_iso(t,iso,"oils") = p15_kcal_pc_iso(t,iso,"oils") p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); -*' +*' +*' The ratio of fat to protein in raw microbial biomass (used as single cell protein) is much lower than for +*' plant based meat alternatives and animal based meat products. If the desired microbial product is alternative meat, +*' this may require supplementation with plant based fats to more closely match other existing products. +*' It is therefore possible to choose whether microbial biomass should be supplemented with plant based oil, +*' which drives additional demand for plant based oil production in MAgPIE. +*' For alternative microbial meats supplemented with fat, the desired fat to protein ratio is given +*' as 2:3 on a mass basis, analogous to similar products. Because microbial biomass already contains some fats, +*' the additional amount of plant based fat needed is given as the difference between the amount of fat present +*' in microbial biomass and the amount of fat needed to reach the desired protein to fat ratio. +*' Unlike additional plant oil and sugar demand for microbial milk, the additional amount of plant fat needed +*' for microbial meat is calculated dynamically based on the protein content of microbial biomass. +*' This is because the microbial protein content varies depending on the specific type of microbes used +*' (e.g. bacteria or funghi), whereas the nutritional content of cow milk is assumed to be fixed. +*' If the microbial protein is therefore changed, the amount of fat must also change to keep the same +*' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates +*' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain +*' very little or no carbohydrates. +*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' +p15_kcal_pc_iso(t,iso,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_iso(t,iso,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / + fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * + s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); +*' *' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index 4aeb29ddcb..e890b03251 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -109,6 +109,7 @@ s15_exo_foodscen_functional_form Switch for functional form of exogenous food s15_exo_foodscen_start Food substitution start year / 2025 / s15_exo_foodscen_target Food substitution target year / 2050 / s15_exo_foodscen_convergence Convergence to exogenous food scenario (1) / 1 / +s15_scp_supplement_fat_meat Switch for supplemental fat needed as ingredient for scp-based meat alternatives (1) / 0 / ; table f15_household_balanceflow(t_all,i,kall,dm_ge_nr) Balance flow to take account of heterogeneous products and processes (mio. tDM) diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index e68c8c1492..5e7a9dc7c1 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -181,9 +181,11 @@ parameters ; scalars - s15_scp_fat_per_milk fat needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / - s15_scp_sugar_per_milk sugar needed as ingredient for scp milk (g per 100g wet matter) / 4.7 / - s15_scp_protein_per_milk protein needed as ingredient for scp milk (g per 100g wet matter) / 3.3 / + s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / + s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / + s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / + s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (g fat per 100 g dry weight) / 5 / + s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (g fat per g protein) / 0.66 / ; *' @code diff --git a/modules/15_food/anthropometrics_jan18/input.gms b/modules/15_food/anthropometrics_jan18/input.gms index 0ad27443bc..b24efd5ebd 100644 --- a/modules/15_food/anthropometrics_jan18/input.gms +++ b/modules/15_food/anthropometrics_jan18/input.gms @@ -88,6 +88,7 @@ s15_exo_foodscen_functional_form Switch for functional form of exogeno s15_exo_foodscen_start Food substitution start year / 2025 / s15_exo_foodscen_target Food substitution target year / 2050 / s15_exo_foodscen_convergence Convergence to exogenous food scenario (1) / 1 / +s15_scp_supplement_fat_meat Switch for supplemental fat needed as ingredient for scp-based meat alternatives (1) / 0 / ; table f15_household_balanceflow(t_all,i,kall,dm_ge_nr) Balance flow to take account of heterogeneous products and processes (mio. tDM) diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 05b69dcd8c..d6f377eb2f 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -251,7 +251,31 @@ p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); -*' +*' +*' The ratio of fat to protein in raw microbial biomass (used as single cell protein) is much lower than for +*' plant based meat alternatives and animal based meat products. If the desired microbial product is alternative meat, +*' this may require supplementation with plant based fats to more closely match other existing products. +*' It is therefore possible to choose whether microbial biomass should be supplemented with plant based oil, +*' which drives additional demand for plant based oil production in MAgPIE. +*' For alternative microbial meats supplemented with fat, the desired fat to protein ratio is given +*' as 2:3 on a mass basis, analogous to similar products. Because microbial biomass already contains some fats, +*' the additional amount of plant based fat needed is given as the difference between the amount of fat present +*' in microbial biomass and the amount of fat needed to reach the desired protein to fat ratio. +*' Unlike additional plant oil and sugar demand for microbial milk, the additional amount of plant fat needed +*' for microbial meat is calculated dynamically based on the protein content of microbial biomass. +*' This is because the microbial protein content varies depending on the specific type of microbes used +*' (e.g. bacteria or funghi), whereas the nutritional content of cow milk is assumed to be fixed. +*' If the microbial protein is therefore changed, the amount of fat must also change to keep the same +*' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates +*' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain +*' very little or no carbohydrates. +*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' +p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / + fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * + s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); +*' *' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 3cdb5ceebc..8a7142a21f 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -458,7 +458,31 @@ p15_kcal_pc_calibrated(t,i,"oils") = p15_kcal_pc_calibrated(t,i,"oils") p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") + sum(kfo_rd$sameas(kfo_rd,"livst_milk"), p15_protein_pc_scp(t,i,kfo_rd)) / s15_scp_protein_per_milk * s15_scp_sugar_per_milk * fm_nutrition_attributes(t, "sugar" ,"kcal"); -*' +*' +*' The ratio of fat to protein in raw microbial biomass (used as single cell protein) is much lower than for +*' plant based meat alternatives and animal based meat products. If the desired microbial product is alternative meat, +*' this may require supplementation with plant based fats to more closely match other existing products. +*' It is therefore possible to choose whether microbial biomass should be supplemented with plant based oil, +*' which drives additional demand for plant based oil production in MAgPIE. +*' For alternative microbial meats supplemented with fat, the desired fat to protein ratio is given +*' as 2:3 on a mass basis, analogous to similar products. Because microbial biomass already contains some fats, +*' the additional amount of plant based fat needed is given as the difference between the amount of fat present +*' in microbial biomass and the amount of fat needed to reach the desired protein to fat ratio. +*' Unlike additional plant oil and sugar demand for microbial milk, the additional amount of plant fat needed +*' for microbial meat is calculated dynamically based on the protein content of microbial biomass. +*' This is because the microbial protein content varies depending on the specific type of microbes used +*' (e.g. bacteria or funghi), whereas the nutritional content of cow milk is assumed to be fixed. +*' If the microbial protein is therefore changed, the amount of fat must also change to keep the same +*' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates +*' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain +*' very little or no carbohydrates. +*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' +p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / + fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * + s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); +*' *' @stop * Conditional reduction of livestock products (without fish) depending on s15_kcal_pc_livestock_supply_target. From 277d21fc0a685e2136330488f897d5f9a2677cf0 Mon Sep 17 00:00:00 2001 From: Jan Dietrich Date: Thu, 18 Jul 2024 16:38:36 +0200 Subject: [PATCH 087/171] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Florian Humpenöder --- scripts/output/extra/out_of_bounds_check.R | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/output/extra/out_of_bounds_check.R b/scripts/output/extra/out_of_bounds_check.R index 6ec819be2d..b5489eac17 100644 --- a/scripts/output/extra/out_of_bounds_check.R +++ b/scripts/output/extra/out_of_bounds_check.R @@ -7,7 +7,7 @@ # -------------------------------------------------------------- # description: checks variables for constraint violations -# comparison script: TRUE +# comparison script: FALSE # --------------------------------------------------------------- ######################### @@ -17,7 +17,7 @@ # library(gdx) library(lucode2) -library(magpie4) +library(magclass) options(error=function()traceback(2)) @@ -30,8 +30,6 @@ if(!exists("source_include")) { ############################################################################### cat("\nStarting output generation\n") -out <- NULL -missing <- NULL for (i in 1:length(outputdir)) { print(paste("Processing",outputdir[i])) @@ -43,14 +41,12 @@ for (i in 1:length(outputdir)) { try(z <- where(x[[i]][,,"level"] < x[[i]][,,"lower"] | x[[i]][,,"level"] > x[[i]][,,"upper"])$true, silent = TRUE) if(exists("z")) { if (length(z$individual) > 0) { - #print(x[[i]][z$regions,z$years,]) for (r in z$regions) { for (y in z$years) { print(paste(i,r,y)) print(x[[i]][r,y,]) } } - #print(x[[i]][z$regions,z$years,]) } rm(z) } From 5002cd8b78f77bd6a622a8e2fae61bccfe07c631 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 18 Jul 2024 16:53:27 +0200 Subject: [PATCH 088/171] update --- literature.bib | 35 ++++++++----------- .../15_food/anthro_iso_jun22/declarations.gms | 2 +- .../15_food/anthro_iso_jun22/exodietmacro.gms | 2 +- .../anthropometrics_jan18/declarations.gms | 2 +- .../anthropometrics_jan18/intersolve.gms | 2 +- .../anthropometrics_jan18/presolve.gms | 2 +- 6 files changed, 19 insertions(+), 26 deletions(-) diff --git a/literature.bib b/literature.bib index b2bd1e8991..64b837e368 100644 --- a/literature.bib +++ b/literature.bib @@ -1665,29 +1665,22 @@ @book{fao_food_2004 year = {2004}, } - -@article{mazac_novelfoods_2022, - title = {Incorporation of novel foods in {European} diets can reduce global warming potential, water use and land use by over 80\%}, - volume = {3}, - copyright = {2022 The Author(s), under exclusive licence to Springer Nature Limited}, - issn = {2662-1355}, - url = {https://www.nature.com/articles/s43016-022-00489-9}, - doi = {10.1038/s43016-022-00489-9}, - abstract = {Global food systems face the challenge of providing healthy and adequate nutrition through sustainable means, which is exacerbated by climate change and increasing protein demand by the world’s growing population. Recent advances in novel food production technologies demonstrate potential solutions for improving the sustainability of food systems. Yet, diet-level comparisons are lacking and are needed to fully understand the environmental impacts of incorporating novel foods in diets. Here we estimate the possible reductions in global warming potential, water use and land use by replacing animal-source foods with novel or plant-based foods in European diets. Using a linear programming model, we optimized omnivore, vegan and novel food diets for minimum environmental impacts with nutrition and feasible consumption constraints. Replacing animal-source foods in current diets with novel foods reduced all environmental impacts by over 80\% and still met nutrition and feasible consumption constraints.}, - language = {en}, - number = {4}, - urldate = {2022-04-26}, - journal = {Nature Food}, - author = {Mazac, Rachel and Meinilä, Jelena and Korkalo, Liisa and Järviö, Natasha and Jalava, Mika and Tuomisto, Hanna L.}, - month = apr, - year = {2022}, - note = {Number: 4 - Publisher: Nature Publishing Group}, - keywords = {Environmental impact, Nutrition}, - pages = {286--293}, +@article{mazac_novelfoods_2023, + title = {Environmental and nutritional {Life} {Cycle} {Assessment} of novel foods in meals as transformative food for the future}, + volume = {876}, + issn = {0048-9697}, + url = {https://www.sciencedirect.com/science/article/pii/S0048969723014122}, + doi = {10.1016/j.scitotenv.2023.162796}, + abstract = {Sustainable diets are key for mitigating further anthropogenic climate change and meeting future health and sustainability goals globally. Given that current diets need to change significantly, novel/future foods (e.g., insect meal, cultured meat, microalgae, mycoprotein) present options for protein alternatives in future diets with lower total environmental impacts than animal source foods. Comparisons at the more concrete meal level would help consumers better understand the scale of environmental impacts of single meals and substitutability of animal sourced foods with novel foods. Our aim was to compare the environmental impacts of meals including novel/future foods with those of vegan and omnivore meals. We compiled a database on environmental impacts and nutrient composition of novel/future foods and modeled the impacts of calorically similar meals. Additionally, we applied two nutritional Life Cycle Assessment (nLCA) methods to compare the meals in terms of nutritional content and environmental impacts in one index. All meals with novel/future foods had up to 88 \% less Global Warming Potential, 83 \% less land use, 87 \% less scarcity-weighted water use, 95 \% less freshwater eutrophication, 78 \% less marine eutrophication, and 92 \% less terrestrial acidification impacts than similar meals with animal source foods, while still offering the same nutritional value as vegan and omnivore meals. The nLCA indices of most novel/future food meals are similar to protein-rich plant-based alternative meals and show fewer environmental impacts in terms of nutrient richness than most animal source meals. Substituting animal source foods with certain novel/future foods may provide for nutritious meals with substantial environmental benefits for sustainably transforming future food systems.}, + urldate = {2024-07-18}, + journal = {Science of The Total Environment}, + author = {Mazac, Rachel and Järviö, Natasha and Tuomisto, Hanna L.}, + month = jun, + year = {2023}, + keywords = {Acidification, Alternative proteins, Environmental impacts, Eutrophication, Global Warming Potential, Land/water use, Novel foods, Sustainable meals}, + pages = {162796}, } - @article{jarvio_LCA_MP_2021, title = {An attributional life cycle assessment of microbial protein production: {A} case study on using hydrogen-oxidizing bacteria}, volume = {776}, diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index be844a4d37..b928660c5c 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -140,7 +140,7 @@ parameters p15_kcal_pc_iso_livestock_orig(t,iso) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_iso_rumdairy_orig(t,iso) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) p15_kcal_pc_iso_plant_orig(t,iso) Auxiliary parameter for per capita plant-based food consumption - basis for scenarios of livestock food substitution (kcal per capita per day) - p15_protein_pc_iso_scp(t,iso,kfo_rd) Per capita consumption of SCP in food demand model after price shock on country level (protein per capita per day) + p15_protein_pc_iso_scp(t,iso,kfo_rd) Per capita consumption of SCP in food demand model after price shock on country level (g protein per capita per day) p15_livestock_kcal_structure_orig(t,iso,kfo_lp) Auxiliary parameter for livestock kcal structure - basis for scenarios of livestock food substitution (1) p15_rumdairy_kcal_structure_orig(t,iso,kfo_rd) Auxiliary parameter for ruminant and dairy kcal structure - basis for scenarios of ruminant-based food substitution (1) p15_plant_kcal_structure_orig(t,iso,kfo_pp) Auxiliary parameter for plant-based food kcal structure - basis for scenarios of livestock food substitution (1) diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index 22f8d39843..871c88a4b6 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -153,7 +153,7 @@ p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") *' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates *' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain *' very little or no carbohydrates. -*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' Data sources: @mazac_novelfoods_2023 and @jarvio_LCA_MP_2021 *' p15_kcal_pc_iso(t,iso,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_iso(t,iso,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 5e7a9dc7c1..088fb3dab1 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -141,7 +141,7 @@ parameters p15_kcal_pc_iso(t,iso,kfo) Per capita consumption in food demand model after price shock on country level (kcal per capita per day) p15_kcal_pc(t,i,kfo) Per capita consumption in food demand model after price shock on regional level (kcal per capita per day) p15_kcal_pc_calibrated(t,i,kfo) Calibrated per capita consumption in food demand model after price shock (kcal per capita per day) - p15_protein_pc_scp(t,i,kfo_rd) Calibrated per capita consumption of SCP in food demand model after price shock (protein per capita per day) + p15_protein_pc_scp(t,i,kfo_rd) Calibrated per capita consumption of SCP in food demand model after price shock (g protein per capita per day) p15_kcal_pc_calibrated_orig(t,i,kfo) Auxiliary parameter for per capita food consumption - basis for convergence into waste and diet scenarios (kcal per capita per day) p15_kcal_pc_calibrated_livestock_orig(t,i) Auxiliary parameter for per capita livestock consumption - basis for scenarios of livestock food substitution (kcal per capita per day) p15_kcal_pc_calibrated_rumdairy_orig(t,i) Auxiliary parameter for per capita ruminant and dairy consumption - basis for scenarios of ruminant-based food substitution (kcal per capita per day) diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index d6f377eb2f..6ab3cee692 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -269,7 +269,7 @@ p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") *' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates *' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain *' very little or no carbohydrates. -*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' Data sources: @mazac_novelfoods_2023 and @jarvio_LCA_MP_2021 *' p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 8a7142a21f..0a6c5f3fe6 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -476,7 +476,7 @@ p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") *' fat to protein ratio. It is also assumed, unlike for microbial milk, that additional carbohydrates *' (e.g., sugar) are not required for alternative microbial meats. This is because meat products contain *' very little or no carbohydrates. -*' Data sources: @mazac_novelfoods_2022 and @jarvio_LCA_MP_2021 +*' Data sources: @mazac_novelfoods_2023 and @jarvio_LCA_MP_2021 *' p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / From f9d16caca6ac882a803746695f6ede0ba97aa644 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 18 Jul 2024 18:21:11 +0200 Subject: [PATCH 089/171] switched time steps to less_TS for better magicc results --- scripts/start/projects/project_EAT2p0.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 7408842a52..29fc6c8e15 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -55,6 +55,9 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # Trade: BAU bau <- function(cfg) { + # time steps until 2150 + gms$c_timesteps <- "less_TS" + # for feasibility cfg$gms$s80_optfile <- 1 From b772452150e8a1e7d40f28a5627c169caa5847df Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 18 Jul 2024 18:43:12 +0200 Subject: [PATCH 090/171] bugfix --- scripts/start/projects/project_EAT2p0.R | 3 --- scripts/start/projects/project_EAT2p0_DeepDive.R | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 29fc6c8e15..7408842a52 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -55,9 +55,6 @@ cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) # Trade: BAU bau <- function(cfg) { - # time steps until 2150 - gms$c_timesteps <- "less_TS" - # for feasibility cfg$gms$s80_optfile <- 1 diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 41df408aee..1cc92589e3 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -63,6 +63,9 @@ cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI", "EL2_default")) # Trade: BAU bau <- function(cfg) { + # time steps until 2150 + cfg$gms$c_timesteps <- "less_TS" + # for feasibility cfg$gms$s80_optfile <- 1 From 669017e7e2f5f2cdde78c815fc55b577a1300828 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 09:14:23 +0200 Subject: [PATCH 091/171] update --- modules/56_ghg_policy/price_aug22/input.gms | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index 75127ec261..54eed74f6e 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -76,9 +76,9 @@ scalars s56_timesteps number of time steps for C price interpolation (1) / 0 / s56_offset helper for C price interpolation (1) / 0 / s56_ghgprice_fader Switch for GHG policy fader (1=on 0=off) / 1 / - s56_fader_start start year of GHG policy fade-in (1) / 2025 / + s56_fader_start start year of GHG policy fade-in (1) / 2030 / s56_fader_target target year of GHG policy fade-in (1) / 2050 / - s56_fader_functional_form blub / 1 / + s56_fader_functional_form Switch for functional form of GHG policy fader (1=linear 2=sigmoid) / 1 / ; $setglobal c56_pollutant_prices R32M46-SSP2EU-NPi From 4d4233dd477d5d7ee5a739da9605adcaae9c7bd3 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 09:25:17 +0200 Subject: [PATCH 092/171] bugfix --- scripts/start_functions.R | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/start_functions.R b/scripts/start_functions.R index 9211c8c96c..cd6f48738f 100644 --- a/scripts/start_functions.R +++ b/scripts/start_functions.R @@ -578,6 +578,7 @@ getReportData <- function(path_to_report_bioenergy, path_to_report_ghgprices = N } .readAndPrepare <- function(mifPath) { + require(magclass) rep <- read.report(mifPath, as.list = FALSE) if (length(getNames(rep, dim = "scenario")) != 1) stop("getReportData: report contains more or less than 1 scenario.") mag <- collapseNames(rep) # get rid of scenario and model dimension if they exist From 13709ef63cf5e4f8cf8f8683fc4409dd1d8a6427 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 10:15:03 +0200 Subject: [PATCH 093/171] bugfix --- modules/15_food/anthro_iso_jun22/declarations.gms | 4 ++-- modules/15_food/anthropometrics_jan18/declarations.gms | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index b928660c5c..5688ef52dc 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -187,8 +187,8 @@ scalars s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / - s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (g fat per 100 g dry weight) / 5 / - s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (g fat per g protein) / 0.66 / + s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / + s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (t fat per t protein) / 0.66 / ; diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index 088fb3dab1..f719cb26ef 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -184,8 +184,8 @@ scalars s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / - s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (g fat per 100 g dry weight) / 5 / - s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (g fat per g protein) / 0.66 / + s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / + s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (t fat per t protein) / 0.66 / ; *' @code From a4597fe5b8d1a5bf7f0f981184592d6ec29adec7 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 12:20:06 +0200 Subject: [PATCH 094/171] update --- modules/56_ghg_policy/price_aug22/input.gms | 31 ++++++++++--------- modules/56_ghg_policy/price_aug22/preloop.gms | 6 ++-- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/modules/56_ghg_policy/price_aug22/input.gms b/modules/56_ghg_policy/price_aug22/input.gms index 54eed74f6e..004c68d53a 100644 --- a/modules/56_ghg_policy/price_aug22/input.gms +++ b/modules/56_ghg_policy/price_aug22/input.gms @@ -62,23 +62,26 @@ sets UGA,UKR,UMI,URY,USA,UZB,VAT,VCT,VEN,VGB, VIR,VNM,VUT,WLF,WSM,YEM,ZAF,ZMB,ZWE / +pollutants_fader(pollutants) pollutants affected by GHG policy fader / co2_c, ch4, n2o_n_direct, n2o_n_indirect, nh3_n, no2_n, no3_n / + ; scalars - s56_limit_ch4_n2o_price upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 4000 / - s56_cprice_red_factor reduction factor for CO2 price (-) / 1 / - s56_minimum_cprice Minium C price for future time steps (USD per tC) / 0 / - s56_ghgprice_devstate_scaling Switch for scaling GHG price with development state (1=on 0=off) / 0 / - s56_c_price_induced_aff Switch for C price driven afforestation (1=on 0=off) / 1 / - s56_c_price_exp_aff c price expectation for afforestation (years) / 50 / - s56_buffer_aff share of carbon credits for afforestation projects pooled in a buffer (1) / 0.5 / - s56_counter counter for C price interpolation (1) / 0 / - s56_timesteps number of time steps for C price interpolation (1) / 0 / - s56_offset helper for C price interpolation (1) / 0 / - s56_ghgprice_fader Switch for GHG policy fader (1=on 0=off) / 1 / - s56_fader_start start year of GHG policy fade-in (1) / 2030 / - s56_fader_target target year of GHG policy fade-in (1) / 2050 / - s56_fader_functional_form Switch for functional form of GHG policy fader (1=linear 2=sigmoid) / 1 / + s56_limit_ch4_n2o_price Upper limit for CH4 and N2O GHG prices (USD05MER per tC) / 4000 / + s56_cprice_red_factor Reduction factor for CO2 price (-) / 1 / + s56_minimum_cprice Minium C price for future time steps (USD per tC) / 0 / + s56_ghgprice_devstate_scaling Switch for scaling GHG price with development state (1=on 0=off) / 0 / + s56_c_price_induced_aff Switch for C price driven re-afforestation (1=on 0=off) / 1 / + s56_c_price_exp_aff Time horizon of CO2 price expectation for re-afforestation (years) / 50 / + s56_buffer_aff Share of carbon credits for re-afforestation projects pooled in a buffer (1) / 0.5 / + s56_counter Counter for C price interpolation (1) / 0 / + s56_timesteps Number of time steps for C price interpolation (1) / 0 / + s56_offset Helper for C price interpolation (1) / 0 / + s56_ghgprice_fader Switch for GHG policy fader (1=on 0=off) / 0 / + s56_fader_start Start year of GHG policy fade-in (1) / 2030 / + s56_fader_end End year of GHG policy fade-in (1) / 2050 / + s56_fader_target Target value of GHG policy fade-in in end year / 1 / + s56_fader_functional_form Switch for functional form of GHG policy fader (1=linear 2=sigmoid) / 1 / ; $setglobal c56_pollutant_prices R32M46-SSP2EU-NPi diff --git a/modules/56_ghg_policy/price_aug22/preloop.gms b/modules/56_ghg_policy/price_aug22/preloop.gms index 43b19677a2..9d0f6d8887 100644 --- a/modules/56_ghg_policy/price_aug22/preloop.gms +++ b/modules/56_ghg_policy/price_aug22/preloop.gms @@ -69,14 +69,14 @@ im_pollutant_prices(t_all,i,"co2_c",emis_source) = im_pollutant_prices(t_all,i," im_pollutant_prices(t_all,i,pollutants,emis_source)$(s56_ghgprice_devstate_scaling = 1) = im_pollutant_prices(t_all,i,pollutants,emis_source)*im_development_state(t_all,i); if (s56_fader_functional_form = 1, - m_linear_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,1); + m_linear_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,s56_fader_target); elseif s56_fader_functional_form = 2, - m_sigmoid_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,1); + m_sigmoid_time_interpol(p56_fader,s56_fader_start,s56_fader_target,0,s56_fader_target); ); ***build and apply temporal fader for GHG policy p56_fader_reg(t_all,i) = p56_fader(t_all) * p56_region_fader_shr(t_all,i) + p56_fader(t_all) * (1-p56_region_fader_shr(t_all,i)); -im_pollutant_prices(t_all,i,pollutants,emis_source)$(s56_ghgprice_fader = 1) = im_pollutant_prices(t_all,i,pollutants,emis_source) * p56_fader_reg(t_all,i); +im_pollutant_prices(t_all,i,pollutants_fader,emis_source)$(s56_ghgprice_fader = 1) = im_pollutant_prices(t_all,i,pollutants_fader,emis_source) * p56_fader_reg(t_all,i); ***GHG emission policy im_pollutant_prices(t_all,i,pollutants,emis_source) = im_pollutant_prices(t_all,i,pollutants,emis_source) * f56_emis_policy("%c56_emis_policy%",pollutants,emis_source); From a016d260f0e654e23efce5877f6ce2447504374b Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 12:24:22 +0200 Subject: [PATCH 095/171] 80_optimization abort GAMS in case of execution errors --- CHANGELOG.md | 1 + modules/80_optimization/nlp_apr17/solve.gms | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b42e4b6ec8..e7f79d0752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **21_trade** refactor equations for enhanced readablility and improve documentation - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. +- **80_optimization** abort GAMS in case of execution errors ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 0a0ba81a4e..3d3ea109e6 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -25,6 +25,10 @@ $onecho > conopt4.op2 Flg_Prep = FALSE $offecho +if(execerror > 0, + abort "Execution error. Check your .lst file."; +); + *' @code solve magpie USING nlp MINIMIZING vm_cost_glo; *' Optional second solve statement From 6c0bfe51cdd991ee6d4e1faf72070f940da44692 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 14:52:27 +0200 Subject: [PATCH 096/171] - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy --- CHANGELOG.md | 1 + config/default.cfg | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f79d0752..05f896b167 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **70_livestock** added realization `fbask_jan16_sticky` - **script** check of variables needed in piamInterfaces in report_rds.R - **42_water_demand** added water abstraction type dimension for non-ag uses +- **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy ### removed - diff --git a/config/default.cfg b/config/default.cfg index 578648c370..9fdf8dafac 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1501,6 +1501,19 @@ cfg$gms$s56_ghgprice_devstate_scaling <- 0 # def = 0 # * lowers the economic incentive for CO2 emission reduction (avoided deforestation) and afforestation cfg$gms$s56_cprice_red_factor <- 1 # def = 1 +# * Switch for GHG policy fader (1=on 0=off) +cfg$gms$s56_ghgprice_fader <- 0 # def = 0 +# * Pollutants on which the GHG policy fader will applied +cfg$gms$pollutants_fader <- c("co2_c", "ch4", "n2o_n_direct", "n2o_n_indirect", "nh3_n", "no2_n", "no3_n") # def = all pollutants +# * Start year of GHG policy fade-in +cfg$gms$s56_fader_start <- 2030 # def = 2030 +# * End year of GHG policy fade-in +cfg$gms$s56_fader_end <- 2050 # def = 2050 +# * Target value of GHG policy fade-in in end year +cfg$gms$s56_fader_target <- 1 # def = 1 +# * Switch for functional form of GHG policy fader (1=linear 2=sigmoid) +cfg$gms$s56_fader_functional_form <- 1 # def = 1 + # * GHG emission price scenario # * Note: For best consistency it is recommended to use trajectories from the most recent # * coupled REMIND-MAgPIE runs. Currently, this is R32M46. From 3e577f0a0625fad6e968929451b64957be61b13b Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 19 Jul 2024 14:55:21 +0200 Subject: [PATCH 097/171] - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy --- modules/56_ghg_policy/price_aug22/declarations.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/56_ghg_policy/price_aug22/declarations.gms b/modules/56_ghg_policy/price_aug22/declarations.gms index 5ea44733bc..70e98e4264 100644 --- a/modules/56_ghg_policy/price_aug22/declarations.gms +++ b/modules/56_ghg_policy/price_aug22/declarations.gms @@ -15,7 +15,7 @@ parameters p56_region_fader_shr(t_all,i) GHG policy fader share of the region (1) p56_country_dummy2(iso) Dummy parameter indicating whether country is affected by selected GHG policy fader (1) p56_fader(t_all) GHG policy fader (1) - p56_fader_reg(t_all,i) GHG policy fader (1) + p56_fader_reg(t_all,i) Regional GHG policy fader (1) ; equations From bca09d98dc764fbf7a712bd7a85c507f10d5c2a1 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 21 Jul 2024 21:43:25 +0200 Subject: [PATCH 098/171] save --- modules/58_peatland/v2/presolve.gms | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index cb977936b4..ed1b82d295 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -57,4 +57,17 @@ p58_scalingFactorRed(t,j,manPeat58) = $(pc58_peatland(j,manPeat58) > 1e-10 AND pc58_manLand(j,manPeat58) > 1e-10) + 0$(pc58_peatland(j,manPeat58) <= 1e-10 OR pc58_manLand(j,manPeat58) <= 1e-10); +*' Peatland scaling factor for expansion: maxPeatland-manPeatland / maxLand-manLand = availPeatlandExp / availLandExp +*' See macro `m58_LandLeft` for details. + +p58_avail_peatland_exp2(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); +p58_avail_land_exp2(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); + +p58_scalingFactorExp(t,j) = + (p58_avail_peatland_exp2(t,j) / p58_avail_land_exp2(t,j)) + $(p58_avail_peatland_exp2(t,j) > 1e-10 AND p58_avail_land_exp2(t,j) > 1e-10) + + 0$(p58_avail_peatland_exp2(t,j) <= 1e-10 OR p58_avail_land_exp2(t,j) <= 1e-10); +p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; + + *' @stop From eee6654ac3175308e21ca1d0dc40ea68daf4e7a1 Mon Sep 17 00:00:00 2001 From: florianh Date: Sun, 21 Jul 2024 21:45:56 +0200 Subject: [PATCH 099/171] save --- modules/58_peatland/v2/declarations.gms | 3 +++ modules/58_peatland/v2/equations.gms | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index a33ac2a46b..24384ca086 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -8,6 +8,7 @@ parameters pc58_peatland(j,land58) Peatland area (mio. ha) pc58_manLand(j,manPeat58) Managed land area (mio. ha) + p58_scalingFactorExp(t,j) Scaling factor for peatland expansion (1) p58_scalingFactorRed(t,j,manPeat58) Scaling factor for peatland reduction (1) p58_mapping_cell_climate(j,clcl58) Mapping between cells and climate regions (binary) i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD05MER per ha) @@ -15,6 +16,8 @@ parameters i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD05MER per ha) i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD05MER per ha) i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD05MER per ha) + p58_avail_peatland_exp2(t,j) + p58_avail_land_exp2(t,j) ; equations diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 45f4e82d1c..0f2886f86e 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -41,7 +41,7 @@ q58_peatlandMan(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,manPeat58) =e= pc58_peatland(j2,manPeat58) - + v58_manLandExp(j2,manPeat58) * v58_scalingFactorExp(j2,manPeat58) + + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)); - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)); *' Peatland scaling factor for expansion: (maxPeatland - totalManagedPeatland) / (maxLand - totalManagedLand). From 890166909b6a2a9954f21ea362558db7e7f11dbd Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 22 Jul 2024 12:26:55 +0200 Subject: [PATCH 100/171] rename --- modules/15_food/anthro_iso_jun22/declarations.gms | 2 +- modules/15_food/anthro_iso_jun22/exodietmacro.gms | 2 +- modules/15_food/anthropometrics_jan18/declarations.gms | 2 +- modules/15_food/anthropometrics_jan18/intersolve.gms | 2 +- modules/15_food/anthropometrics_jan18/presolve.gms | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 5688ef52dc..f25d190e74 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -187,7 +187,7 @@ scalars s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / - s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / + s15_scp_fat_content Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (t fat per t protein) / 0.66 / ; diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index 871c88a4b6..73485274b6 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -158,7 +158,7 @@ p15_kcal_pc_iso(t,iso,"sugar") = p15_kcal_pc_iso(t,iso,"sugar") p15_kcal_pc_iso(t,iso,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_iso(t,iso,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_iso_scp(t,iso,kfo_rd)) / fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * - s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); + s15_scp_fat_protein_ratio_meat - s15_scp_fat_content) * fm_nutrition_attributes(t,"oils", "kcal"); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index f719cb26ef..b2f5ce1b6c 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -184,7 +184,7 @@ scalars s15_scp_fat_per_milk Fat needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / s15_scp_sugar_per_milk Sugar needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 4.7 / s15_scp_protein_per_milk Protein needed as ingredient for scp-based milk alternative (g per 100g wet matter) / 3.3 / - s15_scp_fat_per_meat Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / + s15_scp_fat_content Fat content of microbial biomass based on Solein from Solar foods (t fat per t DM) / 0.05 / s15_scp_fat_protein_ratio_meat Ratio of protein to fat in both plant based meat alternatives and current meat products (t fat per t protein) / 0.66 / ; diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 6ab3cee692..4434095a33 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -274,7 +274,7 @@ p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * - s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); + s15_scp_fat_protein_ratio_meat - s15_scp_fat_content) * fm_nutrition_attributes(t,"oils", "kcal"); *' *' @stop diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 0a6c5f3fe6..38dbeb3df1 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -481,7 +481,7 @@ p15_kcal_pc_calibrated(t,i,"sugar") = p15_kcal_pc_calibrated(t,i,"sugar") p15_kcal_pc_calibrated(t,i,"oils")$(s15_scp_supplement_fat_meat = 1) = p15_kcal_pc_calibrated(t,i,"oils") + sum(kfo_rd$sameas(kfo_rd,"livst_rum"), p15_protein_pc_scp(t,i,kfo_rd)) / fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * - s15_scp_fat_protein_ratio_meat - s15_scp_fat_per_meat) * fm_nutrition_attributes(t,"oils", "kcal"); + s15_scp_fat_protein_ratio_meat - s15_scp_fat_content) * fm_nutrition_attributes(t,"oils", "kcal"); *' *' @stop From 754b98ac699ae2b3c7240579c83df3555c87a907 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 22 Jul 2024 16:26:52 +0200 Subject: [PATCH 101/171] update --- .../dynamic_may24/declarations.gms | 4 +++ .../32_forestry/dynamic_may24/equations.gms | 9 ++++-- .../32_forestry/dynamic_may24/postsolve.gms | 8 +++++ modules/58_peatland/v2/declarations.gms | 12 ++++---- modules/58_peatland/v2/equations.gms | 16 +++++----- modules/58_peatland/v2/postsolve.gms | 12 +++----- modules/58_peatland/v2/preloop.gms | 2 ++ modules/58_peatland/v2/presolve.gms | 29 +++++++++---------- 8 files changed, 51 insertions(+), 41 deletions(-) diff --git a/modules/32_forestry/dynamic_may24/declarations.gms b/modules/32_forestry/dynamic_may24/declarations.gms index 5a806f3fa4..fe6faa21f5 100644 --- a/modules/32_forestry/dynamic_may24/declarations.gms +++ b/modules/32_forestry/dynamic_may24/declarations.gms @@ -73,6 +73,7 @@ positive variables vm_landreduction_forestry(j,type32) Forestry land reduction (mio. ha) vm_land_forestry(j,type32) Forestry land pools (mio. ha) v32_prod_forestry_future(i) Future expected production of woody biomass from commercial plantations (mio. tDM per yr) + v32_land_replant(j) Harvested and replanted area in timber plantations (mio. ha) ; variables @@ -108,6 +109,7 @@ equations q32_bv_plant(j,potnatveg) Biodiversity value for plantations (Mha) q32_land_expansion_forestry(j,type32) Forestry land expansion (mio. ha) q32_land_reduction_forestry(j,type32) Forestry land reduction (mio. ha) + q32_land_replant(j) Harvested and replanted area in timber plantations (mio. ha) ; @@ -128,6 +130,7 @@ parameters ov_landreduction_forestry(t,j,type32,type) Forestry land reduction (mio. ha) ov_land_forestry(t,j,type32,type) Forestry land pools (mio. ha) ov32_prod_forestry_future(t,i,type) Future expected production of woody biomass from commercial plantations (mio. tDM per yr) + ov32_land_replant(t,j,type) Harvested and replanted area in timber plantations (mio. ha) ov_cdr_aff(t,j,ac,aff_effect,type) Expected bgc (CDR) and local bph effects of afforestation depending on planning horizon (mio. tC) oq32_cost_total(t,i,type) Total forestry costs constraint (mio. USD) oq32_land(t,j,type) Land constraint (mio. ha) @@ -157,5 +160,6 @@ parameters oq32_bv_plant(t,j,potnatveg,type) Biodiversity value for plantations (Mha) oq32_land_expansion_forestry(t,j,type32,type) Forestry land expansion (mio. ha) oq32_land_reduction_forestry(t,j,type32,type) Forestry land reduction (mio. ha) + oq32_land_replant(t,j,type) Harvested and replanted area in timber plantations (mio. ha) ; *##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/32_forestry/dynamic_may24/equations.gms b/modules/32_forestry/dynamic_may24/equations.gms index 1cfdcf2597..dcd0a42fbc 100644 --- a/modules/32_forestry/dynamic_may24/equations.gms +++ b/modules/32_forestry/dynamic_may24/equations.gms @@ -60,10 +60,15 @@ sum(ac_est, v32_land(j2,"aff",ac_est)) =l= sum(ac, v32_land(j2,"aff",ac)) - sum( vm_land_forestry(j2,type32) =e= sum(ac, v32_land(j2,type32,ac)); q32_land_expansion_forestry(j2,type32) .. - vm_landexpansion_forestry(j2,type32) =e= v32_land_expansion(j2,type32); + vm_landexpansion_forestry(j2,type32) =e= v32_land_expansion(j2,type32) - (v32_land_replant(j2))$sameas(type32,"plant"); q32_land_reduction_forestry(j2,type32) .. - vm_landreduction_forestry(j2,type32) =e= sum(ac_sub, v32_land_reduction(j2,type32,ac_sub)); + vm_landreduction_forestry(j2,type32) =e= sum(ac_sub, v32_land_reduction(j2,type32,ac_sub)) - (v32_land_replant(j2))$sameas(type32,"plant"); + + q32_land_replant(j2) .. + v32_land_replant(j2) + =e= + sum(ac_sub, v32_hvarea_forestry(j2,ac_sub)) * sum(cell(i2,j2), min(1, sum(ct, p32_future_to_current_demand_ratio(ct,i2))))$s32_establishment_dynamic; *' The constraint `q32_aff_pol` accounts for the exogenous afforestation prescribed by NPI/NDC policies. diff --git a/modules/32_forestry/dynamic_may24/postsolve.gms b/modules/32_forestry/dynamic_may24/postsolve.gms index be0c978644..5d35a57145 100644 --- a/modules/32_forestry/dynamic_may24/postsolve.gms +++ b/modules/32_forestry/dynamic_may24/postsolve.gms @@ -25,6 +25,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); ov_landreduction_forestry(t,j,type32,"marginal") = vm_landreduction_forestry.m(j,type32); ov_land_forestry(t,j,type32,"marginal") = vm_land_forestry.m(j,type32); ov32_prod_forestry_future(t,i,"marginal") = v32_prod_forestry_future.m(i); + ov32_land_replant(t,j,"marginal") = v32_land_replant.m(j); ov_cdr_aff(t,j,ac,aff_effect,"marginal") = vm_cdr_aff.m(j,ac,aff_effect); oq32_cost_total(t,i,"marginal") = q32_cost_total.m(i); oq32_land(t,j,"marginal") = q32_land.m(j); @@ -54,6 +55,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); oq32_bv_plant(t,j,potnatveg,"marginal") = q32_bv_plant.m(j,potnatveg); oq32_land_expansion_forestry(t,j,type32,"marginal") = q32_land_expansion_forestry.m(j,type32); oq32_land_reduction_forestry(t,j,type32,"marginal") = q32_land_reduction_forestry.m(j,type32); + oq32_land_replant(t,j,"marginal") = q32_land_replant.m(j); ov_cost_fore(t,i,"level") = vm_cost_fore.l(i); ov32_cost_hvarea(t,i,"level") = v32_cost_hvarea.l(i); ov32_land(t,j,type32,ac,"level") = v32_land.l(j,type32,ac); @@ -69,6 +71,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); ov_landreduction_forestry(t,j,type32,"level") = vm_landreduction_forestry.l(j,type32); ov_land_forestry(t,j,type32,"level") = vm_land_forestry.l(j,type32); ov32_prod_forestry_future(t,i,"level") = v32_prod_forestry_future.l(i); + ov32_land_replant(t,j,"level") = v32_land_replant.l(j); ov_cdr_aff(t,j,ac,aff_effect,"level") = vm_cdr_aff.l(j,ac,aff_effect); oq32_cost_total(t,i,"level") = q32_cost_total.l(i); oq32_land(t,j,"level") = q32_land.l(j); @@ -98,6 +101,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); oq32_bv_plant(t,j,potnatveg,"level") = q32_bv_plant.l(j,potnatveg); oq32_land_expansion_forestry(t,j,type32,"level") = q32_land_expansion_forestry.l(j,type32); oq32_land_reduction_forestry(t,j,type32,"level") = q32_land_reduction_forestry.l(j,type32); + oq32_land_replant(t,j,"level") = q32_land_replant.l(j); ov_cost_fore(t,i,"upper") = vm_cost_fore.up(i); ov32_cost_hvarea(t,i,"upper") = v32_cost_hvarea.up(i); ov32_land(t,j,type32,ac,"upper") = v32_land.up(j,type32,ac); @@ -113,6 +117,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); ov_landreduction_forestry(t,j,type32,"upper") = vm_landreduction_forestry.up(j,type32); ov_land_forestry(t,j,type32,"upper") = vm_land_forestry.up(j,type32); ov32_prod_forestry_future(t,i,"upper") = v32_prod_forestry_future.up(i); + ov32_land_replant(t,j,"upper") = v32_land_replant.up(j); ov_cdr_aff(t,j,ac,aff_effect,"upper") = vm_cdr_aff.up(j,ac,aff_effect); oq32_cost_total(t,i,"upper") = q32_cost_total.up(i); oq32_land(t,j,"upper") = q32_land.up(j); @@ -142,6 +147,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); oq32_bv_plant(t,j,potnatveg,"upper") = q32_bv_plant.up(j,potnatveg); oq32_land_expansion_forestry(t,j,type32,"upper") = q32_land_expansion_forestry.up(j,type32); oq32_land_reduction_forestry(t,j,type32,"upper") = q32_land_reduction_forestry.up(j,type32); + oq32_land_replant(t,j,"upper") = q32_land_replant.up(j); ov_cost_fore(t,i,"lower") = vm_cost_fore.lo(i); ov32_cost_hvarea(t,i,"lower") = v32_cost_hvarea.lo(i); ov32_land(t,j,type32,ac,"lower") = v32_land.lo(j,type32,ac); @@ -157,6 +163,7 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); ov_landreduction_forestry(t,j,type32,"lower") = vm_landreduction_forestry.lo(j,type32); ov_land_forestry(t,j,type32,"lower") = vm_land_forestry.lo(j,type32); ov32_prod_forestry_future(t,i,"lower") = v32_prod_forestry_future.lo(i); + ov32_land_replant(t,j,"lower") = v32_land_replant.lo(j); ov_cdr_aff(t,j,ac,aff_effect,"lower") = vm_cdr_aff.lo(j,ac,aff_effect); oq32_cost_total(t,i,"lower") = q32_cost_total.lo(i); oq32_land(t,j,"lower") = q32_land.lo(j); @@ -186,4 +193,5 @@ pc32_land(j,type32,ac) = v32_land.l(j,type32,ac); oq32_bv_plant(t,j,potnatveg,"lower") = q32_bv_plant.lo(j,potnatveg); oq32_land_expansion_forestry(t,j,type32,"lower") = q32_land_expansion_forestry.lo(j,type32); oq32_land_reduction_forestry(t,j,type32,"lower") = q32_land_reduction_forestry.lo(j,type32); + oq32_land_replant(t,j,"lower") = q32_land_replant.lo(j); *##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 24384ca086..81d4b8d335 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -9,15 +9,15 @@ parameters pc58_peatland(j,land58) Peatland area (mio. ha) pc58_manLand(j,manPeat58) Managed land area (mio. ha) p58_scalingFactorExp(t,j) Scaling factor for peatland expansion (1) - p58_scalingFactorRed(t,j,manPeat58) Scaling factor for peatland reduction (1) + p58_scalingFactorRed(t,j) Scaling factor for peatland reduction (1) p58_mapping_cell_climate(j,clcl58) Mapping between cells and climate regions (binary) i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD05MER per ha) i58_cost_rewet_onetime(t) One-time costs for peatland rewetting (USD05MER per ha) i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD05MER per ha) i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD05MER per ha) i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD05MER per ha) - p58_avail_peatland_exp2(t,j) - p58_avail_land_exp2(t,j) + p58_avail_peatland_exp(t,j) Available peatland for expansion (mio. ha) + p58_avail_land_exp(t,j) Available land for expansion (mio. ha) ; equations @@ -27,7 +27,7 @@ equations q58_manLandExp(j,manPeat58) Managed land area expansion (mio. ha) q58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) q58_peatlandMan(j,manPeat58) Change of managed peatland area (mio. ha) - q58_scalingFactorExp(j,manPeat58) Scaling factor for peatland expansion (1) + q58_peatlandMan2(j,manPeat58) Contraint for managed peatland area (mio. ha) q58_peatland_cost(j) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) q58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) q58_peatland_emis_detail(j,land58,emis58) Detailed GHG emissions from peatlands (Tg per yr) @@ -45,7 +45,6 @@ positive variables v58_manLand(j,manPeat58) Managed land area (mio. ha) v58_manLandExp(j,manPeat58) Managed land area expansion (mio. ha) v58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) - v58_scalingFactorExp(j,manPeat58) Scaling factor for peatland expansion (1) v58_balance(j,manPeat58) Technical balance term for peatland scaling factor (1) v58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) ; @@ -59,7 +58,6 @@ parameters ov58_manLand(t,j,manPeat58,type) Managed land area (mio. ha) ov58_manLandExp(t,j,manPeat58,type) Managed land area expansion (mio. ha) ov58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) - ov58_scalingFactorExp(t,j,manPeat58,type) Scaling factor for peatland expansion (1) ov58_balance(t,j,manPeat58,type) Technical balance term for peatland scaling factor (1) ov58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) oq58_peatland(t,j,type) Constraint for total peatland area (mio. ha) @@ -68,7 +66,7 @@ parameters oq58_manLandExp(t,j,manPeat58,type) Managed land area expansion (mio. ha) oq58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) oq58_peatlandMan(t,j,manPeat58,type) Change of managed peatland area (mio. ha) - oq58_scalingFactorExp(t,j,manPeat58,type) Scaling factor for peatland expansion (1) + oq58_peatlandMan2(t,j,manPeat58,type) Contraint for managed peatland area (mio. ha) oq58_peatland_cost(t,j,type) One-time and recurring cost of peatland conversion and management (mio. USD05MER per yr) oq58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) oq58_peatland_emis_detail(t,j,land58,emis58,type) Detailed GHG emissions from peatlands (Tg per yr) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 0f2886f86e..b2e747fbd9 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -15,7 +15,7 @@ *' Peatland area change: q58_peatlandChange(j2,land58) .. - v58_peatlandChange(j2,land58) =e= v58_peatland(j2,land58)-pc58_peatland(j2,land58); + v58_peatlandChange(j2,land58) =e= v58_peatland(j2,land58)-pc58_peatland(j2,land58); *' Managed land area: @@ -39,19 +39,17 @@ *' In case managed land remains unchanged, also managed peatland remains unchanged. q58_peatlandMan(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. - v58_peatland(j2,manPeat58) =e= + v58_peatland(j2,manPeat58) =g= pc58_peatland(j2,manPeat58) - + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)); - - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)); + + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)) - v58_balance(j2,manPeat58) + - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2)); + + q58_peatlandMan2(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. + v58_peatland(j2,manPeat58) =l= v58_manLand(j2,manPeat58); *' Peatland scaling factor for expansion: (maxPeatland - totalManagedPeatland) / (maxLand - totalManagedLand). *' See macro `m58_LandLeft` for details. -q58_scalingFactorExp(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. - v58_scalingFactorExp(j2,manPeat58) * m58_LandLeft(pcm_land,"land",v58_manLand,pc58_manLand) + v58_balance(j2,manPeat58) - =e= - m58_LandLeft(pc58_peatland,"land58",v58_peatland,pc58_peatland); - *' Costs for peatland degradation and rewetting q58_peatland_cost(j2) .. diff --git a/modules/58_peatland/v2/postsolve.gms b/modules/58_peatland/v2/postsolve.gms index 38e6ded2cc..58cdb3abd9 100644 --- a/modules/58_peatland/v2/postsolve.gms +++ b/modules/58_peatland/v2/postsolve.gms @@ -16,7 +16,6 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLand(t,j,manPeat58,"marginal") = v58_manLand.m(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"marginal") = v58_manLandExp.m(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"marginal") = v58_manLandRed.m(j,manPeat58); - ov58_scalingFactorExp(t,j,manPeat58,"marginal") = v58_scalingFactorExp.m(j,manPeat58); ov58_balance(t,j,manPeat58,"marginal") = v58_balance.m(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"marginal") = v58_peatland_cost_annuity.m(j,cost58); oq58_peatland(t,j,"marginal") = q58_peatland.m(j); @@ -25,7 +24,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandExp(t,j,manPeat58,"marginal") = q58_manLandExp.m(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"marginal") = q58_manLandRed.m(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"marginal") = q58_peatlandMan.m(j,manPeat58); - oq58_scalingFactorExp(t,j,manPeat58,"marginal") = q58_scalingFactorExp.m(j,manPeat58); + oq58_peatlandMan2(t,j,manPeat58,"marginal") = q58_peatlandMan2.m(j,manPeat58); oq58_peatland_cost(t,j,"marginal") = q58_peatland_cost.m(j); oq58_peatland_cost_annuity(t,j,cost58,"marginal") = q58_peatland_cost_annuity.m(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"marginal") = q58_peatland_emis_detail.m(j,land58,emis58); @@ -37,7 +36,6 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLand(t,j,manPeat58,"level") = v58_manLand.l(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"level") = v58_manLandExp.l(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"level") = v58_manLandRed.l(j,manPeat58); - ov58_scalingFactorExp(t,j,manPeat58,"level") = v58_scalingFactorExp.l(j,manPeat58); ov58_balance(t,j,manPeat58,"level") = v58_balance.l(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"level") = v58_peatland_cost_annuity.l(j,cost58); oq58_peatland(t,j,"level") = q58_peatland.l(j); @@ -46,7 +44,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandExp(t,j,manPeat58,"level") = q58_manLandExp.l(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"level") = q58_manLandRed.l(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"level") = q58_peatlandMan.l(j,manPeat58); - oq58_scalingFactorExp(t,j,manPeat58,"level") = q58_scalingFactorExp.l(j,manPeat58); + oq58_peatlandMan2(t,j,manPeat58,"level") = q58_peatlandMan2.l(j,manPeat58); oq58_peatland_cost(t,j,"level") = q58_peatland_cost.l(j); oq58_peatland_cost_annuity(t,j,cost58,"level") = q58_peatland_cost_annuity.l(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"level") = q58_peatland_emis_detail.l(j,land58,emis58); @@ -58,7 +56,6 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLand(t,j,manPeat58,"upper") = v58_manLand.up(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"upper") = v58_manLandExp.up(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"upper") = v58_manLandRed.up(j,manPeat58); - ov58_scalingFactorExp(t,j,manPeat58,"upper") = v58_scalingFactorExp.up(j,manPeat58); ov58_balance(t,j,manPeat58,"upper") = v58_balance.up(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"upper") = v58_peatland_cost_annuity.up(j,cost58); oq58_peatland(t,j,"upper") = q58_peatland.up(j); @@ -67,7 +64,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandExp(t,j,manPeat58,"upper") = q58_manLandExp.up(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"upper") = q58_manLandRed.up(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"upper") = q58_peatlandMan.up(j,manPeat58); - oq58_scalingFactorExp(t,j,manPeat58,"upper") = q58_scalingFactorExp.up(j,manPeat58); + oq58_peatlandMan2(t,j,manPeat58,"upper") = q58_peatlandMan2.up(j,manPeat58); oq58_peatland_cost(t,j,"upper") = q58_peatland_cost.up(j); oq58_peatland_cost_annuity(t,j,cost58,"upper") = q58_peatland_cost_annuity.up(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"upper") = q58_peatland_emis_detail.up(j,land58,emis58); @@ -79,7 +76,6 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLand(t,j,manPeat58,"lower") = v58_manLand.lo(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"lower") = v58_manLandExp.lo(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"lower") = v58_manLandRed.lo(j,manPeat58); - ov58_scalingFactorExp(t,j,manPeat58,"lower") = v58_scalingFactorExp.lo(j,manPeat58); ov58_balance(t,j,manPeat58,"lower") = v58_balance.lo(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"lower") = v58_peatland_cost_annuity.lo(j,cost58); oq58_peatland(t,j,"lower") = q58_peatland.lo(j); @@ -88,7 +84,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); oq58_manLandExp(t,j,manPeat58,"lower") = q58_manLandExp.lo(j,manPeat58); oq58_manLandRed(t,j,manPeat58,"lower") = q58_manLandRed.lo(j,manPeat58); oq58_peatlandMan(t,j,manPeat58,"lower") = q58_peatlandMan.lo(j,manPeat58); - oq58_scalingFactorExp(t,j,manPeat58,"lower") = q58_scalingFactorExp.lo(j,manPeat58); + oq58_peatlandMan2(t,j,manPeat58,"lower") = q58_peatlandMan2.lo(j,manPeat58); oq58_peatland_cost(t,j,"lower") = q58_peatland_cost.lo(j); oq58_peatland_cost_annuity(t,j,cost58,"lower") = q58_peatland_cost_annuity.lo(j,cost58); oq58_peatland_emis_detail(t,j,land58,emis58,"lower") = q58_peatland_emis_detail.lo(j,land58,emis58); diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index 9525ea2860..5adbe7de96 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -17,3 +17,5 @@ pc58_peatland(j,land58) = 0; * For the internal GHG emission pricing it is assumed that intact peatlands have the same GHG emission factors as rewetted peatlands. * Without this assumption, GHG emissions of intact peatlands would be zero (no data available). This can lead to cases where intact peatland is converted to rewetted peatland. f58_ipcc_wetland_ef(clcl58,"intact",emis58) = f58_ipcc_wetland_ef(clcl58,"rewetted",emis58); + +*v58_balance.fx(j,manPeat58) = 0; diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index ed1b82d295..3cedcae09f 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -21,7 +21,6 @@ if (m_year(t) <= s58_fix_peatland, * Peatland area is fixed to `pc58_peatland` until the year given by s58_fix_peatland v58_peatland.fx(j,land58) = pc58_peatland(j,land58); - v58_scalingFactorExp.fx(j,manPeat58) = 0; v58_balance.fx(j,manPeat58) = 0; i58_cost_rewet_recur(t) = 0; @@ -37,8 +36,6 @@ else v58_peatland.up(j,"rewetted") = s58_rewetting_switch; v58_peatland.up(j,"intact") = pc58_peatland(j,"intact"); v58_peatland.fx(j,"peatExtract") = pc58_peatland(j,"peatExtract"); - v58_scalingFactorExp.lo(j,manPeat58) = 0; - v58_scalingFactorExp.up(j,manPeat58) = Inf; v58_balance.lo(j,manPeat58) = 0; v58_balance.up(j,manPeat58) = Inf; @@ -50,23 +47,25 @@ else ); *' @code -*' Peatland scaling factor for reduction: currentPeatland / currentManagedLand +*' Peatland scaling factor for reduction: manPeatland / totalPeatland -p58_scalingFactorRed(t,j,manPeat58) = - (pc58_peatland(j,manPeat58)/pc58_manLand(j,manPeat58)) - $(pc58_peatland(j,manPeat58) > 1e-10 AND pc58_manLand(j,manPeat58) > 1e-10) - + 0$(pc58_peatland(j,manPeat58) <= 1e-10 OR pc58_manLand(j,manPeat58) <= 1e-10); +p58_scalingFactorRed(t,j) = + (sum(manPeat58, pc58_peatland(j,manPeat58)) / sum(land58, pc58_peatland(j,land58))) + $(sum(manPeat58, pc58_peatland(j,manPeat58)) > 1e-10 AND sum(land58, pc58_peatland(j,land58)) > 1e-10) + + 0$(sum(land58, pc58_peatland(j,land58)) <= 1e-10) + + 1$(sum(manPeat58, pc58_manLand(j,manPeat58)) <= 1e-10); +p58_scalingFactorRed(t,j)$(p58_scalingFactorRed(t,j) > 1) = 1; -*' Peatland scaling factor for expansion: maxPeatland-manPeatland / maxLand-manLand = availPeatlandExp / availLandExp -*' See macro `m58_LandLeft` for details. -p58_avail_peatland_exp2(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); -p58_avail_land_exp2(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); +*' Peatland scaling factor for expansion: totalPeatland-manPeatland / totalLand-manLand = availPeatlandExp / availLandExp + +p58_avail_peatland_exp(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); +p58_avail_land_exp(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); p58_scalingFactorExp(t,j) = - (p58_avail_peatland_exp2(t,j) / p58_avail_land_exp2(t,j)) - $(p58_avail_peatland_exp2(t,j) > 1e-10 AND p58_avail_land_exp2(t,j) > 1e-10) - + 0$(p58_avail_peatland_exp2(t,j) <= 1e-10 OR p58_avail_land_exp2(t,j) <= 1e-10); + (p58_avail_peatland_exp(t,j) / p58_avail_land_exp(t,j)) + $(p58_avail_peatland_exp(t,j) > 1e-10 AND p58_avail_land_exp(t,j) > 1e-10) + + 0$(p58_avail_peatland_exp(t,j) <= 1e-10 OR p58_avail_land_exp(t,j) <= 1e-10); p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; From 3bf94db8ce86f15126f217c41a61e02ba1d8fcc8 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 23 Jul 2024 21:09:40 +0200 Subject: [PATCH 102/171] documentation --- CHANGELOG.md | 2 ++ core/macros.gms | 5 ---- modules/58_peatland/v2/declarations.gms | 4 ++-- modules/58_peatland/v2/equations.gms | 23 ++++++++++-------- modules/58_peatland/v2/preloop.gms | 2 -- modules/58_peatland/v2/presolve.gms | 31 +++++++++++++------------ modules/58_peatland/v2/realization.gms | 5 ++++ 7 files changed, 38 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb63d9c84..2ceb2d8d3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. - **80_optimization** abort GAMS in case of execution errors +- **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. +- **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/core/macros.gms b/core/macros.gms index 1c1c443466..53d07debd2 100644 --- a/core/macros.gms +++ b/core/macros.gms @@ -111,11 +111,6 @@ $macro m58_LandMerge(land,landForestry,set) \ + land(&&set,"past")$(sameas(manPeat58,"past")) \ + landForestry(&&set,"plant")$(sameas(manPeat58,"forestry")) -$macro m58_LandLeft(pclandFull,setFull,vland,pcland) \ - (sum(&&setFull,pclandFull(j2,&&setFull)) \ - - sum(manPeat58_alias$(not sameas(manPeat58_alias,manPeat58)),vland(j2,manPeat58_alias)) \ - - sum(manPeat58_alias$(sameas(manPeat58_alias,manPeat58)),pcland(j2,manPeat58_alias))) - * macro for trade module $macro m21_baseline_production(supply, excess_prod, self_suff) \ ((sum(supreg(h2,i2),supply(i2,k_trade)) + excess_prod(h2,k_trade)) \ diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 81d4b8d335..77a8b13ea3 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -16,8 +16,8 @@ parameters i58_cost_drain_recur(t) Recurring costs for drained and managed peatlands (USD05MER per ha) i58_cost_drain_intact_onetime(t) One-time costs for drainage of intact peatland (USD05MER per ha) i58_cost_drain_rewet_onetime(t) One-time costs for drainage of rewetted peatland (USD05MER per ha) - p58_avail_peatland_exp(t,j) Available peatland for expansion (mio. ha) - p58_avail_land_exp(t,j) Available land for expansion (mio. ha) + p58_availPeatlandExp(t,j) Available area for expansion of drained peatland (mio. ha) + p58_availLandExp(t,j) Available area for expansion of managed land (mio. ha) ; equations diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index b2e747fbd9..8a49783a83 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -30,13 +30,17 @@ q58_manLandRed(j2,manPeat58) .. v58_manLandRed(j2,manPeat58) =e= m58_LandMerge(vm_landreduction,vm_landreduction_forestry,"j2"); -*' Future peatland dynamics (`v58_peatland`) depend on changes in managed land (`v58_manLandExp`, `v58_manLandRed`), -*' multiplied with corresponding scaling factors for expansion (`v58_scalingFactorExp`) and reduction (`p58_scalingFactorRed`). -*' The scaling factor for expansion makes sure that in case the full cell area consists of -*' managed land (cropland, pasture, forestry plantations), the full peatland area is drained. -*' Likewise, the scaling factor for reduction makes sure that in case no area is used for managed land, -*' managed peatland (`manPeat58`) is reduced to zero. -*' In case managed land remains unchanged, also managed peatland remains unchanged. +*' Future peatland dynamics (`v58_peatland`) for drained peatlands used as cropland, pasture or forestry (`manPeat58`) +*' depend on changes in managed agricultural and forestry land (`v58_manLandExp`, `v58_manLandRed`), +*' multiplied with corresponding scaling factors for expansion (`p58_scalingFactorExp`) and reduction (`p58_scalingFactorRed`). +*' Both scaling factors are time-dynamic, i.e. the scaling factors vary depending on changes in drained peatland and managed land. +*' The scaling factor for expansion reflects the ratio of available area for peatland drainage and managed land expansion, +*' based on the assumption that the expansion of drained peatland is proportional to the expansion of managed land. +*' The scaling factor for reduction reflects the ratio of drained peatland and total peatland area, +*' based on the assumption that the likelihood of peatland rewetting increases with a higher share of +*' drained peatland over total peatland area. +*' Vice-versa, the scaling factor for reduction decreases with an increasing share of rewetted peatland. +*' In case managed land remains unchanged, also drained peatland remains unchanged. q58_peatlandMan(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,manPeat58) =g= @@ -44,12 +48,11 @@ + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)) - v58_balance(j2,manPeat58) - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2)); +*' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. + q58_peatlandMan2(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. v58_peatland(j2,manPeat58) =l= v58_manLand(j2,manPeat58); -*' Peatland scaling factor for expansion: (maxPeatland - totalManagedPeatland) / (maxLand - totalManagedLand). -*' See macro `m58_LandLeft` for details. - *' Costs for peatland degradation and rewetting q58_peatland_cost(j2) .. diff --git a/modules/58_peatland/v2/preloop.gms b/modules/58_peatland/v2/preloop.gms index 5adbe7de96..9525ea2860 100644 --- a/modules/58_peatland/v2/preloop.gms +++ b/modules/58_peatland/v2/preloop.gms @@ -17,5 +17,3 @@ pc58_peatland(j,land58) = 0; * For the internal GHG emission pricing it is assumed that intact peatlands have the same GHG emission factors as rewetted peatlands. * Without this assumption, GHG emissions of intact peatlands would be zero (no data available). This can lead to cases where intact peatland is converted to rewetted peatland. f58_ipcc_wetland_ef(clcl58,"intact",emis58) = f58_ipcc_wetland_ef(clcl58,"rewetted",emis58); - -*v58_balance.fx(j,manPeat58) = 0; diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 3cedcae09f..014dffb1dc 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -47,26 +47,27 @@ else ); *' @code +*' Peatland scaling factor for expansion: (totalPeatland - manPeatland) / (totalLand - manLand) +*' +*' p58_availPeatlandExp = totalPeatland - manPeatland +*' +*' p58_availLandExp = totalLand - manLand + +p58_availPeatlandExp(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); +p58_availLandExp(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); + +p58_scalingFactorExp(t,j) = + (p58_availPeatlandExp(t,j) / p58_availLandExp(t,j)) + $(p58_availPeatlandExp(t,j) > 1e-10 AND p58_availLandExp(t,j) > 1e-10) + + 0$(p58_availPeatlandExp(t,j) <= 1e-10 OR p58_availLandExp(t,j) <= 1e-10); +p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; + *' Peatland scaling factor for reduction: manPeatland / totalPeatland p58_scalingFactorRed(t,j) = (sum(manPeat58, pc58_peatland(j,manPeat58)) / sum(land58, pc58_peatland(j,land58))) $(sum(manPeat58, pc58_peatland(j,manPeat58)) > 1e-10 AND sum(land58, pc58_peatland(j,land58)) > 1e-10) - + 0$(sum(land58, pc58_peatland(j,land58)) <= 1e-10) - + 1$(sum(manPeat58, pc58_manLand(j,manPeat58)) <= 1e-10); + + 0$(sum(land58, pc58_peatland(j,land58)) <= 1e-10 OR sum(manPeat58, pc58_manLand(j,manPeat58)) <= 1e-10); p58_scalingFactorRed(t,j)$(p58_scalingFactorRed(t,j) > 1) = 1; - -*' Peatland scaling factor for expansion: totalPeatland-manPeatland / totalLand-manLand = availPeatlandExp / availLandExp - -p58_avail_peatland_exp(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); -p58_avail_land_exp(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); - -p58_scalingFactorExp(t,j) = - (p58_avail_peatland_exp(t,j) / p58_avail_land_exp(t,j)) - $(p58_avail_peatland_exp(t,j) > 1e-10 AND p58_avail_land_exp(t,j) > 1e-10) - + 0$(p58_avail_peatland_exp(t,j) <= 1e-10 OR p58_avail_land_exp(t,j) <= 1e-10); -p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; - - *' @stop diff --git a/modules/58_peatland/v2/realization.gms b/modules/58_peatland/v2/realization.gms index 95aecd5adc..15090c4f04 100644 --- a/modules/58_peatland/v2/realization.gms +++ b/modules/58_peatland/v2/realization.gms @@ -16,10 +16,15 @@ *' In this realisation, peatland GHG emission factors for boreal and tropical climates are based on @IPCC_wetland_2013 and @wilson_2016. *' Peatland GHG emission factors for temperate climates are based on more recent estimates from @tiemeyer_peatland_2020. *' Assumed rules for changes in peatland area: +*' *' Sum over total peatland area (degraded, intact, rewetted) is assumed constant. +*' *' Intact peatland area can only decrease. +*' *' Degraded peatland area (crop, past, forestry and unused) depends on managed land. +*' *' Area for peat extraction (peatExtract) is fixed. +*' *' Rewetted and intact peatland have the same GHG emission factors, which avoids that intact is converted to rewetted peatland area. *' @stop From 2f039d4b541c20803a88f77983dd2cda399f85ca Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 24 Jul 2024 09:48:24 +0200 Subject: [PATCH 103/171] documentation --- modules/58_peatland/v2/presolve.gms | 5 ++--- modules/58_peatland/v2/realization.gms | 16 +++++++--------- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index 014dffb1dc..dfc9fb5190 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -49,9 +49,8 @@ else *' @code *' Peatland scaling factor for expansion: (totalPeatland - manPeatland) / (totalLand - manLand) *' -*' p58_availPeatlandExp = totalPeatland - manPeatland -*' -*' p58_availLandExp = totalLand - manLand +*' * p58_availPeatlandExp = totalPeatland - manPeatland +*' * p58_availLandExp = totalLand - manLand p58_availPeatlandExp(t,j) = sum(land58, pc58_peatland(j,land58)) - sum(manPeat58, pc58_peatland(j,manPeat58)); p58_availLandExp(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLand(j,manPeat58)); diff --git a/modules/58_peatland/v2/realization.gms b/modules/58_peatland/v2/realization.gms index 15090c4f04..8fef618fcf 100644 --- a/modules/58_peatland/v2/realization.gms +++ b/modules/58_peatland/v2/realization.gms @@ -15,17 +15,15 @@ *' GHG emissions from drained and rewetted peatlands as well as from peat extraction are calculated based on GHG emission factors. *' In this realisation, peatland GHG emission factors for boreal and tropical climates are based on @IPCC_wetland_2013 and @wilson_2016. *' Peatland GHG emission factors for temperate climates are based on more recent estimates from @tiemeyer_peatland_2020. -*' Assumed rules for changes in peatland area: -*' -*' Sum over total peatland area (degraded, intact, rewetted) is assumed constant. -*' -*' Intact peatland area can only decrease. *' -*' Degraded peatland area (crop, past, forestry and unused) depends on managed land. -*' -*' Area for peat extraction (peatExtract) is fixed. +*' Assumed rules for changes in peatland area: *' -*' Rewetted and intact peatland have the same GHG emission factors, which avoids that intact is converted to rewetted peatland area. +*' * Sum over total peatland area (degraded, intact, rewetted) is assumed constant. +*' * Intact peatland area can only decrease. +*' * Degraded peatland area (crop, past, forestry and unused) depends on managed land. +*' * Area for peat extraction (peatExtract) is fixed. +*' * Rewetted and intact peatland have the same GHG emission factors, which avoids that intact is converted to rewetted peatland area. +*' *' @stop From e5d77adfc089e8e4a2982c07a58d6f79687e0e6e Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 25 Jul 2024 07:06:40 +0200 Subject: [PATCH 104/171] revision of scaling factor --- modules/58_peatland/v2/declarations.gms | 4 +++- modules/58_peatland/v2/equations.gms | 6 +++--- modules/58_peatland/v2/input.gms | 6 +++--- modules/58_peatland/v2/postsolve.gms | 4 ++++ modules/58_peatland/v2/presolve.gms | 12 +++++++----- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 77a8b13ea3..6791419f6e 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -9,7 +9,7 @@ parameters pc58_peatland(j,land58) Peatland area (mio. ha) pc58_manLand(j,manPeat58) Managed land area (mio. ha) p58_scalingFactorExp(t,j) Scaling factor for peatland expansion (1) - p58_scalingFactorRed(t,j) Scaling factor for peatland reduction (1) + p58_scalingFactorRed(t,j,manPeat58) Scaling factor for peatland reduction (1) p58_mapping_cell_climate(j,clcl58) Mapping between cells and climate regions (binary) i58_cost_rewet_recur(t) Recurring costs for rewetted peatland (USD05MER per ha) i58_cost_rewet_onetime(t) One-time costs for peatland rewetting (USD05MER per ha) @@ -46,6 +46,7 @@ positive variables v58_manLandExp(j,manPeat58) Managed land area expansion (mio. ha) v58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) v58_balance(j,manPeat58) Technical balance term for peatland scaling factor (1) + v58_balance2(j,manPeat58) Technical balance term for peatland scaling factor (1) v58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) ; @@ -59,6 +60,7 @@ parameters ov58_manLandExp(t,j,manPeat58,type) Managed land area expansion (mio. ha) ov58_manLandRed(t,j,manPeat58,type) Managed land area reduction (mio. ha) ov58_balance(t,j,manPeat58,type) Technical balance term for peatland scaling factor (1) + ov58_balance2(t,j,manPeat58,type) Technical balance term for peatland scaling factor (1) ov58_peatland_cost_annuity(t,j,cost58,type) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) oq58_peatland(t,j,type) Constraint for total peatland area (mio. ha) oq58_peatlandChange(t,j,land58,type) Peatland area change (mio. ha) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 8a49783a83..9db3ad2a17 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -43,10 +43,10 @@ *' In case managed land remains unchanged, also drained peatland remains unchanged. q58_peatlandMan(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. - v58_peatland(j2,manPeat58) =g= + v58_peatland(j2,manPeat58) =e= pc58_peatland(j2,manPeat58) + v58_manLandExp(j2,manPeat58) * sum(ct, p58_scalingFactorExp(ct,j2)) - v58_balance(j2,manPeat58) - - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2)); + - v58_manLandRed(j2,manPeat58) * sum(ct, p58_scalingFactorRed(ct,j2,manPeat58)) + v58_balance2(j2,manPeat58); *' Drained peatland used for agriculture and forestry cannot exceed corresponding managed land. @@ -59,7 +59,7 @@ vm_peatland_cost(j2) =e= sum(cost58, v58_peatland_cost_annuity(j2,cost58)) + v58_peatland(j2,"rewetted") * sum(ct, i58_cost_rewet_recur(ct)) + sum(manPeat58, v58_peatland(j2,manPeat58)) * sum(ct, i58_cost_drain_recur(ct)) - + sum(manPeat58, v58_balance(j2,manPeat58)) * s58_balance_penalty; + + sum(manPeat58, v58_balance(j2,manPeat58)+v58_balance2(j2,manPeat58)) * s58_balance_penalty; q58_peatland_cost_annuity(j2,cost58) .. v58_peatland_cost_annuity(j2,cost58) =g= diff --git a/modules/58_peatland/v2/input.gms b/modules/58_peatland/v2/input.gms index 99c9207abf..afa2b3face 100644 --- a/modules/58_peatland/v2/input.gms +++ b/modules/58_peatland/v2/input.gms @@ -6,11 +6,11 @@ *** | Contact: magpie@pik-potsdam.de scalars - s58_cost_rewet_recur Recurring costs for rewetted peatland (USD05MER per ha) / 200 / - s58_cost_rewet_onetime One-time costs for peatland rewetting (USD05MER per ha) / 7000 / + s58_cost_rewet_recur Recurring costs for rewetted peatland (USD05MER per ha) / 30 / + s58_cost_rewet_onetime One-time costs for peatland rewetting (USD05MER per ha) / 1000 / s58_cost_drain_recur Recurring costs for drained and managed peatlands (USD05MER per ha) / 0 / s58_cost_drain_intact_onetime One-time costs for drainage of intact peatland (USD05MER per ha) / 0 / - s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD05MER per ha) / 0 / + s58_cost_drain_rewet_onetime One-time costs for drainage of rewetted peatland (USD05MER per ha) / 1000 / s58_rewetting_switch Peatland rewetting on (Inf) or off (0) / Inf / s58_fix_peatland Year indicating until when peatland area should be fixed (year) / 2020 / s58_balance_penalty Penalty for technical peatland balance term (USD05MER) / 1e+06 / diff --git a/modules/58_peatland/v2/postsolve.gms b/modules/58_peatland/v2/postsolve.gms index 58cdb3abd9..b8274c3db3 100644 --- a/modules/58_peatland/v2/postsolve.gms +++ b/modules/58_peatland/v2/postsolve.gms @@ -17,6 +17,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"marginal") = v58_manLandExp.m(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"marginal") = v58_manLandRed.m(j,manPeat58); ov58_balance(t,j,manPeat58,"marginal") = v58_balance.m(j,manPeat58); + ov58_balance2(t,j,manPeat58,"marginal") = v58_balance2.m(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"marginal") = v58_peatland_cost_annuity.m(j,cost58); oq58_peatland(t,j,"marginal") = q58_peatland.m(j); oq58_peatlandChange(t,j,land58,"marginal") = q58_peatlandChange.m(j,land58); @@ -37,6 +38,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"level") = v58_manLandExp.l(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"level") = v58_manLandRed.l(j,manPeat58); ov58_balance(t,j,manPeat58,"level") = v58_balance.l(j,manPeat58); + ov58_balance2(t,j,manPeat58,"level") = v58_balance2.l(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"level") = v58_peatland_cost_annuity.l(j,cost58); oq58_peatland(t,j,"level") = q58_peatland.l(j); oq58_peatlandChange(t,j,land58,"level") = q58_peatlandChange.l(j,land58); @@ -57,6 +59,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"upper") = v58_manLandExp.up(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"upper") = v58_manLandRed.up(j,manPeat58); ov58_balance(t,j,manPeat58,"upper") = v58_balance.up(j,manPeat58); + ov58_balance2(t,j,manPeat58,"upper") = v58_balance2.up(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"upper") = v58_peatland_cost_annuity.up(j,cost58); oq58_peatland(t,j,"upper") = q58_peatland.up(j); oq58_peatlandChange(t,j,land58,"upper") = q58_peatlandChange.up(j,land58); @@ -77,6 +80,7 @@ pc58_manLand(j,manPeat58) = v58_manLand.l(j,manPeat58); ov58_manLandExp(t,j,manPeat58,"lower") = v58_manLandExp.lo(j,manPeat58); ov58_manLandRed(t,j,manPeat58,"lower") = v58_manLandRed.lo(j,manPeat58); ov58_balance(t,j,manPeat58,"lower") = v58_balance.lo(j,manPeat58); + ov58_balance2(t,j,manPeat58,"lower") = v58_balance2.lo(j,manPeat58); ov58_peatland_cost_annuity(t,j,cost58,"lower") = v58_peatland_cost_annuity.lo(j,cost58); oq58_peatland(t,j,"lower") = q58_peatland.lo(j); oq58_peatlandChange(t,j,land58,"lower") = q58_peatlandChange.lo(j,land58); diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index dfc9fb5190..f3d2d2a9f5 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -63,10 +63,12 @@ p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; *' Peatland scaling factor for reduction: manPeatland / totalPeatland -p58_scalingFactorRed(t,j) = - (sum(manPeat58, pc58_peatland(j,manPeat58)) / sum(land58, pc58_peatland(j,land58))) - $(sum(manPeat58, pc58_peatland(j,manPeat58)) > 1e-10 AND sum(land58, pc58_peatland(j,land58)) > 1e-10) - + 0$(sum(land58, pc58_peatland(j,land58)) <= 1e-10 OR sum(manPeat58, pc58_manLand(j,manPeat58)) <= 1e-10); -p58_scalingFactorRed(t,j)$(p58_scalingFactorRed(t,j) > 1) = 1; +p58_scalingFactorRed(t,j,manPeat58) = + (pc58_peatland(j,manPeat58) / sum(land58, pc58_peatland(j,land58))) + $(pc58_peatland(j,manPeat58) > 1e-10 AND sum(land58, pc58_peatland(j,land58)) > 1e-10) + + 0$(pc58_peatland(j,manPeat58) <= 1e-10 OR sum(land58, pc58_peatland(j,land58)) <= 1e-10); +p58_scalingFactorRed(t,j,manPeat58)$(p58_scalingFactorRed(t,j,manPeat58) > 1) = 1; +p58_scalingFactorRed(t,j,manPeat58)$(pc58_manLand(j,manPeat58) * p58_scalingFactorRed(t,j,manPeat58) > + pc58_peatland(j,manPeat58)) = pc58_peatland(j,manPeat58)/pc58_manLand(j,manPeat58); *' @stop From b93ab284ade08aa25679bca4f41733921891dbbf Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 25 Jul 2024 15:59:42 +0200 Subject: [PATCH 105/171] defaults --- config/default.cfg | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index 5766d8a374..12aa047db3 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1720,14 +1720,14 @@ cfg$gms$peatland <- "v2" # def = v2 cfg$gms$s58_rewetting_switch <- Inf # def = Inf # * One-time and recurring costs for peatland rewetting (USD05MER per ha) -cfg$gms$s58_cost_rewet_onetime <- 7000 # def = 7000 -cfg$gms$s58_cost_rewet_recur <- 200 # def = 200 +cfg$gms$s58_cost_rewet_onetime <- 1000 # def = 1000 +cfg$gms$s58_cost_rewet_recur <- 30 # def = 30 # * One-time and recurring costs for peatland drainage (USD05MER per ha) # * One-time costs apply on the drainage of intact and rewetted peatland # * Recurring costs apply on the level of drained and managed peatland cfg$gms$s58_cost_drain_intact_onetime <- 0 # def = 0 -cfg$gms$s58_cost_drain_rewet_onetime <- 0 # def = 0 +cfg$gms$s58_cost_drain_rewet_onetime <- 1000 # def = 1000 cfg$gms$s58_cost_drain_recur <- 0 # def = 0 # * Penalty for technical peatland balance term (USD05MER) From 0bb2b695c9bcac5769587ce6c1bf836a9d1771a0 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 26 Jul 2024 04:53:29 +0200 Subject: [PATCH 106/171] update --- modules/58_peatland/v2/presolve.gms | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index f3d2d2a9f5..eebd309905 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -57,18 +57,16 @@ p58_availLandExp(t,j) = sum(land, pcm_land(j,land)) - sum(manPeat58, pc58_manLan p58_scalingFactorExp(t,j) = (p58_availPeatlandExp(t,j) / p58_availLandExp(t,j)) - $(p58_availPeatlandExp(t,j) > 1e-10 AND p58_availLandExp(t,j) > 1e-10) - + 0$(p58_availPeatlandExp(t,j) <= 1e-10 OR p58_availLandExp(t,j) <= 1e-10); + $(p58_availPeatlandExp(t,j) > 1e-4 AND p58_availLandExp(t,j) > 1e-4) + + 0$(p58_availPeatlandExp(t,j) <= 1e-4 OR p58_availLandExp(t,j) <= 1e-4); p58_scalingFactorExp(t,j)$(p58_scalingFactorExp(t,j) > 1) = 1; *' Peatland scaling factor for reduction: manPeatland / totalPeatland p58_scalingFactorRed(t,j,manPeat58) = (pc58_peatland(j,manPeat58) / sum(land58, pc58_peatland(j,land58))) - $(pc58_peatland(j,manPeat58) > 1e-10 AND sum(land58, pc58_peatland(j,land58)) > 1e-10) - + 0$(pc58_peatland(j,manPeat58) <= 1e-10 OR sum(land58, pc58_peatland(j,land58)) <= 1e-10); + $(pc58_peatland(j,manPeat58) > 1e-4 AND sum(land58, pc58_peatland(j,land58)) > 1e-4) + + 0$(pc58_peatland(j,manPeat58) <= 1e-4 OR sum(land58, pc58_peatland(j,land58)) <= 1e-4); p58_scalingFactorRed(t,j,manPeat58)$(p58_scalingFactorRed(t,j,manPeat58) > 1) = 1; -p58_scalingFactorRed(t,j,manPeat58)$(pc58_manLand(j,manPeat58) * p58_scalingFactorRed(t,j,manPeat58) > - pc58_peatland(j,manPeat58)) = pc58_peatland(j,manPeat58)/pc58_manLand(j,manPeat58); *' @stop From 0dbddcf19d4b7396314c0798689ddc2f831146c5 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 26 Jul 2024 14:15:04 +0200 Subject: [PATCH 107/171] bugfix in parameter declaration of food module --- CHANGELOG.md | 2 ++ .../15_food/anthro_iso_jun22/declarations.gms | 8 ++++---- .../anthropometrics_jan18/declarations.gms | 16 ++++++++-------- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddb63d9c84..95b009e095 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/). - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. - **80_optimization** abort GAMS in case of execution errors +- **script** updated EATLancet project start scripts ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` @@ -26,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. +- **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso ## [4.8.1] - 2024-06-19 diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index f25d190e74..07f5ef4621 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -79,9 +79,9 @@ parameters p15_livestock_threshold_subst_fader(t_all) Fader for livestock threshold target (1) p15_exo_food_scenario_fader(t_all) Exogenous diet scenario fader (1) -*prices - p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) +* prices + p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) * anthropometrics p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) @@ -118,7 +118,7 @@ parameters i15_staples_kcal_structure_iso(t,iso,kfo_st) Share of single staple products within total staples (1) i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) Share of single livestock products within total livestock products (uncorrected for future changes in shares) (1) i15_livestock_kcal_structure_iso(t,iso,kfo_ap) Share of single livestock products within total livestock products (corrected for future changes in shares) (1) - i15_processed_kcal_structure_iso Share of single processed products within total processed food (1) + i15_processed_kcal_structure_iso(t,iso,kfo_pf) Share of single processed products within total processed food (1) * diet calibration p15_kcal_calib(t,iso,kfo) Balance flow to diverge from mean calories of regressions (kcal per cap per day) diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms index b2f5ce1b6c..9ba90a94b5 100644 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ b/modules/15_food/anthropometrics_jan18/declarations.gms @@ -82,9 +82,9 @@ parameters p15_livestock_threshold_subst_fader(t_all) Fader for livestock threshold target (1) p15_exo_food_scenario_fader(t_all) Exogenous diet scenario fader (1) -*prices - p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) +* prices + p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD05PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD05PPP per kcal) * anthropometrics o15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) @@ -118,12 +118,12 @@ parameters i15_rumdairy_scp_fadeout(t,i) Ruminant meat and dairy fadeout share to be replaced by SCP (1) i15_livestock_fadeout_threshold(t,i) Livestock fadeout share for threshold (1) - i15_protein_to_kcal_ratio(t,kfo) protein-to-kcal ratio (g protein per kcal) + i15_protein_to_kcal_ratio(t,kfo) Protein-to-kcal ratio (g protein per kcal) - i15_staples_kcal_structure_iso(t,iso,kfo_st) Share of single staple products within total staples (1) - i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) Share of single livestock products within total livestock products (uncorrected for future changes in shares) (1) - i15_livestock_kcal_structure_iso(t,iso,kfo_ap) Share of single livestock products within total livestock products (corrected for future changes in shares) (1) - i15_processed_kcal_structure_iso Share of single processed products within total processed food (1) + i15_staples_kcal_structure_iso(t,iso,kfo_st) Share of single staple products within total staples (1) + i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) Share of single livestock products within total livestock products (uncorrected for future changes in shares) (1) + i15_livestock_kcal_structure_iso(t,iso,kfo_ap) Share of single livestock products within total livestock products (corrected for future changes in shares) (1) + i15_processed_kcal_structure_iso(t,iso,kfo_pf) Share of single processed products within total processed food (1) * diet calibration p15_kcal_calib(t,iso,kfo) Balance flow to diverge from mean calories of regressions (kcal per cap per day) From 835b1941b9666b99da5116faff07636918234f02 Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Tue, 30 Jul 2024 12:42:50 +0200 Subject: [PATCH 108/171] add partition=priority --- scripts/run_submit/submit_priority.sh | 1 + scripts/run_submit/submit_priority_maxMem.sh | 1 + scripts/slurmOutput.yml | 4 ++-- scripts/slurmStart.yml | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/run_submit/submit_priority.sh b/scripts/run_submit/submit_priority.sh index 33c8496d5e..a1d82d0ce6 100644 --- a/scripts/run_submit/submit_priority.sh +++ b/scripts/run_submit/submit_priority.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=priority +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_priority_maxMem.sh b/scripts/run_submit/submit_priority_maxMem.sh index ae58b9695f..612b33efc5 100644 --- a/scripts/run_submit/submit_priority_maxMem.sh +++ b/scripts/run_submit/submit_priority_maxMem.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=priority +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/slurmOutput.yml b/scripts/slurmOutput.yml index f493010be1..fcabde7981 100644 --- a/scripts/slurmOutput.yml +++ b/scripts/slurmOutput.yml @@ -1,5 +1,5 @@ slurmjobs: SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" - SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority" - SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=0 --cpus-per-task=16" + SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority" + SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --mem-per-cpu=0 --cpus-per-task=16" diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index 8040e4a28c..584ac675fd 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: - SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" + SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --cpus-per-task=3" SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From 1c8c2ffe8324535a1e8b4c929e982981162d188e Mon Sep 17 00:00:00 2001 From: Jake Tommey Date: Thu, 1 Aug 2024 00:15:36 +0200 Subject: [PATCH 109/171] modify standby runs to include parition information --- scripts/run_submit/submit_standby.sh | 1 + scripts/run_submit/submit_standby_dayMax.sh | 1 + scripts/run_submit/submit_standby_maxMem.sh | 1 + scripts/run_submit/submit_standby_maxMem_dayMax.sh | 1 + scripts/slurmOutput.yml | 4 ++-- scripts/slurmStart.yml | 2 +- 6 files changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/run_submit/submit_standby.sh b/scripts/run_submit/submit_standby.sh index f0bff32339..8dca74aae4 100644 --- a/scripts/run_submit/submit_standby.sh +++ b/scripts/run_submit/submit_standby.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=standby +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_dayMax.sh b/scripts/run_submit/submit_standby_dayMax.sh index d7836390d1..39b04f8baa 100644 --- a/scripts/run_submit/submit_standby_dayMax.sh +++ b/scripts/run_submit/submit_standby_dayMax.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=standby +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_maxMem.sh b/scripts/run_submit/submit_standby_maxMem.sh index 23b0999431..e556d4aff3 100644 --- a/scripts/run_submit/submit_standby_maxMem.sh +++ b/scripts/run_submit/submit_standby_maxMem.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=standby +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_maxMem_dayMax.sh b/scripts/run_submit/submit_standby_maxMem_dayMax.sh index ac3ba4d307..9e02db436d 100644 --- a/scripts/run_submit/submit_standby_maxMem_dayMax.sh +++ b/scripts/run_submit/submit_standby_maxMem_dayMax.sh @@ -1,6 +1,7 @@ #!/bin/bash #SBATCH --qos=standby +#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/slurmOutput.yml b/scripts/slurmOutput.yml index fcabde7981..da4bfc3254 100644 --- a/scripts/slurmOutput.yml +++ b/scripts/slurmOutput.yml @@ -1,5 +1,5 @@ slurmjobs: - SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" - SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" + SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --time=24:00:00" + SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority" SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --mem-per-cpu=0 --cpus-per-task=16" diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index 584ac675fd..f3e52215ed 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --cpus-per-task=3" - SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" + SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --cpus-per-task=3" SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From caf708d9ce9aa4e77bb909cfcd4d84ccd8827243 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Mon, 5 Aug 2024 21:11:50 +0200 Subject: [PATCH 110/171] replaced gdx with gdx2 require/library statements and added missing library/require gdx2 statements --- scripts/calibration/calc_calib.R | 5 +++-- scripts/calibration/landconversion_cost.R | 3 ++- scripts/output/extra/disaggregation.R | 1 + scripts/output/extra/highres.R | 2 +- scripts/output/extra/out_of_bounds_check.R | 2 +- scripts/output/extra/reportMAgPIE2SEALS.R | 2 +- scripts/output/projects/FSDP_collect.R | 2 +- scripts/output/projects/FSDP_collect2.R | 2 +- scripts/output/projects/peatland.R | 2 +- scripts/output/validation_cell.R | 1 + scripts/start/extra/input_REMIND.R | 2 +- scripts/start/projects/paper_peatland.R | 2 +- scripts/start/projects/project_ABCDR.R | 2 +- scripts/start/projects/project_BEST.R | 2 +- scripts/start/projects/project_LAMACLIMA_WP4.R | 2 +- 15 files changed, 18 insertions(+), 14 deletions(-) diff --git a/scripts/calibration/calc_calib.R b/scripts/calibration/calc_calib.R index 76ec96c28b..5fb4af9246 100644 --- a/scripts/calibration/calc_calib.R +++ b/scripts/calibration/calc_calib.R @@ -39,7 +39,7 @@ calibration_run <- function(putfolder, calib_magpie_name, logoption = 3) { get_areacalib <- function(gdx_file) { require(magclass) require(magpie4) - require(gdx) + require(gdx2) data <- readGDX(gdx_file, "pm_land_start")[, , c("crop", "past")] data <- dimSums(data, dim = 1.2) magpie <- land(gdx_file)[, , c("crop", "past")] @@ -54,7 +54,7 @@ get_areacalib <- function(gdx_file) { get_yieldcalib <- function(gdx_file) { require(magclass) - require(gdx) + require(gdx2) require(luscale) prep <- function(x) { @@ -81,6 +81,7 @@ update_calib <- function(gdx_file, calib_accuracy = 0.1, calibrate_pasture = TRU n_maxcalib = 20, best_calib = FALSE) { require(magclass) require(magpie4) + require(gdx2) if (!(modelstat(gdx_file)[1, 1, 1] %in% c(1, 2, 7))) stop("Calibration run infeasible") area_factor <- get_areacalib(gdx_file) diff --git a/scripts/calibration/landconversion_cost.R b/scripts/calibration/landconversion_cost.R index 138e047690..306c4bca6e 100644 --- a/scripts/calibration/landconversion_cost.R +++ b/scripts/calibration/landconversion_cost.R @@ -38,7 +38,7 @@ calibration_run <- function(putfolder, calib_magpie_name, logoption = 3, s_use_g getCalibFactor <- function(gdx_file, mode = "cost", calib_accuracy = 0.05, lowpass_filter = 1) { require(magclass) require(magpie4) - require(gdx) + require(gdx2) y <- readGDX(gdx_file,"t") magpie <- land(gdx_file)[, y, "crop"] hist <- dimSums(readGDX(gdx_file, "f10_land")[, , "crop"], dim = 1.2) @@ -94,6 +94,7 @@ getHistCrop <- function() { update_calib <- function(gdx_file, calib_accuracy = 0.05, lowpass_filter = 1, calib_file, cost_max = 3, cost_min = 0.05, calibration_step = "", n_maxcalib = 40, best_calib = FALSE) { require(magclass) require(magpie4) + require(gdx2) if (!(modelstat(gdx_file)[1, 1, 1] %in% c(1, 2, 7))) stop("Calibration run infeasible") y <- readGDX(gdx_file,"t") diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 9194cc03bf..2592a29f12 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -16,6 +16,7 @@ library(luscale) library(madrat) library(dplyr) library(gms) +library(gdx2) # ============================================= # Basic configuration diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index bde43b4419..ae270348a8 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -13,7 +13,7 @@ # Author: Florian Humpenoeder library(magclass) -library(gdx) +library(gdx2) library(magpie4) library(lucode2) library(gms) diff --git a/scripts/output/extra/out_of_bounds_check.R b/scripts/output/extra/out_of_bounds_check.R index b5489eac17..602ca5f8fc 100644 --- a/scripts/output/extra/out_of_bounds_check.R +++ b/scripts/output/extra/out_of_bounds_check.R @@ -15,7 +15,7 @@ ######################### # Version 1.0, Florian Humpenoeder # -library(gdx) +library(gdx2) library(lucode2) library(magclass) diff --git a/scripts/output/extra/reportMAgPIE2SEALS.R b/scripts/output/extra/reportMAgPIE2SEALS.R index 8b325e86c1..936cb02911 100644 --- a/scripts/output/extra/reportMAgPIE2SEALS.R +++ b/scripts/output/extra/reportMAgPIE2SEALS.R @@ -14,7 +14,7 @@ # 1.00: first working version library(gms) -library(gdx) +library(gdx2) library(magpie4) message("Starting to report gridded MAgPIE land use for SEALS") diff --git a/scripts/output/projects/FSDP_collect.R b/scripts/output/projects/FSDP_collect.R index 120eacc858..daf8578cc7 100644 --- a/scripts/output/projects/FSDP_collect.R +++ b/scripts/output/projects/FSDP_collect.R @@ -17,7 +17,7 @@ library(magclass) library(gms) library(magpiesets) library(data.table) -library(gdx) +library(gdx2) library(quitte) library(m4fsdp) library(stringr) diff --git a/scripts/output/projects/FSDP_collect2.R b/scripts/output/projects/FSDP_collect2.R index 6b842a2880..8e20f3c97a 100644 --- a/scripts/output/projects/FSDP_collect2.R +++ b/scripts/output/projects/FSDP_collect2.R @@ -17,7 +17,7 @@ library(magclass) library(gms) library(magpiesets) library(data.table) -library(gdx) +library(gdx2) library(quitte) library(m4fsdp) library(stringr) diff --git a/scripts/output/projects/peatland.R b/scripts/output/projects/peatland.R index 6cbf8d45e9..915a87ca78 100644 --- a/scripts/output/projects/peatland.R +++ b/scripts/output/projects/peatland.R @@ -18,7 +18,7 @@ library(lucode2) library(magpie4) library(luscale) - +library(gdx2) library(luplot) library(ggplot2) library(luscale) diff --git a/scripts/output/validation_cell.R b/scripts/output/validation_cell.R index 4113c4d201..d924c90247 100644 --- a/scripts/output/validation_cell.R +++ b/scripts/output/validation_cell.R @@ -15,6 +15,7 @@ library(luscale) library(luplot) library(lusweave) library(magpiesets) +library(gdx2) ############################# BASIC CONFIGURATION ############################## if (!file.exists(paste0(outputdir, "/LUH2_croparea_0.5.mz"))) stop("Cell validation is not possible. LUH2_croparea_0.5.mz and MAPSPAM_croparea_0.5.mz files are missing") diff --git a/scripts/start/extra/input_REMIND.R b/scripts/start/extra/input_REMIND.R index ed991a19c3..914ad26d0c 100644 --- a/scripts/start/extra/input_REMIND.R +++ b/scripts/start/extra/input_REMIND.R @@ -12,7 +12,7 @@ library(gms) library(magclass) -library(gdx) +library(gdx2) # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") diff --git a/scripts/start/projects/paper_peatland.R b/scripts/start/projects/paper_peatland.R index a520a9e6ff..c46c579ed6 100644 --- a/scripts/start/projects/paper_peatland.R +++ b/scripts/start/projects/paper_peatland.R @@ -12,7 +12,7 @@ library(gms) library(magclass) -library(gdx) +library(gdx2) library(luscale) library(magpie4) diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index b21af3cdf6..4295fba570 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -7,7 +7,7 @@ library(lucode2) library(gms) library(magclass) -library(gdx) +library(gdx2) # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") diff --git a/scripts/start/projects/project_BEST.R b/scripts/start/projects/project_BEST.R index 689d357b59..c525421d52 100644 --- a/scripts/start/projects/project_BEST.R +++ b/scripts/start/projects/project_BEST.R @@ -17,7 +17,7 @@ version <- "V13" library(lucode2) library(magclass) -library(gdx) +library(gdx2) library(magpie4) library(gms) diff --git a/scripts/start/projects/project_LAMACLIMA_WP4.R b/scripts/start/projects/project_LAMACLIMA_WP4.R index a3b87fdc5f..53abde91de 100644 --- a/scripts/start/projects/project_LAMACLIMA_WP4.R +++ b/scripts/start/projects/project_LAMACLIMA_WP4.R @@ -16,7 +16,7 @@ library(gms) library(magclass) -library(gdx) +library(gdx2) # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") From 7fce62fee57b9b96b18c5f8d63b9b6513a6ca96c Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Mon, 5 Aug 2024 21:15:03 +0200 Subject: [PATCH 111/171] updated CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95b009e095..41ce60ac3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. - **80_optimization** abort GAMS in case of execution errors - **script** updated EATLancet project start scripts +- **script** replaced gdx package with gdx2 package calls ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` From c22704e50820bceab81cd03bdb086b1b448d44b9 Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Wed, 7 Aug 2024 17:42:29 +0200 Subject: [PATCH 112/171] mrdownscale output script --- .../output/extra/disaggregation_mrdownscale.R | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 scripts/output/extra/disaggregation_mrdownscale.R diff --git a/scripts/output/extra/disaggregation_mrdownscale.R b/scripts/output/extra/disaggregation_mrdownscale.R new file mode 100644 index 0000000000..6217ab2f08 --- /dev/null +++ b/scripts/output/extra/disaggregation_mrdownscale.R @@ -0,0 +1,27 @@ +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# ------------------------------------------------------------------------------------------------ +# description: Downscale MAgPIE results to 0.25 degree resolution in LUH2 format for ESMs +# comparison script: FALSE +# ------------------------------------------------------------------------------------------------ +library(mrdownscale) + +outputdir <- normalizePath(outputdir) + +clustermap <- Sys.glob(file.path(outputdir, "clustermap_*.rds")) +gdx <- file.path(outputdir, "fulldata.gdx") +stopifnot(file.exists(gdx), length(clustermap) == 1) + +scenario <- gsub("_", "-", sub("-mag-[0-9]+$", "", basename(outputdir))) + +local({ # redirectSource is local by default, running it in the global environment does not work + redirectSource("MagpieFulldataGdx", c(clustermap, gdx), linkOthers = FALSE) + stopifnot(length(getConfig("redirections")) >= 1) + retrieveData("ESM", rev = format(Sys.time(), "%Y-%m-%d"), scenario = scenario, progress = FALSE, + outputfolder = outputdir) +}) From 141cc01ef32dc4a6ba8fe42ba6405a3d4c209fa8 Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Thu, 8 Aug 2024 09:09:29 +0200 Subject: [PATCH 113/171] use downscaleRunESM --- DESCRIPTION | 1 + .../output/extra/disaggregation_mrdownscale.R | 17 +---------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ab960bac8f..c6007c09d2 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -41,6 +41,7 @@ Imports: Suggests: goxygen, languageserver, + mrdownscale (>= 0.23.0), qgraph, shinyresults, XML diff --git a/scripts/output/extra/disaggregation_mrdownscale.R b/scripts/output/extra/disaggregation_mrdownscale.R index 6217ab2f08..72f0e065fe 100644 --- a/scripts/output/extra/disaggregation_mrdownscale.R +++ b/scripts/output/extra/disaggregation_mrdownscale.R @@ -9,19 +9,4 @@ # description: Downscale MAgPIE results to 0.25 degree resolution in LUH2 format for ESMs # comparison script: FALSE # ------------------------------------------------------------------------------------------------ -library(mrdownscale) - -outputdir <- normalizePath(outputdir) - -clustermap <- Sys.glob(file.path(outputdir, "clustermap_*.rds")) -gdx <- file.path(outputdir, "fulldata.gdx") -stopifnot(file.exists(gdx), length(clustermap) == 1) - -scenario <- gsub("_", "-", sub("-mag-[0-9]+$", "", basename(outputdir))) - -local({ # redirectSource is local by default, running it in the global environment does not work - redirectSource("MagpieFulldataGdx", c(clustermap, gdx), linkOthers = FALSE) - stopifnot(length(getConfig("redirections")) >= 1) - retrieveData("ESM", rev = format(Sys.time(), "%Y-%m-%d"), scenario = scenario, progress = FALSE, - outputfolder = outputdir) -}) +mrdownscale::downscaleRunESM(outputdir) From a239e107fe8fdd8924ae6faf9dca1494bdd54dc7 Mon Sep 17 00:00:00 2001 From: Jake Tommey Date: Thu, 8 Aug 2024 11:03:22 +0200 Subject: [PATCH 114/171] remove priority information from job submission scripts --- scripts/run_submit/submit_priority.sh | 1 - scripts/run_submit/submit_priority_maxMem.sh | 1 - scripts/run_submit/submit_standby.sh | 1 - scripts/run_submit/submit_standby_dayMax.sh | 1 - scripts/run_submit/submit_standby_maxMem.sh | 1 - scripts/run_submit/submit_standby_maxMem_dayMax.sh | 1 - scripts/slurmOutput.yml | 8 ++++---- scripts/slurmStart.yml | 4 ++-- 8 files changed, 6 insertions(+), 12 deletions(-) diff --git a/scripts/run_submit/submit_priority.sh b/scripts/run_submit/submit_priority.sh index a1d82d0ce6..33c8496d5e 100644 --- a/scripts/run_submit/submit_priority.sh +++ b/scripts/run_submit/submit_priority.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=priority -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_priority_maxMem.sh b/scripts/run_submit/submit_priority_maxMem.sh index 612b33efc5..ae58b9695f 100644 --- a/scripts/run_submit/submit_priority_maxMem.sh +++ b/scripts/run_submit/submit_priority_maxMem.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=priority -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby.sh b/scripts/run_submit/submit_standby.sh index 8dca74aae4..f0bff32339 100644 --- a/scripts/run_submit/submit_standby.sh +++ b/scripts/run_submit/submit_standby.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=standby -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_dayMax.sh b/scripts/run_submit/submit_standby_dayMax.sh index 39b04f8baa..d7836390d1 100644 --- a/scripts/run_submit/submit_standby_dayMax.sh +++ b/scripts/run_submit/submit_standby_dayMax.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=standby -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_maxMem.sh b/scripts/run_submit/submit_standby_maxMem.sh index e556d4aff3..23b0999431 100644 --- a/scripts/run_submit/submit_standby_maxMem.sh +++ b/scripts/run_submit/submit_standby_maxMem.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=standby -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/run_submit/submit_standby_maxMem_dayMax.sh b/scripts/run_submit/submit_standby_maxMem_dayMax.sh index 9e02db436d..ac3ba4d307 100644 --- a/scripts/run_submit/submit_standby_maxMem_dayMax.sh +++ b/scripts/run_submit/submit_standby_maxMem_dayMax.sh @@ -1,7 +1,6 @@ #!/bin/bash #SBATCH --qos=standby -#SBATCH --partition=priority #SBATCH --job-name=mag-run #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL diff --git a/scripts/slurmOutput.yml b/scripts/slurmOutput.yml index da4bfc3254..f493010be1 100644 --- a/scripts/slurmOutput.yml +++ b/scripts/slurmOutput.yml @@ -1,5 +1,5 @@ slurmjobs: - SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --time=24:00:00" - SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" - SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority" - SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --mem-per-cpu=0 --cpus-per-task=16" + SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" + SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" + SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority" + SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=0 --cpus-per-task=16" diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index f3e52215ed..8040e4a28c 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: - SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --partition=priority --cpus-per-task=3" - SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --partition=priority --cpus-per-task=3" + SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" + SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From 85c19ca7b0f9100c2b972b2e3906df11dad9a76c Mon Sep 17 00:00:00 2001 From: Pascal Sauer Date: Fri, 9 Aug 2024 12:52:33 +0200 Subject: [PATCH 115/171] mrdownscale script --- scripts/output/extra/disaggregation_mrdownscale.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/output/extra/disaggregation_mrdownscale.R b/scripts/output/extra/disaggregation_mrdownscale.R index 72f0e065fe..13ff3fa212 100644 --- a/scripts/output/extra/disaggregation_mrdownscale.R +++ b/scripts/output/extra/disaggregation_mrdownscale.R @@ -9,4 +9,5 @@ # description: Downscale MAgPIE results to 0.25 degree resolution in LUH2 format for ESMs # comparison script: FALSE # ------------------------------------------------------------------------------------------------ -mrdownscale::downscaleRunESM(outputdir) +library(mrdownscale) +downscaleRunESM(outputdir) From 19a0fbba7143d12d38cc435cee575a52e67391d0 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 12 Aug 2024 16:35:12 +0200 Subject: [PATCH 116/171] test --- modules/80_optimization/nlp_apr17/solve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 3d3ea109e6..7b42b77aa6 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -87,7 +87,7 @@ if (magpie.modelstat > 2, s80_resolve_option$(s80_resolve_option >= 4) = 0; - until (magpie.modelstat <= 2 or s80_counter >= s80_maxiter) + until ((magpie.modelstat <= 2 AND magpie.numNOpt = 0) or s80_counter >= s80_maxiter) ); ); From b9714cd05c2db735bf39a68ff73e1d9a654c503a Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 13 Aug 2024 09:17:46 +0200 Subject: [PATCH 117/171] test --- modules/80_optimization/nlp_apr17/solve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 7b42b77aa6..cd561869c9 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -43,7 +43,7 @@ display magpie.modelstat; magpie.modelStat$(magpie.modelStat=NA) = 13; * in case of problems try different solvers and optfile settings -if (magpie.modelstat > 2, +if (magpie.modelstat > 2 OR magpie.numNOpt > 0, repeat( s80_counter = s80_counter + 1 ; s80_resolve_option = s80_resolve_option + 1; From 83349daf127ce78ed1e6700a5cf45e06b4697be0 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 13 Aug 2024 17:18:01 +0200 Subject: [PATCH 118/171] test --- modules/80_optimization/nlp_apr17/solve.gms | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index cd561869c9..c03c4f7ceb 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -12,6 +12,7 @@ s80_resolve_option = 0; *** solver settings option nlp = conopt4; +option threads = 1 magpie.optfile = s80_optfile; magpie.scaleopt = 1 ; magpie.solprint = 0 ; @@ -43,7 +44,7 @@ display magpie.modelstat; magpie.modelStat$(magpie.modelStat=NA) = 13; * in case of problems try different solvers and optfile settings -if (magpie.modelstat > 2 OR magpie.numNOpt > 0, +if (magpie.modelstat > 2, repeat( s80_counter = s80_counter + 1 ; s80_resolve_option = s80_resolve_option + 1; @@ -87,7 +88,7 @@ if (magpie.modelstat > 2 OR magpie.numNOpt > 0, s80_resolve_option$(s80_resolve_option >= 4) = 0; - until ((magpie.modelstat <= 2 AND magpie.numNOpt = 0) or s80_counter >= s80_maxiter) + until (magpie.modelstat <= 2 or s80_counter >= s80_maxiter) ); ); From d80f7041d725578299702cdb391de64d3651f290 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 15 Aug 2024 08:33:09 +0200 Subject: [PATCH 119/171] bugfix --- modules/80_optimization/nlp_apr17/solve.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index c03c4f7ceb..c6ceb4c58d 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -12,7 +12,7 @@ s80_resolve_option = 0; *** solver settings option nlp = conopt4; -option threads = 1 +option threads = 1; magpie.optfile = s80_optfile; magpie.scaleopt = 1 ; magpie.solprint = 0 ; From df505c461c1215ecd85f93883a2cf23ce5a66c6c Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 15 Aug 2024 12:27:03 +0200 Subject: [PATCH 120/171] test --- modules/80_optimization/lp_nlp_apr17/solve.gms | 1 + modules/80_optimization/nlp_apr17/solve.gms | 12 ++++++++++-- modules/80_optimization/nlp_par/solve.gms | 11 ++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index 7252140a62..4f0ee84d12 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -19,6 +19,7 @@ magpie.holdfixed = 1 ; * linear solver option lp = cplex ; option qcp = cplex ; +option threads = 1; $onecho > cplex.opt $offecho diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index c6ceb4c58d..d81cb393bf 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -12,7 +12,7 @@ s80_resolve_option = 0; *** solver settings option nlp = conopt4; -option threads = 1; +*option threads = 1; magpie.optfile = s80_optfile; magpie.scaleopt = 1 ; magpie.solprint = 0 ; @@ -26,6 +26,10 @@ $onecho > conopt4.op2 Flg_Prep = FALSE $offecho +$onecho > conopt4.op3 +Flg_NoDefc = TRUE +$offecho + if(execerror > 0, abort "Execution error. Check your .lst file."; ); @@ -62,6 +66,10 @@ if (magpie.modelstat > 2, option nlp = conopt4; magpie.optfile = 2; elseif s80_resolve_option = 4, + display "Modelstat > 2 | Retry solve with CONOPT4 w/o search for definitional constraints"; + option nlp = conopt4; + magpie.optfile = 3; + elseif s80_resolve_option = 5, display "Modelstat > 2 | Retry solve with CONOPT3"; option nlp = conopt; magpie.optfile = 0; @@ -86,7 +94,7 @@ if (magpie.modelstat > 2, * Otherwise, the repeat loop will never end. magpie.modelStat$(magpie.modelStat=NA) = 13; - s80_resolve_option$(s80_resolve_option >= 4) = 0; + s80_resolve_option$(s80_resolve_option >= 5) = 0; until (magpie.modelstat <= 2 or s80_counter >= s80_maxiter) ); diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index e4478be1e6..8be359c8ed 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -13,6 +13,7 @@ p80_resolve_option(h) = 0; *** solver settings option nlp = conopt4; +option threads = 1; magpie.solvelink = 3; magpie.optfile = s80_optfile ; magpie.scaleopt = 1 ; @@ -28,6 +29,10 @@ $onecho > conopt4.op2 Flg_Prep = FALSE $offecho +$onecho > conopt4.op3 +Flg_NoDefc = TRUE +$offecho + h2(h) = no; i2(i) = no; j2(j) = no; @@ -112,6 +117,10 @@ repeat option nlp = conopt4; magpie.optfile = 2; elseif p80_resolve_option(h) = 4, + display "Modelstat > 2 | Retry solve with CONOPT4 w/o search for definitional constraints"; + option nlp = conopt4; + magpie.optfile = 3; + elseif p80_resolve_option(h) = 5, display "Modelstat > 2 | Retry solve with CONOPT3"; option nlp = conopt; magpie.optfile = 0; @@ -124,7 +133,7 @@ repeat option nlp = conopt4; magpie.optfile = s80_optfile; - p80_resolve_option(h)$(p80_resolve_option(h) >= 4) = 0; + p80_resolve_option(h)$(p80_resolve_option(h) >= 5) = 0; ); h2(h) = no; i2(i) = no; From 37ebeca1364b703929c8afcfc8bc5222f17b5e33 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 15 Aug 2024 14:24:27 +0200 Subject: [PATCH 121/171] update --- modules/15_food/anthro_iso_jun22/intersolve.gms | 1 + modules/15_food/anthro_iso_jun22/presolve.gms | 4 ++-- modules/15_food/anthropometrics_jan18/intersolve.gms | 1 + modules/15_food/anthropometrics_jan18/presolve.gms | 4 ++-- modules/80_optimization/nlp_apr17/solve.gms | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/intersolve.gms b/modules/15_food/anthro_iso_jun22/intersolve.gms index a8c71d9858..dd63850648 100644 --- a/modules/15_food/anthro_iso_jun22/intersolve.gms +++ b/modules/15_food/anthro_iso_jun22/intersolve.gms @@ -27,6 +27,7 @@ if (s15_elastic_demand = 1 AND m_year(t) > sm_fix_SSP2, display "elastic demand model is activated"; option nlp = conopt4; + option threads = 1; * A new iteration is started p15_iteration_counter(t) = p15_iteration_counter(t) + 1; diff --git a/modules/15_food/anthro_iso_jun22/presolve.gms b/modules/15_food/anthro_iso_jun22/presolve.gms index 199444b198..966459bdbb 100644 --- a/modules/15_food/anthro_iso_jun22/presolve.gms +++ b/modules/15_food/anthro_iso_jun22/presolve.gms @@ -23,8 +23,8 @@ else + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_dummy(iso)); ); -option nlp = conopt4 - +option nlp = conopt4; +option threads = 1; *' @code *' Within the major food groups determined by the regressions diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index 4434095a33..b7bef0edd7 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -6,6 +6,7 @@ *** | Contact: magpie@pik-potsdam.de option nlp = conopt4; +option threads = 1; * A new iteration is started p15_iteration_counter(t) = p15_iteration_counter(t) + 1; diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 38dbeb3df1..3c8f4fca52 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -23,8 +23,8 @@ else + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_dummy(iso)); ); -option nlp = conopt4 - +option nlp = conopt4; +option threads = 1; *' @code *' Within the major food groups determined by the regressions diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index d81cb393bf..1ad53e28f0 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -12,7 +12,7 @@ s80_resolve_option = 0; *** solver settings option nlp = conopt4; -*option threads = 1; +option threads = 1; magpie.optfile = s80_optfile; magpie.scaleopt = 1 ; magpie.solprint = 0 ; From 2f8c1828e93190822fe2df660ea69e39c3c2b5b4 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 15 Aug 2024 14:41:49 +0200 Subject: [PATCH 122/171] update --- scripts/slurmStart.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index 8040e4a28c..6949aeb075 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: - SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" - SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3" + SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3 --time=6:00:00" + SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3 --time=6:00:00" SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From 84986ff01f9c3407d87ffc55a6a7a04b0fe95443 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 16 Aug 2024 16:11:48 +0200 Subject: [PATCH 123/171] changelog --- CHANGELOG.md | 2 +- scripts/slurmStart.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e840845f19..c51c6d170f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. -- **80_optimization** abort GAMS in case of execution errors +- **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default and Flg_NoDefc = TRUE as option - **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. - **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area - **script** updated EATLancet project start scripts diff --git a/scripts/slurmStart.yml b/scripts/slurmStart.yml index 6949aeb075..264a8c3414 100644 --- a/scripts/slurmStart.yml +++ b/scripts/slurmStart.yml @@ -1,4 +1,4 @@ slurmjobs: - SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3 --time=6:00:00" - SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3 --time=6:00:00" + SLURM priority: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --cpus-per-task=3" + SLURM standby: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --cpus-per-task=3 --time=24:00:00" SLURM medium: "sbatch --job-name=%NAME --output=logs/%NAME-%j.out --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=medium --cpus-per-task=3" From f0981f73f1ed6902443cd28223d7db9c3f1714ee Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 16 Aug 2024 16:25:33 +0200 Subject: [PATCH 124/171] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c51c6d170f..36e3678eb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. - **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. -- **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default and Flg_NoDefc = TRUE as option +- **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default to avoid infeasibilites and Flg_NoDefc = TRUE as option +- **config** default settings for 58_peatland revised - **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. - **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area - **script** updated EATLancet project start scripts From f7acc2de65312624a6c40b5f3fd8f2d7f51f36cf Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 20 Aug 2024 15:16:03 +0200 Subject: [PATCH 125/171] bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` --- CHANGELOG.md | 1 + modules/15_food/anthro_iso_jun22/intersolve.gms | 2 +- modules/15_food/anthro_iso_jun22/presolve.gms | 2 +- modules/15_food/anthropometrics_jan18/intersolve.gms | 2 +- modules/15_food/anthropometrics_jan18/presolve.gms | 2 +- modules/80_optimization/lp_nlp_apr17/solve.gms | 4 ++-- modules/80_optimization/nlp_apr17/solve.gms | 2 +- modules/80_optimization/nlp_par/solve.gms | 4 +--- 8 files changed, 9 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36e3678eb2..bfb580d9e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso +- **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` ## [4.8.1] - 2024-06-19 diff --git a/modules/15_food/anthro_iso_jun22/intersolve.gms b/modules/15_food/anthro_iso_jun22/intersolve.gms index dd63850648..3f6bacb822 100644 --- a/modules/15_food/anthro_iso_jun22/intersolve.gms +++ b/modules/15_food/anthro_iso_jun22/intersolve.gms @@ -48,7 +48,7 @@ if (s15_elastic_demand = 1 AND m_year(t) > sm_fix_SSP2, * in case of problems try CONOPT3 if(m15_food_demand.modelstat > 2, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; solve m15_food_demand USING nlp MAXIMIZING v15_objective; option nlp = conopt4; ); diff --git a/modules/15_food/anthro_iso_jun22/presolve.gms b/modules/15_food/anthro_iso_jun22/presolve.gms index 966459bdbb..1fed66b995 100644 --- a/modules/15_food/anthro_iso_jun22/presolve.gms +++ b/modules/15_food/anthro_iso_jun22/presolve.gms @@ -241,7 +241,7 @@ solve m15_food_demand USING nlp MAXIMIZING v15_objective; * in case of problems try CONOPT3 if(m15_food_demand.modelstat > 2, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; solve m15_food_demand USING nlp MAXIMIZING v15_objective; option nlp = conopt4; ); diff --git a/modules/15_food/anthropometrics_jan18/intersolve.gms b/modules/15_food/anthropometrics_jan18/intersolve.gms index b7bef0edd7..7a01bd2061 100644 --- a/modules/15_food/anthropometrics_jan18/intersolve.gms +++ b/modules/15_food/anthropometrics_jan18/intersolve.gms @@ -43,7 +43,7 @@ solve m15_food_demand USING nlp MAXIMIZING v15_objective; * in case of problems try CONOPT3 if(m15_food_demand.modelstat > 2, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; solve m15_food_demand USING nlp MAXIMIZING v15_objective; option nlp = conopt4; ); diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms index 3c8f4fca52..772a0a383d 100644 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ b/modules/15_food/anthropometrics_jan18/presolve.gms @@ -241,7 +241,7 @@ solve m15_food_demand USING nlp MAXIMIZING v15_objective; * in case of problems try CONOPT3 if(m15_food_demand.modelstat > 2, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; solve m15_food_demand USING nlp MAXIMIZING v15_objective; option nlp = conopt4; ); diff --git a/modules/80_optimization/lp_nlp_apr17/solve.gms b/modules/80_optimization/lp_nlp_apr17/solve.gms index 4f0ee84d12..c3250b566c 100644 --- a/modules/80_optimization/lp_nlp_apr17/solve.gms +++ b/modules/80_optimization/lp_nlp_apr17/solve.gms @@ -135,7 +135,7 @@ $batinclude "./modules/include.gms" nl_relax * if s80_add_conopt3 is 1 add additional solve statement for conopt3 if((s80_add_conopt3 = 1), display "Additional solve with CONOPT3!"; - option nlp = conopt; + option nlp = conopt3; solve magpie USING nlp MINIMIZING vm_cost_glo; if(s80_secondsolve = 1, solve magpie USING nlp MINIMIZING vm_cost_glo; ); option nlp = conopt4; @@ -154,7 +154,7 @@ $batinclude "./modules/include.gms" nl_relax * if solve stopped with an error, try it again with conopt3 if ((magpie.modelstat = 13), display "WARNING: Modelstat 13 | retry with CONOPT3!"; - option nlp = conopt; + option nlp = conopt3; solve magpie USING nlp MINIMIZING vm_cost_glo; if(s80_secondsolve = 1, solve magpie USING nlp MINIMIZING vm_cost_glo; ); option nlp = conopt4; diff --git a/modules/80_optimization/nlp_apr17/solve.gms b/modules/80_optimization/nlp_apr17/solve.gms index 1ad53e28f0..7dc3b1198d 100644 --- a/modules/80_optimization/nlp_apr17/solve.gms +++ b/modules/80_optimization/nlp_apr17/solve.gms @@ -71,7 +71,7 @@ if (magpie.modelstat > 2, magpie.optfile = 3; elseif s80_resolve_option = 5, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; magpie.optfile = 0; ); diff --git a/modules/80_optimization/nlp_par/solve.gms b/modules/80_optimization/nlp_par/solve.gms index 8be359c8ed..60d888a72e 100644 --- a/modules/80_optimization/nlp_par/solve.gms +++ b/modules/80_optimization/nlp_par/solve.gms @@ -100,8 +100,6 @@ repeat if(p80_extra_solve(h) = 1, display "Resolve"; p80_resolve_option(h) = p80_resolve_option(h) + 1; - display "Load solution from last time step as starting point"; - execute_loadpoint 'fulldata.gdx'; s80_resolve_option = sum(h2,p80_resolve_option(h2)); display s80_resolve_option; if(p80_resolve_option(h) = 1, @@ -122,7 +120,7 @@ repeat magpie.optfile = 3; elseif p80_resolve_option(h) = 5, display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt; + option nlp = conopt3; magpie.optfile = 0; ); if(execerror > 0, execerror = 0); From 94f2f3093663caa3c10398cf20577d2646b5cd7b Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 21 Aug 2024 11:04:18 +0200 Subject: [PATCH 126/171] doc forestry --- modules/32_forestry/dynamic_may24/equations.gms | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/modules/32_forestry/dynamic_may24/equations.gms b/modules/32_forestry/dynamic_may24/equations.gms index dcd0a42fbc..c2f861d0d5 100644 --- a/modules/32_forestry/dynamic_may24/equations.gms +++ b/modules/32_forestry/dynamic_may24/equations.gms @@ -11,14 +11,12 @@ ****** Costs ****** *------------------ -*' The direct costs of Timber production and afforestation `vm_cost_fore` include -*' maintenance and monitoring costs for newly established plantations as well as -*' standing plantations '[@sathaye_ghg_2005]. In addition, this type of forest management -*' (including afforestation) may cause costs in other parts of the model such as costs -*' for technological change [13_tc] or land expansion [39_landconversion]. Also included -*' are additional costs for producing timber from extremely highly managed plantations -*' which are analogous to intensification using technological change from [13_tc] but -*' in a parametrized form. +*' The direct costs for timber plantations and re/afforestation `vm_cost_fore` include +*' establishment cost for new forests, recurring maintenance and monitoring +*' costs for standing forests as well as harvesting costs for timber plantations. +*' In addition, this type of forest management +*' (including re/afforestation) may cause costs in other parts of the model such as costs +*' for technological change [13_tc] or land expansion [39_landconversion]. q32_cost_total(i2) .. vm_cost_fore(i2) =e= v32_cost_recur(i2) From 5980aa63a747d0e17f0b3ad3afade3e391fc7eb3 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 28 Aug 2024 16:07:44 +0200 Subject: [PATCH 127/171] updated EAT2p0 script to refer to new config file --- scripts/start/projects/project_EAT2p0.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 7408842a52..e43f45bbcc 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -43,6 +43,7 @@ cfg$output <- c( # SCENARIO DEFINITION # ####################### cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") ### BAU Scenario ### # SSP: SSP2 @@ -153,6 +154,7 @@ miti <- function(cfg) { cfg$title <- "BAU" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -163,6 +165,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_DIET" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) @@ -173,6 +176,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_PROD" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- prod(cfg = cfg) @@ -183,6 +187,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_WAST" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- waste(cfg = cfg) @@ -193,6 +198,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_RCP26" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -202,6 +208,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_NoCC" # standard setting, but without CC cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) start_run(cfg, codeCheck = FALSE) @@ -211,6 +218,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "BAU_MITI" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -221,6 +229,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "EL2" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) @@ -233,6 +242,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -246,6 +256,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_DIET" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -258,6 +269,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_PROD" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -270,6 +282,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_WAST" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -282,6 +295,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_RCP70" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -295,6 +309,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_NoCC" # standard setting, but with NDC activated (for miti) and without CC cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- miti(cfg = cfg) @@ -308,6 +323,7 @@ start_run(cfg, codeCheck = FALSE) cfg$title <- "ELM_MITI" # standard setting, but with NDC activated (for miti) cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) +cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") # scenario settings cfg <- bau(cfg = cfg) cfg <- diet(cfg = cfg) From e2b3faee321a00d2ad3be46963c80b631e78bc61 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 28 Aug 2024 16:18:17 +0200 Subject: [PATCH 128/171] bugfix lamaclima script --- scripts/start/projects/project_LAMACLIMA_WP4.R | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/start/projects/project_LAMACLIMA_WP4.R b/scripts/start/projects/project_LAMACLIMA_WP4.R index fa1a6ca379..709d580522 100644 --- a/scripts/start/projects/project_LAMACLIMA_WP4.R +++ b/scripts/start/projects/project_LAMACLIMA_WP4.R @@ -46,7 +46,7 @@ cfg$qos <- "priority_maxMem" ### Global Sustainability, largely based on SDP cfg$title <- paste(prefix, "Sustainability", sep = "_") cfg <- setScenario(cfg, c("rcp1p9")) -cfg <- setScenario(cfg, c("LAMA_Sustainability"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Sustainability"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- all_iso_countries cfg$gms$policy_countries22 <- all_iso_countries @@ -59,7 +59,7 @@ start_run(cfg,codeCheck=FALSE) ### Global Inequality, largely based on SSP4 cfg$title <- paste(prefix, "Inequality", sep = "_") cfg <- setScenario(cfg, c("rcp1p9")) -cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -73,7 +73,7 @@ start_run(cfg,codeCheck=FALSE) ### LAMA_Inequal-SustDemand cfg$title <- paste(prefix, "Inequality-SustDemand", sep = "_") cfg <- setScenario(cfg, c("rcp1p9")) -cfg <- setScenario(cfg, c("LAMA_Inequal-SustDemand"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Inequal-SustDemand"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -85,7 +85,7 @@ start_run(cfg,codeCheck=FALSE) ### LAMA_Inequal-EnvirProt cfg$title <- paste(prefix, "Inequality-EnvirProt", sep = "_") cfg <- setScenario(cfg, c("rcp1p9")) -cfg <- setScenario(cfg, c("LAMA_Inequal-EnvirProt"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Inequal-EnvirProt"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- all_iso_countries cfg$gms$policy_countries22 <- all_iso_countries cfg$gms$EFP_countries <- all_iso_countries @@ -97,7 +97,7 @@ start_run(cfg,codeCheck=FALSE) ### LAMA_Inequal-GHGPrice cfg$title <- paste(prefix, "Inequality-GHGPrice", sep = "_") cfg <- setScenario(cfg, c("rcp1p9")) -cfg <- setScenario(cfg, c("LAMA_Inequal-GHGPrice"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Inequal-GHGPrice"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU @@ -109,7 +109,7 @@ start_run(cfg,codeCheck=FALSE) ### Global Inequality with higher climate impacts cfg$title <- paste(prefix, "Inequality-rcp7p0", sep = "_") cfg <- setScenario(cfg, c("rcp7p0")) -cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/config_lama.csv") +cfg <- setScenario(cfg, c("LAMA_Inequal"), scenario_config = "config/projects/scenario_config_lama.csv") cfg$gms$policy_countries30 <- oecd90andEU cfg$gms$policy_countries22 <- oecd90andEU cfg$gms$EFP_countries <- oecd90andEU From 83c7542b46af53ab3b4450d5496ecde8f23440ff Mon Sep 17 00:00:00 2001 From: weindl <39915455+weindl@users.noreply.github.com> Date: Fri, 30 Aug 2024 14:33:41 +0200 Subject: [PATCH 129/171] Update scenario_config_gcs.csv to account for additional GCS scenarios --- config/projects/scenario_config_gcs.csv | 62 +++++++++++++++---------- 1 file changed, 38 insertions(+), 24 deletions(-) diff --git a/config/projects/scenario_config_gcs.csv b/config/projects/scenario_config_gcs.csv index 9548161ebf..fa07333dc1 100755 --- a/config/projects/scenario_config_gcs.csv +++ b/config/projects/scenario_config_gcs.csv @@ -1,24 +1,38 @@ -;Tland -gms$s15_exo_foodscen_start;2020 -gms$s15_exo_foodscen_target;2050 -gms$s15_exo_waste;1 -gms$s15_waste_scen;1.2 -gms$s15_exo_diet;1 -gms$c15_kcal_scen;healthy_BMI -gms$c15_EAT_scen;FLX -gms$s15_exo_brans;1 -gms$c22_protect_scenario;BH -gms$c22_protect_scenario_noselect;none -gms$s32_max_aff_area;500 -gms$c32_aff_mask;onlytropical -gms$s35_forest_damage_end;2030 -gms$s42_irrig_eff_scenario;3 -gms$c42_env_flow_policy;on -gms$s42_efp_targetyear;2040 -gms$c50_scen_neff;baseeff_add3_add15_add25_max75 -gms$c50_scen_neff_noselect;baseeff_add3_add15_add25_max75 -gms$c55_scen_conf;ssp1 -gms$c55_scen_conf_noselect;ssp1 -gms$c60_1stgen_biodem;phaseout2020 -gms$c60_res_2ndgenBE_dem;sdp -gms$c70_feed_scen;ssp1 +;GCSF;LNDlbs;LNDres;LNDfood;Tland +gms$food;anthro_iso_jun22;;;; +gms$s15_exo_foodscen_start;;;;2020;2020 +gms$s15_exo_foodscen_target;;;;2050;2050 +gms$s15_exo_waste;;;;1;1 +gms$s15_waste_scen;;;;1.2;1.2 +gms$s15_exo_diet;;;;1;1 +gms$c15_kcal_scen;;;;healthy_BMI;healthy_BMI +gms$c15_EAT_scen;;;;FLX;FLX +gms$s15_exo_monogastric;;;;1;1 +gms$s15_exo_ruminant;;;;1;1 +gms$s15_exo_fish;;;;1;1 +gms$s15_exo_fruitvegnut;;;;1;1 +gms$s15_exo_pulses;;;;1;1 +gms$s15_exo_sugar;;;;1;1 +gms$s15_exo_oils;;;;1;1 +gms$s15_exo_brans;;;;1;1 +gms$s15_exo_scp;;;;1;1 +gms$s15_exo_alcohol;;;;1;1 +gms$c22_protect_scenario;;BH_IFL;;;BH_IFL +gms$s29_snv_shr;;0.2;;;0.2 +gms$s29_snv_scenario_target;;2030;;;2030 +gms$c30_bioen_water;;;rainfed;;rainfed +gms$s32_aff_plantation;;0;;;0 +gms$s32_aff_bii_coeff;;0;;;0 +gms$s32_max_aff_area;;500;;;500 +gms$c32_aff_mask;;onlytropical;;;onlytropical +gms$s35_forest_damage_end;;2030;;;2030 +gms$s42_irrig_eff_scenario;;;3;;3 +gms$c42_env_flow_policy;;;on;;on +gms$s42_efp_targetyear;;;2040;;2040 +gms$c50_scen_neff;;;baseeff_add3_add15_add25_max75;;baseeff_add3_add15_add25_max75 +gms$c55_scen_conf;;;ssp1;;ssp1 +gms$s56_buffer_aff;;0.2;;;0.2 +gms$c56_emis_policy;;gcs_lbs;gcs_res;;redd+natveg_nosoil +gms$c60_1stgen_biodem;;;phaseout2020;;phaseout2020 +gms$c60_res_2ndgenBE_dem;;;;sdp;sdp +gms$c70_feed_scen;;;ssp1;;ssp1 From a6a560935d6a116ebdf0ce0018c66e98fb6b57e2 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 30 Aug 2024 15:47:58 +0200 Subject: [PATCH 130/171] cleaned up EL2 AgMIP start script --- scripts/start/projects/project_EAT2p0.R | 37 +------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 7408842a52..6f40c3cc3d 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -135,7 +135,6 @@ waste <- function(cfg) { # starting from 2020. miti <- function(cfg) { # Mitigation: consistent with 1.5C considering diet change - # To Do: update to iteration 5! cfg$path_to_report_ghgprices <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif" cfg$gms$c56_pollutant_prices <- "coupling" cfg$path_to_report_bioenergy <- "/p/projects/magpie/users/beier/EL2_DeepDive_release/remind/output/C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12/REMIND_generic_C_SSP2EU-DSPkB650-DS_betax_AgMIP-rem-12.mif" @@ -159,7 +158,7 @@ start_run(cfg, codeCheck = FALSE) # BAU_DIET # # Decomposition scenario. Adds EL2.0 Diet to BAU: -# Globally achieves EL2 diet by 2050 # To Do: Check implemention! +# Globally achieves EL2 diet by 2050 cfg$title <- "BAU_DIET" # standard setting cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) @@ -188,15 +187,6 @@ cfg <- bau(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) -# BAU_RCP26 # -# Decomposition Scenario. Apply lower climate impacts based on RCP 2.6 to BAU -cfg$title <- "BAU_RCP26" -# standard setting -cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) -# scenario settings -cfg <- bau(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # BAU_NoCC # # Decomposition scenario. Remove climate impacts (NoCC) from BAU to isolate climate effects cfg$title <- "BAU_NoCC" @@ -277,19 +267,6 @@ cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) start_run(cfg, codeCheck = FALSE) -# ELM_RCP70 # -# Decomposition Scenario. Applies RCP 7.0 climate impacts to ELM -cfg$title <- "ELM_RCP70" -# standard setting, but with NDC activated (for miti) -cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) -# scenario settings -cfg <- bau(cfg = cfg) -cfg <- miti(cfg = cfg) -cfg <- diet(cfg = cfg) -cfg <- prod(cfg = cfg) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # ELM_NoCC # # Decomposition Scenario. Removes climate impacts (NoCC) from ELM cfg$title <- "ELM_NoCC" @@ -302,15 +279,3 @@ cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) - -# ELM_MITI # -# Decomposition Scenario. Removes climate mitigation and LUC policies from ELM -cfg$title <- "ELM_MITI" -# standard setting, but with NDC activated (for miti) -cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) -# scenario settings -cfg <- bau(cfg = cfg) -cfg <- diet(cfg = cfg) -cfg <- prod(cfg = cfg) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) From 5011a60308091823ff0e135b0007b20bf26b0a1d Mon Sep 17 00:00:00 2001 From: Felicitas Date: Fri, 30 Aug 2024 15:58:36 +0200 Subject: [PATCH 131/171] bugfix for noCC scenario --- scripts/start/projects/project_EAT2p0.R | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 6f40c3cc3d..363295ded7 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -194,6 +194,8 @@ cfg$title <- "BAU_NoCC" cfg <- setScenario(cfg, c("nocc_hist", "SSP2", "NPI")) # scenario settings cfg <- bau(cfg = cfg) +# deactivate labor productivity climate impacts +cfg$gms$labor_prod <- "off" start_run(cfg, codeCheck = FALSE) # BAU_MITI # @@ -278,4 +280,6 @@ cfg <- miti(cfg = cfg) cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) cfg <- waste(cfg = cfg) +# deactivate labor productivity climate impacts +cfg$gms$labor_prod <- "off" start_run(cfg, codeCheck = FALSE) From 0286b8b942d0e38f1bb30588da66dfd63afe9c39 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 3 Sep 2024 17:25:19 +0200 Subject: [PATCH 132/171] update doc --- modules/58_peatland/v2/equations.gms | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/58_peatland/v2/equations.gms b/modules/58_peatland/v2/equations.gms index 9db3ad2a17..569fc87361 100644 --- a/modules/58_peatland/v2/equations.gms +++ b/modules/58_peatland/v2/equations.gms @@ -39,7 +39,8 @@ *' The scaling factor for reduction reflects the ratio of drained peatland and total peatland area, *' based on the assumption that the likelihood of peatland rewetting increases with a higher share of *' drained peatland over total peatland area. -*' Vice-versa, the scaling factor for reduction decreases with an increasing share of rewetted peatland. +*' Therefore, the scaling factor for peatland reduction increases with an increasing share of drained peatland +*' and decreases with a decreasing share of drained peatland. *' In case managed land remains unchanged, also drained peatland remains unchanged. q58_peatlandMan(j2,manPeat58)$(sum(ct, m_year(ct)) > s58_fix_peatland) .. From 89a3e7d8de5ef88b41e5930e04ea66b0171cf27d Mon Sep 17 00:00:00 2001 From: Kristine Karstens <33092354+k4rst3ns@users.noreply.github.com> Date: Thu, 5 Sep 2024 11:36:49 +0200 Subject: [PATCH 133/171] Update CHANGELOG.md Co-authored-by: pvjeetze <50408549+pvjeetze@users.noreply.github.com> --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb5688f335..d0015d3fd4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **80_optimization** abort GAMS in case of execution errors - **scripts** updated EATLancet project start scripts - **scripts** replaced gdx package with gdx2 package calls -- **scripts** split scenario_config into project-specific configs +- **config** split scenario_config into project-specific configs ### added From a884e2c22ca8d2d1ff336bb07c6fab4b8fe4a29b Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 5 Sep 2024 15:01:34 +0200 Subject: [PATCH 134/171] update R packages --- DESCRIPTION | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index ab960bac8f..856244b754 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -8,8 +8,7 @@ Imports: curl, data.table, dplyr, - gdx, - gdxrrw, + gdx2, ggplot2, ggrepel, gms (>= 0.24.0), @@ -22,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.5.6), + magpie4 (>= 2.10.2), MagpieNCGains, magpiesets, mip, From 79138f567bdcbef249fd8059302238ee3f61dd34 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 6 Sep 2024 09:02:15 +0200 Subject: [PATCH 135/171] Update AgroForestry ABCDR --- CHANGELOG.md | 2 + DESCRIPTION | 2 +- config/default.cfg | 8 ++- modules/29_cropland/detail_apr24/input.gms | 7 +- modules/29_cropland/detail_apr24/preloop.gms | 13 ++-- scripts/start/projects/project_ABCDR.R | 68 ++++++++++---------- 6 files changed, 54 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a80e24e22b..43eaac8677 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** updated EATLancet project start scripts - **script** replaced gdx package with gdx2 package calls - **config** split scenario_config into project-specific configs +- **config** initial treecover on cropland starts from zero ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` @@ -26,6 +27,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** check of variables needed in piamInterfaces in report_rds.R - **42_water_demand** added water abstraction type dimension for non-ag uses - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy +- **cropland** added option for discarding initial treecover on cropland ### removed - diff --git a/DESCRIPTION b/DESCRIPTION index 856244b754..c6ed62ba59 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.10.2), + magpie4 (>= 2.10.3), MagpieNCGains, magpiesets, mip, diff --git a/config/default.cfg b/config/default.cfg index 603e0c76be..82e689d062 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -742,6 +742,10 @@ cfg$gms$land_snv <- "secdforest, forestry, past, other" #def = "secdforest, f # *** Options only available for `detail_apr24` realization *** ## Agroforestry settings for treecover on cropland +# * Initial tree cover +# * (0): tree cover on cropland starts from zero +# * (1): tree cover on cropland is initialized based on satellite data for 2015 +cfg$gms$s29_treecover_map <- 0 # def = 0 # * Sigmoid fader for minimum area share of treecover on total cropland at cluster level # * Minimum area share of treecover on total cropland in target year # Note: s29_treecover_target applies to countries selected in policy_countries29 @@ -750,7 +754,7 @@ cfg$gms$s29_treecover_target <- 0 # def = 0 cfg$gms$s29_treecover_target_noselect <- 0 # def = 0 # * Avoid loss of existing treecover (1=yes 0=no). # * If set to 1, `s29_treecover_target` will be adjusted based existing treecover area. -cfg$gms$s29_treecover_keep <- 1 # def = 1 +cfg$gms$s29_treecover_keep <- 0 # def = 0 # * Maximum share of treecover on total cropland (1) cfg$gms$s29_treecover_max <- 0.4 # def = 0.4 # * Start year of fader @@ -758,7 +762,7 @@ cfg$gms$s29_treecover_scenario_start <- 2025 # def = 2025 # * Target year of fader (year when full implementation is reached) cfg$gms$s29_treecover_scenario_target <- 2050 # def = 2050 # * Penalty for violation of treecover target before scenario start (USD05MER per ha) -cfg$gms$s29_treecover_penalty_before <- 5000 # def = 5000 +cfg$gms$s29_treecover_penalty_before <- 0 # def = 0 # * Penalty for violation of treecover target after scenario start (USD05MER per ha) cfg$gms$s29_treecover_penalty <- 5000 # def = 5000 # * Tree cover establishment cost (USD05MER per ha) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index 163dc134e1..c483bf6a5c 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -23,15 +23,16 @@ scalars s29_treecover_scenario_target Cropland treecover scenario target year / 2050 / s29_treecover_target Minimum share of treecover on total cropland in target year (1) / 0 / s29_treecover_target_noselect Minimum share of treecover on total cropland in target year (1) / 0 / - s29_treecover_keep Avoid loss of existing treecover (1=yes 0=no) / 1 / + s29_treecover_keep Avoid loss of existing treecover (1=yes 0=no) / 0 / s29_treecover_max Maximum share of treecover on total cropland (1) / 0.4 / - s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD05MER per ha) / 5000 / + s29_treecover_penalty_before Penalty for violation of treecover target before scenario start (USD05MER per ha) / 0 / s29_treecover_penalty Penalty for violation of treecover target after sceanrio start (USD05MER per ha) / 5000 / s29_fallow_scenario_start Fallow land scenario start year / 2025 / s29_fallow_scenario_target Fallow land scenario target year / 2050 / s29_fallow_target Minimum share of fallow land on total cropland in target year (1) / 0 / s29_fallow_max Maximum share of fallow land on total cropland (1) / 0.4 / s29_fallow_penalty Penalty for violation of fallow target (USD05MER per ha) / 500 / + s29_treecover_map Treecover map for initialization (binary) / 0 / ; @@ -92,7 +93,7 @@ $offdelim ********* Cropland tree cover ******************************************* -parameter f29_treecover(j) Tree cover on cropland in 2019 (mio. ha) +parameter f29_treecover(j) Tree cover on cropland in 2015 (mio. ha) / $ondelim $include "./modules/29_cropland/input/CroplandTreecover.cs2" diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index 1f288bd228..af9180f7ee 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -23,11 +23,14 @@ elseif s29_snv_shr > s29_snv_relocation_data_x1, * Initial tree cover on cropland is assumed to be equally distributed among all age-classes -pc29_treecover_share(j) = 0; -pc29_treecover_share(j)$(pm_land_hist("y2015",j,"crop") > 1e-10) = f29_treecover(j) / pm_land_hist("y2015",j,"crop"); -pc29_treecover_share(j)$(pc29_treecover_share(j) > s29_treecover_max) = s29_treecover_max; -pc29_treecover(j,ac) = (pc29_treecover_share(j) * pm_land_hist("y1995",j,"crop")) / card(ac); - +if (s29_treecover_map = 1, + pc29_treecover_share(j) = 0; + pc29_treecover_share(j)$(pm_land_hist("y2015",j,"crop") > 1e-10) = f29_treecover(j) / pm_land_hist("y2015",j,"crop"); + pc29_treecover_share(j)$(pc29_treecover_share(j) > s29_treecover_max) = s29_treecover_max; + pc29_treecover(j,ac) = (pc29_treecover_share(j) * pm_land_hist("y1995",j,"crop")) / card(ac); +elseif s29_treecover_map = 0, + pc29_treecover(j,ac) = 0 +); vm_treecover.l(j) = sum(ac, pc29_treecover(j,ac)); *' Switch for tree cover on cropland: diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 4295fba570..96e3f15824 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,9 +19,8 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR05" +cfg$info$flag <- "ABCDR07" -cfg$output <- c("rds_report") # Only run rds_report after model run cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE cfg$force_download <- FALSE @@ -33,10 +32,10 @@ cfg$qos <- "standby_maxMem_dayMax" .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -cfg$input['regional'] <- "rev4.109_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.109_36f73207_validation.tgz" +cfg$input['regional'] <- "rev4.111_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.111_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" -cfg$input['cellular'] <- "rev4.109_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" ssp <- "SSP2" @@ -48,37 +47,36 @@ cfg$gms$scen_countries15 <- isoCountriesEUR cfg$gms$policy_countries29 <- isoCountriesEUR cfg$gms$policy_countries30 <- isoCountriesEUR + +cfg$gms$s29_treecover_keep <- 0 +cfg$gms$s29_treecover_penalty_before <- 0 cfg$gms$s29_treecover_penalty <- 5000 -cfg$gms$s30_betr_penalty <- 5000 - -for (pol in c("NDC","1p5deg")) { - for (diet in c("dietDefault","dietShift")) { - for (AFS in c("SRC","treeCover")) { - for (shr in c(0, 0.01, 0.05, 0.1, 0.2)) { - cfg$title <- .title(cfg, paste(ssp,pol,diet,paste0(AFS,sprintf("%02d",shr*100)),sep="-")) - if (pol == "NDC") { - cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) - cfg$input['cellular'] <- "rev4.109_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - cfg$gms$c56_mute_ghgprices_until <- "y2150" - cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") - cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") - } else if (pol == "1p5deg") { - cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) - cfg$input['cellular'] <- "rev4.109_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" - cfg$gms$c56_mute_ghgprices_until <- "y2030" - cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") - cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") - } - if (diet == "dietShift") cfg <- setScenario(cfg,"eat_lancet_diet") - if (AFS == "SRC") { - cfg$gms$s29_treecover_target <- 0 - cfg$gms$s30_betr_target <- shr - } else if (AFS == "treeCover") { - cfg$gms$s29_treecover_target <- shr - cfg$gms$s30_betr_target <- 0 - } - start_run(cfg, codeCheck = FALSE) - } +cfg$gms$s30_betr_penalty <- 0 + +for (pol in c("NDC","1p5deg","1p5deg-Diet")) { + for (shr in c(0, 0.005, 0.01, 0.02)) { + cfg$title <- .title(cfg, paste(ssp,pol,paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) + if (pol == "NDC") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) + cfg$input['cellular'] <- "rev4.111_36f73207_30c9dc61_cellularmagpie_c400_MRI-ESM2-0-ssp245_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NDC") + } else if (pol == "1p5deg") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) + cfg$input['cellular'] <- "rev4.111_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2030" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + } else if (pol == "1p5deg-Diet") { + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9","eat_lancet_diet_v1")) + cfg$input['cellular'] <- "rev4.111_36f73207_bc624950_cellularmagpie_c400_MRI-ESM2-0-ssp119_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + cfg$gms$c56_mute_ghgprices_until <- "y2030" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } + cfg$gms$s29_treecover_target <- shr + cfg$gms$s30_betr_target <- 0 + start_run(cfg, codeCheck = FALSE) } } From 4cda7f6548f34fdb838e269c3948e9fd64ce57db Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 9 Sep 2024 11:38:36 +0200 Subject: [PATCH 136/171] added output script for conversion of validation.mif file into validation.rds --- CHANGELOG.md | 1 + scripts/output/extra/convertValidation.R | 44 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 scripts/output/extra/convertValidation.R diff --git a/CHANGELOG.md b/CHANGELOG.md index 43eaac8677..12c8bbd4cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **42_water_demand** added water abstraction type dimension for non-ag uses - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy - **cropland** added option for discarding initial treecover on cropland +- **script** added output script for conversion of validation.mif file into validation.rds ### removed - diff --git a/scripts/output/extra/convertValidation.R b/scripts/output/extra/convertValidation.R new file mode 100644 index 0000000000..e1e1e8a16a --- /dev/null +++ b/scripts/output/extra/convertValidation.R @@ -0,0 +1,44 @@ +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# -------------------------------------------------------------- +# description: converts validation.mif file into validation.rds for use in shinyresults +# comparison script: FALSE +# --------------------------------------------------------------- + +######################### +#### convert validation.mif #### +######################### +# Version 1.0, Florian Humpenoeder +# +library(quitte) + +options(error=function()traceback(2)) + +############################# BASIC CONFIGURATION ############################# +if(!exists("source_include")) { + outputdir <- file.path("output/",list.dirs("output/", full.names = FALSE, recursive = FALSE)) + #Define arguments that can be read from command line + lucode2::readArgs("outputdir") +} +############################################################################### +cat("\nStarting output generation\n") + + +for (i in 1:length(outputdir)) { + print(paste("Processing",outputdir[i])) + val<-file.path(outputdir[i],"validation.mif") + rds <- file.path(outputdir[i],"validation.rds") + if(file.exists(val)) { + q <- read.quitte(val) + # as.quitte converts "World" into "GLO". But we want to keep "World" and therefore undo these changes + q <- droplevels(q) + levels(q$region)[levels(q$region) == "GLO"] <- "World" + q$region <- factor(q$region,levels = sort(levels(q$region))) + saveRDS(q, file = rds, version = 2) + } +} From ad9d2b5c56f7906961b947e7160d3c611005fd90 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 9 Sep 2024 12:05:03 +0200 Subject: [PATCH 137/171] update start script --- scripts/start/projects/paper_peatlandTax.R | 192 +++++++++++++-------- 1 file changed, 119 insertions(+), 73 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 984c321eb5..9a5b617e1d 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -13,7 +13,7 @@ ## Load lucode2 and gms to use setScenario later library(lucode2) library(gms) -library(gdx) +library(gdx2) library(magpie4) # Load start_run(cfg) function which is needed to start MAgPIE runs @@ -23,108 +23,154 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax03H16" +cfg$info$flag <- "PTax20" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" cfg$force_replace <- TRUE +cfg$force_download <- FALSE #cfg$qos <- "priority_maxMem" -cfg$qos <- "standby_maxMem_dayMax" +#cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby_maxMem" # support function to create standardized title -.title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) - -cfg$repositories <- append(list("https://rse.pik-potsdam.de/data/magpie/public"=NULL, - "./patch_inputdata"=NULL), - getOption("magpie_repos")) - -cfg$input['regional'] <- "rev4.109_36f73207_magpie.tgz" -cfg$input['validation'] <- "rev4.109_36f73207_validation.tgz" +.title <- function(cfg, ...) + return(paste(cfg$info$flag, sep = "_", ...)) + +cfg$repositories <- append( + list( + "https://rse.pik-potsdam.de/data/magpie/public" = NULL, + "./patch_inputdata" = NULL + ), + getOption("magpie_repos") +) + +cfg$input['regional'] <- "rev4.111_36f73207_magpie.tgz" +cfg$input['validation'] <- "rev4.111_36f73207_validation.tgz" cfg$input['calibration'] <- "calibration_H16_14Jun24.tgz" -cfg$input['zzzpatchGHGprices'] <- "patchGHGprices.tgz" - -cfg$gms$c_timesteps <- "5year" - -cfg$output <- c(cfg$output, "extra/highres") -ssp <- "SSP2" -cfg <- setScenario(cfg,c(ssp,"NPI","rcp7p0")) -cfg$input['cellular'] <- "rev4.109_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" -cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") -cfg$gms$c56_pollutant_prices_noselect <- "T0-CO2" -cfg$gms$policy_countries56 <- isoCountriesEUR +cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" +download_and_update(cfg) +## Create patch file for GHG prices calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") - T0 <- collapseNames(T0[,,getNames(T0,dim=2)[1]]) - T0[,,] <- 0 + T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) + T0[, , ] <- 0 #T200 200 USD/tCO2 in 2050 - T200 <- new.magpie(getRegions(T0),c(seq(1995,2025,by=5),2050,2100,2150),getNames(T0),fill = 0) - T200[,"y2025","co2_c"] <- 0 - T200[,"y2050","co2_c"] <- 200 - T200[,"y2100","co2_c"] <- 200 - T200[,"y2150","co2_c"] <- 200 - T200 <- time_interpolate(T200,seq(2015,2100,by=5),TRUE) - T200 <- time_interpolate(T200,seq(2100,2150,by=5),TRUE) - T200[,,"ch4"] <- T200[,,"co2_c"]*28 - T200[,,"n2o_n_direct"] <- T200[,,"co2_c"]*265*44/28 - T200[,,"n2o_n_indirect"] <- T200[,,"co2_c"]*265*44/28 - T200[,,"co2_c"] <- T200[,,"co2_c"]*44/12 + T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) + T200[, "y2025", "co2_c"] <- 0 + T200[, "y2050", "co2_c"] <- 200 + T200[, "y2100", "co2_c"] <- 200 + T200[, "y2150", "co2_c"] <- 200 + T200 <- time_interpolate(T200, seq(2015, 2100, by = 5), TRUE) + T200 <- time_interpolate(T200, seq(2100, 2150, by = 5), TRUE) + T200[, , "ch4"] <- T200[, , "co2_c"] * 28 + T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 + T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 + T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 T50 <- T200 * 0.25 T100 <- T200 * 0.5 + T400 <- T200 * 2 + T800 <- T200 * 4 - GHG <- mbind(add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), - add_dimension(T50, dim = 3.2, add = "scen", nm = "T50-GHG"), - add_dimension(T100, dim = 3.2, add = "scen", nm = "T100-GHG"), - add_dimension(T200, dim = 3.2, add = "scen", nm = "T200-GHG")) + GHG <- mbind( + add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), + add_dimension( + T50, + dim = 3.2, + add = "scen", + nm = "T50-GHG" + ), + add_dimension( + T100, + dim = 3.2, + add = "scen", + nm = "T100-GHG" + ), + add_dimension( + T200, + dim = 3.2, + add = "scen", + nm = "T200-GHG" + ), + add_dimension( + T400, + dim = 3.2, + add = "scen", + nm = "T400-GHG" + ), + add_dimension( + T800, + dim = 3.2, + add = "scen", + nm = "T800-GHG" + ) + ) CO2 <- GHG - CO2[,,c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 - getNames(CO2,dim=2) <- gsub("GHG","CO2", getNames(CO2,dim=2)) + CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 + getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) GHGCH4GWP20 <- GHG - GHGCH4GWP20[,,"ch4"] <- GHGCH4GWP20[,,"ch4"]/28*84 - getNames(GHGCH4GWP20,dim=2) <- gsub("GHG","GHG-CH4GWP20", getNames(GHGCH4GWP20,dim=2)) + GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 + getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = + 2)) GHG <- mbind(CO2, GHG, GHGCH4GWP20) - if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") - if (dir.exists("./patch_inputdata/patchGHGprices")) unlink("./patch_inputdata/patchGHGprices", recursive = TRUE) + if (!dir.exists("./patch_inputdata")) + dir.create("./patch_inputdata") + if (dir.exists("./patch_inputdata/patchGHGprices")) + unlink("./patch_inputdata/patchGHGprices", recursive = TRUE) dir.create("./patch_inputdata/patchGHGprices") - write.magpie(GHG,file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") - tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") + write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") + tardir("patch_inputdata/patchGHGprices", + "patch_inputdata/patchGHGprices.tgz") - # scen56 <- magclass::read.magpie("modules/56_ghg_policy/input/f56_emis_policy.csv",file_type = "cs3") - # scen56 <- magclass::getNames(scen56,dim=1) - # - # sets <- list(list(name = "ghgscen56", - # desc = "ghg price scenarios", - # items = ghgscen56), - # list(name = "scen56", - # desc = "emission policy scenarios", - # items = scen56)) - # gms::writeSets(sets, "modules/56_ghg_policy/price_aug22/sets.gms") - unlink("patch_inputdata/patchGHGprices", recursive=TRUE) + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } ghgscen56 <- calc_ghgprice() +cfg$input['zzzpatchGHGprices'] <- "patchGHGprices.tgz" - -cfg$title <- .title(cfg, paste(ssp,"Ref",sep="-")) -cfg$gms$c56_mute_ghgprices_until <- "y2150" -cfg$gms$c56_pollutant_prices <- "T0-CO2" -cfg$gms$c56_emis_policy <- "reddnatveg_nosoil_nopeat" -download_and_update(cfg) -start_run(cfg, codeCheck = FALSE) - - -cfg$gms$c56_mute_ghgprices_until <- "y2025" - -for (tax in ghgscen56) { - for (peat in c("peatOff", "peatOn")) { - cfg$title <- .title(cfg, paste(ssp,tax,peat,sep="-")) +## General settings +cfg$gms$c_timesteps <- "5year" +ssp <- "SSP2" +cfg <- setScenario(cfg, c(ssp, "NPI", "rcp7p0")) +cfg$gms$c56_pollutant_prices_noselect <- "T0-CO2" +cfg$gms$policy_countries56 <- isoCountriesEUR +cfg$gms$c56_emis_policy <- "sdp_peatland" +cfg$gms$factor_costs <- "sticky_feb18" +cfg$gms$livestock <- "fbask_jan16_sticky" +cfg$gms$s56_c_price_induced_aff <- 0 + +## Start scenarios +for (res in c("c400", "c1000")) { + if (res == "c400") + cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + else if (res == "c1000") { + cfg$input['cellular'] <- "rev4.111_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" + } + ## Ref scenario + cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- "T0-CO2" + # cfg$gms$c22_base_protect <- "none" + # cfg$gms$c22_base_protect_noselect <- "none" + # cfg$gms$s22_restore_land <- 0 + start_run(cfg, codeCheck = FALSE) + + ## Policy scenarios + for (tax in c("T50-CO2", + "T100-CO2", + "T200-CO2", + "T400-CO2", + "T400-GHG", + "T400-GHG-GWP20")) { + cfg$title <- .title(cfg, paste(res, ssp, tax, sep = "-")) + cfg$gms$c56_mute_ghgprices_until <- "y2025" cfg$gms$c56_pollutant_prices <- tax - cfg$gms$c56_emis_policy <- if (peat=="peatOff") "reddnatveg_nosoil_nopeat" else "reddnatveg_nosoil" start_run(cfg, codeCheck = FALSE) } } From d412aec846e716dd57582dbefaf779eb1ab43c57 Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 9 Sep 2024 21:50:23 +0200 Subject: [PATCH 138/171] additional data update additional_data_rev4.53.tgz --- CHANGELOG.md | 1 + config/default.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12c8bbd4cc..687f79fdf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **script** replaced gdx package with gdx2 package calls - **config** split scenario_config into project-specific configs - **config** initial treecover on cropland starts from zero +- **config** additional data update additional_data_rev4.53.tgz ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/config/default.cfg b/config/default.cfg index 82e689d062..8b2c6f61a9 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -25,7 +25,7 @@ cfg$model <- "main.gms" #def = "main.gms" cfg$input <- c(regional = "rev4.111_h12_magpie.tgz", cellular = "rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.111_h12_validation.tgz", - additional = "additional_data_rev4.51.tgz", + additional = "additional_data_rev4.53.tgz", calibration = "calibration_H12_26Mar24.tgz") # NOTE: It is recommended to recalibrate the model when changing cellular input data From f41745974af6dc04b9c159ac9b2f6bbf2506dd6e Mon Sep 17 00:00:00 2001 From: florianh Date: Mon, 9 Sep 2024 21:51:37 +0200 Subject: [PATCH 139/171] update start script --- scripts/start/projects/paper_peatlandTax.R | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 9a5b617e1d..6a18fe2159 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,14 +23,12 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax20" +cfg$info$flag <- "PTax22" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" cfg$force_replace <- TRUE cfg$force_download <- FALSE -#cfg$qos <- "priority_maxMem" -#cfg$qos <- "standby_maxMem_dayMax" cfg$qos <- "standby_maxMem" # support function to create standardized title @@ -156,9 +154,6 @@ for (res in c("c400", "c1000")) { cfg$title <- .title(cfg, paste(res, ssp, "Ref", sep = "-")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" - # cfg$gms$c22_base_protect <- "none" - # cfg$gms$c22_base_protect_noselect <- "none" - # cfg$gms$s22_restore_land <- 0 start_run(cfg, codeCheck = FALSE) ## Policy scenarios From 3f0e645e77f91021e60f5a98cfa593554eb9df18 Mon Sep 17 00:00:00 2001 From: Jan Philipp Dietrich Date: Tue, 10 Sep 2024 09:37:32 +0200 Subject: [PATCH 140/171] bugfix in calc_calib.R to be compatible with gdx2 package --- scripts/calibration/calc_calib.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/calibration/calc_calib.R b/scripts/calibration/calc_calib.R index 5fb4af9246..f06b101751 100644 --- a/scripts/calibration/calc_calib.R +++ b/scripts/calibration/calc_calib.R @@ -67,7 +67,7 @@ get_yieldcalib <- function(gdx_file) { y_ini <- prep(readGDX(gdx_file, "i14_yields", "i14_yields_calib", format = "first_found", react = "silent")) - y <- prep(readGDX(gdx_file, "vm_yld")[, , "l"]) + y <- prep(readGDX(gdx_file, "vm_yld")[, , "level"]) out <- y / y_ini out[out == 0] <- 1 From 4e882c498709bda58606cab3b5e5b2e761927caa Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 11 Sep 2024 15:00:08 +0200 Subject: [PATCH 141/171] update start script --- scripts/start/projects/paper_peatlandTax.R | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 6a18fe2159..e507b4d970 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,13 +23,14 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax22" +cfg$info$flag <- "PTax23" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" +cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_maxMem" +cfg$qos <- "standby_maxMem_dayMax" # support function to create standardized title .title <- function(cfg, ...) @@ -144,7 +145,7 @@ cfg$gms$livestock <- "fbask_jan16_sticky" cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios -for (res in c("c400", "c1000")) { +for (res in c("c400")) { if (res == "c400") cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { From e801bcdc3aa3e3f39b521d0e0e11d3b3a6e83482 Mon Sep 17 00:00:00 2001 From: Michael Crawford Date: Wed, 11 Sep 2024 17:31:20 +0200 Subject: [PATCH 142/171] Added convertToNetCDF output script --- CHANGELOG.md | 1 + scripts/output/extra/convertToNetCDF.R | 43 ++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 scripts/output/extra/convertToNetCDF.R diff --git a/CHANGELOG.md b/CHANGELOG.md index d0015d3fd4..e856625b72 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### added +- **scripts** added output script converting all grid-level .mz files to .nc (netCDF) - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` - **scripts** added out of bounds check as output script - **70_livestock** added realization `fbask_jan16_sticky` diff --git a/scripts/output/extra/convertToNetCDF.R b/scripts/output/extra/convertToNetCDF.R new file mode 100644 index 0000000000..99d9dffec7 --- /dev/null +++ b/scripts/output/extra/convertToNetCDF.R @@ -0,0 +1,43 @@ +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# -------------------------------------------------------------- +# description: Convert all .mz files to NetCDF (.nc) for a magpie directory +# comparison script: FALSE +# --------------------------------------------------------------- + +# Version 1.00 - Michael Crawford +# 1.00: first working version + +library(gms) +library(magclass) + +############################# BASIC CONFIGURATION ####################################### +if (!exists("source_include")) { + + title <- NULL + outputdir <- NULL + + # Define arguments that can be read from command line + readArgs("outputdir", "title") + +} +######################################################################################### + +message("Converting all .mz outputs to .nc for output directory: ", outputdir) + +mzFiles <- list.files(path = outputdir, pattern = "0\\.5(_share)?\\.mz$", full.names = TRUE) + +lapply(X = mzFiles, FUN = function(x) { + tryCatch({ + magObj <- magclass::read.magpie(x) + newName <- sub("\\.[^.]+$", "", x) + write.magpie(x = magObj, file_name = paste0(newName, ".nc"), file_folder = outputdir, append = FALSE) + }, error = function(e) { + message("Error processing file: ", x, " - ", e$message) + }) +}) \ No newline at end of file From 3c352460b4df459ff467ebb93b5b71f0f265f444 Mon Sep 17 00:00:00 2001 From: florianh Date: Thu, 12 Sep 2024 16:12:30 +0200 Subject: [PATCH 143/171] bugfix peatland --- modules/58_peatland/v2/declarations.gms | 2 +- modules/58_peatland/v2/presolve.gms | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/58_peatland/v2/declarations.gms b/modules/58_peatland/v2/declarations.gms index 6791419f6e..a8b438f8b8 100644 --- a/modules/58_peatland/v2/declarations.gms +++ b/modules/58_peatland/v2/declarations.gms @@ -46,7 +46,7 @@ positive variables v58_manLandExp(j,manPeat58) Managed land area expansion (mio. ha) v58_manLandRed(j,manPeat58) Managed land area reduction (mio. ha) v58_balance(j,manPeat58) Technical balance term for peatland scaling factor (1) - v58_balance2(j,manPeat58) Technical balance term for peatland scaling factor (1) + v58_balance2(j,manPeat58) Technical balance term for peatland scaling factor (1) v58_peatland_cost_annuity(j,cost58) Annuity costs for peatland conversion in the current timestep (mio. USD05MER per yr) ; diff --git a/modules/58_peatland/v2/presolve.gms b/modules/58_peatland/v2/presolve.gms index eebd309905..02d99220b5 100644 --- a/modules/58_peatland/v2/presolve.gms +++ b/modules/58_peatland/v2/presolve.gms @@ -22,6 +22,7 @@ if (m_year(t) <= s58_fix_peatland, * Peatland area is fixed to `pc58_peatland` until the year given by s58_fix_peatland v58_peatland.fx(j,land58) = pc58_peatland(j,land58); v58_balance.fx(j,manPeat58) = 0; + v58_balance2.fx(j,manPeat58) = 0; i58_cost_rewet_recur(t) = 0; i58_cost_drain_recur(t) = 0; @@ -38,6 +39,8 @@ else v58_peatland.fx(j,"peatExtract") = pc58_peatland(j,"peatExtract"); v58_balance.lo(j,manPeat58) = 0; v58_balance.up(j,manPeat58) = Inf; + v58_balance2.lo(j,manPeat58) = 0; + v58_balance2.up(j,manPeat58) = Inf; i58_cost_rewet_recur(t) = s58_cost_rewet_recur; i58_cost_drain_recur(t) = s58_cost_drain_recur; From 1585a96842edce106c53d496c520afd042b16aa2 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 13 Sep 2024 13:54:39 +0200 Subject: [PATCH 144/171] bugfix 35_natveg --- modules/35_natveg/pot_forest_may24/presolve.gms | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/35_natveg/pot_forest_may24/presolve.gms b/modules/35_natveg/pot_forest_may24/presolve.gms index 406ccbc762..d6e63de4a6 100644 --- a/modules/35_natveg/pot_forest_may24/presolve.gms +++ b/modules/35_natveg/pot_forest_may24/presolve.gms @@ -174,6 +174,7 @@ p35_restoration_shift(j) = p35_land_restoration(j,"secdforest") - pc35_max_fores p35_restoration_shift(j)$(p35_restoration_shift(j) < 1e-6) = 0; p35_restoration_shift(j)$(p35_restoration_shift(j) > p35_land_restoration(j,"secdforest")) = p35_land_restoration(j,"secdforest"); p35_land_restoration(j,"secdforest") = p35_land_restoration(j,"secdforest") - p35_restoration_shift(j); +pm_land_conservation(t,j,"secdforest","restore") = p35_land_restoration(j,"secdforest"); pm_land_conservation(t,j,"other","restore") = pm_land_conservation(t,j,"other","restore") + p35_restoration_shift(j); * set conservation bound @@ -204,6 +205,7 @@ p35_land_restoration(j,"other") = pm_land_conservation(t,j,"other","restore"); * Do not restore other land in areas where total natural * land area meets the total natural land conservation target p35_land_restoration(j,"other")$(sum(land_natveg, pcm_land(j,land_natveg)) >= sum((land_natveg, consv_type), pm_land_conservation(t,j,land_natveg,consv_type))) = 0; +pm_land_conservation(t,j,"other","restore") = p35_land_restoration(j,"other"); * set conservation bound vm_land.lo(j,"other") = pm_land_conservation(t,j,"other","protect") + p35_land_restoration(j,"other"); From 905875f33d36ea177a1775876d3c28466c3648e3 Mon Sep 17 00:00:00 2001 From: florianh Date: Fri, 13 Sep 2024 14:28:17 +0200 Subject: [PATCH 145/171] changelog --- CHANGELOG.md | 1 + scripts/start/projects/paper_peatlandTax.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 687f79fdf4..de8c745532 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso - **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` +- **35_natveg** bugfix secdforest and other land restoration to avoid double-counting of restoration in equation `q29_land_snv` ## [4.8.1] - 2024-06-19 diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index e507b4d970..2ed3cdbbe0 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -23,7 +23,7 @@ source("scripts/start_functions.R") source("config/default.cfg") # create additional information to describe the runs -cfg$info$flag <- "PTax23" +cfg$info$flag <- "PTax24" cfg$results_folder <- "output/:title:" cfg$results_folder_highres <- "output" From 0499bda273028c380804eabcbaeb7d5d4a49a473 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Mon, 16 Sep 2024 12:42:32 +0200 Subject: [PATCH 146/171] changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8c745532..375f41d212 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy - **cropland** added option for discarding initial treecover on cropland - **script** added output script for conversion of validation.mif file into validation.rds +- **script** for downscaling to 0.25 deg using LUH2v2h as reference via mrdownscale ### removed - From dc26bf918f02e1b215d3d8e35e5d280a201e7297 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 17 Sep 2024 12:45:11 +0200 Subject: [PATCH 147/171] update ABCDR --- modules/29_cropland/detail_apr24/input.gms | 1 + modules/29_cropland/detail_apr24/preloop.gms | 14 ++++++++++---- scripts/start/projects/project_ABCDR.R | 12 +++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/modules/29_cropland/detail_apr24/input.gms b/modules/29_cropland/detail_apr24/input.gms index c483bf6a5c..0b8b21899e 100644 --- a/modules/29_cropland/detail_apr24/input.gms +++ b/modules/29_cropland/detail_apr24/input.gms @@ -33,6 +33,7 @@ scalars s29_fallow_max Maximum share of fallow land on total cropland (1) / 0.4 / s29_fallow_penalty Penalty for violation of fallow target (USD05MER per ha) / 500 / s29_treecover_map Treecover map for initialization (binary) / 0 / + s29_fader_functional_form Switch for functional form of faders (1) / 2 / ; diff --git a/modules/29_cropland/detail_apr24/preloop.gms b/modules/29_cropland/detail_apr24/preloop.gms index af9180f7ee..34c0fe6eac 100644 --- a/modules/29_cropland/detail_apr24/preloop.gms +++ b/modules/29_cropland/detail_apr24/preloop.gms @@ -6,10 +6,16 @@ *** | Contact: magpie@pik-potsdam.de ** Trajectory for cropland scenarios -* sigmoidal interpolation between start year and target year -m_sigmoid_time_interpol(i29_snv_scenario_fader,s29_snv_scenario_start,s29_snv_scenario_target,0,1); -m_sigmoid_time_interpol(i29_treecover_scenario_fader,s29_treecover_scenario_start,s29_treecover_scenario_target,0,1); -m_sigmoid_time_interpol(i29_fallow_scenario_fader,s29_fallow_scenario_start,s29_fallow_scenario_target,0,1); +* linear or sigmoidal interpolation between start year and target year +if (s29_fader_functional_form = 1, + m_linear_time_interpol(i29_snv_scenario_fader,s29_snv_scenario_start,s29_snv_scenario_target,0,1); + m_linear_time_interpol(i29_treecover_scenario_fader,s29_treecover_scenario_start,s29_treecover_scenario_target,0,1); + m_linear_time_interpol(i29_fallow_scenario_fader,s29_fallow_scenario_start,s29_fallow_scenario_target,0,1); +elseif s29_fader_functional_form = 2, + m_sigmoid_time_interpol(i29_snv_scenario_fader,s29_snv_scenario_start,s29_snv_scenario_target,0,1); + m_sigmoid_time_interpol(i29_treecover_scenario_fader,s29_treecover_scenario_start,s29_treecover_scenario_target,0,1); + m_sigmoid_time_interpol(i29_fallow_scenario_fader,s29_fallow_scenario_start,s29_fallow_scenario_target,0,1); +); * linear interpolation to estimate the cropland that * requires relocation due to SNV policy diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 96e3f15824..981fb823e7 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -19,14 +19,13 @@ source("config/default.cfg") #download_and_update(cfg) # create additional information to describe the runs -cfg$info$flag <- "ABCDR07" +cfg$info$flag <- "ABCDR08" cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE cfg$force_download <- FALSE cfg$qos <- "standby_maxMem_dayMax" -#cfg$qos <- "priority" # support function to create standardized title .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) @@ -40,7 +39,6 @@ cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM ssp <- "SSP2" cfg$gms$cropland <- "detail_apr24" -# cfg$gms$croparea <- "detail_apr24" cfg$gms$scen_countries15 <- isoCountriesEUR @@ -53,8 +51,12 @@ cfg$gms$s29_treecover_penalty_before <- 0 cfg$gms$s29_treecover_penalty <- 5000 cfg$gms$s30_betr_penalty <- 0 +cfg$gms$s29_fader_functional_form <- 1 # linear fader +cfg$gms$s29_treecover_scenario_start <- 2025 +cfg$gms$s29_treecover_scenario_target <- 2060 + for (pol in c("NDC","1p5deg","1p5deg-Diet")) { - for (shr in c(0, 0.005, 0.01, 0.02)) { + for (shr in c(0, 0.005, 0.01, 0.02)) { # share in 2045 cfg$title <- .title(cfg, paste(ssp,pol,paste0("AFS_tree_",sub("\\.","p",as.character(shr*100))),sep="-")) if (pol == "NDC") { cfg <- setScenario(cfg,c(ssp,"NDC","rcp4p5")) @@ -75,7 +77,7 @@ for (pol in c("NDC","1p5deg","1p5deg-Diet")) { cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-PkBudg650") } - cfg$gms$s29_treecover_target <- shr + cfg$gms$s29_treecover_target <- shr / (2045 - 2025) * (2060 - 2025) # Continue linear increase after 2045 until 2060 cfg$gms$s30_betr_target <- 0 start_run(cfg, codeCheck = FALSE) } From 3dde5cb3dec57cb652e6f510250c3413f8031e57 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 17 Sep 2024 14:53:38 +0200 Subject: [PATCH 148/171] update ABCDR --- CHANGELOG.md | 2 ++ config/default.cfg | 3 +++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 375f41d212..64143768e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** split scenario_config into project-specific configs - **config** initial treecover on cropland starts from zero - **config** additional data update additional_data_rev4.53.tgz +- **29_cropland** added option for linear and sigmoidal faders + ### added - **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` diff --git a/config/default.cfg b/config/default.cfg index 8b2c6f61a9..76facad415 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -741,6 +741,9 @@ cfg$gms$land_snv <- "secdforest, forestry, past, other" #def = "secdforest, f # *** Options only available for `detail_apr24` realization *** +# * Switch for functional form of faders (1=linear 2=sigmoid) +cfg$gms$s29_fader_functional_form <- 2 # def = 2 + ## Agroforestry settings for treecover on cropland # * Initial tree cover # * (0): tree cover on cropland starts from zero From 239a1808e999171606fe8b1431e9be0494493525 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 17 Sep 2024 15:15:36 +0200 Subject: [PATCH 149/171] update highres output script --- scripts/output/extra/highres.R | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index ae270348a8..963ce1be5f 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -37,7 +37,10 @@ resultsarchive <- "/p/projects/rd3mod/models/results/magpie" # Load start_run(cfg) function which is needed to start MAgPIE runs source("scripts/start_functions.R") -highres <- function(cfg) { +# Plausible values for "res" (high resolution): "c1000" and "c2000" +# Options for "tc" (13_tc realization): NULL (no change), "exo" and "endo_jan22" + +highres <- function(cfg = cfg, res = "c2000", tc = NULL) { #lock the model folder lockId <- gms::model_lock(timeout1 = 24) withr::defer(gms::model_unlock(lockId)) @@ -46,9 +49,6 @@ highres <- function(cfg) { cfg$output <- cfg$output[cfg$output!="extra/highres"] - # set high resolution, available options are c1000 and c2000 - res <- "c1000" - # search for matching high resolution file in repositories # pattern: "rev4.65_h12_*_cellularmagpie_c2000_MRI-ESM2-0-ssp370_lpjml-3eb70376.tgz" x <- unlist(strsplit(cfg$input["cellular"],"_")) @@ -139,10 +139,12 @@ highres <- function(cfg) { f21_trade_balance <- toolAggregate(ov_prod_reg - (ov_supply + import_for_feasibility), supreg) write.magpie(f21_trade_balance, paste0("modules/21_trade/input/f21_trade_balance.cs3")) - #get tau from low resolution run with c200 - ov_tau <- readGDX(gdx, "ov_tau",select=list(type="level")) - write.magpie(ov_tau,"modules/13_tc/input/f13_tau_scenario.csv") - cfg$gms$tc <- "exo" + if(!is.null(tc)) { + #get tau from low resolution run with c200 + ov_tau <- readGDX(gdx, "ov_tau",select=list(type="level")) + write.magpie(ov_tau,"modules/13_tc/input/f13_tau_scenario.csv") + cfg$gms$tc <- tc + } #use exo trade and parallel optimization cfg$gms$trade <- "exo" From 8c23b6b80fa0f36dee6c54825d851a622321b4e1 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 17 Sep 2024 16:51:46 +0200 Subject: [PATCH 150/171] update highres --- CHANGELOG.md | 1 + scripts/output/extra/highres.R | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64143768e2..95a5a39bd8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** initial treecover on cropland starts from zero - **config** additional data update additional_data_rev4.53.tgz - **29_cropland** added option for linear and sigmoidal faders +- **scripts** output/extra/highres.R use default 13_tc realization ### added diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index 963ce1be5f..3d93842c78 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -40,7 +40,7 @@ source("scripts/start_functions.R") # Plausible values for "res" (high resolution): "c1000" and "c2000" # Options for "tc" (13_tc realization): NULL (no change), "exo" and "endo_jan22" -highres <- function(cfg = cfg, res = "c2000", tc = NULL) { +highres <- function(cfg = cfg, res = "c1000", tc = NULL) { #lock the model folder lockId <- gms::model_lock(timeout1 = 24) withr::defer(gms::model_unlock(lockId)) From ef3728e63efa0d7322e94df4a6fa9b1a1f746da8 Mon Sep 17 00:00:00 2001 From: florianh Date: Tue, 17 Sep 2024 17:26:16 +0200 Subject: [PATCH 151/171] typo fix --- modules/73_timber/default/equations.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/73_timber/default/equations.gms b/modules/73_timber/default/equations.gms index 0b062cc877..dad60fffe0 100644 --- a/modules/73_timber/default/equations.gms +++ b/modules/73_timber/default/equations.gms @@ -55,7 +55,7 @@ q73_prod_woodfuel(j2).. *' Production of residues is calculated based on `s73_residue_ratio`. This fraction *' of industrial roundwood production is assumed to be lost during harvesting processes. *' USDA reports that ca. 30% of roundwood harvested are residues (@oswalt2019forest). -*' Not all of this residue is recoverwed from forest and we assume 50% of residue +*' Not all of this residue is recovered from forest and we assume 50% of residue *' removal based on @pokharel2017factors. These numbers (residue levels and residude *' removals vary strongly among different studies, the numbers used here are from *' a USDA report on state of forests in USA which has consistent reporting over years) From 98e53fb25d32d5356f50db7acba538840de830ed Mon Sep 17 00:00:00 2001 From: florianh Date: Wed, 18 Sep 2024 09:45:40 +0200 Subject: [PATCH 152/171] update magpie4 R version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5420bd36bf..779c99c492 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.10.3), + magpie4 (>= 2.11.0), MagpieNCGains, magpiesets, mip, From 5051b828f5465f674f73a87c404a0bd1f38a384e Mon Sep 17 00:00:00 2001 From: Felicitas Date: Wed, 18 Sep 2024 13:52:26 +0200 Subject: [PATCH 153/171] fix merge conflicts --- scripts/start/projects/project_EAT2p0.R | 35 ------------------------- 1 file changed, 35 deletions(-) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 0282c49b1a..9b1c073d22 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -192,16 +192,6 @@ cfg <- bau(cfg = cfg) cfg <- waste(cfg = cfg) start_run(cfg, codeCheck = FALSE) -# BAU_RCP26 # -# Decomposition Scenario. Apply lower climate impacts based on RCP 2.6 to BAU -cfg$title <- "BAU_RCP26" -# standard setting -cfg <- setScenario(cfg, c("cc", "SSP2", "NPI")) -cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") -# scenario settings -cfg <- bau(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # BAU_NoCC # # Decomposition scenario. Remove climate impacts (NoCC) from BAU to isolate climate effects cfg$title <- "BAU_NoCC" @@ -214,17 +204,6 @@ cfg <- bau(cfg = cfg) cfg$gms$labor_prod <- "off" start_run(cfg, codeCheck = FALSE) -# BAU_MITI # -# Decomposition Scenario. Adds mitigation and land-use policies consistent with 1.5C by 2050 to BAU -cfg$title <- "BAU_MITI" -# standard setting, but with NDC activated (for miti) -cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) -cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") -# scenario settings -cfg <- bau(cfg = cfg) -cfg <- miti(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # EL2 # # Full EAT-Lancet Scenario (diet, productivity, FLW) without mitigation and higher climate impacts based on RCP 7.0 cfg$title <- "EL2" @@ -291,20 +270,6 @@ cfg <- diet(cfg = cfg) cfg <- prod(cfg = cfg) start_run(cfg, codeCheck = FALSE) -# ELM_RCP70 # -# Decomposition Scenario. Applies RCP 7.0 climate impacts to ELM -cfg$title <- "ELM_RCP70" -# standard setting, but with NDC activated (for miti) -cfg <- setScenario(cfg, c("cc", "SSP2", "NDC")) -cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/scenario_config_el2.csv") -# scenario settings -cfg <- bau(cfg = cfg) -cfg <- miti(cfg = cfg) -cfg <- diet(cfg = cfg) -cfg <- prod(cfg = cfg) -cfg <- waste(cfg = cfg) -start_run(cfg, codeCheck = FALSE) - # ELM_NoCC # # Decomposition Scenario. Removes climate impacts (NoCC) from ELM cfg$title <- "ELM_NoCC" From 23ca6a72c58e8b6ecbcd636016f4a765f97e02ec Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 18 Sep 2024 15:53:37 +0200 Subject: [PATCH 154/171] added SEALS allocation script --- DESCRIPTION | 2 +- config/default.cfg | 21 +- scripts/output/extra/disaggregation.R | 1 - scripts/output/extra/runSEALSallocation.R | 231 ++++++++++++++++++++ scripts/start/projects/paper_healthyLscps.R | 164 ++++++++++++++ 5 files changed, 408 insertions(+), 11 deletions(-) create mode 100644 scripts/output/extra/runSEALSallocation.R create mode 100644 scripts/start/projects/paper_healthyLscps.R diff --git a/DESCRIPTION b/DESCRIPTION index 779c99c492..3a199b5dbd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.11.0), + magpie4 (>= 2.12.0), MagpieNCGains, magpiesets, mip, diff --git a/config/default.cfg b/config/default.cfg index 76facad415..c651b1aeb9 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -399,7 +399,7 @@ cfg$gms$kfo_rd <- "livst_rum" #def = livst_rum # * Switch for supplemental fat needed as ingredient for scp-based meat alternatives # * options: 0 (=off), 1 (=on) -cfg$gms$s15_scp_supplement_fat_meat <- 0 # def = 0 +cfg$gms$s15_scp_supplement_fat_meat <- 0 # def = 0 # * Convergence of livestock food calorie supply towards a kcal/cap/day target with or w/o substitution. # * The functional form and the start and target years of the food substitution can be specified below. @@ -695,7 +695,7 @@ cfg$gms$ageclass <- "feb21" # def = feb21 # ***--------------------- 29_cropland ----------------------------------- # * Cropland is defined as the sum of croparea, fallow land and tree cover # * Croparea is provided by 30_crop. -# * Fallow land and tree cover are defined by 29_cropland, +# * Fallow land and tree cover are defined by 29_cropland, # * (simple_apr24): Fallow land and tree cover on cropland are fixed to zero # * (detail_apr24): Fallow land and tree cover based on rules or incentives # NOTE: It is recommended to recalibrate the model when changing this setting! @@ -737,7 +737,7 @@ cfg$gms$s29_snv_scenario_target <- 2050 # def = 2050 # * plausible options: "secdforest, forestry, past, other", # * "secdforest, other", # * "secdforest, past, other" etc. -cfg$gms$land_snv <- "secdforest, forestry, past, other" #def = "secdforest, forestry, past, other" +cfg$gms$land_snv <- "secdforest, other" #def = "secdforest, other" # *** Options only available for `detail_apr24` realization *** @@ -755,7 +755,7 @@ cfg$gms$s29_treecover_map <- 0 # def = 0 # s29_treecover_target_noselect applies to all other countries. cfg$gms$s29_treecover_target <- 0 # def = 0 cfg$gms$s29_treecover_target_noselect <- 0 # def = 0 -# * Avoid loss of existing treecover (1=yes 0=no). +# * Avoid loss of existing treecover (1=yes 0=no). # * If set to 1, `s29_treecover_target` will be adjusted based existing treecover area. cfg$gms$s29_treecover_keep <- 0 # def = 0 # * Maximum share of treecover on total cropland (1) @@ -808,12 +808,12 @@ cfg$gms$policy_countries30 <- all_iso_countries ## Agroforestry settings for bioenergy trees # * Sigmoid fader for minimum area share of bioenergy trees (betr) on total cropland at cluster level # * Minimum area share of bioenergy trees on total cropland in start year -# Note: s30_betr_start applies to countries selected in policy_countries30, +# Note: s30_betr_start applies to countries selected in policy_countries30, # s30_betr_start_noselect applies to all other countries. cfg$gms$s30_betr_start <- 0 # def = 0 cfg$gms$s30_betr_start_noselect <- 0 # def = 0 # * Minimum area share of bioenergy trees on total cropland in target year -# Note: s30_betr_target applies to countries selected in policy_countries30, +# Note: s30_betr_target applies to countries selected in policy_countries30, # s30_betr_target_noselect applies to all other countries. cfg$gms$s30_betr_target <- 0 # def = 0 cfg$gms$s30_betr_target_noselect <- 0 # def = 0 @@ -841,14 +841,14 @@ cfg$gms$s30_implementation <- 1 # def = 1 # * Rotation rules: # * min (minimal constraints), default (best guess), good (good practice), # * good_20div (good practice - 20% for other crops), setaside (default plus fallow), -# * legumes (minimum share of legumes), sixfoldrotation (crops can only repeat after 6 years), +# * legumes (minimum share of legumes), sixfoldrotation (crops can only repeat after 6 years), # * agroecology (mix of previous scenarios), FSEC (similar to agroecology) # * betr0 (minimum share of short rotation agroforestry trees), betr10, betr20, betr25, betr30, betr40, betr50. cfg$gms$c30_rotation_rules <- "default" # def = "default" # * Rotation incentives: -# * none (no incentives), default (best guess), -# * legumes (increased incentives for legumes), agroecology (mix), +# * none (no incentives), default (best guess), +# * legumes (increased incentives for legumes), agroecology (mix), # * betr500 and betr1000 (incentives for short rotation agroforestry trees) cfg$gms$c30_rotation_incentives <- "none" # def = "none" @@ -2072,6 +2072,9 @@ cfg$gms$s80_secondsolve <- 0 # def = 0 # bjoernAR6_C_SSP2-NPi.mif, bjoernAR6_C_SSP2-PkBudg900.mif cfg$magicc_emis_scen <- "bjoernAR6_C_SSP2-NDC.mif" +# Years in which SEALS downscaling is applied +cfg$seals_years <- c(2020, 2050) + # Decide whether the runs should be run sequentially (TRUE), # or in parallel (FALSE) # NA means that this decision is taken automatically diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 2592a29f12..e9e31f3367 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -68,7 +68,6 @@ if (length(map_file) > 1) { base::message(message) x <- .fixCoords(x) write.magpie(x, file, comment = comment) - write.magpie(x, sub(".mz", ".nc", file), comment = comment) } .dissagcrop <- function(gdx, land_hr, map_file) { diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R new file mode 100644 index 0000000000..fe6b865d99 --- /dev/null +++ b/scripts/output/extra/runSEALSallocation.R @@ -0,0 +1,231 @@ +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# -------------------------------------------------------------- +# description: Starts SEALS allocation run based on gridded MAgPIE land cover projections (SEALS) +# comparison script: FALSE +# --------------------------------------------------------------- + +# Version 1.00 - Patrick v. Jeetze, Pascal Sauer +# 1.00: first working version + +library(gms) +library(gdx) +library(magpie4) +library(filelock) + +message("Initialising SEALS allocation run") + +############################# BASIC CONFIGURATION ####################################### +if (!exists("source_include")) { + title <- NULL + outputdir <- NULL + + # Define arguments that can be read from command line + readArgs("outputdir", "title") +} +######################################################################################### + +# ======================== +# User settings +# ======================== + +### SEALS python environment name +# see https://justinandrewjohnson.com/earth_economy_devstack/installation.html +# for instructions on how to set up a python environment for SEALS +sealsEnv <- "seals_dev" + +### Path to miniforge installation +# For instructions on how to install miniforge see https://github.com/conda-forge/miniforge +miniforgePath <- "/home/vjeetze/miniforge3/bin/activate" + +### Path to SEALS base input file directory +dirBaseFiles <- "/p/projects/magpie/users/vjeetze/seals/files" + +### Path to SEALS code base +dirSEALS <- "/p/projects/magpie/users/vjeetze/seals/files/seals/seals_dev" + + +# ======================== +# Prepare MAgPIE output +# ======================== + +message("Script started for output directory: ", outputdir) + +cfg <- gms::loadConfig(file.path(outputdir, "config.yml")) +title <- cfg$title + +if (length(cfg$seals_years) != 0) { + rep_years <- cfg$seals_years[cfg$seals_years > 2020] + rep_years <- c(2020, rep_years) +} else { + rep_years <- seq(2020, 2050, 5) +} + +# Restructure data to conform to SEALS +reportLandUseForSEALS( + magCellLand = "cell.land_0.5_share.mz", + outFile = paste0("cell.land_0.5_SEALS_", title, ".nc"), + dir = outputdir, selectyears = rep_years +) + + +# ======================== +# Setup SEALS run +# ======================== + +# -------------------------------- +# Prepare SEALS start script +# -------------------------------- + +.setupSEALSrun <- function(title, dir, dirProject, dirSEALS, dirBaseFiles) { + if (!dir.exists(file.path(dirProject, "scripts"))) { + dir.create(file.path(dirProject, "scripts"), recursive = TRUE) + } + + file.copy( + from = list.files(file.path(dirSEALS, "seals"), full.names = TRUE), + to = file.path(dirProject, "scripts"), + overwrite = TRUE, + recursive = TRUE + ) + + if (!dir.exists(file.path(dirProject, "inputs"))) { + dir.create(file.path(dirProject, "inputs"), recursive = TRUE) + } + + file.copy( + from = file.path(dir, paste0("seals_scenario_config_", title, ".csv")), + to = file.path(dirProject, "inputs", paste0("seals_scenario_config_", title, ".csv")), + overwrite = TRUE + ) + + main <- readLines(file.path(dirProject, "scripts/run_test_standard.py")) + + main[min(which(grepl(" p.user_dir =", main)))] <- paste0(" p.user_dir = \'", dirBaseFiles, "\'") + main[min(which(grepl(" p.extra_dirs", main)))] <- paste0(" p.extra_dirs = '.'") + main[min(which(grepl(" p.project_name =", main)))] <- paste0(" p.project_name = \'", title, "\'") + main[min(which(grepl(" p.project_dir =", main)))] <- paste0( + " p.project_dir = \'", normalizePath(dirProject), "\'" + ) + main[min(which(grepl("hb.pretty_time()", main)))] <- " " + main[min(which(grepl(" p.base_data_dir =", main)))] <- paste0( + " p.base_data_dir = \'", dirBaseFiles, "/base_data\'" + ) + main[min(which(grepl(" p.scenario_definitions_filename =", main)))] <- paste0( + " p.scenario_definitions_filename = \'", paste0("seals_scenario_config_", title, ".csv"), "\'" + ) + + writeLines(main, file.path(dirProject, "scripts", paste0("run_seals_", title, ".py"))) + + + if (!dir.exists(file.path(dirProject, "run_submit"))) { + dir.create(file.path(dirProject, "run_submit"), recursive = TRUE) + } +} + +# -------------------------------- +# Submit run +# -------------------------------- + +.submitSEALS <- function(title, dirProject, miniforgePath, sealsEnv, qos = "short", + slurmID = FALSE, dependsID = NULL) { + submitFile <- file.path(dirProject, "run_submit", paste0("submit_seals_", title, ".sh")) + + submit <- c( + "#!/bin/bash", "\n", + paste0("#SBATCH --qos=", qos), + ifelse(qos %in% c("priority", "standby"), "#SBATCH --partition=priority", "#SBATCH --partition=standard"), + "#SBATCH --job-name=seals_allocation", + paste0("#SBATCH --chdir=", normalizePath(file.path(dirProject, "scripts"))), + "#SBATCH --output=outfile_%j.out", + "#SBATCH --error=outfile_%j.err", + "#SBATCH --mail-type=END,FAIL", + "#SBATCH --time=3:00:00", + "#SBATCH --nodes=1", + "#SBATCH --ntasks=1", + ifelse(!is.null(dependsID), paste0( + "#SBATCH --dependency=afterok:", dependsID, + "\n#SBATCH --kill-on-invalid-dep=yes" + ), + "#SBATCH --dependency=singleton" + ), "\n", + ifelse(qos == "priority", "#SBATCH --cpus-per-task=64", "#SBATCH --cpus-per-task=128"), "\n", + paste("source", miniforgePath), + paste("conda activate", sealsEnv), "\n", + paste("python", paste0("run_seals_", title, ".py")) + ) + writeLines(submit, submitFile) + + id <- system(paste("sbatch --parsable", submitFile), intern = TRUE) + if (slurmID) { + return(id) + } +} + +# create output directory +dirProject <- "./output/seals" + +if (!dir.exists(file.path(dirProject))) { + dir.create(file.path(dirProject), recursive = TRUE) +} + +iniLock <- file.path(dirProject, ".lock") +lockOn <- filelock::lock(iniLock, exclusive = TRUE, timeout = Inf) +Sys.chmod(iniLock, mode = "0664") + +# -------------------------------- +# Run SEALS allocation +# -------------------------------- + +if (!is.null(lockOn)) { + sealsLock <- file.path(dirProject, "seals.lock") + + if (!file.exists(sealsLock) || file.size(sealsLock) == 0) { + message("Starting SEALS allocation with input data creation.") + .setupSEALSrun( + title = title, + dir = outputdir, + dirProject = dirProject, + dirSEALS = dirSEALS, + dirBaseFiles = dirBaseFiles + ) + + id <- .submitSEALS( + title = title, + dirProject = dirProject, + miniforgePath = miniforgePath, + sealsEnv = sealsEnv, + qos = "short", + slurmID = TRUE + ) + + writeLines(id, sealsLock) + } else { + message("Starting SEALS allocation using existing input data.") + id <- readLines(sealsLock) + + .setupSEALSrun( + title = title, + dir = outputdir, + dirProject = dirProject, + dirSEALS = dirSEALS, + dirBaseFiles = dirBaseFiles + ) + + .submitSEALS( + title = title, + dirProject = dirProject, + miniforgePath = miniforgePath, + sealsEnv = sealsEnv, + qos = "short", + slurmID = FALSE, + dependsID = id + ) + } + unlink(iniLock) +} diff --git a/scripts/start/projects/paper_healthyLscps.R b/scripts/start/projects/paper_healthyLscps.R new file mode 100644 index 0000000000..0ea21e9210 --- /dev/null +++ b/scripts/start/projects/paper_healthyLscps.R @@ -0,0 +1,164 @@ +# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | authors, and contributors see CITATION.cff file. This file is part +# | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of +# | AGPL-3.0, you are granted additional permissions described in the +# | MAgPIE License Exception, version 1.0 (see LICENSE file). +# | Contact: magpie@pik-potsdam.de + +# ---------------------------------------------------------- +# description: Healthy Landscapes Paper +# ---------------------------------------------------------- + +rev <- "rev9" + +# Note: rev4 used MAgPIE 4.6.9 +# Note: rev6 used MAgPIE 4.6.10 +# Note: rev7 used MAgPIE 4.6.11 +# Note: rev8 used MAgPIE dev 16 Sep 2024 +# Note: rev9 used MAgPIE 4.8.2 + +###################################### +#### Script to start a MAgPIE run #### +###################################### + +library(gms) +library(lucode2) +library(magclass) +library(gdx2) + +# Load start functions +source("scripts/start_functions.R") + +# ==================== +# Calibration +# ==================== + +source("config/default.cfg") + +cfg$title <- "calib_run" +cfg$output <- c("rds_report", "validation_short") +cfg$force_replace <- TRUE + +cfg$recalibrate <- TRUE +cfg$recalibrate_landconversion_cost <- TRUE + +cfg$best_calib <- TRUE +cfg$best_calib_landconversion_cost <- FALSE + +# cc is new default +cfg <- setScenario(cfg, "nocc_hist") + +# New iso food realisation +cfg$gms$food <- "anthro_iso_jun22" + +cfg$gms$s14_use_yield_calib <- 1 + +# sticky +cfg$gms$factor_costs <- "sticky_feb18" + +# marginal land scenario +cfg$gms$c30_marginal_land <- "q33_marginal" + +start_run(cfg = cfg) +calib_tgz <- magpie4::submitCalibration(paste(rev, "healthyLscps", sep = "_")) + +# ==================== +# Scenario runs +# ==================== + +prefix <- paste(rev, "healthyLscps", sep = "_") + +SSPs <- c("SSP2", "SSP1", "SSP3") + +scenarios <- c( + "REF", "DIET100", "DIET50", + "BIOS", "DIET100-BIOS", "DIET50-BIOS", + "landConservation", "DIET100-landConservation", "DIET50-landConservation", + "noNatureLoss2030", "DIET100-noNatureLoss2030", "DIET50-noNatureLoss2030", + "SNV20", "DIET100-SNV20", "DIET50-SNV20" +) + +for (ssp in SSPs) { + for (scen in scenarios) { + actions <- unlist(strsplit(scen, "-")) + + source("config/default.cfg") + + cfg$qos <- "short_maxMem" + + cfg$results_folder <- "output/:title::date:" + + cfg$output <- c( + "output_check", "extra/disaggregation", "rds_report", "extra/runSEALSallocation" + ) + + cfg$input["calibration"] <- calib_tgz + + # Climate change switched off for these runs + cfg <- setScenario(cfg, "nocc_hist") + + # New iso food realisation + cfg$gms$food <- "anthro_iso_jun22" + + cfg$gms$s14_use_yield_calib <- 1 + + # sticky + cfg$gms$factor_costs <- "sticky_feb18" + + # SNV habitat defintion + cfg$gms$land_snv <- "secdforest, other" + + cfg <- setScenario(cfg, c(ssp, "NPI")) + cfg$gms$c15_food_scenario <- ssp + + cfg$seals_years <- c(2020, 2050) + + # --- Dietary transitions --- + + # 50 % convergence towards EAT lancet diet + if ("DIET50" %in% actions) { + cfg <- setScenario(cfg, "eat_lancet_diet_v1") + cfg$gms$s15_exo_foodscen_start <- 2020 + cfg$gms$s15_exo_foodscen_target <- 2050 + cfg$gms$s15_exo_foodscen_convergence <- 0.5 + cfg$gms$s15_exo_waste <- 1 + } + + # 100% convergence towards EAT lancet diet + if ("DIET100" %in% actions) { + cfg <- setScenario(cfg, "eat_lancet_diet_v1") + cfg$gms$s15_exo_foodscen_start <- 2020 + cfg$gms$s15_exo_foodscen_target <- 2050 + cfg$gms$s15_exo_foodscen_convergence <- 1 + cfg$gms$s15_exo_waste <- 1 + } + + # --- Ecosystem stewarship actions --- + + # 30by30 land conservation + if (any(actions %in% c("BIOS", "landConservation"))) { + cfg$gms$c22_protect_scenario <- "30by30" + cfg$gms$s22_conservation_start <- 2020 + cfg$gms$s22_conservation_target <- 2030 + } + + # no net nature loss + if (any(actions %in% c("BIOS", "noNatureLoss2030"))) { + cfg$gms$c44_bii_decrease <- 0 + cfg$gms$s44_start_year <- 2030 + } + + # permanent habitats in agricultural landscapes + if (any(actions %in% c("BIOS", "SNV20"))) { + cfg$gms$s29_snv_shr <- 0.2 + cfg$gms$s29_snv_scenario_start <- 2020 + cfg$gms$s29_snv_scenario_target <- 2030 + } + + # parameters are fixed to SSP2 values until 2020 + cfg <- setScenario(cfg, "fix_2020", scenario_config = "config/projects/scenario_config_year_fix.csv") + + cfg$title <- paste0(prefix, "_", ssp, "-", scen) + start_run(cfg = cfg, codeCheck = FALSE) + } +} From 1f503af21495e9d9d4eb31f4d7a4c1c570a1381c Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 18 Sep 2024 16:01:58 +0200 Subject: [PATCH 155/171] updated changelog --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a5a39bd8..e9b093e0ee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** additional data update additional_data_rev4.53.tgz - **29_cropland** added option for linear and sigmoidal faders - **scripts** output/extra/highres.R use default 13_tc realization +- **scripts** `.nc` files are no longer created by default after disaggregation ### added @@ -34,9 +35,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **cropland** added option for discarding initial treecover on cropland - **script** added output script for conversion of validation.mif file into validation.rds - **script** for downscaling to 0.25 deg using LUH2v2h as reference via mrdownscale +- **config** added `scenario_config_year_fix.csv` for choosing until when parameters are fixed to SSP2 values +- **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` +- **scripts** added script for automatic submission of SEALS allocation runs `./extra/runSEALSallocation.R` ### removed -- + ### fixed - **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. @@ -50,7 +54,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### changed - **29_ageclass** module 29_ageclass has been renamed to 28_ageclass to make space for `29_cropland` just before `30_croparea` - **30_crop** module `30_crop` renamed to `30_croparea`, which now only accounts for crop area. -- **30_crop** Semi-Natural Vegetation (SNV) implementation has been moved from `30_crop` to `29_cropland` +- **30_crop** Semi-Natural Vegetation (SNV) implementation has been moved from `30_crop` to `29_cropland` - **30_crop** the previous `30_crop/endo_apr21` realization has been moved to `30_croparea/simple_apr24` - **30_crop** the two realizations `penalty_apr22` and `rotation_apr22` have been merged into a single `30_croparea/detail_apr24` realization - **default.cfg** update additional data to rev4.51 From 40a442ab2590e9f427757830cf72102f742c09aa Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 18 Sep 2024 16:13:45 +0200 Subject: [PATCH 156/171] added scenario config to set SSP2 fix --- config/projects/scenario_config_year_fix.csv | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 config/projects/scenario_config_year_fix.csv diff --git a/config/projects/scenario_config_year_fix.csv b/config/projects/scenario_config_year_fix.csv new file mode 100644 index 0000000000..282d61934e --- /dev/null +++ b/config/projects/scenario_config_year_fix.csv @@ -0,0 +1,16 @@ +;fix_2020;fix_2025 +gms$sm_fix_SSP2;2020;2025 +gms$sm_fix_cc;2020;2025 +gms$s15_food_substitution_start;2020;2025 +gms$s15_exo_foodscen_start;2020;2025 +gms$s21_trade_tariff_startyear;2020;2025 +gms$s22_conservation_start;2020;2025 +gms$s29_snv_scenario_start;2020;2025 +gms$s29_treecover_scenario_start;2020;2025 +gms$s29_fallow_scenario_start;2020;2025 +gms$s30_betr_scenario_start;2020;2025 +gms$s30_rotation_scenario_start;2020;2025 +gms$s38_startyear_labor_substitution;2020;2025 +gms$s42_efp_startyear;2020;2025 +gms$s44_start_year;2020;2025 +gms$s70_feed_substitution_start;2020;2025 From 98778a49a5cd7e93859ed1f0bfc3869c546fdb47 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Wed, 18 Sep 2024 17:03:06 +0200 Subject: [PATCH 157/171] updated copyright year --- scripts/start/projects/GENIE_0_default.R | 2 +- scripts/start/projects/GENIE_1_tau-export.R | 4 ++-- scripts/start/projects/GENIE_2_bm-priced.R | 6 +++--- scripts/start/projects/GENIE_3_bm-demand.R | 4 ++-- scripts/start/projects/GENIE_4_feedback.R | 10 +++++----- scripts/start/projects/paper_healthyLscps.R | 2 +- scripts/start/projects/project_EAT2p0_DeepDive.R | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/start/projects/GENIE_0_default.R b/scripts/start/projects/GENIE_0_default.R index 248e67bfa6..74fde2c3ce 100644 --- a/scripts/start/projects/GENIE_0_default.R +++ b/scripts/start/projects/GENIE_0_default.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the diff --git a/scripts/start/projects/GENIE_1_tau-export.R b/scripts/start/projects/GENIE_1_tau-export.R index 4859e78552..561266c5c4 100644 --- a/scripts/start/projects/GENIE_1_tau-export.R +++ b/scripts/start/projects/GENIE_1_tau-export.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the @@ -52,7 +52,7 @@ cfg$info$flag <- identifierFlag cfg$results_folder <- paste0("output/", identifierFlag, "/:title:") cfg$gms$c44_bii_decrease <- 0 -cfg$gms$c22_protect_scenario <- "BH" +cfg$gms$c22_protect_scenario <- "BH" cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 0 cfg$gms$c60_bioenergy_subsidy <- 0 diff --git a/scripts/start/projects/GENIE_2_bm-priced.R b/scripts/start/projects/GENIE_2_bm-priced.R index e58c1b485d..5cac564635 100644 --- a/scripts/start/projects/GENIE_2_bm-priced.R +++ b/scripts/start/projects/GENIE_2_bm-priced.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the @@ -52,7 +52,7 @@ cfg$info$flag <- identifierFlag cfg$results_folder <- paste0("output/", identifierFlag, "/:title:") -### BE +### BE cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 0 cfg$gms$c60_bioenergy_subsidy <- 0 beV <- c(0, 5, 7, 10, 15, 25, 45) @@ -83,7 +83,7 @@ for (bl in blV) { preflag <- paste0("MP", str_pad(mp, 2, pad = "0"), "BI", str_pad(bl * 100, 2, pad = "0")) cfg$results_folder <- paste("output", identifierFlag, preflag, ":title:", sep = "/") cfg$info$flag2 <- preflag - + cfg$gms$s15_rumdairy_scp_substitution <- mp / 100 for (be in beV) { diff --git a/scripts/start/projects/GENIE_3_bm-demand.R b/scripts/start/projects/GENIE_3_bm-demand.R index 5bca4b0229..715ecb4e84 100644 --- a/scripts/start/projects/GENIE_3_bm-demand.R +++ b/scripts/start/projects/GENIE_3_bm-demand.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the @@ -51,7 +51,7 @@ cfg$info$flag <- identifierFlag cfg$results_folder <- paste0("output/", identifierFlag, "/:title:") -### BE +### BE cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 0 cfg$gms$c60_bioenergy_subsidy <- 0 beV <- c(0, 5, 7, 10, 15, 25, 45) diff --git a/scripts/start/projects/GENIE_4_feedback.R b/scripts/start/projects/GENIE_4_feedback.R index 1fa097a562..2f2ced23b7 100644 --- a/scripts/start/projects/GENIE_4_feedback.R +++ b/scripts/start/projects/GENIE_4_feedback.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the @@ -50,12 +50,12 @@ cfg$info$flag <- identifierFlag cfg$results_folder <- paste0("output/", identifierFlag, "/:title:") -### BE +### BE cfg$gms$s60_2ndgen_bioenergy_dem_min_post_fix <- 0 cfg$gms$c60_bioenergy_subsidy <- 0 ### Tau / Yield -cfg$gms$tc <- "exo" +cfg$gms$tc <- "exo" ### Biodiv blV <- c(0) #BII lower bound (0-1), default 0 @@ -87,7 +87,7 @@ for (bl in blV) { # "output", identifierFlag, preflag, ":title:", sep = "/" "output", identifierFlag, ":title:", sep = "/" ) - + n <- "Feedback_step13_400f" m <- n cfg$gms$c60_2ndgen_biodem <- n @@ -96,7 +96,7 @@ for (bl in blV) { ############################################## #runflag <- paste("feedback", f_flag, sep = "_") - runflag <- paste0(m, "") + runflag <- paste0(m, "") cfg$title <- paste0(preflag, runflag) diff --git a/scripts/start/projects/paper_healthyLscps.R b/scripts/start/projects/paper_healthyLscps.R index 0ea21e9210..d1d3e39ebf 100644 --- a/scripts/start/projects/paper_healthyLscps.R +++ b/scripts/start/projects/paper_healthyLscps.R @@ -1,4 +1,4 @@ -# | (C) 2008-2021 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 3dd9e4bf29..40fbb9d8ac 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -1,4 +1,4 @@ -# | (C) 2008-2023 Potsdam Institute for Climate Impact Research (PIK) +# | (C) 2008-2024 Potsdam Institute for Climate Impact Research (PIK) # | authors, and contributors see CITATION.cff file. This file is part # | of MAgPIE and licensed under AGPL-3.0-or-later. Under Section 7 of # | AGPL-3.0, you are granted additional permissions described in the @@ -240,7 +240,7 @@ cfg <- setScenario(cfg, c("EL2_default"), scenario_config = "config/projects/sce cfg <- bau(cfg = cfg) # Mitigation cfg <- miti(cfg = cfg) -# ecoSysProtAll_agMgmtOff: +# ecoSysProtAll_agMgmtOff: # (Above ground CO2 emis from LUC in forest, forestry, natveg; All types of emis from peatland; No further CH4/N2O/other emis related to ag. management) cfg$gms$c56_emis_policy <- "ecoSysProtAll_agMgmtOff" start_run(cfg, codeCheck = FALSE) From eaadd8c395648d26adde064d34055e3af1a744bc Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Thu, 19 Sep 2024 10:49:38 +0200 Subject: [PATCH 158/171] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b093e0ee..ac433147cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **29_cropland** added option for linear and sigmoidal faders - **scripts** output/extra/highres.R use default 13_tc realization - **scripts** `.nc` files are no longer created by default after disaggregation +- **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" ### added From 6aef8ede403b36302ceba22e06c49c310698860a Mon Sep 17 00:00:00 2001 From: pvjeetze <50408549+pvjeetze@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:38:52 +0200 Subject: [PATCH 159/171] Update scripts/output/extra/runSEALSallocation.R Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- scripts/output/extra/runSEALSallocation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index fe6b865d99..fa8184ad4d 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -6,7 +6,7 @@ # | Contact: magpie@pik-potsdam.de # -------------------------------------------------------------- -# description: Starts SEALS allocation run based on gridded MAgPIE land cover projections (SEALS) +# description: Starts SEALS allocation run based on gridded MAgPIE land cover projections # comparison script: FALSE # --------------------------------------------------------------- From e859db92c918138d9202f7a23b955f78f1e2a2c3 Mon Sep 17 00:00:00 2001 From: pvjeetze <50408549+pvjeetze@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:46:09 +0200 Subject: [PATCH 160/171] Update scripts/output/extra/runSEALSallocation.R Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- scripts/output/extra/runSEALSallocation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index fa8184ad4d..07ebf324a1 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -104,7 +104,7 @@ reportLandUseForSEALS( overwrite = TRUE ) - main <- readLines(file.path(dirProject, "scripts/run_test_standard.py")) + main <- readLines(file.path(dirProject, "scripts", "run_test_standard.py")) main[min(which(grepl(" p.user_dir =", main)))] <- paste0(" p.user_dir = \'", dirBaseFiles, "\'") main[min(which(grepl(" p.extra_dirs", main)))] <- paste0(" p.extra_dirs = '.'") From b13da8f7ad53d52cf799f17023a7bdeb69416b6a Mon Sep 17 00:00:00 2001 From: pvjeetze <50408549+pvjeetze@users.noreply.github.com> Date: Thu, 19 Sep 2024 11:47:48 +0200 Subject: [PATCH 161/171] Update scripts/output/extra/runSEALSallocation.R Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- scripts/output/extra/runSEALSallocation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index 07ebf324a1..8f71ad912a 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -139,7 +139,7 @@ reportLandUseForSEALS( submit <- c( "#!/bin/bash", "\n", paste0("#SBATCH --qos=", qos), - ifelse(qos %in% c("priority", "standby"), "#SBATCH --partition=priority", "#SBATCH --partition=standard"), + if (qos %in% c("priority", "standby")) "#SBATCH --partition=priority" else "#SBATCH --partition=standard", "#SBATCH --job-name=seals_allocation", paste0("#SBATCH --chdir=", normalizePath(file.path(dirProject, "scripts"))), "#SBATCH --output=outfile_%j.out", From c04f45ba666708497d0341c4f8824840c2cae240 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Thu, 19 Sep 2024 14:15:02 +0200 Subject: [PATCH 162/171] changed source path of miniforge3 --- scripts/output/extra/runSEALSallocation.R | 45 +++++++++++++++-------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index fe6b865d99..93914f2bc9 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -39,10 +39,6 @@ if (!exists("source_include")) { # for instructions on how to set up a python environment for SEALS sealsEnv <- "seals_dev" -### Path to miniforge installation -# For instructions on how to install miniforge see https://github.com/conda-forge/miniforge -miniforgePath <- "/home/vjeetze/miniforge3/bin/activate" - ### Path to SEALS base input file directory dirBaseFiles <- "/p/projects/magpie/users/vjeetze/seals/files" @@ -78,6 +74,36 @@ reportLandUseForSEALS( # Setup SEALS run # ======================== +# Check whether base data and local SEALS code repo exist +if (length(list.files(dirBaseFiles)) == 0) { + stop(paste( + "Please set the path to the SEALS base data", + "directory under 'User settings' of the", + "extra/runSEALSallocation.R script." + )) +} else if (length(list.files(dirBaseFiles)) == 0) { + stop(paste( + "Please set the path to your local clone", + "of the SEALS code under 'User settings' of the", + "extra/runSEALSallocation.R script." + )) +} + +### Path to miniforge installation +miniforgePath <- "/p/projects/rd3mod/miniforge3/bin/activate" + +# create output directory +dirProject <- "./output/seals" + +if (!dir.exists(file.path(dirProject))) { + dir.create(file.path(dirProject), recursive = TRUE) +} + +iniLock <- file.path(dirProject, ".lock") +lockOn <- filelock::lock(iniLock, exclusive = TRUE, timeout = Inf) +Sys.chmod(iniLock, mode = "0664") + + # -------------------------------- # Prepare SEALS start script # -------------------------------- @@ -167,17 +193,6 @@ reportLandUseForSEALS( } } -# create output directory -dirProject <- "./output/seals" - -if (!dir.exists(file.path(dirProject))) { - dir.create(file.path(dirProject), recursive = TRUE) -} - -iniLock <- file.path(dirProject, ".lock") -lockOn <- filelock::lock(iniLock, exclusive = TRUE, timeout = Inf) -Sys.chmod(iniLock, mode = "0664") - # -------------------------------- # Run SEALS allocation # -------------------------------- From 5e8f173589a7db42c99e294cbd6e8cf3438ca740 Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Thu, 19 Sep 2024 14:18:03 +0200 Subject: [PATCH 163/171] bugfix --- scripts/output/extra/runSEALSallocation.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index 5823fcda46..0b9f2eafa4 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -81,7 +81,7 @@ if (length(list.files(dirBaseFiles)) == 0) { "directory under 'User settings' of the", "extra/runSEALSallocation.R script." )) -} else if (length(list.files(dirBaseFiles)) == 0) { +} else if (length(list.files(dirSEALS)) == 0) { stop(paste( "Please set the path to your local clone", "of the SEALS code under 'User settings' of the", From 0fb4578ee1f9e3f9cc5836903208ca7a38e8c851 Mon Sep 17 00:00:00 2001 From: emolinab Date: Thu, 19 Sep 2024 14:58:10 +0200 Subject: [PATCH 164/171] shift to sticky as default --- CHANGELOG.md | 1 + config/default.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7baeca640c..a627e4f5dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### changed +- **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. - **21_trade** refactor equations for enhanced readablility and improve documentation - **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. diff --git a/config/default.cfg b/config/default.cfg index 76facad415..f36103e966 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -1135,7 +1135,7 @@ cfg$gms$c37_labor_uncertainty <- "ensmean" # default = "ensmean" # NOTE: It is recommended to recalibrate the model when changing this setting! # NOTE: In case the maximum number of iterations is reached without convergence # in the calibration, please consider to use the best_calib setting for the calibration run -cfg$gms$factor_costs <- "per_ton_fao_may22" # default = per_ton_fao_may22 +cfg$gms$factor_costs <- "sticky_feb18" # default = "sticky_feb18" # * Regional (reg) or global (glo) factor requirements (applicable for per_ton_fao_may22, # * sticky_feb18, sticky_labor). The regional version keeps factor requirements constant From ff6244b0a20a168e16e616c185e489dd8c66cf22 Mon Sep 17 00:00:00 2001 From: pvjeetze <50408549+pvjeetze@users.noreply.github.com> Date: Thu, 19 Sep 2024 15:58:05 +0200 Subject: [PATCH 165/171] Update scripts/output/extra/runSEALSallocation.R Co-authored-by: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> --- scripts/output/extra/runSEALSallocation.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index 0b9f2eafa4..21b289f026 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -94,6 +94,8 @@ miniforgePath <- "/p/projects/rd3mod/miniforge3/bin/activate" # create output directory dirProject <- "./output/seals" +message(paste("Stitched SEALS allocation outputs are written to", + "'./output/seals/intermediate/stitched_lulc_simplified_scenarios'")) if (!dir.exists(file.path(dirProject))) { dir.create(file.path(dirProject), recursive = TRUE) From 759ff44df1f4cdc64b489731b7133a543f98ab8b Mon Sep 17 00:00:00 2001 From: pvjeetze Date: Fri, 20 Sep 2024 12:03:15 +0200 Subject: [PATCH 166/171] additional fixes, including run submissions of Foote --- CHANGELOG.md | 1 + config/default.cfg | 20 +++++++++---------- scripts/output/extra/highres.R | 4 ++-- scripts/output/extra/runSEALSallocation.R | 15 ++++++++++---- scripts/projects/fsec.R | 2 +- scripts/run_submit/submit_priority.sh | 1 + ...y_maxMem.sh => submit_priority_highMem.sh} | 2 +- scripts/run_submit/submit_short.sh | 1 + ...hort_maxMem.sh => submit_short_highMem.sh} | 2 +- scripts/run_submit/submit_standby.sh | 1 + scripts/run_submit/submit_standby_dayMax.sh | 1 + ...by_maxMem.sh => submit_standby_highMem.sh} | 2 +- ...ax.sh => submit_standby_highMem_dayMax.sh} | 2 +- scripts/slurmOutput.yml | 8 ++++---- scripts/start/projects/paper_healthyLscps.R | 2 +- scripts/start/projects/paper_peatlandTax.R | 20 +++++++++---------- scripts/start/projects/project_ABCDR.R | 2 +- scripts/start/projects/project_EAT2p0.R | 2 +- .../start/projects/project_EAT2p0_DeepDive.R | 2 +- .../start/projects/project_LAMACLIMA_WP4.R | 2 +- 20 files changed, 52 insertions(+), 40 deletions(-) rename scripts/run_submit/{submit_priority_maxMem.sh => submit_priority_highMem.sh} (86%) rename scripts/run_submit/{submit_short_maxMem.sh => submit_short_highMem.sh} (86%) rename scripts/run_submit/{submit_standby_maxMem.sh => submit_standby_highMem.sh} (86%) rename scripts/run_submit/{submit_standby_maxMem_dayMax.sh => submit_standby_highMem_dayMax.sh} (88%) diff --git a/CHANGELOG.md b/CHANGELOG.md index ac433147cd..7fbdc8f34e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **scripts** output/extra/highres.R use default 13_tc realization - **scripts** `.nc` files are no longer created by default after disaggregation - **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" +- **config** Submissions with high memory requirements now get 16 CPUs and 80GB of memory to account for the new specifications of PIK's new HPC 'Foote'. `maxMem` was renamed to `highMem`, because 80GB of memory does not correspond to the maximum available memory of a compute node. ### added diff --git a/config/default.cfg b/config/default.cfg index c651b1aeb9..57b6d09704 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -26,7 +26,7 @@ cfg$input <- c(regional = "rev4.111_h12_magpie.tgz", cellular = "rev4.111_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", validation = "rev4.111_h12_validation.tgz", additional = "additional_data_rev4.53.tgz", - calibration = "calibration_H12_26Mar24.tgz") + calibration = "calibration_H12_26Mar24_fixed.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, @@ -2083,15 +2083,15 @@ cfg$sequential <- NA # Selection of QOS to be used for submitted runs on cluster. # Will be ignored for all other runs. -# * options: short (24h max, no preemption) -# * short_maxMem (same as short but with 16 CPUs and max Memory) -# * medium (1 week max, no preemption) -# * priority (immediate start, but slots limited to 5 in parallel) -# * priority_maxMem (same as priority but with 16 CPUs and max Memory) -# * standby (1 week max, preemption possible) -# * standby_dayMax (24h max, preemption possible) -# * standby_maxMem_dayMax (same as standby_dayMax but with 16 CPUs and max Memory) -# * standby_maxMem (same as standby but with 16 CPUs and max Memory) +# * options: short (24h max, 3 CPUs, no preemption) +# * short_highMem (same as short but with 16 CPUs and 80GB of memory) +# * medium (1 week max, 3 CPUs, no preemption) +# * priority (immediate start, 3 CPUs, but slots limited to 5 in parallel) +# * priority_highMem (same as priority but with 16 CPUs and 80GB of memory) +# * standby (1 week max, 3 CPUs, preemption possible) +# * standby_dayMax (24h max, 3 CPUs, preemption possible) +# * standby_highMem_dayMax (same as standby_dayMax but with 16 CPUs and 80GB of memory) +# * standby_highMem (same as standby but with 16 CPUs and 80GB of memory) # * NULL (educated guess of best option based # * available resources) cfg$qos <- NULL # def = NULL diff --git a/scripts/output/extra/highres.R b/scripts/output/extra/highres.R index 3d93842c78..c1768e03d6 100644 --- a/scripts/output/extra/highres.R +++ b/scripts/output/extra/highres.R @@ -104,7 +104,7 @@ highres <- function(cfg = cfg, res = "c1000", tc = NULL) { cfg$gms$s_use_gdx <- 2 #max resources for parallel runs - cfg$qos <- "standby_maxMem_dayMax" + cfg$qos <- "standby_highMem_dayMax" # set force download to FALSE # otherwise data is download again when calling start_run(), which overwrites @@ -156,7 +156,7 @@ highres <- function(cfg = cfg, res = "c1000", tc = NULL) { write.magpie(readGDX(gdx,"f56_pollutant_prices_emulator"),"modules/56_ghg_policy/input/f56_pollutant_prices_emulator.cs3") write.magpie(readGDX(gdx,"f60_bioenergy_dem_coupling"),"modules/60_bioenergy/input/reg.2ndgen_bioenergy_demand.csv") write.magpie(readGDX(gdx,"f60_bioenergy_dem_emulator"),"modules/60_bioenergy/input/glo.2ndgen_bioenergy_demand.csv") - + #get regional afforestation patterns from low resolution run with c200 aff <- dimSums(landForestry(gdx)[,,c("aff","ndc")],dim=3) #Take away initial NDC area for consistency with global afforestation limit diff --git a/scripts/output/extra/runSEALSallocation.R b/scripts/output/extra/runSEALSallocation.R index 21b289f026..26b8fcfdf4 100644 --- a/scripts/output/extra/runSEALSallocation.R +++ b/scripts/output/extra/runSEALSallocation.R @@ -94,8 +94,6 @@ miniforgePath <- "/p/projects/rd3mod/miniforge3/bin/activate" # create output directory dirProject <- "./output/seals" -message(paste("Stitched SEALS allocation outputs are written to", - "'./output/seals/intermediate/stitched_lulc_simplified_scenarios'")) if (!dir.exists(file.path(dirProject))) { dir.create(file.path(dirProject), recursive = TRUE) @@ -203,7 +201,11 @@ if (!is.null(lockOn)) { sealsLock <- file.path(dirProject, "seals.lock") if (!file.exists(sealsLock) || file.size(sealsLock) == 0) { - message("Starting SEALS allocation with input data creation.") + message(paste( + "Starting SEALS allocation with input data creation.\n", + "Stitched SEALS allocation outputs will be written to", + "'./output/seals/intermediate/stitched_lulc_simplified_scenarios'" + )) .setupSEALSrun( title = title, dir = outputdir, @@ -223,7 +225,12 @@ if (!is.null(lockOn)) { writeLines(id, sealsLock) } else { - message("Starting SEALS allocation using existing input data.") + message(paste( + "Starting SEALS allocation using existing input data.\n", + "Stitched SEALS allocation outputs will be written to", + "'./output/seals/intermediate/stitched_lulc_simplified_scenarios'" + )) + id <- readLines(sealsLock) .setupSEALSrun( diff --git a/scripts/projects/fsec.R b/scripts/projects/fsec.R index 0449a6028b..f7f3302baa 100644 --- a/scripts/projects/fsec.R +++ b/scripts/projects/fsec.R @@ -214,7 +214,7 @@ fsecScenario <- function(scenario) { # general cfg$title <- paste(v, scenario, sep = "") cfg$recalibrate <- FALSE - cfg$qos <- "standby_maxMem_dayMax" + cfg$qos <- "standby_highMem_dayMax" cfg$output <- c("extra/highres", "extra/disaggregation", "projects/FSEC_nitrogenPollution", diff --git a/scripts/run_submit/submit_priority.sh b/scripts/run_submit/submit_priority.sh index 33c8496d5e..b23c5bd67e 100644 --- a/scripts/run_submit/submit_priority.sh +++ b/scripts/run_submit/submit_priority.sh @@ -5,5 +5,6 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_priority_maxMem.sh b/scripts/run_submit/submit_priority_highMem.sh similarity index 86% rename from scripts/run_submit/submit_priority_maxMem.sh rename to scripts/run_submit/submit_priority_highMem.sh index ae58b9695f..feae971607 100644 --- a/scripts/run_submit/submit_priority_maxMem.sh +++ b/scripts/run_submit/submit_priority_highMem.sh @@ -5,6 +5,6 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 -#SBATCH --mem-per-cpu=0 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_short.sh b/scripts/run_submit/submit_short.sh index 4e7b6edfc1..433ed3308c 100644 --- a/scripts/run_submit/submit_short.sh +++ b/scripts/run_submit/submit_short.sh @@ -5,5 +5,6 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_short_maxMem.sh b/scripts/run_submit/submit_short_highMem.sh similarity index 86% rename from scripts/run_submit/submit_short_maxMem.sh rename to scripts/run_submit/submit_short_highMem.sh index 2016794e79..cf8f9669a9 100644 --- a/scripts/run_submit/submit_short_maxMem.sh +++ b/scripts/run_submit/submit_short_highMem.sh @@ -5,7 +5,7 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 -#SBATCH --mem-per-cpu=0 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_standby.sh b/scripts/run_submit/submit_standby.sh index f0bff32339..e3ab2dd5b3 100644 --- a/scripts/run_submit/submit_standby.sh +++ b/scripts/run_submit/submit_standby.sh @@ -5,5 +5,6 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_standby_dayMax.sh b/scripts/run_submit/submit_standby_dayMax.sh index d7836390d1..aa6b3673d0 100644 --- a/scripts/run_submit/submit_standby_dayMax.sh +++ b/scripts/run_submit/submit_standby_dayMax.sh @@ -5,6 +5,7 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=3 +#SBATCH --mem-per-cpu=5G #SBATCH --time=24:00:00 Rscript submit.R diff --git a/scripts/run_submit/submit_standby_maxMem.sh b/scripts/run_submit/submit_standby_highMem.sh similarity index 86% rename from scripts/run_submit/submit_standby_maxMem.sh rename to scripts/run_submit/submit_standby_highMem.sh index 23b0999431..4791ed844d 100644 --- a/scripts/run_submit/submit_standby_maxMem.sh +++ b/scripts/run_submit/submit_standby_highMem.sh @@ -5,6 +5,6 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 -#SBATCH --mem-per-cpu=0 +#SBATCH --mem-per-cpu=5G Rscript submit.R diff --git a/scripts/run_submit/submit_standby_maxMem_dayMax.sh b/scripts/run_submit/submit_standby_highMem_dayMax.sh similarity index 88% rename from scripts/run_submit/submit_standby_maxMem_dayMax.sh rename to scripts/run_submit/submit_standby_highMem_dayMax.sh index ac3ba4d307..674bc10f5a 100644 --- a/scripts/run_submit/submit_standby_maxMem_dayMax.sh +++ b/scripts/run_submit/submit_standby_highMem_dayMax.sh @@ -5,7 +5,7 @@ #SBATCH --output=slurm.log #SBATCH --mail-type=END,FAIL #SBATCH --cpus-per-task=16 -#SBATCH --mem-per-cpu=0 +#SBATCH --mem-per-cpu=5G #SBATCH --time=24:00:00 Rscript submit.R diff --git a/scripts/slurmOutput.yml b/scripts/slurmOutput.yml index f493010be1..d3e35abe57 100644 --- a/scripts/slurmOutput.yml +++ b/scripts/slurmOutput.yml @@ -1,5 +1,5 @@ slurmjobs: - SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00" - SLURM standby maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=0 --cpus-per-task=16" - SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority" - SLURM priority maxMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --mem-per-cpu=8000 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=0 --cpus-per-task=16" + SLURM standby: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --wrap=\"Rscript %SCRIPT\" --qos=standby --mem-per-cpu=5G --cpus-per-task=3" + SLURM standby highMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=standby --time=24:00:00 --mem-per-cpu=5G --cpus-per-task=16" + SLURM priority: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --time=200 --wrap=\"Rscript %SCRIPT\" --qos=priority --mem-per-cpu=5G --cpus-per-task=3" + SLURM priority highMem: "sbatch --job-name=scripts-output --output=logs/out-%NAME-%j.out --error=logs/out-%NAME-%j.err --mail-type=END,FAIL --wrap=\"Rscript %SCRIPT\" --qos=priority --time=24:00:00 --mem-per-cpu=5G --cpus-per-task=16" diff --git a/scripts/start/projects/paper_healthyLscps.R b/scripts/start/projects/paper_healthyLscps.R index d1d3e39ebf..9e5ff97765 100644 --- a/scripts/start/projects/paper_healthyLscps.R +++ b/scripts/start/projects/paper_healthyLscps.R @@ -84,7 +84,7 @@ for (ssp in SSPs) { source("config/default.cfg") - cfg$qos <- "short_maxMem" + cfg$qos <- "short_highMem" cfg$results_folder <- "output/:title::date:" diff --git a/scripts/start/projects/paper_peatlandTax.R b/scripts/start/projects/paper_peatlandTax.R index 2ed3cdbbe0..91824915f5 100644 --- a/scripts/start/projects/paper_peatlandTax.R +++ b/scripts/start/projects/paper_peatlandTax.R @@ -30,7 +30,7 @@ cfg$results_folder_highres <- "output" cfg$output <- c(cfg$output, "extra/highres") cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby_highMem_dayMax" # support function to create standardized title .title <- function(cfg, ...) @@ -55,7 +55,7 @@ calc_ghgprice <- function() { T0 <- read.magpie("modules/56_ghg_policy/input/f56_pollutant_prices.cs3") T0 <- collapseNames(T0[, , getNames(T0, dim = 2)[1]]) T0[, , ] <- 0 - + #T200 200 USD/tCO2 in 2050 T200 <- new.magpie(getRegions(T0), c(seq(1995, 2025, by = 5), 2050, 2100, 2150), getNames(T0), fill = 0) T200[, "y2025", "co2_c"] <- 0 @@ -68,12 +68,12 @@ calc_ghgprice <- function() { T200[, , "n2o_n_direct"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "n2o_n_indirect"] <- T200[, , "co2_c"] * 265 * 44 / 28 T200[, , "co2_c"] <- T200[, , "co2_c"] * 44 / 12 - + T50 <- T200 * 0.25 T100 <- T200 * 0.5 T400 <- T200 * 2 T800 <- T200 * 4 - + GHG <- mbind( add_dimension(T0, dim = 3.2, add = "scen", nm = "T0-GHG"), add_dimension( @@ -107,16 +107,16 @@ calc_ghgprice <- function() { nm = "T800-GHG" ) ) - + CO2 <- GHG CO2[, , c("ch4", "n2o_n_direct", "n2o_n_indirect")] <- 0 getNames(CO2, dim = 2) <- gsub("GHG", "CO2", getNames(CO2, dim = 2)) - + GHGCH4GWP20 <- GHG GHGCH4GWP20[, , "ch4"] <- GHGCH4GWP20[, , "ch4"] / 28 * 84 getNames(GHGCH4GWP20, dim = 2) <- gsub("GHG", "GHG-GWP20", getNames(GHGCH4GWP20, dim = 2)) - + GHG <- mbind(CO2, GHG, GHGCH4GWP20) if (!dir.exists("./patch_inputdata")) dir.create("./patch_inputdata") @@ -126,7 +126,7 @@ calc_ghgprice <- function() { write.magpie(GHG, file_name = "patch_inputdata/patchGHGprices/f56_pollutant_prices.cs3") tardir("patch_inputdata/patchGHGprices", "patch_inputdata/patchGHGprices.tgz") - + unlink("patch_inputdata/patchGHGprices", recursive = TRUE) return(getNames(GHG, dim = 2)) } @@ -146,7 +146,7 @@ cfg$gms$s56_c_price_induced_aff <- 0 ## Start scenarios for (res in c("c400")) { - if (res == "c400") + if (res == "c400") cfg$input['cellular'] <- "rev4.111_36f73207_44a213b6_cellularmagpie_c400_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" else if (res == "c1000") { cfg$input['cellular'] <- "rev4.111_36f73207_10f98ac1_cellularmagpie_c1000_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1_clusterweight-ba4466a8.tgz" @@ -156,7 +156,7 @@ for (res in c("c400")) { cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- "T0-CO2" start_run(cfg, codeCheck = FALSE) - + ## Policy scenarios for (tax in c("T50-CO2", "T100-CO2", diff --git a/scripts/start/projects/project_ABCDR.R b/scripts/start/projects/project_ABCDR.R index 981fb823e7..8b1480c537 100644 --- a/scripts/start/projects/project_ABCDR.R +++ b/scripts/start/projects/project_ABCDR.R @@ -25,7 +25,7 @@ cfg$results_folder <- "output/:title:" cfg$force_replace <- TRUE cfg$force_download <- FALSE -cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby_highMem_dayMax" # support function to create standardized title .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) diff --git a/scripts/start/projects/project_EAT2p0.R b/scripts/start/projects/project_EAT2p0.R index 9b1c073d22..83c759c07b 100644 --- a/scripts/start/projects/project_EAT2p0.R +++ b/scripts/start/projects/project_EAT2p0.R @@ -27,7 +27,7 @@ cfg$results_folder <- "output/:title::date:" cfg$force_download <- TRUE # Special outputs required for Deep Dive -cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby_highMem_dayMax" cfg$output <- c( "output_check", # "extra/highres", # do manually on last magpie run diff --git a/scripts/start/projects/project_EAT2p0_DeepDive.R b/scripts/start/projects/project_EAT2p0_DeepDive.R index 40fbb9d8ac..704e05d09b 100644 --- a/scripts/start/projects/project_EAT2p0_DeepDive.R +++ b/scripts/start/projects/project_EAT2p0_DeepDive.R @@ -27,7 +27,7 @@ cfg$results_folder <- "output/:title::date:" cfg$force_download <- TRUE # Special outputs required for Deep Dive -cfg$qos <- "standby_maxMem_dayMax" +cfg$qos <- "standby_highMem_dayMax" cfg$output <- c( "output_check", "extra/highres", diff --git a/scripts/start/projects/project_LAMACLIMA_WP4.R b/scripts/start/projects/project_LAMACLIMA_WP4.R index 709d580522..a8b1ac6f12 100644 --- a/scripts/start/projects/project_LAMACLIMA_WP4.R +++ b/scripts/start/projects/project_LAMACLIMA_WP4.R @@ -39,7 +39,7 @@ cfg$gms$c37_labor_uncertainty <- "ensmean" cfg$results_folder <- "output/:title:" cfg$output <- c("rds_report","extra/disaggregation","extra/disaggregation_LUH2","extra/highres") -cfg$qos <- "priority_maxMem" +cfg$qos <- "priority_highMem" #### Main scenarios From aba4eb106e23c1546b382c3aab298b0a970d8b1f Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:29:05 +0200 Subject: [PATCH 167/171] renv 1.0.8 --- Makefile | 2 +- renv/activate.R | 105 ++++++++++++++++++++++--- scripts/output/extra/convertToNetCDF.R | 3 +- 3 files changed, 99 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index 3a844b1205..738915e4e8 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ update-renv: ## Upgrade all pik-piam packages in your renv to the respective update-renv-all: ## Upgrade all packages (including CRAN packages) in your renv ## to the respective latest release and write renv.lock to archive. - Rscript -e 'renv::update(exclude = "renv"); piamenv::archiveRenv()' + Rscript -e 'renv::update(type = getOption("pkgType")); piamenv::archiveRenv()' archive-renv: ## Write renv.lock to archive. Rscript -e 'piamenv::archiveRenv()' diff --git a/renv/activate.R b/renv/activate.R index d13f9932a1..2ebe403479 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.7" + version <- "1.0.8" attr(version, "sha") <- NULL # the project directory @@ -98,6 +98,66 @@ local({ unloadNamespace("renv") # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;ide:run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + `%||%` <- function(x, y) { if (is.null(x)) y else x } @@ -142,7 +202,10 @@ local({ # compute common indent indent <- regexpr("[^[:space:]]", lines) common <- min(setdiff(indent, -1L)) - leave - paste(substring(lines, common), collapse = "\n") + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) } @@ -306,7 +369,11 @@ local({ ) if ("headers" %in% names(formals(utils::download.file))) - args$headers <- renv_bootstrap_download_custom_headers(url) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } do.call(utils::download.file, args) @@ -385,10 +452,22 @@ local({ for (type in types) { for (repos in renv_bootstrap_repos()) { + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) + { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + # retrieve package database db <- tryCatch( as.data.frame( - utils::available.packages(type = type, repos = repos), + do.call(utils::available.packages, args), stringsAsFactors = FALSE ), error = identity @@ -470,6 +549,14 @@ local({ } + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + renv_bootstrap_download_github <- function(version) { enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") @@ -477,16 +564,16 @@ local({ return(FALSE) # prepare download options - pat <- Sys.getenv("GITHUB_PAT") - if (nzchar(Sys.which("curl")) && nzchar(pat)) { + token <- renv_bootstrap_github_token() + if (nzchar(Sys.which("curl")) && nzchar(token)) { fmt <- "--location --fail --header \"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "curl", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) - } else if (nzchar(Sys.which("wget")) && nzchar(pat)) { + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { fmt <- "--header=\"Authorization: token %s\"" - extra <- sprintf(fmt, pat) + extra <- sprintf(fmt, token) saved <- options("download.file.method", "download.file.extra") options(download.file.method = "wget", download.file.extra = extra) on.exit(do.call(base::options, saved), add = TRUE) diff --git a/scripts/output/extra/convertToNetCDF.R b/scripts/output/extra/convertToNetCDF.R index 99d9dffec7..22bd01fd5b 100644 --- a/scripts/output/extra/convertToNetCDF.R +++ b/scripts/output/extra/convertToNetCDF.R @@ -40,4 +40,5 @@ lapply(X = mzFiles, FUN = function(x) { }, error = function(e) { message("Error processing file: ", x, " - ", e$message) }) -}) \ No newline at end of file +}) + From f2f0171755729c3cbe707a800e6b79605a64a8d4 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:40:05 +0200 Subject: [PATCH 168/171] piamenv 0.5.5 --- .Rprofile | 4 ++-- DESCRIPTION | 2 +- scripts/output/extra/convertToNetCDF.R | 1 - 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.Rprofile b/.Rprofile index 7913b2deba..43d47c62c3 100644 --- a/.Rprofile +++ b/.Rprofile @@ -36,6 +36,6 @@ if (isTRUE(rownames(installed.packages(priority = "NA")) == "renv")) { } # in case bootstrapping fails halfway, install piamenv and rely on requirement auto-fixing -if (tryCatch(utils::packageVersion("piamenv") < "0.3.4", error = function(error) TRUE)) { - renv::install("piamenv", prompt = FALSE) +if (tryCatch(utils::packageVersion("piamenv") < "0.5.5", error = function(error) TRUE)) { + renv::install("piamenv", type = getOption("pkgType"), prompt = FALSE) } diff --git a/DESCRIPTION b/DESCRIPTION index 3a199b5dbd..3cc18bc481 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,7 +27,7 @@ Imports: mip, mrcommons, patchwork, - piamenv (>= 0.3.4), + piamenv (>= 0.5.5), piamInterfaces (>= 0.20.7), piamutils, quitte, diff --git a/scripts/output/extra/convertToNetCDF.R b/scripts/output/extra/convertToNetCDF.R index 22bd01fd5b..5c079f35a7 100644 --- a/scripts/output/extra/convertToNetCDF.R +++ b/scripts/output/extra/convertToNetCDF.R @@ -41,4 +41,3 @@ lapply(X = mzFiles, FUN = function(x) { message("Error processing file: ", x, " - ", e$message) }) }) - From 41e804410068c486332ae7ac968a16d756b77850 Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:59:20 +0200 Subject: [PATCH 169/171] require magpie4 2.12.6 --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 3cc18bc481..0f91ffe750 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -21,7 +21,7 @@ Imports: m4fsdp, madrat, magclass (>= 6.14.0), - magpie4 (>= 2.12.0), + magpie4 (>= 2.12.6), MagpieNCGains, magpiesets, mip, From 42741bafedabb588c7a502a3948a521cc698b85e Mon Sep 17 00:00:00 2001 From: Pascal Sauer <156898545+pascal-sauer@users.noreply.github.com> Date: Tue, 24 Sep 2024 09:06:36 +0200 Subject: [PATCH 170/171] renv 1.0.9 --- Makefile | 2 +- renv/activate.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 738915e4e8..18c6a289d2 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ update-renv: ## Upgrade all pik-piam packages in your renv to the respective update-renv-all: ## Upgrade all packages (including CRAN packages) in your renv ## to the respective latest release and write renv.lock to archive. - Rscript -e 'renv::update(type = getOption("pkgType")); piamenv::archiveRenv()' + Rscript -e 'renv::update(); piamenv::archiveRenv()' archive-renv: ## Write renv.lock to archive. Rscript -e 'piamenv::archiveRenv()' diff --git a/renv/activate.R b/renv/activate.R index 2ebe403479..c360bf2962 100644 --- a/renv/activate.R +++ b/renv/activate.R @@ -2,7 +2,7 @@ local({ # the requested version of renv - version <- "1.0.8" + version <- "1.0.9" attr(version, "sha") <- NULL # the project directory From 9d021a88c7785ab5b3ad6bb9f82e2f48f4b05861 Mon Sep 17 00:00:00 2001 From: Jake Tommey Date: Tue, 24 Sep 2024 11:00:18 +0200 Subject: [PATCH 171/171] magpie release 4.8.2 --- .zenodo.json | 8 ++++++-- CHANGELOG.md | 53 ++++++++++++++++++++++++++-------------------------- CITATION.cff | 4 ++-- README.md | 6 +++--- 4 files changed, 37 insertions(+), 34 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index a721129a86..b2f362ae35 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,6 +1,6 @@ { "title": "MAgPIE - An Open Source land-use modeling framework", - "version": "4.8.1dev", + "version": "4.8.2", "creators": [ { "name": "Dietrich, Jan Philipp", @@ -104,6 +104,10 @@ "affiliation": "Potsdam Institute for Climate Impact Research", "orcid": "0000-0002-5989-6855" }, + { + "name": "Hötten, David", + "affiliation": "Potsdam Institute for Climate Impact Research" + }, { "name": "Lotze-Campen, Hermann", "affiliation": "Potsdam Institute for Climate Impact Research", @@ -119,5 +123,5 @@ "license": { "id": "AGPL-3.0-or-later" }, - "publication_date": "2024-06-19" + "publication_date": "2024-09-24" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ecf219d9b..566893809e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,53 +4,51 @@ 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.8.2] - 2024-09-24 ### changed -- **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. -- **21_trade** refactor equations for enhanced readablility and improve documentation -- **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. - **15_food** revision of MP/SCP implementation for milk and meat alternatives. Added demand for fat and sugar as ingredients for MP-based milk alternatives. Added optional demand for fat as ingredient for MP-based meat alternatives. -- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. +- **21_trade** refactor equations for enhanced readablility and improve documentation +- **29_cropland** added option for linear and sigmoidal faders +- **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area +- **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. - **80_optimization** abort GAMS in case of execution errors, added threads = 1 as default to avoid infeasibilites and Flg_NoDefc = TRUE as option +- **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" +- **config** additional data update additional_data_rev4.53.tgz - **config** default settings for 58_peatland revised -- **58_peatland** variable `v58_scalingFactorExp` converted into parameter `p58_scalingFactorExp` to avoid infeasibilites. `p58_scalingFactorRed` has been revised. -- **32_forestry** Interfaces `vm_landexpansion_forestry` and `vm_landreduction_forestry` have been corrected by harvested and replanted timber plantation area -- **script** updated EATLancet project start scripts -- **script** replaced gdx package with gdx2 package calls -- **config** split scenario_config into project-specific configs - **config** initial treecover on cropland starts from zero -- **config** additional data update additional_data_rev4.53.tgz -- **29_cropland** added option for linear and sigmoidal faders -- **scripts** output/extra/highres.R use default 13_tc realization -- **scripts** `.nc` files are no longer created by default after disaggregation -- **config** `cfg$gms$land_snv`changed from "secdforest, forestry, past, other" to "secdforest, other" +- **config** split scenario_config into project-specific configs - **config** Submissions with high memory requirements now get 16 CPUs and 80GB of memory to account for the new specifications of PIK's new HPC 'Foote'. `maxMem` was renamed to `highMem`, because 80GB of memory does not correspond to the maximum available memory of a compute node. +- **config** The default realization for the 38_factor_costs module was switched to `sticky_feb18`. In this realization, capital stocks and their depreciation are tracked, giving some inertia to random relocation of production, improving high resolution outputs. +- **script** replaced gdx package with gdx2 package calls +- **script** scripts/start_functions.R decide individually for demand and price whether they are read from a REMIND report. +- **script** updated EATLancet project start scripts +- **scripts** `.nc` files are no longer created by default after disaggregation +- **scripts** output/extra/highres.R use default 13_tc realization +- **scripts** rewrite of merge_report.R based on rds files and rbind, which allows for more flexibility when merging reports. Avoid inconsistent use of "GLO" instead of "World" in report.rds files. ### added -- **scripts** added output script converting all grid-level .mz files to .nc (netCDF) -- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` -- **scripts** added out of bounds check as output script -- **70_livestock** added realization `fbask_jan16_sticky` -- **script** check of variables needed in piamInterfaces in report_rds.R - **42_water_demand** added water abstraction type dimension for non-ag uses - **56_ghg_policy** added optional temporal and regional fader for GHG emission pricing policy +- **70_livestock** added realization `fbask_jan16_sticky` +- **config** added `scenario_config_year_fix.csv` for choosing until when parameters are fixed to SSP2 values - **cropland** added option for discarding initial treecover on cropland - **script** added output script for conversion of validation.mif file into validation.rds +- **script** check of variables needed in piamInterfaces in report_rds.R - **script** for downscaling to 0.25 deg using LUH2v2h as reference via mrdownscale -- **config** added `scenario_config_year_fix.csv` for choosing until when parameters are fixed to SSP2 values -- **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` +- **scripts** added out of bounds check as output script +- **scripts** added output report `EU_report.R` that uses `EU_report.Rmd` +- **scripts** added output script converting all grid-level .mz files to .nc (netCDF) - **scripts** added script for automatic submission of SEALS allocation runs `./extra/runSEALSallocation.R` - -### removed +- **scripts** added start script for 'Healthly Landscapes' paper `paper_healthyLscps.R` ### fixed -- **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. - **15_food** fixing parameter declaration of i15_processed_kcal_structure_iso -- **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` - **35_natveg** bugfix secdforest and other land restoration to avoid double-counting of restoration in equation `q29_land_snv` +- **80_optimization** bugfix for variables levels not obeying the bounds in nlp_par, `conopt` changed to `conopt3` +- **scripts** fixing an error in start.R and output.R which occurred if more than one slurm job was submitted at the same time. ## [4.8.1] - 2024-06-19 @@ -1011,7 +1009,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.8.1...develop +[Unreleased]: https://github.com/magpiemodel/magpie/compare/v4.8.2...develop +[4.8.2]: https://github.com/magpiemodel/magpie/compare/v4.8.1...v4.8.2 [4.8.1]: https://github.com/magpiemodel/magpie/compare/v4.8.0...v4.8.1 [4.8.0]: https://github.com/magpiemodel/magpie/compare/v4.7.3...v4.8.0 [4.7.3]: https://github.com/magpiemodel/magpie/compare/v4.7.2...v4.7.3 diff --git a/CITATION.cff b/CITATION.cff index 450dabd249..1b89aa711d 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -156,8 +156,8 @@ abstract: The *Model of Agricultural Production and its Impact on the Environmen exogenously given population in 10 food energy categories, based on regional diets. Future trends in food demand are derived from a cross-country regression analysis, based on future scenarios on GDP and population growth. -version: 4.8.1dev -date-released: 2024-06-19 +version: 4.8.2 +date-released: 2024-09-24 repository-code: https://github.com/magpiemodel/magpie keywords: - landuse diff --git a/README.md b/README.md index 4871b882dc..6e6e8f8bac 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.8.1 can be found at -https://rse.pik-potsdam.de/doc/magpie/4.8.1/ +The model documentation for version 4.8.2 can be found at +https://rse.pik-potsdam.de/doc/magpie/4.8.2/ A most recent version of the documentation can also be extracted from the model source code via the R package goxygen @@ -226,7 +226,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.8.1/#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.8.2/#how-to-cite) in the model documentation for information how to cite the model. ## AUTHORS See list of authors in CITATION.cff