From 4130f03af4ccaec00e41626601f49b83b4dd2887 Mon Sep 17 00:00:00 2001 From: mppalves Date: Thu, 20 Jun 2024 00:04:45 +0200 Subject: [PATCH] fixed grassland implementation --- CHANGELOG.md | 7 +++++-- config/default.cfg | 13 +++++++++--- .../31_past/grasslands_apr22/declarations.gms | 3 ++- .../31_past/grasslands_apr22/equations.gms | 4 ++-- modules/31_past/grasslands_apr22/input.gms | 20 ++++++++----------- modules/31_past/grasslands_apr22/preloop.gms | 8 ++++++++ modules/31_past/grasslands_apr22/presolve.gms | 4 ++-- modules/31_past/grasslands_apr22/sets.gms | 7 ------- modules/31_past/input/files | 3 ++- 9 files changed, 39 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aeb59f1998..e2ca6aa978 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,11 +15,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **default.cfg** update additional data to rev4.51 - **scripts** adjusted SLURM job handling - **scripts** updated EL2p0 start scripts +- **grassland_apr22** Update in module description +- **grassland_apr22** grassland expansion cost only apply to the first time step ### added - **42_water_demand** added non-agricultural water demand for entire year - **29_cropland** new module `29_cropland` accounting for crop area, fallow cropland and tree cover on cropland with two realizations: `detail_apr24` and `simple_apr24` (default). - **10_land** added interface `pm_land_hist` with historic land use patterns +- **grassland_apr22** Added a calibration step for managed pasture areas to the preloop file ### removed - **32_forestry** removed technical balance term `v32_land_missing_ndc` @@ -150,7 +153,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### changed - **15_food** Added improved EAT Lancet diet implementation (EAT 2p0) - **21_trade** s21_trade_bal_damper for roundwood changed from 0.75 to 0.65 -- **31_past** in grasslands_apr22 realization: changed structure of f31_pastr_suitability to align with ssp-rcp specific input data formulation. Changed input filename from cs3 to cs2. Added `cc`, `nocc` and `nocc_hist` options for `i31_manpast_suit` and changed input gams code from table to parameter. Climate scenario assignment moved from preloop.gms to input.gms. Removed pastSuit set in sets.gms as not needed anymore. Adjusted not_used.txt in both grasslands_apr22 and static realizations. +- **31_past** in grasslands_apr22 realization: changed structure of f31_max_managed_pasture to align with ssp-rcp specific input data formulation. Changed input filename from cs3 to cs2. Added `cc`, `nocc` and `nocc_hist` options for `i31_manpast_suit` and changed input gams code from table to parameter. Climate scenario assignment moved from preloop.gms to input.gms. Removed pastSuit set in sets.gms as not needed anymore. Adjusted not_used.txt in both grasslands_apr22 and static realizations. - **default.cfg and scenario_config.csv** Default for cfg$gms$c56_emis_policy changed from `redd+natveg_nosoil` to `reddnatveg_nosoil`,i.e. timber plantations are excluded from carbon pricing by default - **default.cfg** changed default for `cfg$gms$s32_aff_prot` from 0 to 1 - **default.cfg** changed default for `cfg$gms$s56_buffer_aff` from 0.2 to 0.5 @@ -559,7 +562,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **config** added cfg$gms$s70_past_mngmnt_factor_fix with default 2005 (previous default was 2010). The previous setting caused a strong spike in CO2 emissions from pasture expansion in SSA. With 2005, this can be avoided. - **inputs** New input files added: f13_pastr_tau_hist.csv -> historical tau for managed pastures. - f31_pastr_suitability.cs3 -> Managed pasture suitability + f31_max_managed_pasture.cs3 -> Managed pasture suitability f31_LUH2v2.cs3 -> LUH2v2 land classes separating rangelands from managed pastures f31_grassl_yld.cs3 -> Rangelands and managed pastures grass yields f31_grass_bio_hist.cs3 -> Historical grass biomass demand diff --git a/config/default.cfg b/config/default.cfg index d01a222b1b..c3fa1b4210 100644 --- a/config/default.cfg +++ b/config/default.cfg @@ -22,9 +22,9 @@ cfg$model <- "main.gms" #def = "main.gms" #### input settings #### # which input data sets should be used? -cfg$input <- c(regional = "rev4.109_h12_magpie.tgz", - cellular = "rev4.109_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", - validation = "rev4.109_h12_validation.tgz", +cfg$input <- c(regional = "rev4.110_h12_magpie.tgz", + cellular = "rev4.110_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz", + validation = "rev4.110_h12_validation.tgz", additional = "additional_data_rev4.51.tgz", calibration = "calibration_H12_26Mar24.tgz") @@ -878,6 +878,13 @@ cfg$gms$c31_grassl_yld_scenario <- "cc" # def = "cc" # * 0 (pure relative calibration) cfg$gms$s31_limit_calib <- 1 # def = 1 +# * Cost associated with pasture expansion (USD05MER per ha) +cfg$gms$s31_expansion_cost <- 1000 # def = 1000 + +# * Cost associated with grassland feed production (USD05MER per tDM) +cfg$gms$s31_cost_grass_prod <- 1 # def = 1 + + # ***--------------------- 32_forestry ----------------------------------- # * (dynamic_may24): Dynamic forestry sector including afforestation with detailed age-classes cfg$gms$forestry <- "dynamic_may24" # def = dynamic_may24 diff --git a/modules/31_past/grasslands_apr22/declarations.gms b/modules/31_past/grasslands_apr22/declarations.gms index fa3568dee3..7bdea0e360 100644 --- a/modules/31_past/grasslands_apr22/declarations.gms +++ b/modules/31_past/grasslands_apr22/declarations.gms @@ -23,7 +23,7 @@ vm_cost_prod_past(i) Costs for putting animal ; parameters -i31_manpast_suit(t_all,j) Areas suitable for managed pastures (mio. ha) +i31_max_managed_pasture(t_all,j) Areas suitable for managed pastures (mio. ha) pc31_grass(j,grassland) Grassland areas in previous time step (mio. ha) i31_grass_calib(t_all,j,grassland) Regional grassland calibration factor correcting for FAO yield levels (1) i31_grass_modeled_yld(t_all,i,grassland) Biophysical input yields average over region and grassland cover type at the historical reference year (tDM per ha) @@ -32,6 +32,7 @@ i31_grassl_areas(t_all,j) Celullar grassland areas i31_lambda_grass(t,i,grassland) Grassland Scaling factor for non-linear management calibration (1) i31_grassl_yld_hist_reg(t,i,grassland) Grassland FAO yields per region at the historical referende year (tDM per ha) i31_grass_hist_yld(t_all,i, grassland) FAO gassland yields (tDM per ha) +p31_grasslands_expansion_cost(t,j) Adjusted expansion costs to avoid unrealistic exchange between pastr and range in the first time step (USD05MER per ha) ; *#################### R SECTION START (OUTPUT DECLARATIONS) #################### diff --git a/modules/31_past/grasslands_apr22/equations.gms b/modules/31_past/grasslands_apr22/equations.gms index b80ad66e98..ba920e2250 100644 --- a/modules/31_past/grasslands_apr22/equations.gms +++ b/modules/31_past/grasslands_apr22/equations.gms @@ -28,8 +28,8 @@ q31_pasture_areas(j2).. *' in comparison with areas in the previous time step 'pc31_grass'. q31_expansion_cost(j2,grassland) .. - v31_cost_grass_expansion(j2, grassland) =g= - (v31_grass_area(j2, grassland) - pc31_grass(j2,grassland)) * s31_cost_expansion; + v31_cost_grass_expansion(j2, grassland) =g= + (v31_grass_area(j2, grassland) - pc31_grass(j2,grassland)) * sum(ct, p31_grasslands_expansion_cost(ct,j2)); *' Cost of production account for the cost of moving animals to grassland areas plus the costs of *' expanding aras of production. diff --git a/modules/31_past/grasslands_apr22/input.gms b/modules/31_past/grasslands_apr22/input.gms index e0b33a5632..7afcbeb3b4 100644 --- a/modules/31_past/grasslands_apr22/input.gms +++ b/modules/31_past/grasslands_apr22/input.gms @@ -7,31 +7,30 @@ scalars - s31_cost_expansion Grasslands expansion costs (USD05MER per hectare) / 1 / - s31_cost_grass_prod Grasslands factor costs (USD05MER per tDM) / 1 / + s31_expansion_cost Grasslands expansion costs (USD05MER per hectare) / 1000 / + s31_cost_grass_prod Grasslands production costs (USD05MER per tDM) / 1 / ; + $setglobal c31_grassl_yld_scenario cc * options: cc (climate change) * nocc (no climate change) * nocc_hist (no climate change after year defined by sm_fix_cc) -parameter f31_pastr_suitability(t_all,j) Areas suitable for pasture management (mio. ha) +parameter f31_max_managed_pasture(t_all,j) Areas suitable for pasture management (mio. ha) / $ondelim -$include "./modules/31_past/input/f31_pastr_suitability.cs2" +$include "./modules/31_past/input/f31_max_managed_pasture.cs2" $offdelim /; -i31_manpast_suit(t_all,j) = f31_pastr_suitability(t_all,j) +i31_max_managed_pasture(t_all,j) = f31_max_managed_pasture(t_all,j) * set values to 1995 if nocc scenario is used, or to sm_fix_cc after sm_fix_cc if nocc_hist is used -$if "%c31_grassl_yld_scenario%" == "nocc" i31_manpast_suit(t_all,j) = f31_pastr_suitability("y1995",j); -$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); - +$if "%c31_grassl_yld_scenario%" == "nocc" i31_max_managed_pasture(t_all,j) = f31_max_managed_pasture("y1995",j); +$if "%c31_grassl_yld_scenario%" == "nocc_hist" i31_max_managed_pasture(t_all,j)$(m_year(t_all) > sm_fix_cc) = i31_max_managed_pasture(t_all,j)$(m_year(t_all) = sm_fix_cc); scalar s31_limit_calib Relative managament calibration switch (1=limited 0=pure relative) / 1 /; - table f31_grassl_yld(t_all,j,grassland,w) LPJmL potential yields per cell (rainfed only) (tDM per ha) $ondelim $include "./modules/31_past/input/f31_grassl_yld.cs3" @@ -41,14 +40,11 @@ $offdelim $if "%c31_grassl_yld_scenario%" == "nocc" f31_grassl_yld(t_all,j,grassland,w) = f31_grassl_yld("y1995",j,grassland,w); $if "%c31_grassl_yld_scenario%" == "nocc_hist" f31_grassl_yld(t_all,j,grassland,w)$(m_year(t_all) > sm_fix_cc) = f31_grassl_yld(t_all,j,grassland,w)$(m_year(t_all) = sm_fix_cc); - table f31_grass_bio(t_all,i, grassland) Estimated regional grass biomass consumption in the past (tDM) $ondelim $include "./modules/31_past/input/f31_grass_bio_hist.cs3" $offdelim; - - table f31_LUH2v2(t_all,j, f31_luh) LUH2v2 land classes separating rangelands from managed pastures $ondelim $include "./modules/31_past/input/f31_LUH2v2.cs3" diff --git a/modules/31_past/grasslands_apr22/preloop.gms b/modules/31_past/grasslands_apr22/preloop.gms index 4b32591636..88e683626c 100644 --- a/modules/31_past/grasslands_apr22/preloop.gms +++ b/modules/31_past/grasslands_apr22/preloop.gms @@ -7,7 +7,14 @@ pc31_grass(j,grassland) = f31_LUH2v2("y1995",j,grassland); +p31_grasslands_expansion_cost(t,j) = 0; +p31_grasslands_expansion_cost("y1995",j) = s31_expansion_cost; +* This next part calculates max managed pastures areas ("i31_max_managed_pasture") based on expected changes in +* aritidy and population density calculated in "f31_max_managed_pasture". + +f31_max_managed_pasture(t_all,j)$(f31_max_managed_pasture(t_all,j) = 0) = f31_LUH2v2("y1995",j,"pastr"); +i31_max_managed_pasture(t_all,j) = f31_LUH2v2("y1995",j,"pastr") * ((f31_max_managed_pasture(t_all,j)/f31_max_managed_pasture("y1995",j))$(f31_max_managed_pasture("y1995",j) <> 0)); ***YIELD CORRECTION ACCOUNTING FOR REGIONAL DIFFERENCES IN MANAGEMENT*** @@ -91,5 +98,6 @@ i31_grass_calib(t,j,grassland) = i31_grass_yields(t,j,"range") = i31_grass_yields(t,j,"range") * i31_grass_calib(t,j,"range"); i31_grass_yields(t,j,"pastr") = i31_grass_yields(t,j,"pastr") * i31_grass_calib(t,j,"pastr"); +*i31_grass_yields(t,j,"pastr") = max(i31_grass_yields(t,j,"pastr"), (i31_grass_yields(t,j,"range") + 0.1)); *' Note that the calculation is split into two parts for better readability. *' @stop diff --git a/modules/31_past/grasslands_apr22/presolve.gms b/modules/31_past/grasslands_apr22/presolve.gms index 3f5ef77c20..85e7c43adf 100644 --- a/modules/31_past/grasslands_apr22/presolve.gms +++ b/modules/31_past/grasslands_apr22/presolve.gms @@ -8,11 +8,11 @@ *' @code *' Socioeconomic and environmental conditions determine the potential managed pastures -*' areas ('i31_manpast_suit'). 'i31_manpast_suit' is estimated by determining areas +*' areas ('i31_max_managed_pasture'). 'i31_max_managed_pasture' is estimated by determining areas *' with more than five inhabitants per km2 and with aridity greater than 0.5 following *' the methodology established by @KleinGoldewijk.2017 -v31_grass_area.up(j,"pastr") = i31_manpast_suit(t,j); +v31_grass_area.up(j,"pastr") = i31_max_managed_pasture(t,j); *' Total grassland area cannot be smaller than legally protected grassland area vm_land.lo(j,"past") = sum(consv_type, pm_land_conservation(t,j,"past",consv_type)); diff --git a/modules/31_past/grasslands_apr22/sets.gms b/modules/31_past/grasslands_apr22/sets.gms index a85206326b..15ac94e304 100644 --- a/modules/31_past/grasslands_apr22/sets.gms +++ b/modules/31_past/grasslands_apr22/sets.gms @@ -12,11 +12,4 @@ sets grassland(f31_luh) Grassland cover types (pastr = managed pastures and range = rangelands) / pastr, range / - - grass_to31(grassland) pasture management options - / pastr,range / - - grass_from31(grassland) pasture management options - / pastr,range / - ; diff --git a/modules/31_past/input/files b/modules/31_past/input/files index b628d2f69c..0ad0c16cd7 100644 --- a/modules/31_past/input/files +++ b/modules/31_past/input/files @@ -1,5 +1,6 @@ * list of files that are required here -f31_pastr_suitability.cs2 +f31_max_managed_pasture.cs2 f31_LUH2v2.cs3 f31_grassl_yld.cs3 f31_grass_bio_hist.cs3 +avl_land_full_t.cs3 \ No newline at end of file