diff --git a/scripts/summariseLandUseOneSim.R b/scripts/summariseLandUseOneSim.R index 01938da06c15c9ec1d472369452b0ead521ea941..35a3385bfa5bc052a1b4ce4a26101f6dd4bce5b3 100644 --- a/scripts/summariseLandUseOneSim.R +++ b/scripts/summariseLandUseOneSim.R @@ -30,7 +30,7 @@ summariseLandUseOutput = function(simDir, writeFile=TRUE) { print (paste("Processing", year, "from", fileName)) luDt = data.table(read.table(fileName, header=TRUE)) - for (cropType in c('maize', 'rice', 'wheat', 'energycrops', 'oilcrops', 'pulses', 'starchyRoots')) { + for (cropType in c('maize', 'rice', 'wheat', 'energycrops', 'oilcrops', 'pulses', 'starchyRoots', "fruitveg", "sugar")) { cropSummary = cropIntensitySummary(luDt, cropType) if (nrow(cropSummary) >0) cropSumDt = rbind(cropSumDt, cbind(cropSummary, year=year)) @@ -40,7 +40,7 @@ summariseLandUseOutput = function(simDir, writeFile=TRUE) { } } - dryMatterDt = data.table(cropType = c("wheat", "maize", "rice", "oilcrops", "pulses", "starchyRoots", "energycrops"), dryMatter= c(0.87, 0.86, 0.89, 0.88, 0.31, 0.21, 1.0)) + dryMatterDt = data.table(cropType = c("wheat", "maize", "rice", "oilcrops", "pulses", "starchyRoots", "energycrops", "fruitveg", "sugar"), dryMatter= c(0.87, 0.86, 0.89, 0.88, 0.31, 0.21, 1.0, 0.1, 1.0)) cropSumDt = merge(cropSumDt, dryMatterDt, by = "cropType") resDt = rbind(cropSumDt, cropSumDt[cropType != 'energycrops', list(cropType='avgExcEC', @@ -70,5 +70,4 @@ if (dir.exists(ensDir)) { summariseLandUseOutput(simDir = ensDir) } else { print(paste(ensDir, "does not exist. Stopping")) -} - +} \ No newline at end of file diff --git a/src/ac/ed/lurg/landuse/IrrigationMaxAmountReader.java b/src/ac/ed/lurg/landuse/IrrigationMaxAmountReader.java index 13aa847ce42aafd82c4829c30820138a0b5d4e55..640bae20e3836d2ad0970a67aaa73e50581b4017 100644 --- a/src/ac/ed/lurg/landuse/IrrigationMaxAmountReader.java +++ b/src/ac/ed/lurg/landuse/IrrigationMaxAmountReader.java @@ -31,6 +31,8 @@ public class IrrigationMaxAmountReader extends AbstractTabularRasterReader<Irrig double oilcrops = getValueForCol(rowValues, LPJCropTypes.OILCROPS + highFertIrrigString) / ModelConfig.IRRIGIATION_EFFICIENCY; double pulses = getValueForCol(rowValues, LPJCropTypes.PULSES + highFertIrrigString) / ModelConfig.IRRIGIATION_EFFICIENCY; double starchy_roots = getValueForCol(rowValues, LPJCropTypes.STARCHY_ROOTS + highFertIrrigString) / ModelConfig.IRRIGIATION_EFFICIENCY; + double fruitveg = getValueForCol(rowValues, LPJCropTypes.FRUITVEG + highFertIrrigString) / ModelConfig.IRRIGIATION_EFFICIENCY; + double sugar = getValueForCol(rowValues, LPJCropTypes.SUGAR + highFertIrrigString) / ModelConfig.IRRIGIATION_EFFICIENCY; item.setMaxIrrigAmount(CropType.WHEAT, c3Cereals); item.setMaxIrrigAmount(CropType.MAIZE, c4Cereals); @@ -39,6 +41,8 @@ public class IrrigationMaxAmountReader extends AbstractTabularRasterReader<Irrig item.setMaxIrrigAmount(CropType.OILCROPS, oilcrops); item.setMaxIrrigAmount(CropType.PULSES, pulses); item.setMaxIrrigAmount(CropType.STARCHY_ROOTS, starchy_roots); + item.setMaxIrrigAmount(CropType.FRUITVEG, fruitveg); + item.setMaxIrrigAmount(CropType.SUGAR, sugar); item.setMaxIrrigAmount(CropType.SETASIDE, 0.0); } } \ No newline at end of file diff --git a/src/ac/ed/lurg/output/LpjgOutputer.java b/src/ac/ed/lurg/output/LpjgOutputer.java index 847c6a46ac9b70e102d1eb32c6293fa49315c0c2..6b0219d277c8946d8af3a66a0ce44d62bff0ae1a 100644 --- a/src/ac/ed/lurg/output/LpjgOutputer.java +++ b/src/ac/ed/lurg/output/LpjgOutputer.java @@ -34,7 +34,7 @@ public class LpjgOutputer extends AbstractLandUseOutputer { BufferedWriter outputWriter = null; try { outputWriter = new BufferedWriter(new FileWriter(outputFileName, false)); - outputWriter.write("Lon Lat Year CerealsC3 Oilcrops StarchyRoots Pulses Maize Miscanthus Rice Pasture"); + outputWriter.write("Lon Lat Year CerealsC3 Oilcrops StarchyRoots Pulses Maize Miscanthus Rice Pasture FruitVeg Sugar"); outputWriter.newLine(); for (Entry<RasterKey, LandUseItem> entry : landUseRaster.entrySet()) { @@ -55,9 +55,11 @@ public class LpjgOutputer extends AbstractLandUseOutputer { double pulses = extractor.extract(item, CropType.PULSES); double starchyRoots = extractor.extract(item, CropType.STARCHY_ROOTS); double pasture = extractor.extract(item, CropType.PASTURE); + double fruitVeg = extractor.extract(item, CropType.FRUITVEG); + double sugar = extractor.extract(item, CropType.SUGAR); - outputWriter.write(String.format("%.2f %.2f %d %.14f %.14f %.14f %.14f %.14f %.14f %.14f %.14f", lat, lon, year, - c3cereal, oilcrops, starchyRoots, pulses, maize, miscanthus, rice, pasture)); + outputWriter.write(String.format("%.2f %.2f %d %.14f %.14f %.14f %.14f %.14f %.14f %.14f %.14f %.14f %.14f", lat, lon, year, + c3cereal, oilcrops, starchyRoots, pulses, maize, miscanthus, rice, pasture, fruitVeg, sugar)); outputWriter.newLine(); } }