From 6a3b60e18c18149066a5889e587e8963f5eff69c Mon Sep 17 00:00:00 2001 From: bodirsky Date: Thu, 16 Jan 2025 12:36:11 +0100 Subject: [PATCH 01/15] tax recycling included. removed all realization of food demand module, as it is outdated. --- config/default.cfg | 5 + main.gms | 8 +- .../15_food/anthro_iso_jun22/declarations.gms | 8 +- .../15_food/anthro_iso_jun22/equations.gms | 6 +- modules/15_food/anthro_iso_jun22/input.gms | 1 + .../15_food/anthro_iso_jun22/intersolve.gms | 4 + modules/15_food/anthro_iso_jun22/preloop.gms | 1 + .../anthropometrics_jan18/declarations.gms | 265 ------- .../anthropometrics_jan18/equations.gms | 207 ------ .../hierarchical_tree.png | Bin 30513 -> 0 bytes .../15_food/anthropometrics_jan18/input.gms | 225 ------ .../anthropometrics_jan18/intersolve.gms | 460 ------------ .../anthropometrics_jan18/postsolve.gms | 237 ------ .../15_food/anthropometrics_jan18/preloop.gms | 137 ---- .../anthropometrics_jan18/presolve.gms | 697 ------------------ .../anthropometrics_jan18/realization.gms | 44 -- .../15_food/anthropometrics_jan18/scaling.gms | 10 - .../15_food/anthropometrics_jan18/sets.gms | 187 ----- renv/.gitignore | 1 - renv/settings.dcf | 10 - renv/settings.json | 8 +- 21 files changed, 28 insertions(+), 2493 deletions(-) delete mode 100644 modules/15_food/anthropometrics_jan18/declarations.gms delete mode 100644 modules/15_food/anthropometrics_jan18/equations.gms delete mode 100644 modules/15_food/anthropometrics_jan18/hierarchical_tree.png delete mode 100644 modules/15_food/anthropometrics_jan18/input.gms delete mode 100644 modules/15_food/anthropometrics_jan18/intersolve.gms delete mode 100644 modules/15_food/anthropometrics_jan18/postsolve.gms delete mode 100644 modules/15_food/anthropometrics_jan18/preloop.gms delete mode 100644 modules/15_food/anthropometrics_jan18/presolve.gms delete mode 100644 modules/15_food/anthropometrics_jan18/realization.gms delete mode 100644 modules/15_food/anthropometrics_jan18/scaling.gms delete mode 100644 modules/15_food/anthropometrics_jan18/sets.gms delete mode 100644 renv/settings.dcf diff --git a/config/default.cfg b/config/default.cfg index 50d4a57f08..c4bb6b88b1 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -343,6 +343,11 @@ cfg$gms$food <- "anthro_iso_jun22" # def = anthro_iso_jun22 # * options: 0 (exogenous food demand) and 1 (endogenous food demand) cfg$gms$s15_elastic_demand <- 0 # def =0 +# * Per capita redistribution of GHG tax revenues +# * options: 1 (distribution_neutral recycling), 0 (burning of money), +#`* <1 (incomplete recycling, regressive), >1 progressive recycling +cfg$gms$s15_tax_redistribution <- 1 # def = 1 + # * maximal number of iterations between food and magpie model before # * simulation proceeds to next time step cfg$gms$s15_maxiter <- 5 # def = 5 diff --git a/main.gms b/main.gms index 9b70d4a2ed..87efb58c68 100644 --- a/main.gms +++ b/main.gms @@ -160,7 +160,7 @@ $title magpie * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * -* Used data set: additional_data_rev4.59.tgz +* Used data set: additional_data_rev4.60.tgz * md5sum: NA * Repository: https://rse.pik-potsdam.de/data/magpie/public * @@ -179,11 +179,11 @@ $title magpie * * Regionscode: 62eff8f7 * -* Regions data revision: 4.114 +* Regions data revision: 4.116 * * lpj2magpie settings: * * LPJmL data: MRI-ESM2-0:ssp370 -* * Revision: 4.114 +* * Revision: 4.116 * * aggregation settings: * * Input resolution: 0.5 @@ -195,7 +195,7 @@ $title magpie * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * * -* Last modification (input data): Sun Oct 27 00:37:36 2024 +* Last modification (input data): Thu Jan 16 10:54:57 2025 * *###################### R SECTION END (VERSION INFO) ########################### diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index 2c7adc6de7..edad73fa1c 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -79,9 +79,6 @@ 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 (USD17PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) * anthropometrics p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) @@ -178,6 +175,11 @@ parameters * country-specific scenario switch p15_country_switch(iso) Switch indicating whether country is affected by diet scenarios (1) +* elastic demand + p15_tax_recycling(t,iso) Tax revenue recycling to households + p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD17PPP per kcal) + i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) + * calculate diet iteration breakpoint p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD17PPP per capita) p15_delta_income(t,i,iter15) Regional change in per capita income due to price shock on regional level (1) diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index 2ae2d6014b..f9e89f5a12 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -47,9 +47,9 @@ q15_aim .. q15_budget(iso) .. v15_income_pc_real_ppp_iso(iso) =e= - sum(kfo, v15_kcal_regr(iso,kfo)*365 - *(i15_prices_initial_kcal(iso,kfo)-sum((ct,curr_iter15), p15_prices_kcal(ct,iso,kfo,curr_iter15)))) - + sum(ct,im_gdp_pc_ppp_iso(ct,iso)) + v15_income_balance(iso); + sum(kfo, v15_kcal_regr(iso,kfo) * 365 + *(i15_prices_initial_kcal(iso,kfo) - sum((ct,curr_iter15), p15_prices_kcal(ct,iso,kfo,curr_iter15)))) + + sum(ct, im_gdp_pc_ppp_iso(ct,iso) + p15_tax_recycling(ct,iso)) + v15_income_balance(iso); *' The budget constraint calculates the real income after a possible price *' shock. The basic assumption is that increasing prices reduce real income, diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index 23f7215e44..0eda6e06ee 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -64,6 +64,7 @@ $offMulti scalars s15_elastic_demand Elastic demand switch (1=elastic 0=exogenous) (1) / 0 / +s15_tax_recycling Tax recycling multiplier (1=distribution neutral) / 1 / s15_calibrate Calibration switch (1=calibrated 0=pure regression outcomes) (1) / 1 / * only for per-capita calories, not for e.g. calibration of transformation parameters between per-capita calories in dm s15_maxiter Scalar defining maximum number of iterations (1) / 5 / diff --git a/modules/15_food/anthro_iso_jun22/intersolve.gms b/modules/15_food/anthro_iso_jun22/intersolve.gms index 3f6bacb822..509034e362 100644 --- a/modules/15_food/anthro_iso_jun22/intersolve.gms +++ b/modules/15_food/anthro_iso_jun22/intersolve.gms @@ -19,6 +19,10 @@ *' module is executed once again. display "Coupling: Reading out marginal costs from MAgPIE"; p15_prices_kcal(t,iso,kfo,curr_iter15)=sum(i_to_iso(i,iso), q15_food_demand.m(i,kfo)); +*' the quantity of tax money from emission pricing for redistribution is calculated + p15_tax_recycling(t,iso) = sum(i_to_iso(i,iso), (vm_emission_costs.l(i) + / im_pop(t,i)) * s15_tax_recycling + * (im_gdp_pc_ppp_iso(t,iso) / im_gdp_pc_mer_iso(t,iso))); *' @stop ); diff --git a/modules/15_food/anthro_iso_jun22/preloop.gms b/modules/15_food/anthro_iso_jun22/preloop.gms index 8c05f5927c..399b7bbc46 100644 --- a/modules/15_food/anthro_iso_jun22/preloop.gms +++ b/modules/15_food/anthro_iso_jun22/preloop.gms @@ -139,4 +139,5 @@ else i15_prices_initial_kcal(iso,kfo)$(fm_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) / (fm_nutrition_attributes("y1995",kfo,"kcal")*10**6); p15_prices_kcal(t,iso,kfo,"iter1") = i15_prices_initial_kcal(iso,kfo); +p15_tax_recycling(t,iso) = 0; p15_convergence_measure(t,iter15) = NA; diff --git a/modules/15_food/anthropometrics_jan18/declarations.gms b/modules/15_food/anthropometrics_jan18/declarations.gms deleted file mode 100644 index 607dac6395..0000000000 --- a/modules/15_food/anthropometrics_jan18/declarations.gms +++ /dev/null @@ -1,265 +0,0 @@ -*** | (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 - - -equations - q15_food_demand(i,kfo) Food demand (mio. kcal) -; - -positive variables - vm_dem_food(i,kall) Food demand (mio. tDM per yr) -; - - -*** #### Food Demand Model - - - -equations - q15_aim Objective function of food demand model (mio. USD17PPP) - q15_budget(iso) Household budget constraint (USD17PPP per cap per day) - - q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) Estimates regression parameters for BMI regression shares (1) - q15_bmi_shr_verylow(iso,sex,agegroup15) Estimates BMI share for population groups with low BMI (1) - q15_bmi_shr_low(iso,sex,agegroup15) Estimates BMI share for population groups with very low BMI (1) - q15_bmi_shr_medium(iso,sex,agegroup15) Estimates BMI share for population groups with medium BMI(1) - q15_bmi_shr_medium_high(iso,sex,agegroup15) Estimates BMI share for population groups with medium to high BMI (1) - q15_bmi_shr_high(iso,sex,agegroup15) Estimates BMI share for population groups with high BMI (1) - q15_bmi_shr_veryhigh(iso,sex,agegroup15) Estimates BMI share for population groups with very high BMI (1) - q15_bmi_shr_agg(iso,sex,age,bmi_group15) Disaggregates age groups from overarching groups (1) - - q15_intake(iso) Estimates average intake for the entire country (kcal per cap per day) - q15_regr_kcal(iso) Per capita total demand (kcal per cap per day) - q15_regr(iso, regr15) Estimates parameters for food demand and dietary composition (1) - q15_foodtree_kcal_animals(iso,kfo_ap) Demand for animal products (kcal per cap per day) - q15_foodtree_kcal_processed(iso,kfo_pf) Demand for processed products (kcal per cap per day) - q15_foodtree_kcal_staples(iso,kfo_st) Demand for staple products (kcal per cap per day) - q15_foodtree_kcal_vegetables(iso) Demand for vegetable and fruit products (kcal per cap per day) - -; - - -positive variables - v15_kcal_regr(iso,kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - v15_kcal_regr_total(iso) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) - v15_demand_regr(iso, regr15) Uncalibrated regression estimates of kcal shares (1) - v15_income_pc_real_ppp_iso(iso) Real income per cap (USD17PPP per cap) - v15_income_balance(iso) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) - v15_kcal_intake_total_regr(iso) Food intake (kcal per cap per day) - v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) Hierarchical tree parameter regressions (1) - v15_bmi_shr_regr(iso,sex,age,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) - v15_bmi_shr_overgroups(iso,sex,agegroup15,bmi_group15) Uncalibrated share of population groups belonging to a certain BMI group (1) -; - -variables - v15_objective Objective term (USD17PPP) -; - -scalars - s15_yeardiff Number of 5-year time intervalls between time steps (1) - s15_count Loop counter for interpolating body height estimates between longer timesteps (1) -; - -parameters -* technical - p15_modelstat(t) Model solver status (1) - p15_iteration_counter(t) Number of iterations required for reaching an equilibrium between food demand model and magpie (1) - p15_convergence_measure(t,iter15) Convergence measure to decide for continuation or stop of food_demand - magpie iteration (1) - i15_dem_intercept(iso,regr15) Food regression parameters intercept in kcal or as share (X) - i15_dem_saturation(iso,regr15) Food regression parameters saturation in kcal or as share (X) - i15_dem_halfsat(iso,regr15) Food regression parameters halfsaturation (USD05PPP per cap) - i15_dem_nonsat(iso,regr15) Food regression parameters nonsaturation (1) - p15_ruminant_subst_fader(t_all) Ruminant meat substitution fader (1) - p15_fish_subst_fader(t_all) Fish substitution fader (1) - p15_alcohol_subst_fader(t_all) Alcohol substitution fader (1) - p15_livestock_subst_fader(t_all) Livestock substitution fader (1) - p15_rumdairy_subst_fader(t_all) Ruminant and dairy substitution fader (1) - p15_rumdairy_scp_subst_fader(t_all) Ruminant and dairy substitution with SCP fader (1) - 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 (USD17PPP per kcal) - i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) - -* anthropometrics - o15_bmi_shr(t,iso,sex,age,bmi_group15) Calibrated estimates BMI share for population groups (1) - p15_bodyheight(t,iso,sex,age,estimates15) Body height (cm per cap) - p15_bodyweight(t,iso,sex,age,bmi_group15) Body weight (kg per cap) - p15_bodyheight_calib(t,iso,sex,age_new_estimated15) Calibration factor for regional height differences (cm) - p15_kcal_growth_food(t_all,iso,underaged15) Average per capita demand for body size growth relevant food items in the last three 5-year steps (kcal per capita per day) - p15_physical_activity_level(t,iso,sex,age) Physical activity levels in PAL relative to basic metabolic rate BMR (kcal per kcal) - - i15_bmi_intercept(sex,agegroup15,bmi_tree15) BMI share regression intercept (1) - i15_bmi_saturation(sex,agegroup15,bmi_tree15) BMI share regression saturation (1) - i15_bmi_halfsat(sex,agegroup15,bmi_tree15) BMI share regression halfsaturation (1) - - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15) Uncalibrated regression estimates of BMI shares (1) - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) Calibration parameters to meet historical BMI shares (1) - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) Calibration parameters of the last year with historical observations (1) - -* diet structure - o15_kcal_intake_total(t,iso) Total food intake in a country (kcal per capita per day) - p15_intake(t,iso,sex,age,bmi_group15) Mean food intake by population group (kcal per capita per day) - i15_kcal_pregnancy(t,iso) Additional calorie requirements for pregnancy and lactation (kcal) - p15_kcal_regr(t, iso, kfo) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - - i15_milk_share_fadeout_india(t_all) Temporal fader of milk share in india (applied before food demand model) (1) - i15_rum_share_fadeout(t_all,iso) Temporal fader of ruminant meat share (applied before food demand model) (1) - i15_ruminant_fadeout(t,i) Ruminant fadeout share (1) - i15_fish_fadeout(t,i) Fish fadeout share (1) - i15_alcohol_fadeout(t,i) Alcohol fadeout share (1) - i15_livestock_fadeout(t,i) Livestock fadeout share (1) - i15_rumdairy_fadeout(t,i) Ruminant meat and dairy fadeout share (1) - 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_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) - p15_kcal_calib_lastcalibyear(iso,kfo) Calibration factor for the last year with observations (kcal per cap per day) - p15_balanceflow_kcal(t,i,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - p15_balanceflow_kcal_iso(t,iso,kfo) Balance flow for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - p15_balanceflow_kcal_lastcalibyear(iso,kfo) Balance flow of last historic time step for mismatch between FAOSTAT and demand estimates (kcal per capita per day) - -* before shock - o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day) - pm_kcal_pc_initial(t,i,kall) Per capita consumption in food demand model before price shock (kcal per capita per day) - p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day) - -* after price shock - 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 (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) - p15_kcal_pc_calibrated_plant_orig(t,i) Auxiliary parameter for per capita plant-based food consumption - basis for scenarios of livestock food substitution (kcal per capita per day) - p15_livestock_kcal_structure_orig(t,i,kfo_lp) Auxiliary parameter for livestock kcal structure - basis for scenarios of livestock food substitution (1) - p15_rumdairy_kcal_structure_orig(t,i,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,i,kfo_pp) Auxiliary parameter for plant-based food kcal structure - basis for scenarios of livestock food substitution (1) - p15_kcal_pc_livestock_supply_target(i) Target of per capita livestock consumption (kcal per capita per day) - - p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) Calibrated estimates of BMI share for population groups (1) - p15_intake_total_iso_calibrated(t,iso) Total food intake in a country (kcal per capita per day) - p15_intake_total_calibrated(t,i) Total regional food intake (kcal per capita per day) - -*food waste - p15_demand2intake_ratio(t,i) Ratio between food calorie demand and intake (1) - p15_demand2intake_ratio_scen(t,i) Ratio between food calorie demand and intake according to exogenous food waste scenario (1) - -* transition to exogenous scenario diets - i15_intake_scen_target(t,i) Target for total per capita calorie intake according to an exogenous diet scenario (kcal per capita per day) - i15_intake_EATLancet_all(i,kcal_scen15,EAT_scen15,kfo) Food-specific per capita calorie intake according to various EAT Lancet diet scenarios (kcal per capita per day) - i15_intake_EATLancet(i,kfo) Food-specific per capita calorie intake according to EAT Lancet diet scenario (kcal per capita per day) - p15_intake_detailed_scen_target(t,i,kfo) Target for food-specific per capita calorie intake according to an exogenous diet scenario (kcal per capita per day) - p15_intake_detailed_regr(t,i,kfo) Food-specific per capita calorie intake according to regression-based projections (kcal per capita per day) - - p15_demand2intake_ratio_ref(i) Ratio between food calorie demand and intake for the historical time step of EAT Lancet diets (1) - p15_foodwaste_growth(t,i) Increase in food waste over time relative to the historical time step of EAT Lancet diets (1) - i15_kcal_pc_scen_target(t,i,kfo) Target for per capita food consumption according to an exogenous diet scenario (kcal per capita per day) - i15_exo_foodscen_fader(t,i) Fader that converges per capita food consumption to an exogenous diet scenario (1) - -* country-specific scenario switch - p15_country_switch(iso) Switch indicating whether country is affected by diet scenarios (1) - p15_foodscen_region_shr(t_all,i) Weighted share of region with regards to diet scenario of countries (1) - -* calculate diet iteration breakpoint - p15_income_pc_real_ppp(t,i) Regional per capita income after price shock on regional level (USD17PPP per capita) - p15_delta_income(t,i,iter15) Regional change in per capita income due to price shock on regional level (1) -; - -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_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 / -; - -*' @code -*' The food demand model consists of the following equations, which are not -*' part of MAgPIE. - -model m15_food_demand / - q15_aim, - q15_budget, - - q15_regr_bmi_shr, - - q15_bmi_shr_verylow, - q15_bmi_shr_low, - q15_bmi_shr_medium, - q15_bmi_shr_medium_high, - q15_bmi_shr_high, - q15_bmi_shr_veryhigh, - - q15_bmi_shr_agg, - - q15_intake, - q15_regr_kcal, - q15_regr, - - q15_foodtree_kcal_animals, - q15_foodtree_kcal_processed, - q15_foodtree_kcal_staples, - q15_foodtree_kcal_vegetables - /; - - - -*' In contrast, the equation `q15_food_demand` is part of MAgPIE, but -*' not of the food demand model. -*' @stop - -m15_food_demand.optfile = 0 ; -m15_food_demand.scaleopt = 1 ; -m15_food_demand.solprint = 0 ; -m15_food_demand.holdfixed = 1 ; - - - -*#################### R SECTION START (OUTPUT DECLARATIONS) #################### -parameters - ov_dem_food(t,i,kall,type) Food demand (mio. tDM per yr) - ov15_kcal_regr(t,iso,kfo,type) Uncalibrated regression estimates of calorie demand (kcal per cap per day) - ov15_kcal_regr_total(t,iso,type) Uncalibrated regression estimates of total per cap calories (kcal per cap per day) - ov15_demand_regr(t,iso,regr15,type) Uncalibrated regression estimates of kcal shares (1) - ov15_income_pc_real_ppp_iso(t,iso,type) Real income per cap (USD17PPP per cap) - ov15_income_balance(t,iso,type) Balance variable to balance cases in which reduction in income is larger than the per capita GDP (USD17PPP per cap per yr) - ov15_kcal_intake_total_regr(t,iso,type) Food intake (kcal per cap per day) - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,type) Hierarchical tree parameter regressions (1) - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,type) Uncalibrated share of population groups belonging to a certain BMI group (1) - ov15_objective(t,type) Objective term (USD17PPP) - oq15_food_demand(t,i,kfo,type) Food demand (mio. kcal) - oq15_aim(t,type) Objective function of food demand model (mio. USD17PPP) - oq15_budget(t,iso,type) Household budget constraint (USD17PPP per cap per day) - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,type) Estimates regression parameters for BMI regression shares (1) - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with low BMI (1) - oq15_bmi_shr_low(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very low BMI (1) - oq15_bmi_shr_medium(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium BMI(1) - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with medium to high BMI (1) - oq15_bmi_shr_high(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with high BMI (1) - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,type) Estimates BMI share for population groups with very high BMI (1) - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,type) Disaggregates age groups from overarching groups (1) - oq15_intake(t,iso,type) Estimates average intake for the entire country (kcal per cap per day) - oq15_regr_kcal(t,iso,type) Per capita total demand (kcal per cap per day) - oq15_regr(t,iso,regr15,type) Estimates parameters for food demand and dietary composition (1) - oq15_foodtree_kcal_animals(t,iso,kfo_ap,type) Demand for animal products (kcal per cap per day) - oq15_foodtree_kcal_processed(t,iso,kfo_pf,type) Demand for processed products (kcal per cap per day) - oq15_foodtree_kcal_staples(t,iso,kfo_st,type) Demand for staple products (kcal per cap per day) - oq15_foodtree_kcal_vegetables(t,iso,type) Demand for vegetable and fruit products (kcal per cap per day) -; -*##################### R SECTION END (OUTPUT DECLARATIONS) ##################### diff --git a/modules/15_food/anthropometrics_jan18/equations.gms b/modules/15_food/anthropometrics_jan18/equations.gms deleted file mode 100644 index 0506f61ff2..0000000000 --- a/modules/15_food/anthropometrics_jan18/equations.gms +++ /dev/null @@ -1,207 +0,0 @@ -*** | (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 - -*' @equations - -q15_food_demand(i2,kfo) .. - (vm_dem_food(i2,kfo) + sum(ct, f15_household_balanceflow(ct,i2,kfo,"dm"))) - * sum(ct,(fm_nutrition_attributes(ct,kfo,"kcal") * 10**6)) =g= - sum(ct,im_pop(ct,i2) * p15_kcal_pc_calibrated(ct,i2,kfo)) * 365 - ; - -*' Above constraint transforms the fooduse of agricultural products into per capita -*' food demand. -*' `vm_dem_food` is the fooduse of agricultural products. It is measured in tons -*' of dry matter prior to processing. The multiplication with the nutrition attributes -*' provides the equivalent in calories. While nutrition attributes are assumed -*' to be globally the same -*' (assumption of homogeneous products), a regional balance flow is used to account -*' for current differences in food processing, where some regions get different calories -*' from the same fooduse quantitiy. Depending on the input data, the balance flow -*' may fade out in the future, which implies actual homogeneous products. - -*' The subsequent equations belong to the standalone food demand model, which is -*' executed before MAgPIE or iterated with MAgPIE. They are excluded from the run -*' of MAgPIE itself. - -q15_aim .. - v15_objective =e= - sum(iso, - - 10**6*v15_income_balance(iso)) - ; - -*' In principle, the food demand model has only one solution that satifies all -*' equations. Technically, the objective could therefore be chosen arbirtrarily, -*' for the solver to find the single solution. -*' However, if the model is executed outside its domain -*' (e.g. with extreme price shocks), it can happen that real income takes a -*' negative value (because the increase in food value exceeds the available income). -*' To avoid this case, a punishment term `v15_income_balance` is introduced. It -*' increases the real income, but affects the maximized objective variable -*' negatively, disincentivizing its use in cases where it is not needed. - - -q15_budget(iso) .. - v15_income_pc_real_ppp_iso(iso) =e= - sum(kfo, v15_kcal_regr(iso,kfo)*365 - *(i15_prices_initial_kcal(iso,kfo)-sum((ct,curr_iter15), p15_prices_kcal(ct,iso,kfo,curr_iter15)))) - + sum(ct,im_gdp_pc_ppp_iso(ct,iso)) + v15_income_balance(iso); - -*' The budget constraint calculates the real income after a possible price -*' shock. The basic assumption is that increasing prices reduce real income, -*' while decreasing prices increase real income. -*' Through this income effect, higher prices reduce the food demand. -*' The income before the food price shock is `im_gdp_pc_ppp_iso`. -*' It is reduced by the change in value of the demanded calories under changed -*' prices. -*' In the following, the real income is used to determine food intake, -*' food demand as well as dietary composition. - -*' The BMI distribution within the population is calculated using -*' regressions in a hierachical tree to estimate the share of the population -*' falling into a certain BMI class. -*' ![Hierarchical tree used to estimate BMI population shares](hierarchical_tree.png){ width=100% } - -*' First, the regression shares are calculated: - -q15_regr_bmi_shr(iso,sex,agegroup15,bmi_tree15) .. - v15_regr_overgroups(iso,sex,agegroup15,bmi_tree15) - =e= - i15_bmi_intercept(sex,agegroup15,bmi_tree15) - + (i15_bmi_saturation(sex,agegroup15,bmi_tree15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso) )) - / (i15_bmi_halfsat(sex,agegroup15,bmi_tree15) + (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso) )); - -*' Then, these regression shares are applied to parameterize the -*' hierarchical tree structure: - -q15_bmi_shr_verylow(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"verylow") - =e= - v15_regr_overgroups(iso,sex,agegroup15,"low") - * v15_regr_overgroups(iso,sex,agegroup15,"lowsplit") - ; - -q15_bmi_shr_low(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"low") - =e= - v15_regr_overgroups(iso,sex,agegroup15,"low") - * (1- v15_regr_overgroups(iso,sex,agegroup15,"lowsplit")) - ; - -q15_bmi_shr_medium(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"medium") - =e= - (1-v15_regr_overgroups(iso,sex,agegroup15,"low") - -v15_regr_overgroups(iso,sex,agegroup15,"high")) - * (1-v15_regr_overgroups(iso,sex,agegroup15,"mediumsplit")) - ; - -q15_bmi_shr_medium_high(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"mediumhigh") - =e= - (1-v15_regr_overgroups(iso,sex,agegroup15,"low") - -v15_regr_overgroups(iso,sex,agegroup15,"high")) - * v15_regr_overgroups(iso,sex,agegroup15,"mediumsplit") - ; - -q15_bmi_shr_high(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"high") - =e= - v15_regr_overgroups(iso,sex,agegroup15,"high") - * (1-v15_regr_overgroups(iso,sex,agegroup15,"highsplit")) - ; - -q15_bmi_shr_veryhigh(iso,sex,agegroup15) .. - v15_bmi_shr_overgroups(iso,sex,agegroup15,"veryhigh") - =e= - v15_regr_overgroups(iso,sex,agegroup15,"high") - * v15_regr_overgroups(iso,sex,agegroup15,"highsplit") - ; - - -*' From BMI shares of the larger groups (overgroups), we disaggregate to -*' age-specific subgroups. - -q15_bmi_shr_agg(iso,sex,age,bmi_group15) .. - v15_bmi_shr_regr(iso,sex,age,bmi_group15) - =e= - sum(agegroup2age(agegroup15,age), - v15_bmi_shr_overgroups(iso,sex,agegroup15,bmi_group15) - ); - - -*' Food intake is estimated based on BMI distribution, typical intakes for -*' BMI groups, demographic structure and extra energy requirements for -*' pregnancy and lactation (estimated based on the new-born population size). - -q15_intake(iso).. - v15_kcal_intake_total_regr(iso) - * sum((sex,age,ct), im_demography(ct,iso,sex,age)) - =e= - sum((ct, sex, age, bmi_group15), - v15_bmi_shr_regr(iso,sex,age,bmi_group15)* - im_demography(ct,iso,sex,age) * - p15_intake(ct,iso,sex,age,bmi_group15) - ) - + sum(ct,i15_kcal_pregnancy(ct,iso)) - ; - - -*' Food demand is based on food intake and a regression -*' based on income, which estimates how much the actual demand is relative to -*' the required intake. -*' The difference between demand and intake is food waste (not explicitly -*' mentioned in this equation) - -q15_regr_kcal(iso) .. - v15_kcal_regr_total(iso) =e= - v15_demand_regr(iso, "overconsumption") - *v15_kcal_intake_total_regr(iso); - -*' This equation estimates key dietary composition regressision factors, -*' such as the share of animal products, empty calories, or -*' fruits, vegetables and nuts. - -q15_regr(iso, regr15) .. - v15_demand_regr(iso, regr15) =e= - i15_dem_intercept(iso,regr15) - + (i15_dem_saturation(iso,regr15) * (v15_income_pc_real_ppp_iso(iso) * fm_gdp_defl_ppp(iso))) - / (i15_dem_halfsat(iso,regr15) + (v15_income_pc_real_ppp_iso(iso) * fm_gp_defl_ppp(iso))**i15_dem_nonsat(iso,regr15)); - -*' In the subsequent equations, those parameters -*' are used to determine the dietary composition using a hierachical tree: -*' Total calories are first divided into animal- and plant-based. The plant-based -*' calories are further divided into processed empty calories and nutritious -*' calories, and so on. - -q15_foodtree_kcal_animals(iso,kfo_ap) .. - v15_kcal_regr(iso,kfo_ap) =e= - v15_kcal_regr_total(iso) - * v15_demand_regr(iso, "livestockshare") - * sum(ct,i15_livestock_kcal_structure_iso(ct,iso,kfo_ap)); - -q15_foodtree_kcal_processed(iso,kfo_pf) .. - v15_kcal_regr(iso,kfo_pf) =e= - v15_kcal_regr_total(iso) - * (1 - v15_demand_regr(iso, "livestockshare")) - * v15_demand_regr(iso, "processedshare") - * sum(ct,i15_processed_kcal_structure_iso(ct,iso,kfo_pf)) ; - -q15_foodtree_kcal_vegetables(iso) .. - v15_kcal_regr(iso,"others") =e= - v15_kcal_regr_total(iso) - * (1 - v15_demand_regr(iso, "livestockshare")) - * (1 - v15_demand_regr(iso, "processedshare")) - * v15_demand_regr(iso, "vegfruitshare"); - -q15_foodtree_kcal_staples(iso,kfo_st) .. - v15_kcal_regr(iso,kfo_st) =e= - v15_kcal_regr_total(iso) - * (1 - v15_demand_regr(iso, "livestockshare")) - * (1 - v15_demand_regr(iso, "processedshare")) - * (1 - v15_demand_regr(iso, "vegfruitshare")) - * sum(ct,i15_staples_kcal_structure_iso(ct,iso,kfo_st)) ; diff --git a/modules/15_food/anthropometrics_jan18/hierarchical_tree.png b/modules/15_food/anthropometrics_jan18/hierarchical_tree.png deleted file mode 100644 index 465f5ab430f0a5e2f0a94090637c42e08f5cd42f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 30513 zcmdRWcTf{w*ly?|O;PDpB3S6X7m*TaKT&#Bnsf-EcMGWWM4B`e1f@zRKuFXdO{6y| zDN3&aLI@B-ZoWJ7-I?!?JNNtN&fJ^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 2, - display "Modelstat > 2 | Retry solve with CONOPT3"; - option nlp = conopt3; - solve m15_food_demand USING nlp MAXIMIZING v15_objective; - option nlp = conopt4; -); - -p15_modelstat(t) = m15_food_demand.modelstat; - -display "Food Demand Model finished with modelstat "; -display p15_modelstat; - -if(p15_modelstat(t) > 2 AND p15_modelstat(t) ne 7, - m15_food_demand.solprint = 1 - Execute_Unload "fulldata.gdx"; - abort "Food Demand Model became infeasible. Should not be possible."; -); - - -* estimate regional indicators from demand model - - - p15_income_pc_real_ppp(t,i)$( - sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ) >0 ) = - sum(i_to_iso(i,iso), - v15_income_pc_real_ppp_iso.l(iso) - * im_pop_iso(t,iso) - ) / sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ); - - - - p15_delta_income(t,i,curr_iter15) = p15_income_pc_real_ppp(t,i) / - ( sum(i_to_iso(i,iso), - im_gdp_pc_ppp_iso(t,iso) - * im_pop_iso(t,iso) - ) / sum(i_to_iso(i,iso), - im_pop_iso(t,iso)) - ); - - -* estimate convergence measure for deciding to stop iteration - - - p15_convergence_measure(t,curr_iter15) =smax(i, - abs(p15_delta_income(t,i,curr_iter15) / sum(prev_iter15,p15_delta_income(t,i,prev_iter15))- 1) - ); - - - -*' @code -*' If `s15_elastic_demand` is 0, MAgPIE is not executed again for this time step. -*' In case that `s15_elastic_demand` is 1, it is checked whether MAgPIE and the -*' food demand model have reached sufficient convergence. The criterion for this -*' is whether the real income in the food demand model has changed in any region -*' by more than `s15_convergences_measure` relative to the last iteration due to -*' changes in food prices from MAgPIE. Moreover, the model aborts when the -*' number of iterations reaches `s15_maxiter`. -*' As long as the iteration continues, the food prices are transferred from -*' MAgPIE to the food demand model, and the food demand is transferred from -*' the food demand model to MAgPIE. -*' @stop - - -display "convergence measure:",p15_convergence_measure; - -if (s15_elastic_demand = 1 AND m_year(t) > sm_fix_SSP2, - display "elastic demand model is activated"; - if ((sum(curr_iter15,p15_convergence_measure(t,curr_iter15)) > s15_convergence and p15_iteration_counter(t) <= s15_maxiter), - - display "convergence between MAgPIE and Food Demand Model not yet reached"; - display "starting magpie in iteration number ", p15_iteration_counter; - sm_intersolve=0; - -* saving regression outcome for postprocessing - p15_kcal_regr(t, iso, kfo)=v15_kcal_regr.l(iso, kfo); - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)=v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); - -* The calibration factor is added to the regression value. - p15_kcal_pc_iso(t,iso,kfo) = v15_kcal_regr.l(iso,kfo) + p15_kcal_calib(t,iso,kfo) * s15_calibrate; - -* Negative values that can possibly occur due to calibration are set to zero. - p15_kcal_pc_iso(t,iso,kfo)$(p15_kcal_pc_iso(t,iso,kfo)<0) = 0; - -* aggregate to regions - p15_kcal_pc(t,i,kfo)$( - sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ) >0 ) = - sum(i_to_iso(i,iso), - p15_kcal_pc_iso(t,iso,kfo) - * im_pop_iso(t,iso) - ) / sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ); - -* We calibrate countries with zero food demand according to FAOSTAT -* down to zero to match FAO world totals. -* Values are rounded to avoid path dependencies of MAgPIE solver. - p15_kcal_pc_calibrated(t,i,kfo)=p15_kcal_pc(t,i,kfo)+p15_balanceflow_kcal(t,i,kfo); - p15_kcal_pc_calibrated(t,i,kfo)=round(p15_kcal_pc_calibrated(t,i,kfo),2); - p15_kcal_pc_calibrated(t,i,kfo)$(p15_kcal_pc_calibrated(t,i,kfo)<0)=0; - - -*############################################################################### -* INSERTION within if-statement (case that "elastic demand model is activated" -* and "convergence between MAgPIE and Food Demand Model not yet reached": - -* This insertion is needed in case that elastic demand mode is combined with -* additional exogenous scenrio assumptions regarding food waste or diets - - - -*############################################################################### -* ###### Food substitution scenarios - - -* Substitution of ruminant beef with poultry: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"livst_rum") = - p15_kcal_pc_calibrated_orig(t,i,"livst_rum") * i15_ruminant_fadeout(t,i); -p15_kcal_pc_calibrated(t,i,"livst_chick") = p15_kcal_pc_calibrated_orig(t,i,"livst_chick") - + p15_kcal_pc_calibrated_orig(t,i,"livst_rum") * (1-i15_ruminant_fadeout(t,i)); - - -* Substitution of fish with poultry: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"fish") = - p15_kcal_pc_calibrated_orig(t,i,"fish") * i15_fish_fadeout(t,i); -p15_kcal_pc_calibrated(t,i,"livst_chick") = p15_kcal_pc_calibrated_orig(t,i,"livst_chick") - + p15_kcal_pc_calibrated_orig(t,i,"fish") * (1-i15_fish_fadeout(t,i)); - - -* Fade-out of alcohol consumption without substitution: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"alcohol") = - p15_kcal_pc_calibrated_orig(t,i,"alcohol") * i15_alcohol_fadeout(t,i); - - -* Substitution of livestock products (without fish) with plant-based food commodities: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_livestock_orig(t,i) = sum(kfo_lp,p15_kcal_pc_calibrated(t,i,kfo_lp)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_livestock_kcal_structure_orig(t,i,kfo_lp)$(p15_kcal_pc_calibrated_livestock_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_lp) - /p15_kcal_pc_calibrated_livestock_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_calibrated(t,i,kfo_lp) = p15_livestock_kcal_structure_orig(t,i,kfo_lp) - *p15_kcal_pc_calibrated_livestock_orig(t,i)*i15_livestock_fadeout(t,i); -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_livestock_orig(t,i) * (1-i15_livestock_fadeout(t,i))); - - -* Substitution of ruminant meat and dairy products with plant-based food commodities: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_rumdairy_orig(t,i) = sum(kfo_rd,p15_kcal_pc_calibrated(t,i,kfo_rd)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_rumdairy_kcal_structure_orig(t,i,kfo_rd)$(p15_kcal_pc_calibrated_rumdairy_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_rd) - /p15_kcal_pc_calibrated_rumdairy_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_rumdairy_kcal_structure_orig(t,i,kfo_rd) - *p15_kcal_pc_calibrated_rumdairy_orig(t,i)*i15_rumdairy_fadeout(t,i); -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))); - -*' @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_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 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_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_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_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)) / - fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * - s15_scp_fat_protein_ratio_meat - s15_scp_fat_content) * fm_nutrition_attributes(t,"oils", "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. -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_livestock_orig(t,i) = sum(kfo_lp,p15_kcal_pc_calibrated(t,i,kfo_lp)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_livestock_kcal_structure_orig(t,i,kfo_lp)$(p15_kcal_pc_calibrated_livestock_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_lp) - /p15_kcal_pc_calibrated_livestock_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_livestock_supply_target(i) = s15_kcal_pc_livestock_supply_target * f15_overcons_FAOwaste(i,"livst_rum"); - -loop(i$(p15_kcal_pc_calibrated_livestock_orig(t,i) > p15_kcal_pc_livestock_supply_target(i)), -p15_kcal_pc_calibrated(t,i,kfo_lp) = p15_livestock_kcal_structure_orig(t,i,kfo_lp) - * (p15_kcal_pc_livestock_supply_target(i)*(1-i15_livestock_fadeout_threshold(t,i)) - + p15_kcal_pc_calibrated_livestock_orig(t,i)*i15_livestock_fadeout_threshold(t,i)); -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_livestock_orig(t,i) - - sum(kfo_lp, p15_kcal_pc_calibrated(t,i,kfo_lp))) * s15_livescen_target_subst); -); - - -*############################################################################### -* ###### WASTE CALCULATIONS (required for exogenous food waste or diet scenarios) - -* The ratio of food demand at household level to food intake is determined -* by the amount of food that is wasted. This ratio is one of the drivers of -* future food demand trajetories. -* For the calculation of the ratio between food demand and intake, total food -* calorie intake based on CALIBRATED parameters needs to be calculated: - -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) = - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)+ - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -* The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)$(p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)<0) = 0; -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)$(p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)>1) = 1; -* The mismatch is balanced by moving the exceeding quantities into the middle BMI group. -p15_bmi_shr_calibrated(t,iso,sex,age,"medium")= - 1 - (sum(bmi_group15, p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)) - - p15_bmi_shr_calibrated(t,iso,sex,age,"medium")); - -p15_intake_total_iso_calibrated(t,iso) = - sum((sex, age, bmi_group15), p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)* - im_demography(t,iso,sex,age)*p15_intake(t,iso,sex,age,bmi_group15) ) - + i15_kcal_pregnancy(t,iso); - -p15_intake_total_calibrated(t,i)$(sum(i_to_iso(i,iso),sum((sex,age), im_demography(t,iso,sex,age)) ) >0 ) - = sum(i_to_iso(i,iso),p15_intake_total_iso_calibrated(t,iso) - ) / sum(i_to_iso(i,iso), - sum((sex,age), im_demography(t,iso,sex,age)) - ); - -p15_demand2intake_ratio(t,i)$(p15_intake_total_calibrated(t,i) >0 ) = - sum(kfo,p15_kcal_pc_calibrated(t,i,kfo)) / - p15_intake_total_calibrated(t,i); - -* In case, no exogenous waste scenario is selceted, the original regression- -* based estimates for food calorie oversupply are used as waste scenario. -* This information is needed in case that an exogenous diet scenario should be -* constructed from food calorie intake. -p15_demand2intake_ratio_scen(t,i) =p15_demand2intake_ratio(t,i); - - -* ###### Exogenous food waste scenario - -if(s15_exo_waste = 1, - -* "Downwards convergence" of regional calorie oversupply due to food waste to the -* waste reduction target, i.e. only for values that are higher than the target: - - p15_demand2intake_ratio_scen(t,i)$(p15_demand2intake_ratio(t,i) > s15_waste_scen ) - = p15_demand2intake_ratio(t,i)*(1-i15_exo_foodscen_fader(t,i)) - + s15_waste_scen*i15_exo_foodscen_fader(t,i); - - p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); - p15_kcal_pc_calibrated(t,i,kfo)$(p15_demand2intake_ratio(t,i) >0 ) = p15_kcal_pc_calibrated_orig(t,i,kfo)*( - p15_demand2intake_ratio_scen(t,i)/p15_demand2intake_ratio(t,i) ); - -); - - -* Now, a second waste parameter can be calculated, which is needed for the construction -* of exogenous diet scenarios on the basis of calorie intake. This parameter describes -* the development of food waste over time and reflects either the exogenous food waste -* scenario or the original regression-based estimates for food calorie oversupply: - -p15_foodwaste_growth(t,i) = ( 1$(p15_demand2intake_ratio_ref(i) = 0) - + (p15_demand2intake_ratio_scen(t,i)/p15_demand2intake_ratio_ref(i))$( - p15_demand2intake_ratio_ref(i) > 0) - ); - - - - -* ###### Exogenous EAT Lancet diet scenario - -*' @code -*' Transition to exogenous EAT Lancet diet scenarios: -*' A part of the definition of exogenous diet scenarios is already accomplished -*' in the presolve.gms, where the parameters `i15_intake_scen_target(t,i)` and -*' `i15_intake_EATLancet(i,kfo)` are calculated. - -if(s15_exo_diet = 1, - -* Food-specific calorie intake of the model-internal diet projections is -* estimated from daily per capita food calorie demand: - p15_intake_detailed_regr(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo) - /(f15_calib_fsupply(i)*f15_overcons_FAOwaste(i,kfo)*p15_foodwaste_growth(t,i)); - - -* Via 's15_alc_scen' a maximum target for alcohol consumption is defined. - if(s15_alc_scen>0, - p15_intake_detailed_scen_target(t,i,"alcohol") = p15_intake_detailed_regr(t,i,"alcohol"); - p15_intake_detailed_scen_target(t,i,"alcohol")$(p15_intake_detailed_scen_target(t,i,"alcohol") > s15_alc_scen*i15_intake_scen_target(t,i)) - = s15_alc_scen*i15_intake_scen_target(t,i); - ); - - p15_intake_detailed_scen_target(t,i,EAT_staples) = ( - i15_intake_scen_target(t,i) - sum(EAT_nonstaples,i15_intake_EATLancet(i,EAT_nonstaples)) )*( - i15_intake_EATLancet(i,EAT_staples)/sum(EAT_staples2,i15_intake_EATLancet(i,EAT_staples2)) ); - - -*' Now, the calorie supply at household level is calculated by multiplying -*' daily per capita calorie intake with a ratio of supply to intake -*' (`f15_overcons_FAOwaste(i,kfo)`) based on FAO estimates on historical food waste -*' at consumption level and food conversion factors, and with a calibration -*' factor `f15_calib_fsupply(i)`. Another multiplicative factor accounts for -*' increases in food waste over time. - -* In case, no exogenous waste scenario is selceted, the original regression- -* based estimates for food calorie oversupply are here used as waste scenario: - - - i15_kcal_pc_scen_target(t,i,kfo) = (f15_calib_fsupply(i)*f15_overcons_FAOwaste(i,kfo) - *p15_intake_detailed_scen_target(t,i,kfo)) - *p15_foodwaste_growth(t,i); - -*' In the last step, the regression-based calculation of daily per capita food demand -*' is faded into the exogenous diet scenario according to a predefined spped of -*' convergence: - - p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); - p15_kcal_pc_calibrated(t,i,kfo) = p15_kcal_pc_calibrated_orig(t,i,kfo) * (1-i15_exo_foodscen_fader(t,i)) - + i15_kcal_pc_scen_target(t,i,kfo) * i15_exo_foodscen_fader(t,i); - - -); -*' @stop - -*############################################################################### - - - - - if (p15_modelstat(t) <= 2, - put_utility 'shell' / 'mv -f m15_food_demand_p.gdx m15_food_demand_' t.tl:0'.gdx'; - ); - - elseif(p15_iteration_counter(t) > s15_maxiter), - sm_intersolve=1; - display "Warning: convergence between MAgPIE and Food Demand Model not reached after ",p15_iteration_counter," iterations. Continue to next time step!"; - else - sm_intersolve=1; - display "Success: convergence between MAgPIE and Food Demand Model reached."; - display "requiring ",p15_iteration_counter," runs of food demand model, "; - display "and one run less with MAgPIE."; -* set back convergence indicators for next timestep - ); - -else -display "exogenous demand information is used" ; -); diff --git a/modules/15_food/anthropometrics_jan18/postsolve.gms b/modules/15_food/anthropometrics_jan18/postsolve.gms deleted file mode 100644 index d174c6625d..0000000000 --- a/modules/15_food/anthropometrics_jan18/postsolve.gms +++ /dev/null @@ -1,237 +0,0 @@ -*** | (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 - -* For calculation of waste trajectories for exogenous diets: -if ((sameas(t,"y2010")), - p15_demand2intake_ratio_ref(i) = p15_demand2intake_ratio(t,i); -); - -*' The calibration parameter is added to the regression value. - - o15_bmi_shr(t,iso,sex,age,bmi_group15) = - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)+ - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -*' The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. - o15_bmi_shr(t,iso,sex,age,bmi_group15)$(o15_bmi_shr(t,iso,sex,age,bmi_group15)<=0) = 0.000001; - o15_bmi_shr(t,iso,sex,age,bmi_group15)$(o15_bmi_shr(t,iso,sex,age,bmi_group15)>1) = 1; -*' In case that the bmi groups, due to calibration, exceed 1, we rescale to 1. - o15_bmi_shr(t,iso,sex,age,bmi_group15)$(sum(bmi_group15_2, o15_bmi_shr(t,iso,sex,age,bmi_group15_2))>1) = - o15_bmi_shr(t,iso,sex,age,bmi_group15)/sum(bmi_group15_2, o15_bmi_shr(t,iso,sex,age,bmi_group15_2)); -*' The mismatch below one is balanced by moving the exceeding quantities into the middle BMI group. - o15_bmi_shr(t,iso,sex,age,"medium")= - 1 - (sum(bmi_group15, o15_bmi_shr(t,iso,sex,age,bmi_group15)) - o15_bmi_shr(t,iso,sex,age,"medium")); - - -*' We recalculate the intake with the new values. - o15_kcal_intake_total(t,iso) = - ( - sum((sex, age, bmi_group15), - o15_bmi_shr(t,iso,sex,age,bmi_group15)* - im_demography(t,iso,sex,age) * - p15_intake(t,iso,sex,age,bmi_group15) - ) + i15_kcal_pregnancy(t,iso) - )/sum((sex,age), im_demography(t,iso,sex,age)); - - - -if(ord(t)>1, -* start from bodyheight structure of last period - p15_bodyheight(t,iso,sex,age,"final") = p15_bodyheight(t-1,iso,sex,age,"final"); - p15_kcal_growth_food(t,iso,underaged15) = p15_kcal_growth_food(t-1,iso,underaged15); -); - -s15_yeardiff = m_yeardiff(t)/5; -if(s15_yeardiff<1,s15_yeardiff=1); - -For (s15_count = 1 to s15_yeardiff, - -* circular move of age by 5 years -* to find out about ++1 search for help on Circular Lag and Lead Operators in Assignments - p15_bodyheight(t,iso,sex,age++1,"final") = p15_bodyheight(t,iso,sex,age,"final"); - -* move on consumption agegroups by 5 years - p15_kcal_growth_food(t,iso,underaged15++1)= - p15_kcal_growth_food(t,iso,underaged15); - -* consumption is calculated as linear interpolation between timesteps - p15_kcal_growth_food(t,iso,"0--4") = - sum(growth_food15, - p15_kcal_pc_iso(t,iso,growth_food15) * (s15_count / (m_yeardiff(t)/5)) - + p15_kcal_pc_iso(t-1,iso,growth_food15) * (1 - s15_count / (m_yeardiff(t)/5)) - ); - -*' @code -*' After each execution of the food demand model, the body height distribution -*' of the population is estimated. The starting point is the body height -*' distribution of the last timestep. The body height estimates of the old -*' period are moved into the subsequent age class (e.g. the 20-24 year old are -*' now 25-29 years old). The age class of 15-19 year old is estimated newly -*' using the body height regressions and the food consumption of the last 15 -*' years. - - p15_bodyheight(t,iso,sex,"15--19","final") = - f15_bodyheight_regr_paras(sex,"slope")* - (sum(underaged15, - p15_kcal_growth_food(t,iso,underaged15) - )/3)**f15_bodyheight_regr_paras(sex,"exponent") - ; - -*' @stop -); - -*' @code -*' The bodyheight of the underaged age class (0-14) is assumed to diverge from 'normal' -*' body height by the same proportion as the age class of the 15-19 year old. - -p15_bodyheight(t,iso,"M","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*92; -p15_bodyheight(t,iso,"M","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*125; -p15_bodyheight(t,iso,"M","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/176*152; - -p15_bodyheight(t,iso,"F","0--4","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*91; -p15_bodyheight(t,iso,"F","5--9","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*124; -p15_bodyheight(t,iso,"F","10--14","final")=p15_bodyheight(t,iso,"M","15--19","final")/163*154; - -*' @stop - -*' @code -*' Finally, the regression outcome is calibrated by a country-specific additive -*' term, which is the residual of the regression fit and observation of the last -*' historical time step. - -if (sum(sameas(t_past,t),1) = 1, -* For historical period, the regression results are only used to estimate the calibration parameter. - p15_bodyheight_calib(t,iso,sex,age_new_estimated15) = f15_bodyheight(t,iso,sex,age_new_estimated15) - p15_bodyheight(t,iso,sex,age_new_estimated15,"final"); - p15_bodyheight(t,iso,sex,age_new_estimated15,"final") = f15_bodyheight(t,iso,sex,age_new_estimated15); -else - p15_bodyheight_calib(t,iso,sex,age_new_estimated15)=p15_bodyheight_calib(t-1,iso,sex,age_new_estimated15); - p15_bodyheight(t,iso,sex,age_new_estimated15,"final")=p15_bodyheight(t,iso,sex,age_new_estimated15,"final")+p15_bodyheight_calib(t,iso,sex,age_new_estimated15)*s15_calibrate; -); - -*' @stop - - - - -*#################### R SECTION START (OUTPUT DEFINITIONS) ##################### - ov_dem_food(t,i,kall,"marginal") = vm_dem_food.m(i,kall); - ov15_kcal_regr(t,iso,kfo,"marginal") = v15_kcal_regr.m(iso,kfo); - ov15_kcal_regr_total(t,iso,"marginal") = v15_kcal_regr_total.m(iso); - ov15_demand_regr(t,iso,regr15,"marginal") = v15_demand_regr.m(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"marginal") = v15_income_pc_real_ppp_iso.m(iso); - ov15_income_balance(t,iso,"marginal") = v15_income_balance.m(iso); - ov15_kcal_intake_total_regr(t,iso,"marginal") = v15_kcal_intake_total_regr.m(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"marginal") = v15_regr_overgroups.m(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"marginal") = v15_bmi_shr_regr.m(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"marginal") = v15_bmi_shr_overgroups.m(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"marginal") = v15_objective.m; - oq15_food_demand(t,i,kfo,"marginal") = q15_food_demand.m(i,kfo); - oq15_aim(t,"marginal") = q15_aim.m; - oq15_budget(t,iso,"marginal") = q15_budget.m(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"marginal") = q15_regr_bmi_shr.m(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_verylow.m(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_low.m(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium.m(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_medium_high.m(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_high.m(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"marginal") = q15_bmi_shr_veryhigh.m(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"marginal") = q15_bmi_shr_agg.m(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"marginal") = q15_intake.m(iso); - oq15_regr_kcal(t,iso,"marginal") = q15_regr_kcal.m(iso); - oq15_regr(t,iso,regr15,"marginal") = q15_regr.m(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"marginal") = q15_foodtree_kcal_animals.m(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"marginal") = q15_foodtree_kcal_processed.m(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"marginal") = q15_foodtree_kcal_staples.m(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"marginal") = q15_foodtree_kcal_vegetables.m(iso); - ov_dem_food(t,i,kall,"level") = vm_dem_food.l(i,kall); - ov15_kcal_regr(t,iso,kfo,"level") = v15_kcal_regr.l(iso,kfo); - ov15_kcal_regr_total(t,iso,"level") = v15_kcal_regr_total.l(iso); - ov15_demand_regr(t,iso,regr15,"level") = v15_demand_regr.l(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"level") = v15_income_pc_real_ppp_iso.l(iso); - ov15_income_balance(t,iso,"level") = v15_income_balance.l(iso); - ov15_kcal_intake_total_regr(t,iso,"level") = v15_kcal_intake_total_regr.l(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"level") = v15_regr_overgroups.l(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"level") = v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"level") = v15_bmi_shr_overgroups.l(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"level") = v15_objective.l; - oq15_food_demand(t,i,kfo,"level") = q15_food_demand.l(i,kfo); - oq15_aim(t,"level") = q15_aim.l; - oq15_budget(t,iso,"level") = q15_budget.l(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"level") = q15_regr_bmi_shr.l(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"level") = q15_bmi_shr_verylow.l(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"level") = q15_bmi_shr_low.l(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium.l(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_medium_high.l(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"level") = q15_bmi_shr_high.l(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"level") = q15_bmi_shr_veryhigh.l(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"level") = q15_bmi_shr_agg.l(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"level") = q15_intake.l(iso); - oq15_regr_kcal(t,iso,"level") = q15_regr_kcal.l(iso); - oq15_regr(t,iso,regr15,"level") = q15_regr.l(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"level") = q15_foodtree_kcal_animals.l(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"level") = q15_foodtree_kcal_processed.l(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"level") = q15_foodtree_kcal_staples.l(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"level") = q15_foodtree_kcal_vegetables.l(iso); - ov_dem_food(t,i,kall,"upper") = vm_dem_food.up(i,kall); - ov15_kcal_regr(t,iso,kfo,"upper") = v15_kcal_regr.up(iso,kfo); - ov15_kcal_regr_total(t,iso,"upper") = v15_kcal_regr_total.up(iso); - ov15_demand_regr(t,iso,regr15,"upper") = v15_demand_regr.up(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"upper") = v15_income_pc_real_ppp_iso.up(iso); - ov15_income_balance(t,iso,"upper") = v15_income_balance.up(iso); - ov15_kcal_intake_total_regr(t,iso,"upper") = v15_kcal_intake_total_regr.up(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"upper") = v15_regr_overgroups.up(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"upper") = v15_bmi_shr_regr.up(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"upper") = v15_bmi_shr_overgroups.up(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"upper") = v15_objective.up; - oq15_food_demand(t,i,kfo,"upper") = q15_food_demand.up(i,kfo); - oq15_aim(t,"upper") = q15_aim.up; - oq15_budget(t,iso,"upper") = q15_budget.up(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"upper") = q15_regr_bmi_shr.up(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_verylow.up(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_low.up(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium.up(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_medium_high.up(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_high.up(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"upper") = q15_bmi_shr_veryhigh.up(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"upper") = q15_bmi_shr_agg.up(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"upper") = q15_intake.up(iso); - oq15_regr_kcal(t,iso,"upper") = q15_regr_kcal.up(iso); - oq15_regr(t,iso,regr15,"upper") = q15_regr.up(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"upper") = q15_foodtree_kcal_animals.up(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"upper") = q15_foodtree_kcal_processed.up(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"upper") = q15_foodtree_kcal_staples.up(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"upper") = q15_foodtree_kcal_vegetables.up(iso); - ov_dem_food(t,i,kall,"lower") = vm_dem_food.lo(i,kall); - ov15_kcal_regr(t,iso,kfo,"lower") = v15_kcal_regr.lo(iso,kfo); - ov15_kcal_regr_total(t,iso,"lower") = v15_kcal_regr_total.lo(iso); - ov15_demand_regr(t,iso,regr15,"lower") = v15_demand_regr.lo(iso,regr15); - ov15_income_pc_real_ppp_iso(t,iso,"lower") = v15_income_pc_real_ppp_iso.lo(iso); - ov15_income_balance(t,iso,"lower") = v15_income_balance.lo(iso); - ov15_kcal_intake_total_regr(t,iso,"lower") = v15_kcal_intake_total_regr.lo(iso); - ov15_regr_overgroups(t,iso,sex,agegroup15,bmi_tree15,"lower") = v15_regr_overgroups.lo(iso,sex,agegroup15,bmi_tree15); - ov15_bmi_shr_regr(t,iso,sex,age,bmi_group15,"lower") = v15_bmi_shr_regr.lo(iso,sex,age,bmi_group15); - ov15_bmi_shr_overgroups(t,iso,sex,agegroup15,bmi_group15,"lower") = v15_bmi_shr_overgroups.lo(iso,sex,agegroup15,bmi_group15); - ov15_objective(t,"lower") = v15_objective.lo; - oq15_food_demand(t,i,kfo,"lower") = q15_food_demand.lo(i,kfo); - oq15_aim(t,"lower") = q15_aim.lo; - oq15_budget(t,iso,"lower") = q15_budget.lo(iso); - oq15_regr_bmi_shr(t,iso,sex,agegroup15,bmi_tree15,"lower") = q15_regr_bmi_shr.lo(iso,sex,agegroup15,bmi_tree15); - oq15_bmi_shr_verylow(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_verylow.lo(iso,sex,agegroup15); - oq15_bmi_shr_low(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_low.lo(iso,sex,agegroup15); - oq15_bmi_shr_medium(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium.lo(iso,sex,agegroup15); - oq15_bmi_shr_medium_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_medium_high.lo(iso,sex,agegroup15); - oq15_bmi_shr_high(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_high.lo(iso,sex,agegroup15); - oq15_bmi_shr_veryhigh(t,iso,sex,agegroup15,"lower") = q15_bmi_shr_veryhigh.lo(iso,sex,agegroup15); - oq15_bmi_shr_agg(t,iso,sex,age,bmi_group15,"lower") = q15_bmi_shr_agg.lo(iso,sex,age,bmi_group15); - oq15_intake(t,iso,"lower") = q15_intake.lo(iso); - oq15_regr_kcal(t,iso,"lower") = q15_regr_kcal.lo(iso); - oq15_regr(t,iso,regr15,"lower") = q15_regr.lo(iso,regr15); - oq15_foodtree_kcal_animals(t,iso,kfo_ap,"lower") = q15_foodtree_kcal_animals.lo(iso,kfo_ap); - oq15_foodtree_kcal_processed(t,iso,kfo_pf,"lower") = q15_foodtree_kcal_processed.lo(iso,kfo_pf); - oq15_foodtree_kcal_staples(t,iso,kfo_st,"lower") = q15_foodtree_kcal_staples.lo(iso,kfo_st); - oq15_foodtree_kcal_vegetables(t,iso,"lower") = q15_foodtree_kcal_vegetables.lo(iso); -*##################### R SECTION END (OUTPUT DEFINITIONS) ###################### diff --git a/modules/15_food/anthropometrics_jan18/preloop.gms b/modules/15_food/anthropometrics_jan18/preloop.gms deleted file mode 100644 index ad58642464..0000000000 --- a/modules/15_food/anthropometrics_jan18/preloop.gms +++ /dev/null @@ -1,137 +0,0 @@ -*** | (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 - - i15_bmi_intercept(sex,agegroup15,bmi_tree15) = f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"intercept"); - i15_bmi_saturation(sex,agegroup15,bmi_tree15) = f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"saturation"); - i15_bmi_halfsat(sex,agegroup15,bmi_tree15) = f15_bmi_shr_paras(sex,agegroup15,bmi_tree15,"halfsaturation"); - -p15_bodyheight(t,iso,sex,age,estimates15) = f15_bodyheight(t,iso,sex,age); - -* calculating growth food for historical period - -loop(t_past, - if (ord(t_past)>3, - p15_kcal_growth_food(t_past,iso,"10--14") = sum(growth_food15, f15_kcal_pc_iso(t_past-3,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"5--9") = sum(growth_food15, f15_kcal_pc_iso(t_past-2,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"0--4") = sum(growth_food15, f15_kcal_pc_iso(t_past-1,iso,growth_food15)); - Elseif ord(t_past)=3, - p15_kcal_growth_food(t_past,iso,"10--14") = sum(growth_food15, f15_kcal_pc_iso(t_past-2,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"5--9") = sum(growth_food15, f15_kcal_pc_iso(t_past-2,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"0--4") = sum(growth_food15, f15_kcal_pc_iso(t_past-1,iso,growth_food15)); - Elseif ord(t_past)=2, - p15_kcal_growth_food(t_past,iso,"10--14") = sum(growth_food15, f15_kcal_pc_iso(t_past-1,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"5--9") = sum(growth_food15, f15_kcal_pc_iso(t_past-1,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"0--4") = sum(growth_food15, f15_kcal_pc_iso(t_past-1,iso,growth_food15)); - Elseif ord(t_past)=1, - p15_kcal_growth_food(t_past,iso,"10--14") = sum(growth_food15, f15_kcal_pc_iso(t_past-0,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"5--9") = sum(growth_food15, f15_kcal_pc_iso(t_past-0,iso,growth_food15)); - p15_kcal_growth_food(t_past,iso,"0--4") = sum(growth_food15, f15_kcal_pc_iso(t_past-0,iso,growth_food15)); - ); -); - - -* Temporal development of ruminant meat share within the livestock food product -* group (applied before food demand model is executed) -$ifthen "%c15_rum_share%" == "mixed" i15_rum_share_fadeout(t,iso) = (f15_rum_share_fadeout(t,"constant") + f15_rum_share_fadeout(t,"halving2050"))/2; -$else i15_rum_share_fadeout(t,iso) = f15_rum_share_fadeout(t,"%c15_rum_share%"); -$endif - -* Stronger ruminant fadeout for India -if (s15_rum_share_fadeout_india_strong = 1, - i15_rum_share_fadeout(t,"IND") = f15_rum_share_fadeout_india(t); -); - -* Milk fadeout for India -if (s15_milk_share_fadeout_india = 0, - i15_milk_share_fadeout_india(t) = 1; -Elseif s15_milk_share_fadeout_india = 1, - i15_milk_share_fadeout_india(t) = f15_milk_share_fadeout_india(t); -); - - - -* ###### Exogenous food waste and diet scenarios as well as food substitution scenarios - - -* Initialisation of the ratio between food calorie demand and food intake for the -* historical reference period: -p15_demand2intake_ratio_ref(i) = 0; - -* Switch to determine countries for which exogenous food scenarios (EAT Lancet diet and -* food waste scenarios), and food substitution scenarios shall be applied. -* In the default case, the food scenario affects all countries when activated. -p15_country_switch(iso) = 0; -p15_country_switch(scen_countries15) = 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. -p15_foodscen_region_shr(t_all,i) = sum(i_to_iso(i,iso), p15_country_switch(iso) * im_pop_iso(t_all,iso)) / sum(i_to_iso(i,iso), im_pop_iso(t_all,iso)); - - -** The following lines define scenario faders for substituting different food groups -* If s15_exo_foodscen_functional_form = 1, the exogenous food scenario is faded in linearly. -* If s15_exo_foodscen_functional_form = 2, the exogenous food scenario is faded in applying a sigmoid trajectory. -if (s15_food_subst_functional_form = 1, - - m_linear_time_interpol(p15_ruminant_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_ruminant_substitution); - m_linear_time_interpol(p15_fish_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_fish_substitution); - m_linear_time_interpol(p15_alcohol_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_alcohol_substitution); - m_linear_time_interpol(p15_livestock_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_livestock_substitution); - m_linear_time_interpol(p15_rumdairy_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_rumdairy_substitution); - m_linear_time_interpol(p15_rumdairy_scp_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0, s15_rumdairy_scp_substitution); - if(s15_livescen_target = 1, - m_linear_time_interpol(p15_livestock_threshold_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,1); - else - p15_livestock_threshold_subst_fader(t) = 0; - ); - -elseif s15_food_subst_functional_form = 2, - - m_sigmoid_time_interpol(p15_ruminant_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_ruminant_substitution); - m_sigmoid_time_interpol(p15_fish_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_fish_substitution); - m_sigmoid_time_interpol(p15_alcohol_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_alcohol_substitution); - m_sigmoid_time_interpol(p15_livestock_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_livestock_substitution); - m_sigmoid_time_interpol(p15_rumdairy_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,s15_rumdairy_substitution); - m_sigmoid_time_interpol(p15_rumdairy_scp_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0, s15_rumdairy_scp_substitution); - if(s15_livescen_target = 1, - m_sigmoid_time_interpol(p15_livestock_threshold_subst_fader,s15_food_substitution_start,s15_food_substitution_target,0,1); - else - p15_livestock_threshold_subst_fader(t) = 0; - ); - -); - -* Food substitution scenarios based on scenario faders -i15_ruminant_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_ruminant_subst_fader(t); -i15_fish_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_fish_subst_fader(t); -i15_alcohol_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_alcohol_subst_fader(t); -i15_livestock_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_livestock_subst_fader(t); -i15_rumdairy_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_rumdairy_subst_fader(t); -i15_rumdairy_scp_fadeout(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_rumdairy_scp_subst_fader(t); -i15_livestock_fadeout_threshold(t,i) = 1 - p15_foodscen_region_shr(t,i)*p15_livestock_threshold_subst_fader(t); - -** The following lines define the scenario fader for the exogeneous food scenario -* If s15_exo_foodscen_functional_form = 1, the exogenous food scenario is faded in linearly. -* If s15_exo_foodscen_functional_form = 2, the exogenous food scenario is faded in applying a sigmoid trajectory. -if (s15_exo_foodscen_functional_form = 1, - m_linear_time_interpol(p15_exo_food_scenario_fader,s15_exo_foodscen_start,s15_exo_foodscen_target,0,s15_exo_foodscen_convergence); - -elseif s15_exo_foodscen_functional_form = 2, - m_sigmoid_time_interpol(p15_exo_food_scenario_fader,s15_exo_foodscen_start,s15_exo_foodscen_target,0,s15_exo_foodscen_convergence); - -); - -* Multiply regional share of countries (see above) with the scenario fader -i15_exo_foodscen_fader(t,i) = p15_exo_food_scenario_fader(t) * p15_foodscen_region_shr(t,i); - - -* initial prices in $US per Kcal -i15_prices_initial_kcal(iso,kfo)$(fm_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) - / (fm_nutrition_attributes("y1995",kfo,"kcal")*10**6); -p15_prices_kcal(t,iso,kfo,"iter1")=i15_prices_initial_kcal(iso,kfo); -p15_convergence_measure(t,iter15)=NA; diff --git a/modules/15_food/anthropometrics_jan18/presolve.gms b/modules/15_food/anthropometrics_jan18/presolve.gms deleted file mode 100644 index 1bf780458e..0000000000 --- a/modules/15_food/anthropometrics_jan18/presolve.gms +++ /dev/null @@ -1,697 +0,0 @@ -*** | (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 - - - -if(m_year(t) <= sm_fix_SSP2, - i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"SSP2","intercept"); - i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"SSP2","saturation"); - i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","halfsaturation"); - i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"SSP2","non_saturation"); -else - i15_dem_intercept(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","intercept")*p15_country_switch(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","intercept")*(1-p15_country_switch(iso)); - i15_dem_saturation(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","saturation")*p15_country_switch(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","saturation")*(1-p15_country_switch(iso)); - i15_dem_halfsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","halfsaturation")*p15_country_switch(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","halfsaturation")*(1-p15_country_switch(iso)); - i15_dem_nonsat(iso,regr15) = f15_demand_paras(regr15,"%c15_food_scenario%","non_saturation")*p15_country_switch(iso) - + f15_demand_paras(regr15,"%c15_food_scenario_noselect%","non_saturation")*(1-p15_country_switch(iso)); -); - -option nlp = conopt4; -option threads = 1; - -*' @code -*' Within the major food groups determined by the regressions -*' (animal calories, empty calories, fruits, vegetable and nut calories as well as staple calories), -*' the relative share of individual products (e.g. eggs within animal calories) -*' is assumed to be constant. An exception is the demand for ruminant meat, -*' which declines in the course of the century at the cost of chicken meat. -*' @stop - -if (sum(sameas(t_past,t),1) = 1, - -*** Calculate the share of individual food products within major food groups, and replace zero shares with regional averages -* First set it to equal shares, just in case there is no population - - - i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) = - sum(iso2, f15_kcal_pc_iso(t,iso2,kfo_ap)*im_pop_iso(t,iso2))/ - ( - sum((kfo_ap2,iso2),(f15_kcal_pc_iso(t,iso2,kfo_ap2)*im_pop_iso(t,iso2))) - +10**(-5) - ); - - i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap)$sum(kfo_ap2,f15_kcal_pc_iso(t,iso,kfo_ap2)>0)= - f15_kcal_pc_iso(t,iso,kfo_ap) / - sum(kfo_ap2,f15_kcal_pc_iso(t,iso,kfo_ap2) -* 10**(-5) required to avoid unlogical division by zero error. - ); - - i15_livestock_kcal_structure_iso(t,iso,kfo_ap) = i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap); - - i15_processed_kcal_structure_iso(t,iso,kfo_pf) = - sum(iso2, f15_kcal_pc_iso(t,iso2,kfo_pf)*im_pop_iso(t,iso2)) / - ( - sum((kfo_pf2,iso2),f15_kcal_pc_iso(t,iso2,kfo_pf2)*im_pop_iso(t,iso2)) - +10**(-5) -* 10**(-5) required to avoid unlogical division by zero error. Ask Jan P - ); - - i15_processed_kcal_structure_iso(t,iso,kfo_pf)$(sum(kfo_pf2,f15_kcal_pc_iso(t,iso,kfo_pf2))>0) = - f15_kcal_pc_iso(t,iso,kfo_pf) - /sum(kfo_pf2,f15_kcal_pc_iso(t,iso,kfo_pf2) - ); - - i15_staples_kcal_structure_iso(t,iso,kfo_st) = - sum(iso2, f15_kcal_pc_iso(t,iso2,kfo_st)*im_pop_iso(t,iso2)) / - ( - sum((kfo_st2,iso2),f15_kcal_pc_iso(t,iso2,kfo_st2)*im_pop_iso(t,iso2)) - +10**(-5) -* 10**(-5) required to avoid unlogical division by zero error. Ask Jan P - ); - - i15_staples_kcal_structure_iso(t,iso,kfo_st)$(sum(kfo_st2,f15_kcal_pc_iso(t,iso,kfo_st2))>0) = - f15_kcal_pc_iso(t,iso,kfo_st) - /sum(kfo_st2,f15_kcal_pc_iso(t,iso,kfo_st2) - ); - - - else -* Assumptions on future calorie structure within food groups for future projections: - i15_staples_kcal_structure_iso(t,iso,kfo_st) =i15_staples_kcal_structure_iso(t-1,iso,kfo_st); - i15_processed_kcal_structure_iso(t,iso,kfo_pf) =i15_processed_kcal_structure_iso(t-1,iso,kfo_pf); - i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap) = i15_livestock_kcal_structure_iso_raw(t-1,iso,kfo_ap); - i15_livestock_kcal_structure_iso(t,iso,kfo_ap) = i15_livestock_kcal_structure_iso_raw(t,iso,kfo_ap); - i15_livestock_kcal_structure_iso(t,iso,"livst_chick") = - i15_livestock_kcal_structure_iso_raw(t,iso,"livst_chick") - + i15_livestock_kcal_structure_iso_raw(t,iso,"livst_rum") * (1-i15_rum_share_fadeout(t,iso)); - i15_livestock_kcal_structure_iso(t,iso,"livst_rum") = - i15_livestock_kcal_structure_iso_raw(t,iso,"livst_rum") * i15_rum_share_fadeout(t,iso); - -* Substitute milk demand in India with chicken, egg and fish (equally distributed) because milk demand in India shows an implausible increase - i15_livestock_kcal_structure_iso(t,"IND","livst_milk") = - i15_livestock_kcal_structure_iso_raw(t,"IND","livst_milk") * i15_milk_share_fadeout_india(t); - i15_livestock_kcal_structure_iso(t,"IND","livst_chick") = - i15_livestock_kcal_structure_iso(t,"IND","livst_chick") - + i15_livestock_kcal_structure_iso_raw(t,"IND","livst_milk") * (1-i15_milk_share_fadeout_india(t)) * 1/3; - i15_livestock_kcal_structure_iso(t,"IND","livst_egg") = - i15_livestock_kcal_structure_iso(t,"IND","livst_egg") - + i15_livestock_kcal_structure_iso_raw(t,"IND","livst_milk") * (1-i15_milk_share_fadeout_india(t)) * 1/3; - i15_livestock_kcal_structure_iso(t,"IND","fish") = - i15_livestock_kcal_structure_iso(t,"IND","fish") - + i15_livestock_kcal_structure_iso_raw(t,"IND","livst_milk") * (1-i15_milk_share_fadeout_india(t)) * 1/3; - ); - - -*' @code -*' The calculations are executed in the following order: -*' -*' In the beginning of each time step, the body height is estimated based on the diets -*' of the previous 15 years. In case that the time step length exceeds 5 years, -*' the consumption is extrapolated using the last two time steps. -*' Body height is estimated using the consumption of proteins and fats, in our case -*' the foodgroups animal products, pulses and oils. -*' To estimate the body size of underaged (0-14 years), we scale the WHO body height -*' recommendations for underaged with the divergence of the 15-19 year old. -*' The body height estimates are repeated again at the end of the time step to improve -*' the results of the extrapolation for cases where the time step length exceeds 5 years. -*' @stop - -* ###### ANTHROPOMETRIC ESTIMATES -* ### Preliminary calculation of body height and weight based on food availability of last 3 timesteps. -* ### This may diverge from final calculation in the case where timestep length exceeds 5 years -* ### as then the demand depends on the result of MAgPIE. -* ### Calculations are therefore repeated after optimization. - -* Calculations are only made after historical period. Before, we use historical values. - -if (sum(sameas(t_past,t),1) = 1, - - p15_bodyheight(t,iso,sex,age,estimates15) = f15_bodyheight(t,iso,sex,age); - - -else - - p15_bodyheight(t,iso,sex,age,"preliminary") = p15_bodyheight(t-1,iso,sex,age,"final"); - p15_kcal_growth_food(t,iso,underaged15) = p15_kcal_growth_food(t-1,iso,underaged15); - - - - - s15_yeardiff = m_yeardiff(t)/5; -* avoid fake 1yr timestep in 1995 - if(s15_yeardiff<1,s15_yeardiff=1); - - For (s15_count = 1 to s15_yeardiff, - - -* circular move of age by 5 years -* to find out about ++1 search for help on Circular Lag and Lead Operators in Assignments - p15_bodyheight(t,iso,sex,age++1,"preliminary") = p15_bodyheight(t,iso,sex,age,"preliminary"); - -* replace age groups of 18 year old - p15_bodyheight(t,iso,sex,"15--19","preliminary") = - f15_bodyheight_regr_paras(sex,"slope")* - (sum(underaged15, - p15_kcal_growth_food(t,iso,underaged15) - )/3)**f15_bodyheight_regr_paras(sex,"exponent") - ; - - ); -*adjust body height of kids proportional to over18 population - p15_bodyheight(t,iso,"M","0--4","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*92; - p15_bodyheight(t,iso,"M","5--9","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*125; - p15_bodyheight(t,iso,"M","10--14","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/176*152; - - p15_bodyheight(t,iso,"F","0--4","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/163*91; - p15_bodyheight(t,iso,"F","5--9","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/163*124; - p15_bodyheight(t,iso,"F","10--14","preliminary")=p15_bodyheight(t,iso,"M","15--19","preliminary")/163*154; - -); - - -*' @code - - - -*### Estimate standardized food requirements -p15_bodyweight(t,iso,sex,age,bmi_group15)= f15_bmi(sex,age,bmi_group15) * (p15_bodyheight(t,iso,sex,age,"preliminary")/100)**2; - -*' Physical activity levels (PAL) relative to the basic metabolic rate (BMR) are -*' estimated based on physical inactivity levels, assuming PALs for sedentary -*' and medium-active populations of 1.53 and 1.76 respectively: -p15_physical_activity_level(t,iso,sex,age)= - im_physical_inactivity(t,iso,sex,age) * 1.53 - +(1-im_physical_inactivity(t,iso,sex,age)) * 1.76 - ; - -p15_intake(t,iso,sex,age,bmi_group15)= - (f15_schofield(sex,age, "intercept") - + f15_schofield(sex,age, "slope")*p15_bodyweight(t,iso,sex,age,bmi_group15)) - * p15_physical_activity_level(t,iso,sex,age); - - -*' Pregnancy and lactation require additional food intake. To account for this, -*' newborns are distributed among reproductive women in a population. This number -*' is then multiplied with the extra energy requirements: -i15_kcal_pregnancy(t,iso)=sum(sex,im_demography(t,iso,sex,"0--4")/5) * ((40/66)*845 + (26/66)*675); - -*' @stop - - - -*###### Estimation of food demand using a first run of the food demand model with unshocked prices. - -*' @code -*' Before MAgPIE is executed, the food demand model is executed, at first -*' without price shocks. -*' @stop - -* demand for non-food products "knf" is set to 0; -vm_dem_food.fx(i,knf)=0; - -*** Food demand model is calculated the first time for the current time step, using standard prices - -* activating the first iteration -p15_iteration_counter(t) = 1; - -* The set curr_iter15 includes only one element with the set element -* of the current iteration, e.g. "iter2" -curr_iter15(iter15) = no; -curr_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)) = yes; - -p15_delta_income(t,i,curr_iter15) = 1; - -display "starting demand model for initialisation run...."; - - -* helping the solver by starting from reasonable values -* by setting real income per capita on exogenous gdp per capita -v15_income_pc_real_ppp_iso.lo(iso)=10; -v15_income_pc_real_ppp_iso.fx(iso)=im_gdp_pc_ppp_iso(t,iso); - -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 = conopt3; - solve m15_food_demand USING nlp MAXIMIZING v15_objective; - option nlp = conopt4; -); - -p15_modelstat(t) = m15_food_demand.modelstat; - -display "Food Demand Model Initialisation run finished with modelstat "; -display p15_modelstat; - -if(p15_modelstat(t) > 2 AND p15_modelstat(t) ne 7, - m15_food_demand.solprint = 1 - Execute_Unload "fulldata.gdx"; - abort "Food Demand Model became infeasible already during initialisation run. Stop run."; -); - -* releasing real income per capita binding for later runs that include shocks -v15_income_pc_real_ppp_iso.lo(iso)=10; -v15_income_pc_real_ppp_iso.up(iso)=Inf; - -* saving regression outcome for per capita food demand for different foods -p15_kcal_regr(t, iso, kfo) = v15_kcal_regr.l(iso, kfo); - -* saving regression outcome for BMI shares -p15_bmi_shr_regr(t,iso,sex,age,bmi_group15 )= v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); - -* deriving calibration values - -*' @code -*' Per capita food demand and BMI shares are calibrated so that historical data -*' are met. For this purpose, the residual between the regression fit and the -*' observation is calculated for the historical period. When the historical period -*' ends, the calibration factor is fixed at the value of the last historical time -*' step. Additionally, a second calibration is required to meet the world totals -*' of FAOSTAT food demand for different foods. While the food demand model estimates -*' the demand for all countries of the world, FAOSTAT only covers a subset of -*' countries. To match FAOSTAT totals, the food demand of countries not included -*' in FAOSTAT is calibrated to zero. As this calibration is done ex-post, food -*' demand estimates can still be used for all countries, but MAgPIE only considers -*' demand from FAOSTAT countries. - -if (sum(sameas(t_past,t),1) = 1, - p15_kcal_calib(t,iso,kfo)$(sum(kfo2,f15_kcal_pc_iso(t,iso,kfo2))=0) = 0; - p15_balanceflow_kcal_iso(t,iso,kfo)$(sum(kfo2,f15_kcal_pc_iso(t,iso,kfo2))>0) = 0; - p15_kcal_calib(t,iso,kfo)$(sum(kfo2,f15_kcal_pc_iso(t,iso,kfo2))>0) = f15_kcal_pc_iso(t,iso,kfo) - v15_kcal_regr.l(iso, kfo); - p15_balanceflow_kcal_iso(t,iso,kfo)$(sum(kfo2,f15_kcal_pc_iso(t,iso,kfo2))=0) = f15_kcal_pc_iso(t,iso,kfo) - v15_kcal_regr.l(iso, kfo); - - p15_kcal_calib_lastcalibyear(iso,kfo) = p15_kcal_calib(t,iso,kfo); - p15_balanceflow_kcal_lastcalibyear(iso,kfo) = p15_balanceflow_kcal_iso(t,iso,kfo); - - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) = - f15_bmi_shr_past(t,iso,age,sex,bmi_group15) - - v15_bmi_shr_regr.l(iso,sex,age,bmi_group15); - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15)= - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -else -*' Depending on the scenario switch c15_calibscen, the divergence of the demand from the -*' historical data is kept constant or faded out. - p15_kcal_calib(t,iso,kfo) = p15_kcal_calib_lastcalibyear(iso,kfo) * f15_kcal_calib_fadeout(t,"%c15_calibscen%"); -*' The divergence of the kcal of countries with no FAOSTAT data is kept constant -*' over time. - p15_balanceflow_kcal_iso(t,iso,kfo) = p15_balanceflow_kcal_lastcalibyear(iso,kfo); - -*' Depending on the scenario switch c15_calibscen, the divergence of the BMI shares from the -*' historical data is kept constant over time or faded out. - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15) = - i15_bmi_shr_calib_lastcalibyear(iso,sex,age,bmi_group15) - * f15_kcal_calib_fadeout(t,"%c15_calibscen%"); -); - -*' The calibration factor is added to the regression value. - p15_kcal_pc_iso(t,iso,kfo) = - v15_kcal_regr.l(iso,kfo) + p15_kcal_calib(t,iso,kfo) * s15_calibrate; -*' Negative values that can possibly occur due to calibration are set to zero. - p15_kcal_pc_iso(t,iso,kfo)$(p15_kcal_pc_iso(t,iso,kfo)<0) = 0; - -*' The country-level parameter p15_kcal_pc_iso is aggregated to the -*' regional level. After removing estimates from countries that are not included -*' in FAOSTAT, the resulting parameter p15_kcal_pc_calibrated is provided to -*' constraint q15_food_demand in the MAgPIE model, which defines the demand for food. -*' @stop - -* aggregate to regions - p15_kcal_pc(t,i,kfo)$( - sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ) >0 ) = - sum(i_to_iso(i,iso), - p15_kcal_pc_iso(t,iso,kfo) - * im_pop_iso(t,iso) - ) / sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ); - - p15_balanceflow_kcal(t,i,kfo)$( - sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ) >0 ) = - sum(i_to_iso(i,iso), - p15_balanceflow_kcal_iso(t,iso,kfo) - * im_pop_iso(t,iso) - ) / sum(i_to_iso(i,iso), - im_pop_iso(t,iso) - ); - - - p15_kcal_pc_initial_iso(t,iso,kfo) = p15_kcal_pc_iso(t,iso,kfo); - pm_kcal_pc_initial(t,i,kfo) = p15_kcal_pc(t,i,kfo); - - o15_kcal_regr_initial(t,iso,kfo)=v15_kcal_regr.l(iso,kfo); - -* Finally, we calibrate countries with zero food demand according to FAOSTAT -* down to zero to match FAO world totals. -* Values are rounded to avoid path dependencies of MAgPIE solver. - p15_kcal_pc_calibrated(t,i,kfo)=p15_kcal_pc(t,i,kfo)+p15_balanceflow_kcal(t,i,kfo); - p15_kcal_pc_calibrated(t,i,kfo)=round(p15_kcal_pc_calibrated(t,i,kfo),2); - p15_kcal_pc_calibrated(t,i,kfo)$(p15_kcal_pc_calibrated(t,i,kfo)<0)=0; - - - - -*############################################################################### -* ###### Food substitution scenarios - - -* Substitution of ruminant beef with poultry: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"livst_rum") = - p15_kcal_pc_calibrated_orig(t,i,"livst_rum") * i15_ruminant_fadeout(t,i); -p15_kcal_pc_calibrated(t,i,"livst_chick") = p15_kcal_pc_calibrated_orig(t,i,"livst_chick") - + p15_kcal_pc_calibrated_orig(t,i,"livst_rum") * (1-i15_ruminant_fadeout(t,i)); - - -* Substitution of fish with poultry: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"fish") = - p15_kcal_pc_calibrated_orig(t,i,"fish") * i15_fish_fadeout(t,i); -p15_kcal_pc_calibrated(t,i,"livst_chick") = p15_kcal_pc_calibrated_orig(t,i,"livst_chick") - + p15_kcal_pc_calibrated_orig(t,i,"fish") * (1-i15_fish_fadeout(t,i)); - - -* Fade-out of alcohol consumption without substitution: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,"alcohol") = - p15_kcal_pc_calibrated_orig(t,i,"alcohol") * i15_alcohol_fadeout(t,i); - - -* Substitution of livestock products (without fish) with plant-based food commodities: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_livestock_orig(t,i) = sum(kfo_lp,p15_kcal_pc_calibrated(t,i,kfo_lp)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_livestock_kcal_structure_orig(t,i,kfo_lp)$(p15_kcal_pc_calibrated_livestock_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_lp) - /p15_kcal_pc_calibrated_livestock_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_calibrated(t,i,kfo_lp) = p15_livestock_kcal_structure_orig(t,i,kfo_lp) - *p15_kcal_pc_calibrated_livestock_orig(t,i)*i15_livestock_fadeout(t,i); -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_livestock_orig(t,i) * (1-i15_livestock_fadeout(t,i))); - - -* Substitution of ruminant meat and dairy products with plant-based food commodities: -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_rumdairy_orig(t,i) = sum(kfo_rd,p15_kcal_pc_calibrated(t,i,kfo_rd)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_rumdairy_kcal_structure_orig(t,i,kfo_rd)$(p15_kcal_pc_calibrated_rumdairy_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_rd) - /p15_kcal_pc_calibrated_rumdairy_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_calibrated(t,i,kfo_rd) = p15_rumdairy_kcal_structure_orig(t,i,kfo_rd) - *p15_kcal_pc_calibrated_rumdairy_orig(t,i)*i15_rumdairy_fadeout(t,i); -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))); - -*' @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_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 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_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_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_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)) / - fm_nutrition_attributes(t,"scp", "protein") * (fm_nutrition_attributes(t,"scp", "protein") * - s15_scp_fat_protein_ratio_meat - s15_scp_fat_content) * fm_nutrition_attributes(t,"oils", "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. -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated_livestock_orig(t,i) = sum(kfo_lp,p15_kcal_pc_calibrated(t,i,kfo_lp)); -p15_kcal_pc_calibrated_plant_orig(t,i) = sum(kfo_pp,p15_kcal_pc_calibrated(t,i,kfo_pp)); - -p15_livestock_kcal_structure_orig(t,i,kfo_lp)$(p15_kcal_pc_calibrated_livestock_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_lp) - /p15_kcal_pc_calibrated_livestock_orig(t,i); - -p15_plant_kcal_structure_orig(t,i,kfo_pp)$(p15_kcal_pc_calibrated_plant_orig(t,i)>0) = - p15_kcal_pc_calibrated(t,i,kfo_pp) - /p15_kcal_pc_calibrated_plant_orig(t,i); - -p15_kcal_pc_livestock_supply_target(i) = s15_kcal_pc_livestock_supply_target * f15_overcons_FAOwaste(i,"livst_rum"); - -loop(i$(p15_kcal_pc_calibrated_livestock_orig(t,i) > p15_kcal_pc_livestock_supply_target(i)), -p15_kcal_pc_calibrated(t,i,kfo_lp) = p15_livestock_kcal_structure_orig(t,i,kfo_lp) - * (p15_kcal_pc_livestock_supply_target(i)*(1-i15_livestock_fadeout_threshold(t,i)) - + p15_kcal_pc_calibrated_livestock_orig(t,i)*i15_livestock_fadeout_threshold(t,i)); -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_livestock_orig(t,i) - - sum(kfo_lp, p15_kcal_pc_calibrated(t,i,kfo_lp))) * s15_livescen_target_subst); -); - - -*############################################################################### -* ###### WASTE CALCULATIONS (required for exogenous food waste or diet scenarios) - -* The ratio of food demand at household level to food intake is determined -* by the amount of food that is wasted. This ratio is one of the drivers of -* future food demand trajetories. -* For the calculation of the ratio between food demand and intake, total food -* calorie intake based on CALIBRATED parameters needs to be calculated: - -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) = - p15_bmi_shr_regr(t,iso,sex,age,bmi_group15)+ - i15_bmi_shr_calib(t,iso,sex,age,bmi_group15); - -* The BMI shares are not allowed to exceed the bounds 0 and 1. Values are corrected to the bounds. -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)$(p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)<0) = 0; -p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)$(p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)>1) = 1; -* The mismatch is balanced by moving the exceeding quantities into the middle BMI group. -p15_bmi_shr_calibrated(t,iso,sex,age,"medium")= - 1 - (sum(bmi_group15, p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)) - - p15_bmi_shr_calibrated(t,iso,sex,age,"medium")); - -p15_intake_total_iso_calibrated(t,iso) = - sum((sex, age, bmi_group15), p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15)* - im_demography(t,iso,sex,age)*p15_intake(t,iso,sex,age,bmi_group15) ) - + i15_kcal_pregnancy(t,iso); - -p15_intake_total_calibrated(t,i)$(sum(i_to_iso(i,iso),sum((sex,age), im_demography(t,iso,sex,age)) ) >0 ) - = sum(i_to_iso(i,iso),p15_intake_total_iso_calibrated(t,iso) - ) / sum(i_to_iso(i,iso), - sum((sex,age), im_demography(t,iso,sex,age)) - ); - -p15_demand2intake_ratio(t,i)$(p15_intake_total_calibrated(t,i) >0 ) = - sum(kfo,p15_kcal_pc_calibrated(t,i,kfo)) / - p15_intake_total_calibrated(t,i); - -* In case, no exogenous waste scenario is selceted, the original regression- -* based estimates for food calorie oversupply are used as waste scenario. -* This information is needed in case that an exogenous diet scenario should be -* constructed from food calorie intake. -p15_demand2intake_ratio_scen(t,i) =p15_demand2intake_ratio(t,i); - - -* ###### Exogenous food waste scenario - -if(s15_exo_waste = 1, - -* "Downwards convergence" of regional calorie oversupply due to food waste to the -* waste reduction target, i.e. only for values that are higher than the target: - -p15_demand2intake_ratio_scen(t,i)$(p15_demand2intake_ratio(t,i) > s15_waste_scen ) - = p15_demand2intake_ratio(t,i)*(1-i15_exo_foodscen_fader(t,i)) - + s15_waste_scen*i15_exo_foodscen_fader(t,i); - -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,kfo)$(p15_demand2intake_ratio(t,i) >0 ) = p15_kcal_pc_calibrated_orig(t,i,kfo)*( - p15_demand2intake_ratio_scen(t,i)/p15_demand2intake_ratio(t,i) ); - -); - - -* Now, a second waste parameter can be calculated, which is needed for the construction -* of exogenous diet scenarios on the basis of calorie intake. This parameter describes -* the development of food waste over time and reflects either the exogenous food waste -* scenario or the original regression-based estimates for food calorie oversupply: - -p15_foodwaste_growth(t,i) = ( 1$(p15_demand2intake_ratio_ref(i) = 0) - + (p15_demand2intake_ratio_scen(t,i)/p15_demand2intake_ratio_ref(i))$( - p15_demand2intake_ratio_ref(i) > 0) - ); - - - - -* ###### Exogenous EAT Lancet diet scenario - -*' @code -*' Transition to exogenous EAT Lancet diet scenarios: -*' It is possible to define exogenous diet scenarios that replace the regression-based -*' calculation of food intake and demand according to a predefined speed of -*' convergence from `p15_kcal_pc_calibrated(t,i,kfo)` to the scenario-dependent target -*' `i15_kcal_pc_scen_target(t,i,kfo)` by setting the switch `s15_exo_diet` -*' to 1. - - -if(s15_exo_diet = 1, - - -* Select from the data set of EAT Lancet scenarios the target years that are -* consistent with the target year of the fader: - -$ifthen "%c15_exo_foodscen%" == "lin_zero_20_30" - i15_intake_EATLancet_all(i,kcal_scen15,EAT_scen15,kfo) = f15_intake_EATLancet("y2030",i,kcal_scen15,EAT_scen15,kfo); -$else - i15_intake_EATLancet_all(i,kcal_scen15,EAT_scen15,kfo) = f15_intake_EATLancet("y2050",i,kcal_scen15,EAT_scen15,kfo); -$endif - - - -*' 1.) In a first step, the exogenous scenario diets are defined by selecting a -*' scenario target for total daily per capita food intake and by choosing -*' food-specific dietary patterns: - -$ifthen "%c15_kcal_scen%" == "healthy_BMI" - i15_intake_scen_target(t,i) = sum(i_to_iso(i,iso), - sum((sex, age), im_demography(t,iso,sex,age)*p15_intake(t,iso,sex,age,"medium") ) - + i15_kcal_pregnancy(t,iso) - ) / sum(i_to_iso(i,iso), - sum((sex,age), im_demography(t,iso,sex,age)) - ); - i15_intake_EATLancet(i,kfo) = - i15_intake_EATLancet_all(i,"2100kcal","%c15_EAT_scen%",kfo); -$else - i15_intake_EATLancet(i,kfo) = - i15_intake_EATLancet_all(i,"%c15_kcal_scen%","%c15_EAT_scen%",kfo); - i15_intake_scen_target(t,i) = sum(kfo,i15_intake_EATLancet(i,kfo)); -$endif - - -*' 2.) The second step defines the daily per capita intake of different food -*' commodities by filling up the scenario target for total daily per capita food -*' intake according to different scenario assumptions on dietary patterns. Calories -*' for staple crops can be modified in order to meet the total calorie target. - -* Food-specific calorie intake of the model-internal diet projections is -* estimated from daily per capita food calorie demand: -p15_intake_detailed_regr(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo) - /(f15_calib_fsupply(i)*f15_overcons_FAOwaste(i,kfo)*p15_foodwaste_growth(t,i)); - - -p15_intake_detailed_scen_target(t,i,EAT_nonstaples) = i15_intake_EATLancet(i,EAT_nonstaples); - -* The EAT-Lancet diet only allows for added sugars, but does not include processed food or -* alcohol. Via 's15_alc_scen' a maximum target for alcohol consumption can be defined. -if(s15_alc_scen>0, -p15_intake_detailed_scen_target(t,i,"alcohol") = p15_intake_detailed_regr(t,i,"alcohol"); -p15_intake_detailed_scen_target(t,i,"alcohol")$(p15_intake_detailed_scen_target(t,i,"alcohol") > s15_alc_scen*i15_intake_scen_target(t,i)) - = s15_alc_scen*i15_intake_scen_target(t,i); -); - -p15_intake_detailed_scen_target(t,i,EAT_staples) = ( - i15_intake_scen_target(t,i) - sum(EAT_nonstaples,i15_intake_EATLancet(i,EAT_nonstaples)) )*( - i15_intake_EATLancet(i,EAT_staples)/sum(EAT_staples2,i15_intake_EATLancet(i,EAT_staples2)) ); - - -*' 3.) The third step estimates the calorie supply at household level by multiplying -*' daily per capita calorie intake with a ratio of supply to intake -*' (`f15_overcons_FAOwaste(i,kfo)`), based on FAO estimates on historical food waste -*' at consumption level and food conversion factors, and with a calibration -*' factor `f15_calib_fsupply(i)`. This factor ensures that the estimated food -*' supply (based on MAgPIE calorie intake, FAO waste shares and food converion -*' factors) is calibrated to FAO food supply for the only historical time slice -*' of the EAT Lancet diet scenarios (y2010). A multiplicative factor accounts for -*' increases in food waste over time relative to the only historical time slice -*' of the EAT Lancet diet scenarios, according to the regression-based approach. - -i15_kcal_pc_scen_target(t,i,kfo) = (f15_calib_fsupply(i)*f15_overcons_FAOwaste(i,kfo) - *p15_intake_detailed_scen_target(t,i,kfo)) - *p15_foodwaste_growth(t,i); - -*' 4.) In the last step, the regression-based calculation of daily per capita food demand -*' is faded into the exogenous diet scenario according to a predefined speed of -*' convergence (note that fading should start after the historical time slice of -*' the EAT Lancet diet scenarios (y2010) as defined in `i15_exo_foodscen_fader(t,i)`): - -p15_kcal_pc_calibrated_orig(t,i,kfo) = p15_kcal_pc_calibrated(t,i,kfo); -p15_kcal_pc_calibrated(t,i,kfo) = p15_kcal_pc_calibrated_orig(t,i,kfo) * (1-i15_exo_foodscen_fader(t,i)) - + i15_kcal_pc_scen_target(t,i,kfo) * i15_exo_foodscen_fader(t,i); - - -); - - -*' @stop - -*############################################################################### - - - - -*' @code -*' Now, MAgPIE is executed. -*' @stop diff --git a/modules/15_food/anthropometrics_jan18/realization.gms b/modules/15_food/anthropometrics_jan18/realization.gms deleted file mode 100644 index df0b0b9098..0000000000 --- a/modules/15_food/anthropometrics_jan18/realization.gms +++ /dev/null @@ -1,44 +0,0 @@ -*** | (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 - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/15_food/anthropometrics_jan18/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/15_food/anthropometrics_jan18/declarations.gms" -$Ifi "%phase%" == "input" $include "./modules/15_food/anthropometrics_jan18/input.gms" -$Ifi "%phase%" == "equations" $include "./modules/15_food/anthropometrics_jan18/equations.gms" -$Ifi "%phase%" == "scaling" $include "./modules/15_food/anthropometrics_jan18/scaling.gms" -$Ifi "%phase%" == "preloop" $include "./modules/15_food/anthropometrics_jan18/preloop.gms" -$Ifi "%phase%" == "presolve" $include "./modules/15_food/anthropometrics_jan18/presolve.gms" -$Ifi "%phase%" == "intersolve" $include "./modules/15_food/anthropometrics_jan18/intersolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/15_food/anthropometrics_jan18/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### - -*' @description -*' The realization anthropometrics_jan18 -*' uses per capita income and the demography of the -*' world population (including sex and age classes at the country level, -*' which are provided from module [09_drivers]) as drivers. -*' The module estimates food demand on iso-country level taking -*' anthropometric food requirements as well as economic dynamics into account. -*' If flexible demand is activated, the module also uses the shadow prices -*' for agircultural products from the optimization, which are the Lagrange -*' multipliers of the constraint `q15_food_demand`. -*' The module consists of a standalone food demand model, which is executed -*' before MAgPIE starts. In the case of endogenous demand, the module is -*' iterated with MAgPIE. -*' Besides providing the fooduse of agricultural products, the model also -*' provides a number of output indicators, including the BMI distribution, -*' body weight and height of the population by age and sex, food intake by -*' age group and sex, food waste, dietary composition between livestock products, -*' empty calories (sugar, oil and alcohol), fruits vegetables and nuts, as well -*' as staple calories. -*' The food demand model can be run in standalone mode by running the -*' the file `standalone/demand_model.gms`. -*' The model is described in [@bodirsky_starved_nodate] -*' -*' @authors Benjamin Leon Bodirsky, Jan Philipp Dietrich - diff --git a/modules/15_food/anthropometrics_jan18/scaling.gms b/modules/15_food/anthropometrics_jan18/scaling.gms deleted file mode 100644 index 6ed99f3ac2..0000000000 --- a/modules/15_food/anthropometrics_jan18/scaling.gms +++ /dev/null @@ -1,10 +0,0 @@ -*** | (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 - -v15_income_pc_real_ppp_iso.scale(iso) = 10e5; -v15_kcal_intake_total_regr.scale(iso) = 10e3; -v15_kcal_regr_total.scale(iso) = 10e4; diff --git a/modules/15_food/anthropometrics_jan18/sets.gms b/modules/15_food/anthropometrics_jan18/sets.gms deleted file mode 100644 index 64baecb433..0000000000 --- a/modules/15_food/anthropometrics_jan18/sets.gms +++ /dev/null @@ -1,187 +0,0 @@ -*** | (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 - - iter15 iterations between food demand model and magpie - /iter1*iter10/ - curr_iter15(iter15) currently active iteration - prev_iter15(iter15) last active iteration - - underaged15(age) Group of underaged age classes - /0--4,5--9,10--14/ - - adult15(age) Age groups for adult population - / 15--19, - 20--24, 25--29, 30--34, 35--39, - 40--44, 45--49, 50--54, 55--59, - 60--64, 65--69, 70--74, 75--79 - 80--84,85--89,90--94,95--99,100+ / - - working15(adult15) Group of working age population - / 15--19, - 20--24, 25--29, 30--34, 35--39, - 40--44, 45--49, 50--54, 55--59/ - - retired15(adult15) Age group of retired population - /60--64, 65--69, 70--74, 75--79 - 80--84,85--89,90--94,95--99,100+ / - - agegroup15 All age groups - /underaged,working,retired / - - age2_adults15(agegroup15) Adult age group - /working,retired / - - agegroup2age(agegroup15,age) Mapping between age cohort and age - / - underaged . (0--4,5--9,10--14) - working . (15--19, - 20--24, 25--29, 30--34, 35--39, - 40--44, 45--49, 50--54, 55--59) - retired . (60--64, 65--69, 70--74, 75--79 - 80--84,85--89,90--94,95--99,100+ ) - / - - bmi_tree15 Body mass index - /low,lowsplit,mediumsplit,high,highsplit/ - - bmi_group15 Body mass index gradient - /verylow,low,medium,mediumhigh,high,veryhigh/ - - bmi_group_est15(bmi_group15) Body mass index extremes - /verylow,low,mediumhigh,high,veryhigh/ - - age_new_estimated15(age) Estimated ages - /0--4,5--9,10--14,15--19/ - - reproductive(age) Age group of people in the reproductive age - /20--24, 25--29, 30--34, 35--39/ - - estimates15 Preliminary or final result for body height distribution - /preliminary,final/ - - paras_s15 Schofield equation parameters - /slope, intercept/ - - paras_b15 Intake equation parameters - /saturation,halfsaturation,intercept/ - - paras_h15 Bodyheight equation parameters - /slope, exponent/ - - kfo(kall) All products in the sectoral version - / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, - potato,cassav_sp,sugr_cane,sugr_beet, - oils,sugar,molasses,alcohol,brans,scp, - livst_rum,livst_pig,livst_chick, livst_egg, livst_milk, fish, - others / - - growth_food15(kfo) Food items that are important for body growth regression - / soybean,groundnut,puls_pro,oils, - livst_rum,livst_pig,livst_chick, livst_egg, livst_milk, fish / - - kst(kfo) Plant-based staple products in the sectoral version - / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, - potato,cassav_sp,sugr_cane,sugr_beet, - oils,sugar,molasses,alcohol,brans,scp / - - kfo_pp(kfo) Plant-based food products - / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, - potato,cassav_sp,sugr_cane,sugr_beet, - oils,sugar,molasses,alcohol,brans,scp, - others / - - kfo_ap(kfo) Animal food products - / livst_rum,livst_pig,livst_chick, livst_egg, livst_milk, fish / - - kfo_lp(kfo) Livestock food products - / livst_rum,livst_pig,livst_chick, livst_egg, livst_milk / - - kfo_st(kfo) Staple products - / tece,maiz,trce,rice_pro,soybean,rapeseed,groundnut,sunflower,puls_pro, - potato,cassav_sp,sugr_cane,sugr_beet,molasses,brans,scp / - - kfo_pf(kfo) Processed foods including oils sugar alcohol - / oils,alcohol,sugar / - - knf(kall) Non-food products in the sectoral version - / oilpalm,cottn_pro,foddr, pasture, begr, betr, - oilcakes,ethanol,distillers_grain,fibres, - res_cereals, res_fibrous, res_nonfibrous, - wood, woodfuel / - - nutrition Nutrition attributes - /kcal, protein/ - - par15 Parameters for food module - / intercept,saturation,halfsaturation,non_saturation / -* intercept + saturation give the max value if non-saturation is 1 -* halfsaturation is the gdp until which half of saturation is reached - - regr15 Demand regression types - / overconsumption,livestockshare,processedshare,vegfruitshare / - -*** Scenarios - food_scen15 Food scenarios - / SSP1, SSP2, SSP3, SSP4, SSP5, - SSP1_boundary, SSP2_boundary, SSP3_boundary, - SSP4_boundary, SSP5_boundary, - SSP2_lowcal, SSP2_lowls, SSP2_waste, - ssp2_high_yvonne,ssp2_low_yvonne,ssp2_lowest_yvonne, - history / - - pop_scen15 Population scenarios - / SSP1, SSP2, SSP3, SSP4, SSP5 / - - - calibscen15 Calibration scenarios for balance flow - / constant, fadeout2050 / - - livst_fadeoutscen15 Scenarios for changed composition of livestock products - / halving2050, constant / - -* The set kfo_rd can be defined in default.cfg and is used in the food substitution scenarios s15_rumdairy_scp_substitution and s15_rumdairy_substitution - kfo_rd(kfo) Ruminant meat and dairy food products - / livst_rum,livst_milk / - - fadeoutscen15 Food substitution scenarios including functional forms with targets and transition periods - / constant, - lin_zero_10_50, lin_zero_20_50, lin_zero_20_30, lin_zero_20_70, lin_50pc_20_50, lin_50pc_20_50_extend65, lin_50pc_20_50_extend80, - 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, sigmoid_75pc_25_50, sigmoid_50pc_25_50, sigmoid_25pc_25_50 / - - t_scen15(t_all) Target years for transition to exogenous scenario diets - / y2010, y2030, y2050 / - - kcal_scen15 Scenario of daily per capita calorie intake - / 2100kcal, 2500kcal / - - EAT_scen15 Scenario of daily per capita calorie intake - / BMK, FLX, PSC, VEG, VGN, FLX_hmilk, FLX_hredmeat / - - EAT_staples(kfo) All staple food products according to EAT Lancet definition - / tece,maiz,trce,rice_pro,potato,cassav_sp / - - EAT_nonstaples(kfo) All non-staple food products according to EAT Lancet definition - / soybean,rapeseed,groundnut,sunflower,puls_pro, - sugr_cane,sugr_beet, - oils,sugar,molasses,alcohol,brans,scp, - livst_rum,livst_pig,livst_chick, livst_egg, livst_milk, fish, - others / - -; - -alias(kst,kst2); -alias(bmi_group15,bmi_group15_2); -alias(kfo,kfo2); -alias(kfo_ap,kfo_ap2); -alias(kfo_st,kfo_st2); -alias(kfo_pf,kfo_pf2); -alias(iso,iso2); -alias(reproductive,reproductive2); -alias(EAT_staples,EAT_staples2); diff --git a/renv/.gitignore b/renv/.gitignore index 7b56d7001f..0ec0cbba2d 100644 --- a/renv/.gitignore +++ b/renv/.gitignore @@ -5,4 +5,3 @@ lock/ python/ sandbox/ staging/ -archive/ diff --git a/renv/settings.dcf b/renv/settings.dcf deleted file mode 100644 index 169d82f1bc..0000000000 --- a/renv/settings.dcf +++ /dev/null @@ -1,10 +0,0 @@ -bioconductor.version: -external.libraries: -ignored.packages: -package.dependency.fields: Imports, Depends, LinkingTo -r.version: -snapshot.type: implicit -use.cache: TRUE -vcs.ignore.cellar: TRUE -vcs.ignore.library: TRUE -vcs.ignore.local: TRUE diff --git a/renv/settings.json b/renv/settings.json index 3331ef2535..74c1d4bb84 100644 --- a/renv/settings.json +++ b/renv/settings.json @@ -1,5 +1,5 @@ { - "bioconductor.version": [], + "bioconductor.version": null, "external.libraries": [], "ignored.packages": [], "package.dependency.fields": [ @@ -7,8 +7,10 @@ "Depends", "LinkingTo" ], - "r.version": [], - "snapshot.type": "implicit", + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "explicit", "use.cache": true, "vcs.ignore.cellar": true, "vcs.ignore.library": true, From 97a023a99415f3ee5c495acb2e08d3f8dbb94001 Mon Sep 17 00:00:00 2001 From: bodirsky Date: Thu, 16 Jan 2025 14:29:44 +0100 Subject: [PATCH 02/15] test script for elastic demand --- scripts/start/projects/test_elastic_demand.R | 48 ++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 scripts/start/projects/test_elastic_demand.R diff --git a/scripts/start/projects/test_elastic_demand.R b/scripts/start/projects/test_elastic_demand.R new file mode 100644 index 0000000000..50f502226d --- /dev/null +++ b/scripts/start/projects/test_elastic_demand.R @@ -0,0 +1,48 @@ +# | (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: Test routine for standardized test runs +# position: 5 +# ---------------------------------------------------------- + +## Load lucode2 and gms to use setScenario later +library(lucode2) +library(gms) + +# Load start_run(cfg) function which is needed to start MAgPIE runs +source("scripts/start_functions.R") + +# Source default cfg. This loads the object "cfg" in R environment +source("config/default.cfg") + +#download default input data +download_and_update(cfg) + +# create additional information to describe the runs +cfg$info$flag <- "elastic_demand" + +cfg$results_folder <- "output/:title:" +cfg$force_replace <- TRUE + +# support function to create standardized title +.title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) + +# Reference and Policy run for SSP1, SSP2 and SSP5 +for(s15_tax_redistribution in c(0,0.5,1)) { + + cfg$title <- .title(cfg, paste("SSP2","PkBudg650","recycling",s15_tax_redistribution,sep="-")) + cfg$gms$s15_elastic_demand <- 0 + cfg$gms$s15_tax_redistribution <- s15_tax_redistribution + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) + 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") + start_run(cfg, codeCheck = FALSE) + +} + From ca6fa15a60c27feafc037eb158cb64372d5b38db Mon Sep 17 00:00:00 2001 From: bodirsky Date: Thu, 16 Jan 2025 14:38:22 +0100 Subject: [PATCH 03/15] test script for module --- scripts/start/projects/test_elastic_demand.R | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/start/projects/test_elastic_demand.R b/scripts/start/projects/test_elastic_demand.R index 50f502226d..80b73e46a9 100644 --- a/scripts/start/projects/test_elastic_demand.R +++ b/scripts/start/projects/test_elastic_demand.R @@ -32,17 +32,26 @@ cfg$force_replace <- TRUE # support function to create standardized title .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) -# Reference and Policy run for SSP1, SSP2 and SSP5 +# Reference and Policy run for various shares of tax recycling for(s15_tax_redistribution in c(0,0.5,1)) { cfg$title <- .title(cfg, paste("SSP2","PkBudg650","recycling",s15_tax_redistribution,sep="-")) - cfg$gms$s15_elastic_demand <- 0 + cfg$gms$s15_elastic_demand <- 1 cfg$gms$s15_tax_redistribution <- s15_tax_redistribution - cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) + cfg <- setScenario(cfg,c("SSP2","NDC","rcp1p9")) 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") start_run(cfg, codeCheck = FALSE) + + cfg$title <- .title(cfg, paste("SSP2","Ref",sep="-")) + cfg$gms$s15_elastic_demand <- 1 + cfg$gms$s15_tax_redistribution <- s15_tax_redistribution + cfg <- setScenario(cfg,c("SSP2","NPI","rcp7p0")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") + start_run(cfg, codeCheck = FALSE) } From d2b50bda5db2848fffc93bc6cf601e6cc52ce873 Mon Sep 17 00:00:00 2001 From: bodirsky Date: Thu, 16 Jan 2025 15:00:24 +0100 Subject: [PATCH 04/15] bugfix --- scripts/start/projects/test_elastic_demand.R | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/start/projects/test_elastic_demand.R b/scripts/start/projects/test_elastic_demand.R index 80b73e46a9..58ac0515ff 100644 --- a/scripts/start/projects/test_elastic_demand.R +++ b/scripts/start/projects/test_elastic_demand.R @@ -35,19 +35,21 @@ cfg$force_replace <- TRUE # Reference and Policy run for various shares of tax recycling for(s15_tax_redistribution in c(0,0.5,1)) { - cfg$title <- .title(cfg, paste("SSP2","PkBudg650","recycling",s15_tax_redistribution,sep="-")) + ssp="SSP2" + + cfg$title <- .title(cfg, paste(ssp,"PkBudg650","recycling",s15_tax_redistribution,sep="-")) cfg$gms$s15_elastic_demand <- 1 cfg$gms$s15_tax_redistribution <- s15_tax_redistribution - cfg <- setScenario(cfg,c("SSP2","NDC","rcp1p9")) + cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) 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") start_run(cfg, codeCheck = FALSE) - cfg$title <- .title(cfg, paste("SSP2","Ref",sep="-")) + cfg$title <- .title(cfg, paste(ssp,"Ref",sep="-")) cfg$gms$s15_elastic_demand <- 1 cfg$gms$s15_tax_redistribution <- s15_tax_redistribution - cfg <- setScenario(cfg,c("SSP2","NPI","rcp7p0")) + cfg <- setScenario(cfg,c(ssp,"NPI","rcp7p0")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") From c8bc75f499ae1974b56c44e3d16dae750f628fcc Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 17 Jan 2025 14:03:04 +0100 Subject: [PATCH 05/15] bugfix for elastic demand --- main.gms | 7 ++++++- modules/15_food/anthro_iso_jun22/declarations.gms | 2 +- modules/15_food/anthro_iso_jun22/equations.gms | 2 +- modules/15_food/anthro_iso_jun22/intersolve.gms | 7 ++++--- modules/15_food/anthro_iso_jun22/preloop.gms | 2 +- modules/15_food/anthro_iso_jun22/presolve.gms | 11 +++++++++-- modules/15_food/anthro_iso_jun22/sets.gms | 2 +- 7 files changed, 23 insertions(+), 10 deletions(-) diff --git a/main.gms b/main.gms index 87efb58c68..f168f9c446 100644 --- a/main.gms +++ b/main.gms @@ -194,8 +194,13 @@ $title magpie * 14 23 10 7 4 26 21 9 16 23 32 15 * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * +* Warning messages: +* 1: In override(url = url, destfile = destfile, quiet = quiet, ... : +* downloaded length 14647821 != reported length 28623062 +* 2: In override(url = url, destfile = destfile, quiet = quiet, ... : +* URL 'https://rse.pik-potsdam.de/r/packages/src/contrib/mrdownscale_0.29.0.tar.gz': Timeout of 60 seconds was reached * -* Last modification (input data): Thu Jan 16 10:54:57 2025 +* Last modification (input data): Fri Jan 17 13:44:42 2025 * *###################### R SECTION END (VERSION INFO) ########################### diff --git a/modules/15_food/anthro_iso_jun22/declarations.gms b/modules/15_food/anthro_iso_jun22/declarations.gms index edad73fa1c..b13bdc7be4 100644 --- a/modules/15_food/anthro_iso_jun22/declarations.gms +++ b/modules/15_food/anthro_iso_jun22/declarations.gms @@ -176,7 +176,7 @@ parameters p15_country_switch(iso) Switch indicating whether country is affected by diet scenarios (1) * elastic demand - p15_tax_recycling(t,iso) Tax revenue recycling to households + p15_tax_recycling(t,iso) Tax revenue recycling to households (USD17PPP per capita) p15_prices_kcal(t,iso,kfo,iter15) Prices from MAgPIE after optimization (USD17PPP per kcal) i15_prices_initial_kcal(iso,kfo) Initial prices that capture the approximate level of prices in 1961-2010 (USD17PPP per kcal) diff --git a/modules/15_food/anthro_iso_jun22/equations.gms b/modules/15_food/anthro_iso_jun22/equations.gms index f9e89f5a12..591fe60668 100644 --- a/modules/15_food/anthro_iso_jun22/equations.gms +++ b/modules/15_food/anthro_iso_jun22/equations.gms @@ -48,7 +48,7 @@ q15_aim .. q15_budget(iso) .. v15_income_pc_real_ppp_iso(iso) =e= sum(kfo, v15_kcal_regr(iso,kfo) * 365 - *(i15_prices_initial_kcal(iso,kfo) - sum((ct,curr_iter15), p15_prices_kcal(ct,iso,kfo,curr_iter15)))) + *(i15_prices_initial_kcal(iso,kfo) - sum((ct,prev_iter15), p15_prices_kcal(ct,iso,kfo,prev_iter15)))) + sum(ct, im_gdp_pc_ppp_iso(ct,iso) + p15_tax_recycling(ct,iso)) + v15_income_balance(iso); *' The budget constraint calculates the real income after a possible price diff --git a/modules/15_food/anthro_iso_jun22/intersolve.gms b/modules/15_food/anthro_iso_jun22/intersolve.gms index 509034e362..7bcbf87b04 100644 --- a/modules/15_food/anthro_iso_jun22/intersolve.gms +++ b/modules/15_food/anthro_iso_jun22/intersolve.gms @@ -36,12 +36,13 @@ if (s15_elastic_demand = 1 AND m_year(t) > sm_fix_SSP2, * A new iteration is started p15_iteration_counter(t) = p15_iteration_counter(t) + 1; * The set current iter includes only one element with the set element -* of the current iteration, e.g. "iter2" +* of the current iteration, e.g. "iter2". As iter0 also exists, +* "iter2" is the third entry of the set iter15, so we add 1. curr_iter15(iter15) = no; - curr_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)) = yes; + curr_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)+1) = yes; * Now we also define a set for the previous iteration prev_iter15(iter15) = no; - prev_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)-1) = yes; + prev_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)) = yes; *' @code display "starting m15_food_demand in iteration number ", p15_iteration_counter; diff --git a/modules/15_food/anthro_iso_jun22/preloop.gms b/modules/15_food/anthro_iso_jun22/preloop.gms index 399b7bbc46..12f173da41 100644 --- a/modules/15_food/anthro_iso_jun22/preloop.gms +++ b/modules/15_food/anthro_iso_jun22/preloop.gms @@ -138,6 +138,6 @@ else * initial prices in $US per Kcal i15_prices_initial_kcal(iso,kfo)$(fm_nutrition_attributes("y1995",kfo,"kcal")>0) = f15_prices_initial(kfo) / (fm_nutrition_attributes("y1995",kfo,"kcal")*10**6); -p15_prices_kcal(t,iso,kfo,"iter1") = i15_prices_initial_kcal(iso,kfo); + p15_tax_recycling(t,iso) = 0; p15_convergence_measure(t,iter15) = NA; diff --git a/modules/15_food/anthro_iso_jun22/presolve.gms b/modules/15_food/anthro_iso_jun22/presolve.gms index b76d8279d5..b86f2e5de1 100644 --- a/modules/15_food/anthro_iso_jun22/presolve.gms +++ b/modules/15_food/anthro_iso_jun22/presolve.gms @@ -218,13 +218,20 @@ vm_dem_food.fx(i,knf)=0; *** Food demand model is calculated the first time for the current time step, using standard prices +* Food prices are intitialized +p15_prices_kcal(t,iso,kfo,"iter0") = i15_prices_initial_kcal(iso,kfo); + * activating the first iteration p15_iteration_counter(t) = 1; * The set curr_iter15 includes only one element with the set element -* of the current iteration, e.g. "iter2" +* of the current iteration, here "iter1". As iter0 also exists, +* its the second entry of the set. curr_iter15(iter15) = no; -curr_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)) = yes; +curr_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)+1) = yes; +* Now we also define a set for the previous iteration + prev_iter15(iter15) = no; + prev_iter15(iter15)$(ord(iter15)=p15_iteration_counter(t)) = yes; p15_delta_income(t,i,curr_iter15) = 1; diff --git a/modules/15_food/anthro_iso_jun22/sets.gms b/modules/15_food/anthro_iso_jun22/sets.gms index 71c24168f3..97188d8c5b 100644 --- a/modules/15_food/anthro_iso_jun22/sets.gms +++ b/modules/15_food/anthro_iso_jun22/sets.gms @@ -8,7 +8,7 @@ sets iter15 iterations between food demand model and magpie - /iter1*iter10/ + /iter0*iter10/ curr_iter15(iter15) currently active iteration prev_iter15(iter15) last active iteration From 392f75292b29d0f96f1c4f68a49fba8cbb5f7503 Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 17 Jan 2025 15:38:44 +0100 Subject: [PATCH 06/15] correcting wrong name in configfile and startscript --- config/default.cfg | 2 +- scripts/start/projects/test_elastic_demand.R | 28 ++++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index c4bb6b88b1..26d9f151ba 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -346,7 +346,7 @@ cfg$gms$s15_elastic_demand <- 0 # def =0 # * Per capita redistribution of GHG tax revenues # * options: 1 (distribution_neutral recycling), 0 (burning of money), #`* <1 (incomplete recycling, regressive), >1 progressive recycling -cfg$gms$s15_tax_redistribution <- 1 # def = 1 +cfg$gms$s15_tax_recycling <- 1 # def = 1 # * maximal number of iterations between food and magpie model before # * simulation proceeds to next time step diff --git a/scripts/start/projects/test_elastic_demand.R b/scripts/start/projects/test_elastic_demand.R index 58ac0515ff..e1e161af37 100644 --- a/scripts/start/projects/test_elastic_demand.R +++ b/scripts/start/projects/test_elastic_demand.R @@ -33,27 +33,39 @@ cfg$force_replace <- TRUE .title <- function(cfg, ...) return(paste(cfg$info$flag, sep="_",...)) # Reference and Policy run for various shares of tax recycling -for(s15_tax_redistribution in c(0,0.5,1)) { +for(s15_tax_recycling in c(0,0.5,1)) { ssp="SSP2" - cfg$title <- .title(cfg, paste(ssp,"PkBudg650","recycling",s15_tax_redistribution,sep="-")) + cfg$title <- .title(cfg, paste(ssp,"PkBudg650","recycling",s15_tax_recycling,sep="-")) cfg$gms$s15_elastic_demand <- 1 - cfg$gms$s15_tax_redistribution <- s15_tax_redistribution + cfg$gms$s15_tax_recycling <- s15_tax_recycling cfg <- setScenario(cfg,c(ssp,"NDC","rcp1p9")) 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") start_run(cfg, codeCheck = FALSE) - - cfg$title <- .title(cfg, paste(ssp,"Ref",sep="-")) + + +} + +s15_tax_recycling=1 + cfg$title <- .title(cfg, paste(ssp,"Ref",s15_tax_recycling,sep="-")) cfg$gms$s15_elastic_demand <- 1 - cfg$gms$s15_tax_redistribution <- s15_tax_redistribution + cfg$gms$s15_tax_recycling <- s15_tax_recycling + cfg <- setScenario(cfg,c(ssp,"NPI","rcp7p0")) + cfg$gms$c56_mute_ghgprices_until <- "y2150" + cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") + cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") + start_run(cfg, codeCheck = FALSE) + +s15_tax_recycling=1 + cfg$title <- .title(cfg, paste(ssp,"Ref_inelastic",sep="-")) + cfg$gms$s15_elastic_demand <- 0 + cfg$gms$s15_tax_recycling <- s15_tax_recycling cfg <- setScenario(cfg,c(ssp,"NPI","rcp7p0")) cfg$gms$c56_mute_ghgprices_until <- "y2150" cfg$gms$c56_pollutant_prices <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") cfg$gms$c60_2ndgen_biodem <- paste0("R32M46-", if (ssp=="SSP2") "SSP2EU" else ssp,"-NPi") start_run(cfg, codeCheck = FALSE) - -} From c74b71504b267c7f87b77bec6c7ec5fc5f47f04f Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 17 Jan 2025 18:11:35 +0100 Subject: [PATCH 07/15] CHANGELOG.m --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c39e0a6fc..bc5d3c8cfe 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 - **scripts** peatland rewetting now automatically considered in `extra/runSEALSallocation.R` +- **15_food** tax recycling for income effect in elastic food demand ### added - **scripts** added start script for land-based mitigation and biodiversity conservation paper @@ -18,6 +19,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### fixed - **44_biodiversity** bugfix i44_biome_share, code cleanup, added scaling of `q44_bii` +- **15_food** elastic demand did not receive prices from the right iteration ## [4.9.0] - 2024-12-05 From 130feeb9418ed00a0649013fe67c4c87585b8b29 Mon Sep 17 00:00:00 2001 From: Benjamin Leon Bodirsky Date: Tue, 28 Jan 2025 13:41:35 +0100 Subject: [PATCH 08/15] wrong unit --- modules/16_demand/sector_may15/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/16_demand/sector_may15/input.gms b/modules/16_demand/sector_may15/input.gms index 0fd698833e..5bd9bcd40c 100644 --- a/modules/16_demand/sector_may15/input.gms +++ b/modules/16_demand/sector_may15/input.gms @@ -17,7 +17,7 @@ $ondelim $include "./modules/16_demand/sector_may15/input/f16_waste_shr.csv" $offdelim; -table fm_attributes(attributes,kall) Conversion factors - where X is ton N P K C DM WM or PJ GE (X per tDM) +table fm_attributes(attributes,kall) Conversion factors - where X is ton N P K C DM WM or GJ GE (X per tDM) $ondelim $include "./modules/16_demand/sector_may15/input/fm_attributes.cs3" $offdelim; From d7d5c3739507a9c28e5575bd6c7d8484b9c5c831 Mon Sep 17 00:00:00 2001 From: Benjamin Leon Bodirsky Date: Tue, 4 Feb 2025 12:38:22 +0100 Subject: [PATCH 09/15] Update CHANGELOG.md modules/15_food/anthropometrics_jan18 deleted --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc5d3c8cfe..29e3d157e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **start_scripts** added `lock_timeout` as option to `start_run` function ### removed -- +- **modules/15_food/anthropometrics_jan18** removed as outdated ### fixed - **44_biodiversity** bugfix i44_biome_share, code cleanup, added scaling of `q44_bii` From cb21c35660a6fbaf4954f07e1e3bf942f2a9967a Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 7 Feb 2025 08:24:21 +0100 Subject: [PATCH 10/15] ... --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55d364db80..0c3ec04f1e 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ model source code via the R package goxygen package and run the main function (goxygen) in the main folder of the model. The resulting documentation can be found in the folder "doc". -Please find a set of tutorials here https://magpiemodel.github.io/tutorials/. +Please find a set of tutorials here https://magpiemodel.github.io/tutorials. This guide will give you a brief technical introduction in how to install, run and use the model and how to analyse the model output. From db1f58eefb39112e3b1647f3b6c03188b140a129 Mon Sep 17 00:00:00 2001 From: Benjamin Leon Bodirsky Date: Fri, 7 Feb 2025 14:21:28 +0100 Subject: [PATCH 11/15] Update modules/15_food/anthro_iso_jun22/input.gms Co-authored-by: Jan Dietrich --- modules/15_food/anthro_iso_jun22/input.gms | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/15_food/anthro_iso_jun22/input.gms b/modules/15_food/anthro_iso_jun22/input.gms index d51ea41d85..f01c593406 100644 --- a/modules/15_food/anthro_iso_jun22/input.gms +++ b/modules/15_food/anthro_iso_jun22/input.gms @@ -64,7 +64,7 @@ $offMulti scalars s15_elastic_demand Elastic demand switch (1=elastic 0=exogenous) (1) / 0 / -s15_tax_recycling Tax recycling multiplier (1=distribution neutral) / 1 / +s15_tax_recycling Tax recycling multiplier (1=distribution neutral) (1) / 1 / s15_calibrate Calibration switch (1=calibrated 0=pure regression outcomes) (1) / 1 / * only for per-capita calories, not for e.g. calibration of transformation parameters between per-capita calories in dm s15_maxiter Scalar defining maximum number of iterations (1) / 5 / From 3f1d173fa5942a2dd183947a0b4af4bb27a985a2 Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 7 Feb 2025 14:27:48 +0100 Subject: [PATCH 12/15] remove warnings, update changelog, rmeove chagnes in renv --- CHANGELOG.md | 1 + main.gms | 6 ------ renv/settings.json | 8 +++----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fb6b7dd9d..6c0cbcdddd 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/). - **default.cfg** settings for land conversion cost calibration updated ### added +- **scripts** output script for testing elastic demand - **scenario_config.csv** added column `NPI-revert` - **scenario_config.csv** added columns `AR-natveg` and `AR-plant` for CO2 price re/afforestation and AgroForestry settings - **scenario_config.csv** added scenario `VLLO` based on `SDP-MC` diff --git a/main.gms b/main.gms index 3d418bf0ee..4efcff6c60 100644 --- a/main.gms +++ b/main.gms @@ -194,12 +194,6 @@ $title magpie * 14 23 10 7 4 26 21 9 16 23 32 15 * * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler) * -* Warning messages: -* 1: In override(url = url, destfile = destfile, quiet = quiet, ... : -* downloaded length 14647821 != reported length 28623062 -* 2: In override(url = url, destfile = destfile, quiet = quiet, ... : -* URL 'https://rse.pik-potsdam.de/r/packages/src/contrib/mrdownscale_0.29.0.tar.gz': Timeout of 60 seconds was reached -* * Last modification (input data): Thu Feb 6 14:08:31 2025 * *###################### R SECTION END (VERSION INFO) ########################### diff --git a/renv/settings.json b/renv/settings.json index 74c1d4bb84..3331ef2535 100644 --- a/renv/settings.json +++ b/renv/settings.json @@ -1,5 +1,5 @@ { - "bioconductor.version": null, + "bioconductor.version": [], "external.libraries": [], "ignored.packages": [], "package.dependency.fields": [ @@ -7,10 +7,8 @@ "Depends", "LinkingTo" ], - "ppm.enabled": null, - "ppm.ignored.urls": [], - "r.version": null, - "snapshot.type": "explicit", + "r.version": [], + "snapshot.type": "implicit", "use.cache": true, "vcs.ignore.cellar": true, "vcs.ignore.library": true, From 89ab8f9c607356808a15362f62be0643079dc24e Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 7 Feb 2025 15:02:47 +0100 Subject: [PATCH 13/15] improving description --- config/default.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/default.cfg b/config/default.cfg index cfce5ab49b..3a88b8a16f 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -369,8 +369,7 @@ cfg$gms$food <- "anthro_iso_jun22" # def = anthro_iso_jun22 cfg$gms$s15_elastic_demand <- 0 # def =0 # * Per capita redistribution of GHG tax revenues -# * options: 1 (distribution_neutral recycling), 0 (burning of money), -#`* <1 (incomplete recycling, regressive), >1 progressive recycling +# * options: 1 (distribution_neutral recycling), 0 (no recycling) cfg$gms$s15_tax_recycling <- 1 # def = 1 # * maximal number of iterations between food and magpie model before From c03106992891a4c1759bb4ba4c7e84874b8896fa Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 7 Feb 2025 16:39:25 +0100 Subject: [PATCH 14/15] ... --- renv/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/renv/.gitignore b/renv/.gitignore index 0ec0cbba2d..b515c4a002 100644 --- a/renv/.gitignore +++ b/renv/.gitignore @@ -5,3 +5,4 @@ lock/ python/ sandbox/ staging/ +archive/ \ No newline at end of file From 1db664825d602676cac327314eaf9f74729836a3 Mon Sep 17 00:00:00 2001 From: bodirsky Date: Fri, 7 Feb 2025 17:00:22 +0100 Subject: [PATCH 15/15] .. --- renv/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renv/.gitignore b/renv/.gitignore index b515c4a002..7b56d7001f 100644 --- a/renv/.gitignore +++ b/renv/.gitignore @@ -5,4 +5,4 @@ lock/ python/ sandbox/ staging/ -archive/ \ No newline at end of file +archive/