Skip to content
Snippets Groups Projects
Commit 97481171 authored by Peter Alexander's avatar Peter Alexander
Browse files

Changes, including format in LPJG output

parent 93777e55
No related branches found
No related tags found
No related merge requests found
......@@ -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/ ;
......
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
......@@ -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
......@@ -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)) {
......
......@@ -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();
}
}
......
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