diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 524c692df94e5c05319b639583018f15f10d4808..a1b83bcb394f2230c1840859ad84846ab4402ba9 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -75,7 +75,6 @@ SCALAR tradeAdjustmentCostRate; SCALAR forestManagementCost cost $1000 per ha; - SCALAR vegClearingCostRate cost of clearing vegetation $1000 per tC; SCALAR carbonForestMaxProportion maximum proportion of land cover as carbon forest; @@ -87,7 +86,7 @@ $load yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth, yieldShock $load fertParam, irrigParam, otherIParam, exportPrices, importPrices, maxNetImport, minNetImport, unhandledCropRate, setAsideRate, maxGrossLccRate, subsidyRate $load meatEfficency, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup, minDemandFraction, seedAndWasteRate $load previousLandCoverArea, maxCroplandArea, carbonCreditRate, conversionCost, woodYieldMax, woodYieldParam, maxRotationIntensity, forestBaseCost, tradeAdjustmentCostRate -$load forestManagementCost, vegClearingCostRate, carbonForestMaxProportion, maxFertChange, maxIrrigChange, previousRotationIntensity, minRotationIntensity +$load forestManagementCost, carbonForestMaxProportion, maxFertChange, maxIrrigChange, previousRotationIntensity, minRotationIntensity $gdxin SCALAR delta "use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf" / 0.00000000001 /; @@ -416,7 +415,7 @@ $gdxin netCarbonCredits = SUM(location, carbonCredits.L(location)); totalWoodProdCost = sum(location, (forestBaseCost('timberForest') + forestManagementCost * rotationIntensity.L(location)) * landCoverArea.L('timberForest', location) - + totalWoodSupply.L(location) * vegClearingCostRate); + + sum(wood_type, woodSupply.L(wood_type) * loggingCost(wood_type))); totalWoodSupplyP = sum(location, totalWoodSupply.L(location)); diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java index 380238a23817900bc7b60b7639bbf452d448b132..43dc2fe1e970aa356fbc030bd338c66e7ec1ab45 100755 --- a/src/ac/ed/lurg/ModelConfig.java +++ b/src/ac/ed/lurg/ModelConfig.java @@ -384,7 +384,7 @@ public class ModelConfig { // Calibration related stuff public static final boolean IS_CALIBRATION_RUN = getBooleanProperty("IS_CALIBRATION_RUN", false); public static final String CALIB_DIR = IS_CALIBRATION_RUN ? OUTPUT_DIR : getProperty("CALIB_DIR", OUTPUT_DIR); - public static final int END_FIRST_STAGE_CALIBRATION = getIntProperty("END_FIRST_STAGE_CALIBRATION", 5); // Keep trade fixed + public static final int END_FIRST_STAGE_CALIBRATION = getIntProperty("END_FIRST_STAGE_CALIBRATION", -1); // Keep trade fixed public static final int END_SECOND_STAGE_CALIBRATION = getIntProperty("END_SECOND_STAGE_CALIBRATION", 20); // Keep land cover fixed public static final String SERIALIZED_LAND_USE_FILENAME = "landUseRaster.ser"; public static final String SERIALIZED_CROP_USAGE_FILENAME = "countryCropUsages.ser"; @@ -487,7 +487,7 @@ public class ModelConfig { public static final boolean RESET_ENERGYCROP_PRICE = getBooleanProperty("RESET_ENERGYCROP_PRICE", false); // Resets price after calibration to avoid problems due to low initial demand // public static final double BIOENERGY_HEATING_VALUE_GJ_PER_T = getDoubleProperty("BIOENERGY_HEATING_VALUE_GJ_PER_T", 17.5); // GJ per t DM - public static final double MARKET_LAMBDA = getDoubleProperty("MARKET_LAMBDA", 1.0); // controls international market price adjustment rate + public static final double MARKET_LAMBDA = getDoubleProperty("MARKET_LAMBDA", 0.6); // controls international market price adjustment rate public static final double MARKET_DELTA = getDoubleProperty("MARKET_DELTA", 0.002); // price adjustment sensitivity to stock use ratio imbalance public static final double DEFAULT_STOCK_USE_RATIO = getDoubleProperty("DEFAULT_STOCK_USE_RATIO", 0.3); @@ -500,11 +500,6 @@ public class ModelConfig { public static final double POPULATION_AGGREG_LIMIT = getDoubleProperty("POPULATION_AGGREG_LIMIT", 30.0); // in millions, smaller countries are aggregated on a regional basis public static final boolean PREDEFINED_COUNTRY_GROUPING = getBooleanProperty("PREDEFINED_COUNTRY_GROUPING", true); - // 1536.7 Mha is all cropland in LUH2, or 1555.6 Mha from FAO. country_data[Country =="World" & Year == 2011, list(arable+ perm_crops)] - // 1377.6 Mha is area of crops in FAO crop production. con_prod_unadj[Country =="World" & Item %in% itemDetails[produced==TRUE]$Item & Year == 2011, sum(prod_area, na.rm=TRUE)] - // 1105.6 Mha is harvested in crops we represent. crop_prod[Country =="World" & Item %in% itemGroupMapping$cropProdItem & Year == 2011, sum(area)] - // extract values by running AltLURead.R and common.R - // So we do not represent crops covering (1341.911-1239.03)/1547.464=6.65% of cropland. Additionally 10.3% of cropland is set aside, fallow or failed crops, public static final double UNHANDLED_CROP_RATE = getDoubleProperty("UNHANDLED_CROP_RATE", 0.01323); // mostly forage crops and fibers public static final double SETASIDE_RATE = getDoubleProperty("SETASIDE_RATE", 0.08298); // includes aside, fallow and failed cropland areas @@ -513,7 +508,7 @@ public class ModelConfig { public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 0.00035); public static final double IRRIG_COST_MULTIPLIER = getDoubleProperty("IRRIG_COST_MULTIPLIER", 1.0); - public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 1.2); // $1000 per tonne + public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.533); // $1000 per tonne. Urea $245/t (2019), 46% nitrogen public static final double FERTILISER_MAX_COST = ModelConfig.getAdjParam("FERTILISER_COST_PER_T") * MAX_FERT_AMOUNT/1000; public static final double DOMESTIC_PRICE_MARKUP = getDoubleProperty("DOMESTIC_PRICE_MARKUP", 1.0); @@ -546,7 +541,7 @@ public class ModelConfig { public static final int LPJG_TIMESTEP_SIZE = getIntProperty("LPJG_TIMESTEP_SIZE", 5); public static final int LPJ_YEAR_OFFSET = getIntProperty("LPJ_YEAR_OFFSET", -1); - public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 5000); + public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 500); public static final long RANDOM_SEED = getIntProperty("RANDOM_SEED", 1974329); // any number will do public static final String CHECKPOINT_YEARS = getProperty("CHECKPOINT_YEARS", null); // 2020,2050 @@ -581,14 +576,13 @@ public class ModelConfig { public static final boolean IS_FORESTRY_ON = getBooleanProperty("IS_FORESTRY_ON", false); public static final String WOOD_DEMAND_FILENAME = getProperty("WOOD_DEMAND_FILENAME", "wood_base_demand.csv"); public static final String WOOD_DEMAND_FILE = getProperty("WOOD_DEMAND_FILE", DATA_DIR + File.separator + WOOD_DEMAND_FILENAME); - public static final double INIT_WOOD_STOCK = getDoubleProperty("INIT_WOOD_STOCK", 600.0); // MtC-eq + public static final double INIT_WOOD_STOCK = getDoubleProperty("INIT_WOOD_STOCK", 600.0); // million m3 public static final double WOOD_BIOMASS_CONVERSION_FACTOR = getDoubleProperty("WOOD_BIOMASS_CONVERSION_FACTOR", 0.3); // m3 to tC-eq p.16 [https://doi.org/10.5194/gmd-13-5425-2020] - public static final double VEGETATION_CLEARING_COST = getDoubleProperty("VEGETATION_CLEARING_COST", 0.08); //$1000/tC public static final double FOREST_MANAGEMENT_COST = IS_FORESTRY_ON ? getDoubleProperty("FOREST_MANAGEMENT_COST", 2.0) : 0.0; // establishment, management etc. $1000/ha public static final double FOREST_BASE_COST = getDoubleProperty("FOREST_BASE_COST", 0.12); // $1000/ha - public static final double WOOD_TRADE_BARRIER = getDoubleProperty("WOOD_TRADE_BARRIER", 0.1); //$1000/tC - public static final double INIT_ROUNDWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_ROUNDWOOD_PRICE", 0.1) : 0.0; // $1000/tC-eq - public static final double INIT_FUELWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_FUELWOOD_PRICE", 0.04) : 0.0; // $1000/tC-eq + public static final double WOOD_TRADE_BARRIER = getDoubleProperty("WOOD_TRADE_BARRIER", 0.1); //$1000/m3 + public static final double INIT_ROUNDWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_ROUNDWOOD_PRICE", 0.1) : 0.0; // $1000/m3 + public static final double INIT_FUELWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_FUELWOOD_PRICE", 0.07) : 0.0; // $1000/m3 public static final int CARBON_WOOD_MAX_TIME = getIntProperty("CARBON_WOOD_MAX_TIME", 160); // upper data limit, years // Carbon diff --git a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java index 810bae5419b88f68dccf705d4ef85d48b9cd9fbe..6edc572fdf588a1cf717ca97e8b087755f839db5 100644 --- a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java @@ -406,16 +406,15 @@ public class GamsLocationOptimiser { setGamsParamValue(maxRotaIntensityP.addRecord(woodType.getName()), 1.0 / woodType.getMinRotation(), 6); } - addScalar(inDB, "forestManagementCost", ModelConfig.FOREST_MANAGEMENT_COST, -1); - addScalar(inDB, "vegClearingCostRate", ModelConfig.VEGETATION_CLEARING_COST, -1); + addScalar(inDB, "forestManagementCost", ModelConfig.getAdjParam("FOREST_MANAGEMENT_COST"), -1); GAMSParameter forestBaseCostP = inDB.addParameter("forestBaseCost", 1); + double forestBaseCost = ModelConfig.getAdjParam("FOREST_BASE_COST"); // No base cost if forestry off to stop unnecessary conversion. setGamsParamValue(forestBaseCostP.addRecord(LandCoverType.TIMBER_FOREST.getName()), - ModelConfig.IS_FORESTRY_ON ? ModelConfig.FOREST_BASE_COST : 0, -1); + ModelConfig.IS_FORESTRY_ON ? forestBaseCost : 0, -1); // Keeping base cost even if forestry & carbon off to stop conversion to carbon forest - setGamsParamValue(forestBaseCostP.addRecord(LandCoverType.CARBON_FOREST.getName()), - ModelConfig.FOREST_BASE_COST, -1); + setGamsParamValue(forestBaseCostP.addRecord(LandCoverType.CARBON_FOREST.getName()), forestBaseCost, -1); for (WoodType wType : WoodType.values()) { double netImport = countryInput.getPreviousWoodUsageData().get(wType).getNetImport(); @@ -490,16 +489,13 @@ public class GamsLocationOptimiser { LccKey key = entry.getKey(); String fromName = key.getFromLc().getName(); String toName = key.getToLc().getName(); - double baseCost = entry.getValue(); - double totalVegYield = woodYieldData.get(location).getYieldLuc(key); - Double vegClearCost = totalVegYield * ModelConfig.VEGETATION_CLEARING_COST; - double totalCost = (vegClearCost.isNaN()) ? baseCost : baseCost + vegClearCost; + double cost = entry.getValue(); Vector<String> v = new Vector<String>(); v.add(fromName); v.add(toName); v.add(location.toString()); - setGamsParamValue(conversionCostP.addRecord(v), totalCost, -1); + setGamsParamValue(conversionCostP.addRecord(v), cost, -1); } } } diff --git a/src/ac/ed/lurg/forestry/WoodYieldData.java b/src/ac/ed/lurg/forestry/WoodYieldData.java index baaef2c61361f96be88d3e0bf2033fe8bcc33c6b..77976162b35c52c6d83ea00866058f67baad2dd5 100644 --- a/src/ac/ed/lurg/forestry/WoodYieldData.java +++ b/src/ac/ed/lurg/forestry/WoodYieldData.java @@ -8,25 +8,7 @@ import ac.ed.lurg.types.LandCoverType; import ac.ed.lurg.types.WoodType; public class WoodYieldData { - private Map<LccKey, Double> yieldLuc = new HashMap<>(); private WoodYieldResponse yieldResponse = new WoodYieldResponse(); - - public void setYieldLuc(LccKey lccKey, double yield) { - yieldLuc.put(lccKey, yield); - } - - public double getYieldLuc(LandCoverType fromLc, LandCoverType toLc) { - LccKey key = new LccKey(fromLc, toLc); - return getYieldLuc(key); - } - - public double getYieldLuc(LccKey lccKey) { - return yieldLuc.getOrDefault(lccKey, Double.NaN); - } - - public Map<LccKey, Double> getYieldLucMap() { - return yieldLuc; - } public double getYieldRota(int age) { return yieldResponse.getYield(age);