Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

55_awms, 59_som, 71_disagg_lvst docu update #21

Merged
merged 5 commits into from
Oct 2, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions modules/55_awms/ipcc2006_aug16/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

*' @equations

*' Manure is esimtated based on feed intake minus the NPK incorporated
*' Manure is estimated based on feed intake minus the NPK incorporated
*' in the biomass of the slaughtered animal.
*' We distinguish 4 general animal waste management systems based on
*' what animals eat and where their manure remains. For simplification,
*' we assume that pastures receive the manure of grazed biomass,
*' while croplands receive the manure of cropbased feed. In reality,
*' while croplands receive the manure of crop based feed. In reality,
*' manure from grazing may be also excreted in stables and vice versa.
*' Problematic may be in particular that grass can also be harvested and
*' fed to animals in stables, and manure from confinements may be applied
Expand All @@ -28,7 +28,7 @@
+ sum(kap,vm_dem_feed(i2,kli,kap) * fm_attributes(npk,kap))
+ sum(ksd,vm_dem_feed(i2,kli,ksd) * fm_attributes(npk,ksd))
+ sum(kres,vm_dem_feed(i2,kli,kres) * fm_attributes(npk,kres)
*(1-sum(ct,im_development_state(ct,i2))*0.25))
*(1-(1-sum(ct,im_development_state(ct,i2))))*0.25)
;

*' b) grazing animals on pastures where the manure stays on pastures
Expand All @@ -38,6 +38,7 @@
(vm_dem_feed(i2,kli,"pasture")) * fm_attributes(npk,"pasture")
*(1-ic55_manure_fuel_shr(i2,kli))
;

*' c) grazing animals on pastures where the manure is collected as household fuel

q55_bal_intake_fuel(i2,kli,npk) ..
Expand All @@ -54,8 +55,13 @@
*(1 - sum(ct,im_development_state(ct,i2)))*0.25)
;

*' The Manure is estimated by substracting from feed a certain share which is
*' incorporated into animal biomass. This share depends on the producivitiy of
*' Please note that the share of residues fed via stubble grazing depends
*' on the development state and has to be subtracted from the residues fed to confined animals.
*' We assume that in developing regions 25% of residues are grazed by animals on stubble fields,
*' whereas stubble grazing is assumed to not occur in developed regions.

*' The manure is estimated by subtracting from feed a certain share which is
*' incorporated into animal biomass. This share depends on the productivity of
*' the animal and is calculated in the preprocessing, also for computational
*' reasons.

Expand Down
12 changes: 6 additions & 6 deletions modules/59_som/cellpool_aug16/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ q59_som_target_noncropland(j2) ..
*' Depending on the setting of `c59_som_scenario `climate impacts (`cc`) are taken into account or not (`nocc`).
*' For a static climate `f59_topsoilc_density` is set to the value of 1995 within the input of the module realization.

*' To account for the transfer of carbon rich soils from natural vegetation to cropland respectively the other way around,
*' the cropland expansion and reduction of each cell is calculated via
*' To account for the transfer of carbon rich soils from natural vegetation to cropland as well as the transfer of
*' depleted soils from cropland to regrowing natural land, the cropland expansion and reduction of each cell is calculated via

q59_crop_diff(j2) ..

Expand All @@ -44,7 +44,7 @@ q59_crop_diff_constraint(i2) ..
*' ensures that no extra cropland reduction and expansion at the same time is happening. Note that this nonlinear realization
*' needs two to three times longer runtime and is thus by default not switch on.

*' The actually carbon transfer from respectively to cropland soils is then given by
*' The actually carbon transfer from cropland as well as to cropland soils is then given by

q59_som_transfer_to_cropland(j2) ..
v59_som_transfer_to_cropland(j2)
Expand All @@ -53,8 +53,8 @@ q59_som_transfer_to_cropland(j2) ..
- v59_crop_reduction(j2) * p59_carbon_density(ct,j2,"cropland"))
;

*' To get the current size of the soil organic carbon pool the pool of the previous timestep corrected by the carbon transfer
*' is developing into the direction of the above calculate target values taken the timestep depending lossrate into account by
*' To get the current size of the soil organic carbon pool, the pool of the previous timestep corrected by the carbon transfer
*' is developing into the direction of the above calculated target values taken the timestep depending lossrate into account by

q59_som_pool_cropland(j2) ..
v59_som_pool(j2,"cropland")
Expand All @@ -64,7 +64,7 @@ q59_som_pool_cropland(j2) ..
+ (p59_som_pool(j2,"cropland") + v59_som_transfer_to_cropland(j2))
;

*' respectively
*' and

q59_som_pool_noncropland(j2) ..
v59_som_pool(j2,"noncropland")
Expand Down
3 changes: 1 addition & 2 deletions modules/59_som/cellpool_aug16/input.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@
*** | Contact: magpie@pik-potsdam.de

scalars
s59_punish_cropdiff Punishment costs per croparea squared (USD05 per (mio. ha)^2) / 10000 /
s59_punish_cropdiff Punishment costs per croparea squared (USD05MER per mio. per ha^2) / 10000 /
;


table f59_cratio_landuse(climate59,kcr) Ratio of soil carbon relative to potential natural vegetation soil carbon for different landuse (1)
$ondelim
$include "./modules/59_som/cellpool_aug16/input/f59_ch5_F_LU.csv"
Expand Down
36 changes: 23 additions & 13 deletions modules/71_disagg_lvst/foragebased_aug18/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*' @equations

*' Ruminant livestock production within a cell is determined by the production of the non-transportable
*' feed items grazed pasture and fodder. They have be larger than the ruminant feed requirements
*' ensured by the following equation containing a split of pasture and fodder fed ruminants
*' feed items: grazed pasture and fodder crops. They have to be larger than the ruminant feed requirements,
*' that are given by the product of ruminant production and the respective feed baskets:

q71_feed_rum_liv(j2,kforage) ..
vm_prod(j2,kforage) =g=
Expand All @@ -17,31 +17,41 @@ q71_feed_rum_liv(j2,kforage) ..
* (1 + v71_feed_balanceflow(j2,kli_rum,kforage)$(s71_lp_fix=0))
+ v71_feed_balanceflow(j2,kli_rum,kforage)$(s71_lp_fix=1))
;


*' The above equation contains a split of pasture and fodder fed ruminants, since we assume that depending
*' on the intensity level of the livestock production, ruminants will graze on pastures (extensive systems)
*' or will be fed via harvested fodder crops (intensive systems).
*' Please note that `s71_lp_fix` is set to zero (for more information please look into the source code).

*' The balance flow for pasture and fodder (summarized with forage) production, that leads to a distortion
*' of the relationship between the livestock and feed production, is incorporated for a linear and non-linear
*' realization of this module.
*' The balance flow for pasture and fodder (summarized with forage) production, accounts as in
*' [70_livestock] `q70_feed(i2,kap,kall)` for inconsistencies with the FAO inventory of national feed use.

*' If module is fixed to linear behaviour the balance flow is allowed to be used in any cell
*' containing pasture respectively cropland area in the previous time step ensured by the restrictions
*' in the nl_fix statement. The balanceflow within a region is than determined by
*' @stop

* If module is fixed to linear behaviour the balance flow is allowed to be used in any cell
* containing pasture or cropland area in the previous time step ensured by the restrictions
* in the nl_fix statement. The balance flow within a region is then determined by

q71_balanceflow_constraint_lp(i2,kli_rum,kforage)$(s71_lp_fix=1) ..
sum(ct, fm_feed_balanceflow(ct,i2,kli_rum,kforage)) =e=
sum(cell(i2,j2), v71_feed_balanceflow(j2,kli_rum,kforage))
;

* Note that for fixation to linear behaviour `q71_balanceflow_constraint_lp` replaces `q71_balanceflow_constraint_nlp`.

*' In the non linear version the balanceflow in each cluster is constraint by its share of
*' livestock production regarding the regional level by
*' @equations

*' In each cluster the balance flow is constrained by its share of livestock production regarding the regional level by

q71_balanceflow_constraint_nlp(j2,kli_rum,kforage)$(s71_lp_fix=0) ..
v71_feed_balanceflow(j2,kli_rum,kforage) =e=
sum((ct,cell(i2,j2)),fm_feed_balanceflow(ct,i2,kli_rum,kforage)
* 1/(im_feed_baskets(ct,i2,kli_rum,kforage)*vm_prod_reg(i2,kli_rum) + 10**(-6)))
/(im_feed_baskets(ct,i2,kli_rum,kforage)*vm_prod_reg(i2,kli_rum) + 10**(-6)))
;

*' Note that $10^(-6)$ is required to avoid division by zero.
*' The regional ruminant production is than given by
*' Note that $10^{-6}$ is required to avoid division by zero.
*' The regional ruminant production is then given by

q71_sum_rum_liv(j2,kli_rum) ..
vm_prod(j2,kli_rum) =e= sum(kforage,v71_prod_rum(j2,kli_rum,kforage))
Expand Down