Skip to content

Commit

Permalink
resolved merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
pvjeetze committed Nov 11, 2024
2 parents 3bcd119 + 3e7dcd3 commit 274dedf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
30 changes: 15 additions & 15 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -147,44 +147,44 @@ $title magpie
*' * Always try to access model outputs through the corresponding magpie package instead of accessing them directly with readGDX. It cannot be guaranteed that your script will work in the future if you do otherwise (as only the corresponding magpie package will be continuously adapted to changes in the GAMS code).

*##################### R SECTION START (VERSION INFO) ##########################
*
*
* Used data set: rev4.114_h12_magpie.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Used data set: rev4.114_h12_fd712c0b_cellularmagpie_c200_MRI-ESM2-0-ssp370_lpjml-8e6c5eb1.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Used data set: rev4.114_h12_validation.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Used data set: additional_data_rev4.56.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Used data set: calibration_H12_27Sep24.tgz
* md5sum: NA
* Repository: https://rse.pik-potsdam.de/data/magpie/public
*
*
* Low resolution: c200
* High resolution: 0.5
*
*
* Total number of cells: 200
*
*
* Number of cells per region:
* CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA
* 14 23 10 7 4 26 21 9 16 23 32 15
*
*
* Regionscode: 62eff8f7
*
*
* Regions data revision: 4.114
*
*
* lpj2magpie settings:
* * LPJmL data: MRI-ESM2-0:ssp370
* * Revision: 4.114
*
*
* aggregation settings:
* * Input resolution: 0.5
* * Output resolution: c200
Expand All @@ -193,10 +193,10 @@ $title magpie
* CAZ CHA EUR IND JPN LAM MEA NEU OAS REF SSA USA
* 14 23 10 7 4 26 21 9 16 23 32 15
* * Call: withCallingHandlers(expr, message = messageHandler, warning = warningHandler, error = errorHandler)
*
*
*
*
* Last modification (input data): Sun Oct 27 00:37:36 2024
*
*
*###################### R SECTION END (VERSION INFO) ###########################

$offupper
Expand Down
12 changes: 10 additions & 2 deletions scripts/output/extra/disaggregation.R
Original file line number Diff line number Diff line change
Expand Up @@ -378,8 +378,6 @@ out <- peat_hr / dimSums(land_hr[, getYears(peat_hr), ], dim = 3)
out[is.nan(out)] <- 0
out[is.infinite(out)] <- 0

rm(land_hr, peat_hr)

.writeDisagg(out, peatland_hr_share_out_file,
comment = "unit: grid-cell land area fraction",
message = "Write outputs peatland share"
Expand Down Expand Up @@ -526,6 +524,10 @@ if (grepl("grass", cfg$gms$past)) {
"past", "manpast",
gsub("range", "rangeland", getNames(land_lr))
)
getNames(land_consv_hr) <- gsub(
"past", "manpast",
gsub("range", "rangeland", getNames(land_consv_hr))
)
} else {
# Disaggregate pasture
land_ini_lr <- mbind(
Expand All @@ -537,6 +539,11 @@ if (grepl("grass", cfg$gms$past)) {
land_lr[, , c("past"), invert = TRUE],
collapseNames(land_lr[, , "past"]) * side_layers_lr[, , c("manpast", "rangeland")]
)

land_consv_hr <- mbind(
land_consv_hr[, , c("past"), invert = TRUE],
collapseNames(land_consv_hr[, , "past"]) * side_layers_hr[, , c("manpast", "rangeland")]
)
}

# Sort and rename
Expand All @@ -556,6 +563,7 @@ land_bii_hr <- interpolateAvlCroplandWeighted(
marginal_land = marginal_land,
urban_land_hr = urban_land_hr,
land_consv_hr = land_consv_hr,
peat_hr = peat_hr,
snv_pol_shr = snv_pol_shr,
snv_pol_fader = snv_pol_fader,
unit = "share"
Expand Down

0 comments on commit 274dedf

Please sign in to comment.