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

country-specific set-aside shares #319

Merged
merged 3 commits into from
Sep 7, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- **51_nitrogen** parameter change in rescaled_jan21, now including regionalized climate-dependent leaching factors
- **config** Update default configuration to new input data (especially cellular inputs) including all module realization updates (14_yield, 22_processing, 30_crop, 38_factor_costs, 39_landconversion). Moreover, climate impatcs (cc options for biophysical inputs) are activiated as default. New best_calib calibration routine is activated as default.
- **scripts** output/extra/disaggregation.R updated to account for country-specific set-aside shares in post-processing

### added

Expand Down
10 changes: 9 additions & 1 deletion scripts/output/extra/disaggregation.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,17 @@ if (cfg$gms$crop=="endo_apr21"){
warning(paste0("Negative values in inital high resolution dataset detected and set to 0. Check the file ",land_hr_file))
land_ini_hr[which(land_ini_hr < 0,arr.ind = T)] <- 0
}

# account for country-specific set-aside shares in post-processing
iso <- readGDX(gdx, "iso")
set_aside_iso <- readGDX(gdx,"policy_countries30")
set_aside_select <- readGDX(gdx, "s30_set_aside_shr")
set_aside_noselect <- readGDX(gdx, "s30_set_aside_shr_noselect")
set_aside_shr <- new.magpie(iso, fill = set_aside_noselect)
set_aside_shr[set_aside_iso,,] <- set_aside_select

avl_cropland_hr <- file.path(outputdir, "avl_cropland_0.5.mz") # available cropland (at high resolution)
marginal_land <- cfg$gms$c30_marginal_land # marginal land scenario
set_aside_shr <- cfg$gms$s30_set_aside_shr # set aside share (default: 0)
target_year <- cfg$gms$c30_set_aside_target # target year of set aside policy (default: "none")
set_aside_fader <- readGDX(gdx,"f30_set_aside_fader", format="first_found")[,,target_year]

Expand Down