From 400eb2d02946b0fb37c25bb95542d9b6de123cb4 Mon Sep 17 00:00:00 2001 From: Felicitas Date: Thu, 18 Jan 2024 13:07:26 +0100 Subject: [PATCH] abort statement if intake_detail_scen_target is negative --- modules/15_food/anthro_iso_jun22/exodietmacro.gms | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/15_food/anthro_iso_jun22/exodietmacro.gms b/modules/15_food/anthro_iso_jun22/exodietmacro.gms index 2ed0b672bf..d2b6437ec3 100644 --- a/modules/15_food/anthro_iso_jun22/exodietmacro.gms +++ b/modules/15_food/anthro_iso_jun22/exodietmacro.gms @@ -595,8 +595,10 @@ 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))); - 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? + if (smin((iso,EAT_staples), i15_intake_detailed_scen_target(t,iso,EAT_staples)) < 0, + abort "The parameter i15_intake_detailed_scen_target became negative after calorie balancing."; + ); + ); *** End of MAgPIE-specific realization of the EAT Lancet diet