Skip to content

Commit

Permalink
separation of targets is now the same as before (monogastric and rumi…
Browse files Browse the repository at this point in the history
…nant) rather than redmeat and poultry
  • Loading branch information
FelicitasBeier committed Jan 17, 2024
1 parent a200ed4 commit 9195bcc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
6 changes: 2 additions & 4 deletions config/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -461,10 +461,8 @@ cfg$gms$c15_EAT_scen <- "FLX" # def = FLX
# * included, while the others will remain to be endogenous.
# * Any shift will be compensated to reach the calorie target by adjusting
# * staple calories.
cfg$gms$s15_exo_monogastric <- 1 # def = 1, options: 0,1 (only relevant for s15_exo_diet = 1)
cfg$gms$s15_exo_ruminant <- 1 # def = 1, options: 0,1 (only relevant for s15_exo_diet = 1)
cfg$gms$s15_exo_redmeatdairy <- 1 # def = 1, options: 0,1 (only relevant for s15_exo_diet = 3)
cfg$gms$s15_exo_poultry <- 1 # def = 1, options: 0,1 (only relevant for s15_exo_diet = 3)
cfg$gms$s15_exo_monogastric <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_ruminant <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fish <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_fruitvegnut <- 1 # def = 1, options: 0,1
cfg$gms$s15_exo_pulses <- 1 # def = 1, options: 0,1
Expand Down
43 changes: 18 additions & 25 deletions modules/15_food/anthro_iso_jun22/exodietmacro.gms
Original file line number Diff line number Diff line change
Expand Up @@ -404,36 +404,37 @@ elseif s15_exo_diet = 3,
p15_intake_detail(t,iso,kfo)$(sum(EATtar_kfo15(EAT_mtargets15_2,kfo),
sum(EATtar_kfo15_2(EAT_mtargets15_2,kfo2), p15_intake_detail(t,iso,kfo2))) = 0) =
p15_intake_detail(t,iso,kfo) + 1e-6;
* FELI: Check whether this is still necessary when the targets are split

* To Do: transform i15_intake_detailed_scen_target and i15_intake_scen_target and p15_intake_detail
* to grams using

*' The single targets can also be set manually via switches
*' The single targets can be set manually via switches
*' (e.g., s15_exo_ruminant, s15_exo_fish, etc.).

*' upper bound for chicken and eggs
if (s15_exo_poultry = 1,
*' upper bound for monogastric products
if (s15_exo_monogastric = 1,
* upper bound for eggs
i15_intake_detailed_scen_target(t,iso,"livst_egg")$(p15_intake_detail(t,iso,"livst_egg")
> i15_rec_EATLancet(iso,"t_livst_egg","max")
) =
i15_rec_EATLancet(iso,"t_livst_egg","max");

* upper bound for chicken
i15_intake_detailed_scen_target(t,iso,"livst_chick")$(p15_intake_detail(t,iso,"livst_chick")
> i15_rec_EATLancet(iso,"t_livst_chick","max")
> i15_rec_EATLancet(iso,"t_livst_chick","max")
) =
i15_rec_EATLancet(iso,"t_livst_chick","max");
* upper bound for redmeat (share of pigs in redmeat)
i15_intake_detailed_scen_target(t,iso,"livst_pig")$(sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2))
> i15_rec_EATLancet(iso,"t_redmeat","max")
) =
i15_rec_EATLancet(iso,"t_livst_chick","max");
(p15_intake_detail(t,iso,"livst_pig") / sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2)))
* i15_rec_EATLancet(iso,"t_redmeat","max");
);

*' upper bound for redmeat and milk
if (s15_exo_redmeatdairy = 1,
*' upper bound for ruminant products
if (s15_exo_ruminant = 1,
* upper bound for redmeat (pig and ruminant)
i15_intake_detailed_scen_target(t,iso,EAT_redmeat15)$(sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2))
i15_intake_detailed_scen_target(t,iso,"livst_rum")$(sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2))
> i15_rec_EATLancet(iso,"t_redmeat","max")
) =
(p15_intake_detail(t,iso,EAT_redmeat15) / sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2)))
(p15_intake_detail(t,iso,"livst_rum") / sum(EAT_redmeat15_2, p15_intake_detail(t,iso,EAT_redmeat15_2)))
* i15_rec_EATLancet(iso,"t_redmeat","max");
* upper bound for milk
i15_intake_detailed_scen_target(t,iso,"livst_milk")$(p15_intake_detail(t,iso,"livst_milk")
Expand Down Expand Up @@ -574,6 +575,7 @@ elseif s15_exo_diet = 3,
*' There is no explicit target for brans in the EATLancet recommendations.
*' It is therefore set to 0.
*** BENNI: Why was this decided in the previous implementation? My approach would have been to keep it at the current level or including it as part of staples.
*** To Do: exclude from both old and new (as last step when approval for the rest of the implementation by Benni/Isabelle)
if (s15_exo_brans = 1,
i15_intake_detailed_scen_target(t,iso,"brans") = 0;
);
Expand All @@ -583,10 +585,6 @@ elseif s15_exo_diet = 3,
i15_intake_detailed_scen_target(t,iso,"scp") = 0;
);


* To Do: transform i15_intake_detailed_scen_target and i15_intake_scen_target and p15_intake_detail
* back to kcal using i15_protein_to_kcal_ratio

*** Balancing calorie requirements ***
*' After all calorie recommendations for non-staple food groups are satisfied,
*' intake of staple crops is now modified such that the
Expand All @@ -597,11 +595,8 @@ elseif s15_exo_diet = 3,
(i15_intake_scen_target(t,iso) - sum(EAT_nonstaples, i15_intake_detailed_scen_target(t,iso,EAT_nonstaples)))
* (p15_intake_detail(t,iso,EAT_staples) / sum(EAT_staples2, p15_intake_detail(t,iso,EAT_staples2)));

display i15_intake_detailed_scen_target;

**** FELI: Check whether it gets negative... And come up with solution for fixing this... (Maybe via positive declaration / setting everyting that's negative to 0?)
* BENNI: What if EATLancet leads to too much calories? Just allow higher values?
* JAN: Can a parameter be declared as positive? Or only variables?
if (i15_intake_detailed_scen_target(t,iso,EAT_staples) < 0, abort "The parameter i15_intake_detailed_scen_target became negative after calorie balancing.", i15_intake_detailed_scen_target(t,iso,EAT_staples););
* JAN: Is there if(any(x)) in GAMS? Or does this above check for each individual and therefore is a if any?

);
*** End of MAgPIE-specific realization of the EAT Lancet diet
Expand All @@ -616,8 +611,6 @@ display i15_intake_detailed_scen_target;
p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) = p15_bmi_shr_calibrated(t,iso,sex,age,bmi_group15) * (1-i15_exo_foodscen_fader(t,iso))
+ p15_bmi_shr_target(t,iso,sex,age,bmi_group15) * i15_exo_foodscen_fader(t,iso);

display p15_intake_detail;

);
*** End of special postprocessing food demand scenarios.

Expand Down

0 comments on commit 9195bcc

Please sign in to comment.