diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 46da561425af629cb9f8375e1f6ddfdea2d8c951..94ba5b3cd5c56383b0aeacbe4be094ea20b5682c 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -32,7 +32,6 @@ SCALAR meatEfficency efficiency of converting feed and pasture into animal products; SCALAR landChangeCost cost required to add ha of agricultural land; - SCALAR minFeedRate minimum rate of feed for producing animal products (why is this needed?); SCALAR fertiliserUnitCost fert cost at max fert rate; SCALAR otherIParam yield response to other intensity; SCALAR otherICost cost of other intensity; @@ -45,7 +44,7 @@ $load location, suitableLandArea, demand, landChangeCost $load previousArea, previousFertIntensity, previousIrrigIntensity, previousOtherIntensity $load yieldNone, yieldFertOnly, yieldIrrigOnly, yieldBoth $load fertParam, irrigParam, otherIParam, exportPrices, importPrices, maxNetImport, minNetImport, unhandledCropArea -$load meatEfficency, minFeedRate, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup +$load meatEfficency, otherICost, irrigCost, irrigMaxRate, irrigConstraint, fertiliserUnitCost, domesticPriceMarkup $gdxin SCALAR delta use to smooth power function see 7.5 www.gams.com dd docs solversconopt.pdf / 0.00000000001 / diff --git a/data/base_consump.csv b/data/base_consump.csv index f20a4b0d7d65d24e40a2edd6a5e11e048e3f6382..150ac39de97d81db0248d39c9d06f3b3d19c6c81 100644 --- a/data/base_consump.csv +++ b/data/base_consump.csv @@ -982,27 +982,33 @@ Zimbabwe,13.973897,Monogastrics,0.0393386029949414 Zimbabwe,13.973897,Oilcrops,0.0207237251574978 Zimbabwe,13.973897,Pulses,0.00526439092610393 Zimbabwe,13.973897,Starchy Roots,0.0187142745889722 -Sudan,34.0992269929472,Ruminants,1.46835161491867 -Sudan,34.0992269929472,Cereals,0.666713502335833 -Sudan,34.0992269929472,Monogastrics,0.0134343766105266 -Sudan,34.0992269929472,Oilcrops,0.159418023905615 -Sudan,34.0992269929472,Pulses,0.0492739600087264 -Sudan,34.0992269929472,Starchy Roots,0.300342119349333 -South Sudan,10.4581697798675,Ruminants,0.264213376179989 -South Sudan,10.4581697798675,Cereals,0.119967604221754 -South Sudan,10.4581697798675,Monogastrics,0.00241736513589582 -South Sudan,10.4581697798675,Oilcrops,0.0286854823409432 -South Sudan,10.4581697798675,Pulses,0.0088662955108232 -South Sudan,10.4581697798675,Starchy Roots,0.0540431900343816 -Somalia,9.14199979055354,Ruminants,0.113527009325342 -Somalia,9.14199979055354,Cereals,0.0515475920263175 -Somalia,9.14199979055354,Monogastrics,0.00103869167524149 -Somalia,9.14199979055354,Oilcrops,0.0123255569733295 -Somalia,9.14199979055354,Pulses,0.00380966333987863 -Somalia,9.14199979055354,Starchy Roots,0.0232212381814648 -Myanmar,52.6219518122997,Ruminants,0.0147153133516239 -Myanmar,52.6219518122997,Cereals,0.0340479024105867 -Myanmar,52.6219518122997,Monogastrics,0.0229664551902684 -Myanmar,52.6219518122997,Oilcrops,0.00500947605012635 -Myanmar,52.6219518122997,Pulses,0.000470545016406678 -Myanmar,52.6219518122997,Starchy Roots,0.00340724178716927 +Sudan,34.9341313459923,Ruminants,0.276944633577609 +Sudan,34.9341313459923,Cereals,0.125748304922094 +Sudan,34.9341313459923,Monogastrics,0.00253384711805011 +Sudan,34.9341313459923,Oilcrops,0.0300677070584709 +Sudan,34.9341313459923,Pulses,0.00929352251932545 +Sudan,34.9341313459923,Starchy Roots,0.0566472889368062 +South Sudan,9.72719437395261,Ruminants,0.276944633577609 +South Sudan,9.72719437395261,Cereals,0.125748304922094 +South Sudan,9.72719437395261,Monogastrics,0.00253384711805011 +South Sudan,9.72719437395261,Oilcrops,0.0300677070584709 +South Sudan,9.72719437395261,Pulses,0.00929352251932545 +South Sudan,9.72719437395261,Starchy Roots,0.0566472889368062 +Somalia,9.26772566595465,Ruminants,0.276944633577609 +Somalia,9.26772566595465,Cereals,0.125748304922094 +Somalia,9.26772566595465,Monogastrics,0.00253384711805011 +Somalia,9.26772566595465,Oilcrops,0.0300677070584709 +Somalia,9.26772566595465,Pulses,0.00929352251932545 +Somalia,9.26772566595465,Starchy Roots,0.0566472889368062 +Democratic Republic of the Congo,65.9387278576882,Ruminants,0.0907337446909379 +Democratic Republic of the Congo,65.9387278576882,Cereals,0.159377417992335 +Democratic Republic of the Congo,65.9387278576882,Monogastrics,0.0215114167704967 +Democratic Republic of the Congo,65.9387278576882,Oilcrops,0.0152548650594949 +Democratic Republic of the Congo,65.9387278576882,Pulses,0.0189863767718427 +Democratic Republic of the Congo,65.9387278576882,Starchy Roots,0.197745481077799 +Myanmar,51.7330131028006,Ruminants,0.097979272451009 +Myanmar,51.7330131028006,Cereals,0.226701846366329 +Myanmar,51.7330131028006,Monogastrics,0.152918019246452 +Myanmar,51.7330131028006,Oilcrops,0.0333546970440809 +Myanmar,51.7330131028006,Pulses,0.00313303952565078 +Myanmar,51.7330131028006,Starchy Roots,0.0226865078163409 diff --git a/data/net_imports.csv b/data/net_imports.csv index f2d9d13371ce43f6082aff5969e21b26ebddddfc..0153c0d294de46cba9112299d6c75ac04f1fc12f 100644 --- a/data/net_imports.csv +++ b/data/net_imports.csv @@ -1679,27 +1679,35 @@ Starchy Roots,Yemen,2010,0.004789 Starchy Roots,Zambia,2010,0.005032 Starchy Roots,Zimbabwe,2010,0.010735 WheatBarleyOats,Timor-Leste,2010,0.014367 -Ruminants,Sudan,2010,0.0140868336448598 -WheatBarleyOats,Sudan,2010,0.184895566978193 -Monogastrics,Sudan,2010,0.00156740700934579 -MaizeMilletSorghum,Sudan,2010,0.0991251635514019 -Oilcrops,Sudan,2010,-0.000420090342679128 -Pulses,Sudan,2010,0.003241746105919 -Rice (Paddy Equivalent),Sudan,2010,0.0239745264797508 -Starchy Roots,Sudan,2010,0.000220327102803738 -Ruminants,South Sudan,2010,0.00462340934579439 -WheatBarleyOats,South Sudan,2010,0.0606841760124611 -Monogastrics,South Sudan,2010,0.000514435280373832 -MaizeMilletSorghum,South Sudan,2010,0.0325336565420561 -Oilcrops,South Sudan,2010,-0.000137876947040498 -Pulses,South Sudan,2010,0.00106396651090343 -Rice (Paddy Equivalent),South Sudan,2010,0.0078686277258567 -Starchy Roots,South Sudan,2010,7.23130841121495e-05 -Ruminants,Somalia,2010,0.00393136135612699 -WheatBarleyOats,Somalia,2010,0.0516007575061054 -Monogastrics,Somalia,2010,0.000437432818560552 -MaizeMilletSorghum,Somalia,2010,0.0276639056888378 -Oilcrops,Somalia,2010,-0.000117239046114064 -Pulses,Somalia,2010,0.000904708303404683 -Rice (Paddy Equivalent),Somalia,2010,0.00669082416319494 -Starchy Roots,Somalia,2010,6.14890101996839e-05 +Ruminants,Sudan,2010,0.0281625413159806 +WheatBarleyOats,Sudan,2010,0.369645100910598 +Monogastrics,Sudan,2010,0.00313357605921368 +MaizeMilletSorghum,Sudan,2010,0.198172036693876 +Oilcrops,Sudan,2010,-0.000839848892264185 +Pulses,Sudan,2010,0.00648093183645824 +Rice (Paddy Equivalent),Sudan,2010,0.0479301175508253 +Starchy Roots,Sudan,2010,0.000440480188250447 +Ruminants,South Sudan,2010,0.00784168670838988 +WheatBarleyOats,South Sudan,2010,0.102925408687719 +Monogastrics,South Sudan,2010,0.000872525013192655 +MaizeMilletSorghum,South Sudan,2010,0.0551797868197042 +Oilcrops,South Sudan,2010,-0.00023385076728807 +Pulses,South Sudan,2010,0.00180457567624046 +Rice (Paddy Equivalent),South Sudan,2010,0.0133458469359296 +Starchy Roots,South Sudan,2010,0.000122649003822414 +Ruminants,Somalia,2010,0.00747128086247846 +WheatBarleyOats,Somalia,2010,0.0980636774698724 +Monogastrics,Somalia,2010,0.000831310874244116 +MaizeMilletSorghum,Somalia,2010,0.0525733430309851 +Oilcrops,Somalia,2010,-0.000222804713741746 +Pulses,Somalia,2010,0.00171933567562249 +Rice (Paddy Equivalent),Somalia,2010,0.0127154494324922 +Starchy Roots,Somalia,2010,0.000116855619095321 +Ruminants,Democratic Republic of the Congo,2010,0.172891440302929 +WheatBarleyOats,Democratic Republic of the Congo,2010,0.777371952905316 +Monogastrics,Democratic Republic of the Congo,2010,0.00632296094150098 +MaizeMilletSorghum,Democratic Republic of the Congo,2010,0.0247954000346653 +Oilcrops,Democratic Republic of the Congo,2010,-0.111860558744792 +Pulses,Democratic Republic of the Congo,2010,-0.161424572281856 +Rice (Paddy Equivalent),Democratic Republic of the Congo,2010,-0.00343314055215297 +Starchy Roots,Democratic Republic of the Congo,2010,-0.00308045121064441 diff --git a/debug_config.properties b/debug_config.properties index 1e41da7cd42fc8c2fa5cba472b417d7eb370eb07..673d92407d9ba7a5ab523320b1686e666ce3d69a 100644 --- a/debug_config.properties +++ b/debug_config.properties @@ -1,7 +1,7 @@ BASE_DIR=/Users/peteralexander/Documents/R_Workspace/UNPLUM #YIELD_DIR=/Users/peteralexander/Documents/LURG/LPJ/yield_anpp_rcps-2016-01-29/rcp8p5_past_fert/output-2016-01-29 -YIELD_DIR=/Users/peteralexander/Documents/LURG/LPJ/10Jan2017/combined +YIELD_DIR=/Users/peteralexander/Documents/LURG/LPJ/19Jan2017/LPJG_PLUM_expt1.2_rcp85_forED SPATIAL_DIR_NAME=halfdeg CELL_SIZE_X=0.5 #ANPP_FILENAME=anpp.out diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java index e81c70d8d2924a4026cc1e40e33eb6e313b0ebbe..e33bf828ba9b229ae1a323f5ae734438817db07a 100644 --- a/src/ac/ed/lurg/ModelConfig.java +++ b/src/ac/ed/lurg/ModelConfig.java @@ -162,7 +162,6 @@ public class ModelConfig { 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 MIN_FEED_RATE = getDoubleProperty("MIN_FEED_RATE", 0.15); 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); @@ -173,7 +172,7 @@ public class ModelConfig { public static final double MARKET_LAMBA = getDoubleProperty("MARKET_LAMBA", 0.5); // controls international market price adjustment rate - 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 POPULATION_AGGREG_LIMIT = getDoubleProperty("POPULATION_AGGREG_LIMIT", 30.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 @@ -181,7 +180,7 @@ public class ModelConfig { 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.87 * 1.4 * 2); // £900/t N * 1.4$/£ * 2NPK/N + public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 0.5007 / 0.18); 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); @@ -197,6 +196,7 @@ public class ModelConfig { 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 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; diff --git a/src/ac/ed/lurg/Timestep.java b/src/ac/ed/lurg/Timestep.java index 50274b6cc0df551c7b0c9960c67c7719fad93a24..e5127fe5eaee1efa7bc353ef98904cd62a41ba01 100644 --- a/src/ac/ed/lurg/Timestep.java +++ b/src/ac/ed/lurg/Timestep.java @@ -86,8 +86,8 @@ public class Timestep { public String getYearSubDir(String rootDir) { if (ModelConfig.CHANGE_YIELD_DATA_YEAR) - return rootDir + File.separator + getYieldYear(); + return rootDir + File.separator + (getYieldYear()-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + getYieldYear(); else - return rootDir + File.separator + ModelConfig.BASE_YEAR; + return rootDir + File.separator + (ModelConfig.BASE_YEAR-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + ModelConfig.BASE_YEAR; } } diff --git a/src/ac/ed/lurg/country/CompositeCountryManager.java b/src/ac/ed/lurg/country/CompositeCountryManager.java index 52ab2e022f76448b862f32c97a30e416636c1c4c..d202092b9b5912ce8600fe006cf202bb53305179 100644 --- a/src/ac/ed/lurg/country/CompositeCountryManager.java +++ b/src/ac/ed/lurg/country/CompositeCountryManager.java @@ -1,6 +1,5 @@ package ac.ed.lurg.country; -import java.util.Arrays; import java.util.Collection; import java.util.HashMap; import java.util.HashSet; @@ -25,7 +24,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("Bangladesh", "Democratic Republic of the Congo")); for (SingleCountry c : baseConsumpManager.getAllCountries()) { CompositeCountry cc; diff --git a/src/ac/ed/lurg/country/gams/GamsCountryInput.java b/src/ac/ed/lurg/country/gams/GamsCountryInput.java index 22915452f5223595f6256a9dad1873d22e31e7a9..ff9f42f42ebe582b00a599fa2da0d15030389be6 100644 --- a/src/ac/ed/lurg/country/gams/GamsCountryInput.java +++ b/src/ac/ed/lurg/country/gams/GamsCountryInput.java @@ -54,10 +54,6 @@ public class GamsCountryInput { return ModelConfig.LAND_CHANGE_COST; } - public double getMinFeedRate() { - return ModelConfig.MIN_FEED_RATE; - } - public Map<CropType, Double> getMinNetImport() { Map<CropType, Double> netImport = new HashMap<CropType, Double>(); for (Map.Entry<CropType, ImportExportConstraint> entry : importConstraints.entrySet()) { diff --git a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java index 9e273d017783ee61a1f986bed2baacac8841ab22..efb19bd7ec16de8306b4a2a048d076b8a4ceb5b0 100644 --- a/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java +++ b/src/ac/ed/lurg/country/gams/GamsLocationOptimiser.java @@ -220,7 +220,6 @@ public class GamsLocationOptimiser { addScalar(inDB, "otherICost",ModelConfig.OTHER_INTENSITY_COST, 3); addScalar(inDB, "otherIParam", ModelConfig.OTHER_INTENSITY_PARAM, 3); addScalar(inDB, "landChangeCost", countryInput.getLandChangeCost(), 3); - addScalar(inDB, "minFeedRate", countryInput.getMinFeedRate(), 3); addScalar(inDB, "unhandledCropArea", ModelConfig.UNHANDLED_CROP_AREA, 3); addScalar(inDB, "domesticPriceMarkup", ModelConfig.DOMESTIC_PRICE_MARKUP, 3); }