Skip to content
Snippets Groups Projects
Commit da86fccb authored by Bart Arendarczyk's avatar Bart Arendarczyk
Browse files

Calibrations and small fixes.

parent e75a9c2e
No related branches found
No related tags found
No related merge requests found
......@@ -57,6 +57,7 @@
PARAMETER woodYieldMax(location);
PARAMETER woodYieldParam(location);
PARAMETER maxRotationIntensity(wood_type);
PARAMETER forestBaseCost(managed_forest);
SCALAR meatEfficency efficiency of converting feed and pasture into animal products;
SCALAR fertiliserUnitCost fert cost at max fert rate;
......@@ -81,7 +82,7 @@ $load previousCropArea, previousFertIntensity, previousIrrigIntensity, previousO
$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, minDemandPerCereal, minDemandPerOilcrop, seedAndWasteRate
$load previousLandCoverArea, carbonCreditRate, conversionCost, woodYieldMax, woodYieldParam, maxRotationIntensity
$load previousLandCoverArea, carbonCreditRate, conversionCost, woodYieldMax, woodYieldParam, maxRotationIntensity, forestBaseCost
$load forestManagementCost, vegClearingCostRate, carbonForestMaxProportion, maxFertChange, maxIrrigChange
$gdxin
......@@ -294,7 +295,7 @@ $gdxin
WOOD_DEMAND_CONSTRAINT(wood_type) .. demand(wood_type) + exportAmount(wood_type) - importAmount(wood_type) =L= sum(location, woodYieldRota(wood_type, location) * timberForestArea(wood_type, location));
FORESTRY_COST_CALC(location) .. forestryCost(location) =E= sum(managed_forest, landCoverArea(managed_forest, location) * 0.05) +
FORESTRY_COST_CALC(location) .. forestryCost(location) =E= sum(managed_forest, landCoverArea(managed_forest, location) * forestBaseCost(managed_forest)) +
sum(wood_type, forestManagementCost * rotationIntensity(wood_type, location));
*********** Carbon ***********************************
......
......@@ -422,8 +422,8 @@ public class ModelConfig {
public static final boolean RESET_ENERGYCROP_PRICE = getBooleanProperty("RESET_ENERGYCROP_PRICE", true); // 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", 0.4); // controls international market price adjustment rate
public static final double MARKET_DAMPING = getDoubleProperty("MARKET_DAMPING", 1.5); // controls international market price adjustment rate
public static final double MARKET_LAMBDA = getDoubleProperty("MARKET_LAMBDA", 0.2); // controls international market price adjustment rate
public static final double MARKET_DAMPING = getDoubleProperty("MARKET_DAMPING", 2.0); // controls international market price adjustment rate
public static final String PRICE_UPDATE_METHOD = getProperty("PRICE_UPDATE_METHOD", "StockUseRatio"); // Options: StockUseRatio, MarketImbalance, StockChange
public static final double MAX_PRICE_INCREASE = getDoubleProperty("MAX_PRICE_INCREASE", 1.5);
......@@ -479,7 +479,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", 0);;
public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 1000);
public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 5000);
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
......@@ -519,6 +519,7 @@ public class ModelConfig {
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.001); //$1000/tC
public static final double FOREST_MANAGEMENT_COST = IS_FORESTRY_ON ? getDoubleProperty("FOREST_ESTABLISHMENT_COST", 3.0) : 0.0; // establishment, management etc. $1000/ha
public static final double FOREST_BASE_COST = getDoubleProperty("FOREST_BASE_COST", 0.05);
public static final double WOOD_TRADE_BARRIER = getDoubleProperty("WOOD_TRADE_BARRIER", 0.2); //$1000/tC
public static final double INIT_ROUNDWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_ROUNDWOOD_PRICE", 0.36) : 0.0; // $1000/tC-eq
public static final double INIT_FUELWOOD_PRICE = IS_FORESTRY_ON ? getDoubleProperty("INIT_FUELWOOD_PRICE", 0.24) : 0.0; // $1000/tC-eq
......
......@@ -116,7 +116,7 @@ public class GlobalPrice implements Serializable {
adjustment = 1 - ModelConfig.MARKET_LAMBDA * stockChange/Math.max(0, stockLevel);
}
else {
LogWriter.printlnWarning("Price adjustment method not set!");
LogWriter.printlnError("Price adjustment method not set!");
}
LogWriter.print(String.format(" initally adjustment= %.4f", adjustment), 2);
......@@ -136,7 +136,7 @@ public class GlobalPrice implements Serializable {
newTransportLosses, refPrice, updatedStockUseRatio);
}
else {
LogWriter.printlnError(String.format("Price for not updated (still %s), as no imports and no exports for it", exportPrice));
LogWriter.printlnWarning(String.format("Price for not updated (still %s), as no imports and no exports for it", exportPrice));
return this;
}
}
......@@ -185,7 +185,7 @@ public class GlobalPrice implements Serializable {
}
public boolean isStockCritical() {
return stockLevel < importAmount && exportAmountBeforeLoss < importAmount * 1.2;
return (stockLevel < importAmount && exportAmountBeforeLoss < importAmount * 1.2) || stockLevel < 0;
}
public double getTradeImbalanceFraction() {
......
......@@ -379,6 +379,14 @@ public class GamsLocationOptimiser {
addScalar(inDB, "forestManagementCost", ModelConfig.FOREST_MANAGEMENT_COST, 5);
addScalar(inDB, "vegClearingCostRate", ModelConfig.VEGETATION_CLEARING_COST, 5);
GAMSParameter forestBaseCostP = inDB.addParameter("forestBaseCost", 1);
// 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);
// 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);
// Yield from timber forest rotation
Map<Integer, ? extends WoodYieldData> woodYieldData = inputData.getWoodYields();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment