From 0f515f57141151a9a285e61971853b970ba81686 Mon Sep 17 00:00:00 2001 From: Bart Arendarczyk <s1924442@ed.ac.uk> Date: Wed, 26 Oct 2022 13:54:30 +0200 Subject: [PATCH] Fixed abandoned pastures. --- GAMS/IntExtOpt.gms | 2 +- src/ac/ed/lurg/ModelMain.java | 3 +-- src/ac/ed/lurg/landuse/LandUseItem.java | 13 ------------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms index 5e2a28fa..b40b7793 100644 --- a/GAMS/IntExtOpt.gms +++ b/GAMS/IntExtOpt.gms @@ -169,7 +169,7 @@ $gdxin (yieldIrrigOnly(crop, location) - yieldNone(crop, location)) * (1 - exp(-irrigParam(crop, location)*irrigI(crop, location))) + (yieldBoth(crop, location) + yieldNone(crop, location) - yieldFertOnly(crop, location) - yieldIrrigOnly(crop, location)) * (1 - exp(-fertParam(crop, location)*fertI(crop, location))) * (1 - exp(-irrigParam(crop, location)*irrigI(crop, location))) - ) * (1 - exp(-otherIntensity(crop, location)*otherIParam)); + ) * (1.01 - exp(-otherIntensity(crop, location)*otherIParam)); NET_SUPPLY_EQ(crop) .. net_supply(crop) =E= sum(location, area(crop, location) * yield(crop, location)) * (1 - seedAndWasteRate(crop)) - ruminantFeed(crop) - monogastricFeed(crop) + importAmount(crop) - exportAmount(crop); diff --git a/src/ac/ed/lurg/ModelMain.java b/src/ac/ed/lurg/ModelMain.java index ae7c4102..1d7b47c3 100644 --- a/src/ac/ed/lurg/ModelMain.java +++ b/src/ac/ed/lurg/ModelMain.java @@ -173,7 +173,7 @@ public class ModelMain { private void writeLandCoverFile(Timestep timestep, RasterSet<LandUseItem> landUseRaster) { try { - StringBuffer sbHeadings = new StringBuffer("Year,Cropland,Pasture,ManForest,UnmanForest,Natural,AbPasture,Suitable,EnergyCrop,FertCrop,IrrigCrop,ManIntCrop,ManIntPast"); + StringBuffer sbHeadings = new StringBuffer("Year,Cropland,Pasture,ManForest,UnmanForest,Natural,Suitable,EnergyCrop,FertCrop,IrrigCrop,ManIntCrop,ManIntPast"); BufferedWriter outputFile = FileWriterHelper.getFileWriter(timestep, ModelConfig.LAND_COVER_OUTPUT_FILE, sbHeadings.toString()); StringBuffer sbData = new StringBuffer(); @@ -183,7 +183,6 @@ public class ModelMain { LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.MANAGED_FOREST), LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.UNMANAGED_FOREST), LandUseItem.getTotalLandCover(landUseRaster.values(), LandCoverType.OTHER_NATURAL), - LandUseItem.getAbandonedPasture(landUseRaster.values()), LandUseItem.getSuitableTotal(landUseRaster.values(), timestep.getYear())) ); diff --git a/src/ac/ed/lurg/landuse/LandUseItem.java b/src/ac/ed/lurg/landuse/LandUseItem.java index 2623e6e3..8dc3af47 100644 --- a/src/ac/ed/lurg/landuse/LandUseItem.java +++ b/src/ac/ed/lurg/landuse/LandUseItem.java @@ -284,19 +284,6 @@ public class LandUseItem implements InterpolatingRasterItem<LandUseItem>, Serial return d; } - public static double getAbandonedPasture(Collection<? extends LandUseItem> landUses) { - double total = 0; - for (LandUseItem a : landUses) { - if (a!=null) { - Double d = a.getLandCoverArea(LandCoverType.PASTURE); - Intensity intensity = a.getIntensity(CropType.PASTURE); - if (intensity!=null && d!=null && intensity.getFertiliserAmount()==0 && intensity.getIrrigationRate()==0 && intensity.getOtherIntensity()==0) - total += d; - } - } - return total; - } - public static double getSuitableTotal(Collection<? extends LandUseItem> landUses, int year) { double total = 0; for (LandUseItem a : landUses) { -- GitLab