Skip to content

Commit bd76178

Browse files
committed
clean up of new past implementation
1 parent 95c1868 commit bd76178

File tree

6 files changed

+13
-78
lines changed

6 files changed

+13
-78
lines changed

modules/31_past/grasslands_apr22/declarations.gms

+2-22
Original file line numberDiff line numberDiff line change
@@ -32,30 +32,10 @@ i31_grassl_areas(t_all,j) Celullar grassland areas
3232
i31_lambda_grass(t,i,grassland) Grassland Scaling factor for non-linear management calibration (1)
3333
i31_grassl_yld_hist_reg(t,i,grassland) Grassland FAO yields per region at the historical referende year (tDM per ha)
3434
i31_grass_hist_yld(t_all,i, grassland) FAO gassland yields (tDM per ha)
35-
p31_pastr_suit_sf(j) Pasture suitability scaling factor (1)
35+
p31_pastr_suit_sf(j) Pasture suitability scaling factor (1)
36+
pc31_scaled_expansion_cost(t,j) Adjusted expansion costs to avoid unrealistic exchange between pastr and range in the first time step (USD05MER per ha)
3637
;
3738

38-
*new parameters for grassland expansion cost (test)
39-
40-
parameters
41-
p31_abs_discrepancy(j) Absolute discrepancy between actual and modeled grassland areas
42-
p31_total_discrepancy Sum of absolute discrepancies for normalization purposes
43-
p31_cost_adj_index(j) Cost adjustment index based on relative discrepancy between actual and modeled pasture areas
44-
pc31_scaled_expansion_cost(t,j) Dynamically adjusted expansion costs based on discrepancy index until 2010, then constant
45-
p31_abs_discrepancy_log(t,j) Absolute discrepancy between actual and modeled grassland areas log
46-
p31_total_discrepancy_log(t) Sum of absolute discrepancies for normalization purposes log
47-
pc31_scaled_expansion_cost_log(t,j) Dynamically adjusted expansion costs based on discrepancy index until 2010, then constant log
48-
;
49-
50-
$ontext
51-
parameters
52-
p31_abs_discrepancy(t,i) Absolute discrepancy between actual and modeled grassland areas
53-
pc31_scaled_expansion_cost(t,i) Dynamically adjusted expansion costs based on discrepancy index until 2010, then constant
54-
p31_abs_discrepancy_log(t,i) Absolute discrepancy between actual and modeled grassland areas log
55-
p31_total_discrepancy_log(t) Sum of absolute discrepancies for normalization purposes log
56-
pc31_scaled_expansion_cost_log(t,i) Dynamically adjusted expansion costs based on discrepancy index until 2010, then constant log
57-
;
58-
$offtext
5939
*#################### R SECTION START (OUTPUT DECLARATIONS) ####################
6040
parameters
6141
ov31_grass_area(t,j,grassland,type) Grassland areas (mio. ha)

modules/31_past/grasslands_apr22/equations.gms

-4
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ q31_pasture_areas(j2)..
2727
*' a cost is associated with the expansion of rangelands and managed pastures 'v31_cost_grass_expansion'
2828
*' in comparison with areas in the previous time step 'pc31_grass'.
2929

30-
*q31_expansion_cost(j2,grassland) ..
31-
* v31_cost_grass_expansion(j2, grassland) =g=
32-
* (v31_grass_area(j2, grassland) - pc31_grass(j2,grassland)) * s31_cost_expansion;
33-
3430
q31_expansion_cost(j2,grassland) ..
3531
v31_cost_grass_expansion(j2, grassland) =g=
3632
(v31_grass_area(j2, grassland) - pc31_grass(j2,grassland)) * sum(ct, pc31_scaled_expansion_cost(ct,j2));

modules/31_past/grasslands_apr22/input.gms

-9
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ i31_manpast_suit(t_all,j) = f31_pastr_suitability(t_all,j)
2828
$if "%c31_grassl_yld_scenario%" == "nocc" i31_manpast_suit(t_all,j) = f31_pastr_suitability("y1995",j);
2929
$if "%c31_grassl_yld_scenario%" == "nocc_hist" i31_manpast_suit(t_all,j)$(m_year(t_all) > sm_fix_cc) = i31_manpast_suit(t_all,j)$(m_year(t_all) = sm_fix_cc);
3030

31-
3231
scalar s31_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 /;
3332

34-
3533
table f31_grassl_yld(t_all,j,grassland,w) LPJmL potential yields per cell (rainfed only) (tDM per ha)
3634
$ondelim
3735
$include "./modules/31_past/input/f31_grassl_yld.cs3"
@@ -50,10 +48,3 @@ table f31_LUH2v2(t_all,j, f31_luh) LUH2v2 land classes separating rangelands fro
5048
$ondelim
5149
$include "./modules/31_past/input/f31_LUH2v2.cs3"
5250
$offdelim;
53-
54-
55-
table f31_land(t_all, j, land31) Land area for different land pools at cluster level (mio. ha)
56-
$ondelim
57-
$include "./modules/31_past/input/avl_land_full_t.cs3"
58-
$offdelim
59-
;

modules/31_past/grasslands_apr22/postsolve.gms

-30
Original file line numberDiff line numberDiff line change
@@ -8,36 +8,6 @@
88
*** Land Patterns are transferred to next timestep
99
pc31_grass(j,grassland) = v31_grass_area.l(j,grassland);
1010

11-
12-
if(ord(t)<=card(t_past),
13-
* Calculation of absolute discrepancy and total discrepancy for normalization
14-
p31_abs_discrepancy(j) = f31_land(t,j,"past") - v31_grass_area.l(j,"pastr");
15-
p31_total_discrepancy = sum(j, p31_abs_discrepancy(j));
16-
p31_total_discrepancy$(p31_total_discrepancy = 0) = 1e-6;
17-
p31_cost_adj_index(j) = (p31_abs_discrepancy(j) / p31_total_discrepancy);
18-
pc31_scaled_expansion_cost(t,j) = s31_cost_expansion * ((1 + p31_cost_adj_index(j)) * 1000);
19-
);
20-
* Beyond 2010, carrying forward the last historical year adjusted costs
21-
p31_abs_discrepancy_log(t,j) = p31_abs_discrepancy(j);
22-
p31_total_discrepancy_log(t) = p31_total_discrepancy;
23-
pc31_scaled_expansion_cost_log(t,j) = pc31_scaled_expansion_cost(t,j);
24-
25-
26-
$ontext
27-
if(ord(t)<=card(t_past),
28-
* Calculation of absolute discrepancy and total discrepancy for normalization
29-
p31_abs_discrepancy(t,i) = sum(cell(i,j), f31_land(t,j,"past") - v31_grass_area.l(j,"pastr"));
30-
pc31_scaled_expansion_cost(t,i) = s31_cost_expansion - p31_abs_discrepancy(t,i) * 10;
31-
elseif(ord(t)>card(t_past)),
32-
pc31_scaled_expansion_cost(t,i) = pc31_scaled_expansion_cost(t-1,i)
33-
);
34-
pc31_scaled_expansion_cost(t,i)$(pc31_scaled_expansion_cost(t,i) < 0) = 0;
35-
36-
* Beyond 2010, carrying forward the last historical year adjusted costs
37-
p31_abs_discrepancy_log(t,i) = p31_abs_discrepancy(t,i);
38-
pc31_scaled_expansion_cost_log(t,i) = pc31_scaled_expansion_cost(t,i);
39-
$offtext
40-
4111
*#################### R SECTION START (OUTPUT DEFINITIONS) #####################
4212
ov31_grass_area(t,j,grassland,"marginal") = v31_grass_area.m(j,grassland);
4313
ov31_cost_grass_expansion(t,j,grassland,"marginal") = v31_cost_grass_expansion.m(j,grassland);

modules/31_past/grasslands_apr22/preloop.gms

+10-5
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@
77

88

99
pc31_grass(j,grassland) = f31_LUH2v2("y1995",j,grassland);
10-
*pc31_scaled_expansion_cost(t,j) = s31_cost_expansion;
1110
pc31_scaled_expansion_cost(t,j) = 0;
1211
pc31_scaled_expansion_cost("y1995",j) = 1000;
1312

14-
* calibrating pasture suitability
15-
i31_manpast_suit(t_all,j)$(i31_manpast_suit(t_all,j) = 0) = f31_land("y1995",j,"past");
16-
p31_pastr_suit_sf(j) = (f31_land("y1995",j,"past") / i31_manpast_suit("y1995",j))$(i31_manpast_suit("y1995",j) <> 0);
13+
* This next part calibrates pasture suitability for managed pastures ("pastr") across various
14+
* regions and time periods. It initializes the suitability for regions with no previous data using 1995
15+
* baseline values from the LUH2v2 dataset. A scaling factor, calculated only where there is existing
16+
* data to avoid division by zero, adjusts pasture suitability based on the ratio of estimated pastures to
17+
* manually adjusted pastures from 1995. This factor is then applied to update suitability for all
18+
* regions and periods. Historical data is directly assigned from LUH2v2 for past periods.
19+
20+
i31_manpast_suit(t_all,j)$(i31_manpast_suit(t_all,j) = 0) = f31_LUH2v2("y1995",j,"pastr");
21+
p31_pastr_suit_sf(j) = (f31_LUH2v2("y1995",j,"pastr") / i31_manpast_suit("y1995",j))$(i31_manpast_suit("y1995",j) <> 0);
1722
i31_manpast_suit(t_all,j) = i31_manpast_suit(t_all,j) * p31_pastr_suit_sf(j);
18-
i31_manpast_suit(t_past,j) = f31_land(t_past,j,"past");
23+
i31_manpast_suit(t_past,j) = f31_LUH2v2(t_past,j,"pastr");
1924

2025
***YIELD CORRECTION ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT***
2126

modules/31_past/grasslands_apr22/sets.gms

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ sets
1313
grassland(f31_luh) Grassland cover types (pastr = managed pastures and range = rangelands)
1414
/ pastr, range /
1515

16-
grass_to31(grassland) pasture management options
17-
/ pastr,range /
18-
19-
grass_from31(grassland) pasture management options
20-
/ pastr,range /
21-
2216
land31 land use types landinitialization
23-
/ crop,past,range,primforest,secdforest,forestry,urban,primother,secdother /
24-
17+
/ crop,past,range,primforest,secdforest,forestry,urban,primother,secdother /
2518
;

0 commit comments

Comments
 (0)