Skip to content

Commit

Permalink
clean up and better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
weindl committed Jul 19, 2023
1 parent 5546be9 commit cb65b5d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 18 deletions.
2 changes: 1 addition & 1 deletion modules/15_food/anthro_iso_jun22/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ parameters

* before shock
o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day)
pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day)
pm_kcal_pc_initial(t,i,kall) Per capita consumption in food demand model before price shock (kcal per capita per day)
p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day)

* after price shock
Expand Down
2 changes: 1 addition & 1 deletion modules/15_food/anthropometrics_jan18/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ parameters

* before shock
o15_kcal_regr_initial(t,iso,kfo) Uncalibrated per capita demand before price shock (kcal per capita per day)
pm_kcal_pc_initial(t,i,kfo) Per capita consumption in food demand model before price shock (kcal per capita per day)
pm_kcal_pc_initial(t,i,kall) Per capita consumption in food demand model before price shock (kcal per capita per day)
p15_kcal_pc_initial_iso(t,iso,kfo) Per capita consumption in food demand model before price shock on country level (kcal per capita per day)

* after price shock
Expand Down
9 changes: 0 additions & 9 deletions modules/16_demand/sector_may15/sets.gms
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ sets
kli_rd(kap) Ruminant meat and dairy products
/ livst_rum,livst_milk /

kap_to_kfo_ap(kap,kfo_ap) Mapping between animal products and animal food products
/livst_rum . livst_rum
livst_pig . livst_pig
livst_chick . livst_chick
livst_egg . livst_egg
livst_milk . livst_milk
fish . fish
/

kforestry(k) forestry products
/ wood, woodfuel /

Expand Down
1 change: 1 addition & 0 deletions modules/70_livestock/fbask_jan16/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ parameters
im_feed_baskets(t_all,i,kap,kall) Feed baskets in tDM per tDM livestock product (1)
p70_cattle_stock_proxy(t,i) Proxy for cattle stocks needed to fullfil food demand for ruminant meat (mio. animals per yr)
p70_milk_cow_proxy(t,i) Proxy for milk cows needed to fullfil food demand for milk (mio. animals per yr)
p70_cattle_feed_pc_proxy(t,i,kli_rd) Proxy for daily per capita feed demand for pasture biomass driven by demand for beef and dairy products (tDM per capita per day)
p70_incr_cattle(t,i) Change in estimated cattle stocks attributed to food demand projections (1)
pm_past_mngmnt_factor(t,i) Regional pasture management intensification factor (1)
i70_cereal_scp_fadeout(t_all,i) Cereal feed fadeout (share 0-1) to be replaced by SCP (1)
Expand Down
15 changes: 8 additions & 7 deletions modules/70_livestock/fbask_jan16/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,20 @@ p70_milk_cow_proxy(t,i) = im_pop(t,i)*pm_kcal_pc_initial(t,i,"livst_milk")
p70_cattle_stock_proxy(t,i)$(p70_cattle_stock_proxy(t,i) < 0.2*p70_cattle_stock_proxy("y1995",i)) = 0.2*p70_cattle_stock_proxy("y1995",i);
p70_milk_cow_proxy(t,i)$(p70_milk_cow_proxy(t,i) < 0.2*p70_milk_cow_proxy("y1995",i)) = 0.2*p70_milk_cow_proxy("y1995",i);

*' The parameter `p70_cattle_feed_pc_proxy` is a proxy for regional daily per capita
*' feed demand for pasture biomass driven by demand for beef and dairy products,
*' which is later used for weighted aggregation.
p70_cattle_feed_pc_proxy(t,i,kli_rd) = pm_kcal_pc_initial(t,i,kli_rd)*im_feed_baskets(t,i,kli_rd,"pasture")/(fm_nutrition_attributes(t,kli_rd,"kcal") * 10**6);

*' The parameter `p70_incr_cattle` describes the changes in the number of cattle
*' relative to the previous time step:

p70_incr_cattle(t,i) = 1$(ord(t)=1)
+ (
( ( pm_kcal_pc_initial(t,i,"livst_rum")*im_feed_baskets(t,i,"livst_rum","pasture")/fm_nutrition_attributes(t,"livst_rum","kcal") )
/ sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) )
* (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i))
+
( ( pm_kcal_pc_initial(t,i,"livst_milk")*im_feed_baskets(t,i,"livst_milk","pasture")/fm_nutrition_attributes(t,"livst_milk","kcal") )
/ sum(kli_rd, sum(kap_to_kfo_ap(kli_rd,kfo_ap),pm_kcal_pc_initial(t,i,kfo_ap))*im_feed_baskets(t,i,kli_rd,"pasture")/fm_nutrition_attributes(t,kli_rd,"kcal") ) )
*(p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i))
( p70_cattle_feed_pc_proxy(t,i,"livst_rum") * (p70_cattle_stock_proxy(t,i)/p70_cattle_stock_proxy(t-1,i))
+
p70_cattle_feed_pc_proxy(t,i,"livst_milk") * (p70_milk_cow_proxy(t,i)/p70_milk_cow_proxy(t-1,i)) )
/ sum(kli_rd, p70_cattle_feed_pc_proxy(t,i,kli_rd) )
)$(ord(t)>1);

*' The pasture management factor is calculated by applying a linear relationship
Expand Down

0 comments on commit cb65b5d

Please sign in to comment.