diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 3cb31c9504bda329ea4823701ffa18c980868f80..500750e9a3f38676f3dfd1d51c0573b1815913fa 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -155,8 +155,8 @@ $gdxin ENERGY_EQ .. energy =E= (SUM((crop, location), area(crop, location) * unitEnergy(crop, location)) + (sum(location, agriLandExpansion(location)) * landChangeEnergy) - + (sum(location, (cropIncrease(location) + cropDecrease(location)) * landChangeEnergy/8)) - + (sum(location, (pastureIncrease(location) + pastureDecrease(location)) * landChangeEnergy/8)) + + (sum(location, SQR((cropIncrease(location) + cropDecrease(location)) / suitableLandArea(location)) * (cropIncrease(location) + cropDecrease(location)) * landChangeEnergy * 10)) + + (sum(location, SQR((pastureIncrease(location) + pastureDecrease(location)) / suitableLandArea(location)) * (pastureIncrease(location) + pastureDecrease(location)) * landChangeEnergy * 10)) + sum(import_crop, (netImportAmount(import_crop)) * worldInputPrices(import_crop))) / 1000000; MODEL LAND_USE /ALL/ ; diff --git a/config.properties b/config.properties index d42bf0eed9666c6a18c9266cb7dacc4875803afa..a3348cf96a04e1697aa6dc2e13d4cff2ae2894aa 100644 --- a/config.properties +++ b/config.properties @@ -1,4 +1,9 @@ BASE_DIR=/Users/peteralexander/Documents/R_Workspace/UNPLUM YIELD_DIR=/Users/peteralexander/Documents/LURG/LPJ +CLEANUP_GAMS_DIR=false + +# Properties for testing CHANGE_YIELD_DATA_YEAR=false -CLEANUP_GAMS_DIR=false \ No newline at end of file +#KEEP_DEMAND_FIXED=true +MAX_IMPORT_CHANGE=0.0 +SEED_AND_WASTE_FRACTION=0.1 \ No newline at end of file diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java index 399883254b4250167a6ebc91e1b9d510c9d4aef2..2b40f8ed4a77e5fe823668d2d5cd066a2c367840 100644 --- a/src/ac/ed/lurg/ModelConfig.java +++ b/src/ac/ed/lurg/ModelConfig.java @@ -124,18 +124,19 @@ public class ModelConfig { public static final int BASE_YEAR = getIntProperty("BASE_YEAR", 2010); // Other model parameters - public static final String SSP_SCENARIO = getProperty("SSP_SCENARIO", "SSP5_v9_130325"); - public static final double MAX_IMPORT_CHANGE = getDoubleProperty("MAX_IMPORT_CHANGE", 0.0); + public static final boolean KEEP_DEMAND_FIXED = getBooleanProperty("KEEP_DEMAND_FIXED", false); + public static final String SSP_SCENARIO = getProperty("SSP_SCENARIO", "SSP1_v9_130325"); + public static final double MAX_IMPORT_CHANGE = getDoubleProperty("MAX_IMPORT_CHANGE", 0.1); public static final double PASTURE_HARVEST_FRACTION = getDoubleProperty("PASTURE_HARVEST_FRACTION", 0.5); public static final double MEAT_EFFICIENCY = getDoubleProperty("MEAT_EFFICIENCY", 0.5); public static final double LAND_CHANGE_COST = getDoubleProperty("LAND_CHANGE_COST", 2.0); public static final double MIN_FEED_RATE = getDoubleProperty("MIN_FEED_RATE", 0.15); - public static final double SEED_AND_WASTE_FRACTION = getDoubleProperty("SEED_AND_WASTE_FRACTION", 0.1 + 0.3); // should be around 10%, but also including set aside and forage crops adjustment + public static final double SEED_AND_WASTE_FRACTION = getDoubleProperty("SEED_AND_WASTE_FRACTION", 0.1); // should be around 10%, but also including set aside and forage crops adjustment public static final double MARKET_LAMBA = getDoubleProperty("MARKET_LAMBA", 0.3); // controls international market price adjustment rate - public static final double POPULATION_AGGREG_LIMIT = 40; // in millions, smaller countries are aggregated on a regional basis + public static final double POPULATION_AGGREG_LIMIT = getDoubleProperty("POPULATION_AGGREG_LIMIT", 40.0); // in millions, smaller countries are aggregated on a regional basis - public static final double IRRIG_COST_SCALE_FACTOR = 2.0; - public static final double TRANSPORT_LOSSES = 0.2; + public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 2.0); + public static final double TRANSPORT_LOSSES = getDoubleProperty("TRANSPORT_LOSSES", 0.2); // in international trade } \ No newline at end of file diff --git a/src/ac/ed/lurg/demand/DemandManager.java b/src/ac/ed/lurg/demand/DemandManager.java index 547b7d9f008cdaf2f3337f0f133e52297c744b69..772c0c11e0ab640e727f05681633841f86341183 100644 --- a/src/ac/ed/lurg/demand/DemandManager.java +++ b/src/ac/ed/lurg/demand/DemandManager.java @@ -33,6 +33,10 @@ public class DemandManager { } public Map<CommodityType, Double> getDemand(CompositeCountry cc, int year) { + + if (ModelConfig.KEEP_DEMAND_FIXED) + year = ModelConfig.BASE_YEAR; + Map<CommodityType, Double> demandMap = new HashMap<CommodityType, Double>(); for (SingleCountry c : compositeCountryManager.getAllForCompositeCountry(cc)) { diff --git a/src/ac/ed/lurg/output/LpjgOutputer.java b/src/ac/ed/lurg/output/LpjgOutputer.java index 0d07e8536714765d9197bf5598e9ce3bbefe397c..6962f9e0f55cedbd9d8b0b1111895f913072e8dc 100644 --- a/src/ac/ed/lurg/output/LpjgOutputer.java +++ b/src/ac/ed/lurg/output/LpjgOutputer.java @@ -95,7 +95,7 @@ public class LpjgOutputer { double forest = item.getLandCoverArea(LandCoverType.FOREST); double otherNatural = item.getLandCoverArea(LandCoverType.OTHER_NATURAL); double barren = item.getLandCoverArea(LandCoverType.BARREN); - landCoverWriter.write(String.format("%.2f %.2f %.4f %.4f %.4f %.4f", lat, lon, crop/area, pasture/area, (forest+otherNatural)/area, barren/area)); + landCoverWriter.write(String.format("%.2f %.2f %d %.14f %.14f %.14f %.14f", lat, lon, timestep.getYear(), crop/area, pasture/area, (forest+otherNatural)/area, barren/area)); landCoverWriter.newLine(); boolean isSpringWheat = false; @@ -109,7 +109,7 @@ public class LpjgOutputer { double lpjSpringWheatFrac = item.getCropFraction(CropType.PULSES, CropType.STARCHY_ROOTS, isSpringWheat ? CropType.WHEAT : null); double lpjCornFrac = item.getCropFraction(CropType.MAIZE); double lpjRiceFrac = item.getCropFraction(CropType.RICE); - cropFractWriter.write(String.format("%.2f %.2f %.4f %.4f %.4f %.4f", lat, lon, lpjWinterWheatFrac, lpjSpringWheatFrac, lpjCornFrac, lpjRiceFrac)); + cropFractWriter.write(String.format("%.2f %.2f %d %.14f %.14f %.14f %.14f", lat, lon, timestep.getYear(), lpjWinterWheatFrac, lpjSpringWheatFrac, lpjCornFrac, lpjRiceFrac)); cropFractWriter.newLine(); } }