diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 94ba5b3cd5c56383b0aeacbe4be094ea20b5682c..eef44d50a59999fe31b4a9dfd250485f91ecaba8 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -63,7 +63,7 @@ $gdxin pasture 1 / ; PARAMETER baseCost(crop) cost per ha before intensity values not including fertiliser or irrigation i.e. seed spray and other. In 1000 $ per ha - / wheat 0.31 + / wheat 0.32 maize 0.26 rice 0.4 oilcrops 0.24 @@ -184,7 +184,7 @@ $gdxin ( SUM((crop, location), area(crop, location) * unitCost(crop, location)) + SUM(location, - 1.5 * agriLandExpansion(location) + + 1.0 * agriLandExpansion(location) + 0.5 * cropIncrease(location) + 0.5 * cropDecrease(location) + 0.5 * pastureIncrease(location) + diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java index e33bf828ba9b229ae1a323f5ae734438817db07a..ee01ad61bb5abc5bfde663daf80f1dc7b4cc4396 100644 --- a/src/ac/ed/lurg/ModelConfig.java +++ b/src/ac/ed/lurg/ModelConfig.java @@ -158,10 +158,10 @@ public class ModelConfig { public static final boolean CHANGE_DEMAND_YEAR = IS_CALIBRATION_RUN ? false : getBooleanProperty("CHANGE_DEMAND_YEAR", true); public static final String SSP_SCENARIO = getProperty("SSP_SCENARIO", "SSP1_v9_130325"); - public static final double PASTURE_HARVEST_FRACTION = getDoubleProperty("PASTURE_HARVEST_FRACTION", 0.25); + public static final double PASTURE_HARVEST_FRACTION = getDoubleProperty("PASTURE_HARVEST_FRACTION", 0.5); public static final double MEAT_EFFICIENCY = getDoubleProperty("MEAT_EFFICIENCY", 1.0); // 'meat' is includes feed conversion ratio already, this is tech. change or similar public static final double IRRIGIATION_EFFICIENCY = getDoubleProperty("IRRIGIATION_EFFICIENCY", 0.5); - public static final double LAND_CHANGE_COST = getDoubleProperty("LAND_CHANGE_COST", 0.6); + public static final double LAND_CHANGE_COST = getDoubleProperty("LAND_CHANGE_COST", 1.0); public static final double SEED_AND_WASTE_FRACTION = getDoubleProperty("SEED_AND_WASTE_FRACTION", 0.15); public static final double TECHNOLOGY_CHANGE_ANNUAL_RATE = IS_CALIBRATION_RUN ? 0.0 : getDoubleProperty("TECHNOLOGY_CHANGE_ANNUAL_RATE", 0.0); @@ -170,34 +170,32 @@ public class ModelConfig { public static final double BIOENERGY_CHANGE_ANNUAL_RATE = IS_CALIBRATION_RUN ? 0.0 : getDoubleProperty("BIOENERGY_CHANGE_ANNUAL_RATE", 0.0); public static final int BIOENERGY_CHANGE_START_YEAR = getIntProperty("BIOENERGY_CHANGE_START_YEAR", 2010); - public static final double MARKET_LAMBA = getDoubleProperty("MARKET_LAMBA", 0.5); // controls international market price adjustment rate + public static final double MARKET_LAMBA = getDoubleProperty("MARKET_LAMBA", 0.3); // controls international market price adjustment rate - 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 double POPULATION_AGGREG_LIMIT = getDoubleProperty("POPULATION_AGGREG_LIMIT", 40.0); // in millions, smaller countries are aggregated on a regional basis public static final double UNHANDLED_CROP_AREA = getDoubleProperty("UNHANDLED_CROP_AREA", 0.3); // includes fruit veg forage crops set aside and failed crop public static final double OTHER_INTENSITY_COST = getDoubleProperty("OTHER_INTENSITY_COST", 0.4); public static final double OTHER_INTENSITY_PARAM = getDoubleProperty("OTHER_INTENSITY_PARAM", 3.22); - public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 0.02); - public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.5007 / 0.18); + public static final double IRRIG_COST_SCALE_FACTOR = getDoubleProperty("IRRIG_COST_SCALE_FACTOR", 0.03); + public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.3/0.34 * 1.1); // $300/t, 34% N/t plus 10% cost for application public static final double FERTILISER_MAX_COST = FERTILISER_COST_PER_T * MAX_FERT_AMOUNT/1000; - public static final double DOMESTIC_PRICE_MARKUP = getDoubleProperty("DOMESTIC_PRICE_MARKUP", 1.2); + public static final double DOMESTIC_PRICE_MARKUP = getDoubleProperty("DOMESTIC_PRICE_MARKUP", 2.0); public static final double TRANSPORT_LOSSES = getDoubleProperty("TRANSPORT_LOSSES", 0.05); // in international trade + public static final double TRANSPORT_COST = getDoubleProperty("TRANSPORT_COST", 0.1); // 100 $/t see Wheat Transportation Profile - USDA public static final double TRADE_BARRIER_FACTOR_DEFAULT = getDoubleProperty("TRADE_BARRIER_FACTOR_DEFAULT", 0.4); // price factor in international trade, transport cost and real trade barriers public static final boolean ACTIVE_TRADE_BARRIERS = getBooleanProperty("ACTIVE_TRADE_BARRIERS", false); // if set to true read in barrier information from file, otherwise use default as above public static final boolean PROTECTED_AREAS_ENABLED = getBooleanProperty("PROTECTED_AREAS_ENABLED", true); - public static final int NUM_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 12); - public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 3); + public static final int NUM_CEREAL_CATEGORIES = getIntProperty("NUM_CEREAL_CATEGORIES", 15); + public static final int NUM_PASTURE_CATEGORIES = getIntProperty("NUM_PASTURE_CATEGORIES", 4); public static final boolean DEBUG_LIMIT_COUNTRIES = getBooleanProperty("DEBUG_LIMIT_COUNTRIES", false); - public static final Object DEBUG_COUNTRY_NAME = getProperty("DEBUG_COUNTRY_NAME", "United States of America"); + public static final String DEBUG_COUNTRY_NAME = getProperty("DEBUG_COUNTRY_NAME", "United States of America"); public static final double PASTURE_MAX_IRRIGATION_RATE = getDoubleProperty("DEFAULT_MAX_IRRIGATION_RATE", 50.0); // shouldn't need this but some areas crops don't have a value, but was causing them to be selected public static final int LPJG_TIMESTEP_SIZE = 5; - - - } \ No newline at end of file diff --git a/src/ac/ed/lurg/ModelMain.java b/src/ac/ed/lurg/ModelMain.java index 942f1d1ea487b875489ad34ab8a816996920bb33..3f92fa07f7ae4f3dd4721f88a2dd5f39288c2a1f 100644 --- a/src/ac/ed/lurg/ModelMain.java +++ b/src/ac/ed/lurg/ModelMain.java @@ -90,17 +90,17 @@ public class ModelMain { countryBoundaryRaster = getCountryBoundaryRaster(); countryAgents = createCountryAgents(compositeCountryManager.getAll()); - // in first timestep we don't have this info, but ok as constrained to import/export specified amount, values based on http://www.indexmundi.com/commodities/ + // in first timestep we don't have this info, but ok as constrained to import/export specified amount, values based on http://www.indexmundi.com/commodities/ for Jun 2010 prevWorldPrices = new HashMap<CropType, GlobalPrice>(); - prevWorldPrices.put(CropType.WHEAT, GlobalPrice.createInitial(0.274)); - prevWorldPrices.put(CropType.MAIZE, GlobalPrice.createInitial(0.251)); - prevWorldPrices.put(CropType.RICE, GlobalPrice.createInitial(0.282)); // 9.8/0.0508023 * 537/368 adjust from hunderdweight of rough rice to k$/t in 2010 - prevWorldPrices.put(CropType.OILCROPS, GlobalPrice.createInitial((1.21 * .4 + 0.387 * .6))); + prevWorldPrices.put(CropType.WHEAT, GlobalPrice.createInitial(0.157)); + prevWorldPrices.put(CropType.MAIZE, GlobalPrice.createInitial(0.152)); + prevWorldPrices.put(CropType.RICE, GlobalPrice.createInitial(0.282)); + prevWorldPrices.put(CropType.OILCROPS, GlobalPrice.createInitial((0.820 * .4 + 0.314 * .6))); prevWorldPrices.put(CropType.PULSES, GlobalPrice.createInitial(0.4)); prevWorldPrices.put(CropType.STARCHY_ROOTS, GlobalPrice.createInitial(0.1)); - prevWorldPrices.put(CropType.MONOGASTRICS, GlobalPrice.createInitial(0.4 * 0.7)); // quantities is in feed equivalent term (0.4 is weighted average price per feed, and 0.7 accounts for mark-up for additional processing) - prevWorldPrices.put(CropType.RUMINANTS, GlobalPrice.createInitial(0.2 * 0.6)); // quantities is in feed equivalent term + prevWorldPrices.put(CropType.MONOGASTRICS, GlobalPrice.createInitial(0.4 * 0.5)); // quantities is in feed equivalent term (0.4 is weighted average price per feed, and 0.5 accounts for mark-up for additional processing) + prevWorldPrices.put(CropType.RUMINANTS, GlobalPrice.createInitial(0.2 * 0.2)); // quantities is in feed equivalent term prevStockLevel = getInitialStockLevels(); } @@ -233,20 +233,21 @@ public class ModelMain { private void writeLandCoverFile(Timestep timestep, RasterSet<LandUseItem> landUseRaster) { try { - StringBuffer sbHeadings = new StringBuffer("Year, Cropland (Mha), Pasture (Mha), Natural (Mha), Fert crop (Mt), Fert pasture (Mt), Irrig crop (km3), Irrig pasture (km3)"); + StringBuffer sbHeadings = new StringBuffer("Year,Cropland (Mha),Pasture (Mha),Forest (Mha),Natural (Mha),Fert crop (Mt),Fert pasture (Mt),Irrig crop (km3),Irrig pasture (km3)"); BufferedWriter outputFile = getFileWriter(timestep, ModelConfig.LAND_COVER_OUTPUT_FILE, sbHeadings.toString()); StringBuffer sbData = new StringBuffer(); - sbData.append(String.format("%d, %.1f, %.1f, %.1f", + sbData.append(String.format("%d,%.1f,%.1f,%.1f,%.1f", timestep.getYear(), LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.CROPLAND), LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.PASTURE), + LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.FOREST), LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.OTHER_NATURAL))); - sbData.append(String.format(", %.1f", LandUseItem.getFertiliserTotal(landUseRaster.values(), CropType.getCropsLessPasture())/1000)); - sbData.append(String.format(", %.1f", LandUseItem.getFertiliserTotal(landUseRaster.values(), CropType.PASTURE)/1000)); - sbData.append(String.format(", %.1f", LandUseItem.getIrrigationTotal(landUseRaster.values(), CropType.getCropsLessPasture()))); - sbData.append(String.format(", %.1f", LandUseItem.getIrrigationTotal(landUseRaster.values(), CropType.PASTURE))); + sbData.append(String.format(",%.1f", LandUseItem.getFertiliserTotal(landUseRaster.values(), CropType.getCropsLessPasture())/1000)); + sbData.append(String.format(",%.1f", LandUseItem.getFertiliserTotal(landUseRaster.values(), CropType.PASTURE)/1000)); + sbData.append(String.format(",%.1f", LandUseItem.getIrrigationTotal(landUseRaster.values(), CropType.getCropsLessPasture()))); + sbData.append(String.format(",%.1f", LandUseItem.getIrrigationTotal(landUseRaster.values(), CropType.PASTURE))); outputFile.write(sbData.toString()); outputFile.newLine(); @@ -349,8 +350,9 @@ public class ModelMain { LandUseOutputer landuseOutputer = new LandUseOutputer(timestep.getYear(), landUseRaster); landuseOutputer.writeOutput(); - outputLandCover(timestep.getYear(), landUseRaster, LandCoverType.CROPLAND); - outputLandCover(timestep.getYear(), landUseRaster, LandCoverType.PASTURE); + // don't really need this a LPJ outputs have same data, although in a slightly different format +// outputLandCover(timestep.getYear(), landUseRaster, LandCoverType.CROPLAND); +// outputLandCover(timestep.getYear(), landUseRaster, LandCoverType.PASTURE); } diff --git a/src/ac/ed/lurg/Timestep.java b/src/ac/ed/lurg/Timestep.java index e5127fe5eaee1efa7bc353ef98904cd62a41ba01..c03a1b3fb478733b5f41631ab7891a9093bb31a6 100644 --- a/src/ac/ed/lurg/Timestep.java +++ b/src/ac/ed/lurg/Timestep.java @@ -85,9 +85,15 @@ public class Timestep { } public String getYearSubDir(String rootDir) { - if (ModelConfig.CHANGE_YIELD_DATA_YEAR) - return rootDir + File.separator + (getYieldYear()-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + getYieldYear(); - else - return rootDir + File.separator + (ModelConfig.BASE_YEAR-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + ModelConfig.BASE_YEAR; + int endYear; + + if (ModelConfig.CHANGE_YIELD_DATA_YEAR) { + endYear = (getYieldYear()/ModelConfig.LPJG_TIMESTEP_SIZE) * ModelConfig.LPJG_TIMESTEP_SIZE; // truncation in division as int + } + else { + endYear = ModelConfig.BASE_YEAR; + } + + return rootDir + File.separator + (endYear-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + endYear; } } diff --git a/src/ac/ed/lurg/country/CompositeCountryManager.java b/src/ac/ed/lurg/country/CompositeCountryManager.java index d202092b9b5912ce8600fe006cf202bb53305179..454b8c4b0d88ee2c4e5e2f58b69f7b161c02fed7 100644 --- a/src/ac/ed/lurg/country/CompositeCountryManager.java +++ b/src/ac/ed/lurg/country/CompositeCountryManager.java @@ -1,5 +1,6 @@ package ac.ed.lurg.country; +import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -24,7 +25,7 @@ public class CompositeCountryManager { private void populate(BaseConsumpManager baseConsumpManager) { mapFromSingleCountry = new HashMap<SingleCountry, CompositeCountry>(); - HashSet<String> countryExclusionList = new HashSet<String>();//Arrays.asList("Bangladesh", "Democratic Republic of the Congo")); + HashSet<String> countryExclusionList = new HashSet<String>(Arrays.asList("Philippines")); for (SingleCountry c : baseConsumpManager.getAllCountries()) { CompositeCountry cc; diff --git a/src/ac/ed/lurg/country/GlobalPrice.java b/src/ac/ed/lurg/country/GlobalPrice.java index 364758ae63e60d9e4e654b1652aab80cb2c53335..cd17f7b48fe0dda5ae6a96f5790a9740cf8ad50a 100644 --- a/src/ac/ed/lurg/country/GlobalPrice.java +++ b/src/ac/ed/lurg/country/GlobalPrice.java @@ -22,7 +22,7 @@ public class GlobalPrice { } public double getCountryImportPrice(double countryTradeBarrier) { - double importPrice = exportPrice * (1.0 + countryTradeBarrier) / (1.0 - ModelConfig.TRANSPORT_LOSSES); + double importPrice = exportPrice * (1.0 + countryTradeBarrier) / (1.0 - ModelConfig.TRANSPORT_LOSSES) + ModelConfig.TRANSPORT_COST; return importPrice; }