diff --git a/main.gms b/main.gms index d359a4d99..ee3826c8b 100644 --- a/main.gms +++ b/main.gms @@ -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 @@ -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 diff --git a/scripts/output/extra/disaggregation.R b/scripts/output/extra/disaggregation.R index 8f4cefec1..7c464448e 100644 --- a/scripts/output/extra/disaggregation.R +++ b/scripts/output/extra/disaggregation.R @@ -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" @@ -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( @@ -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 @@ -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"