Skip to content
Snippets Groups Projects
Commit 427d6e01 authored by R0slyn's avatar R0slyn
Browse files

converting irrigation constraint from km3 to mm

parent e94cc8a6
No related branches found
No related tags found
No related merge requests found
......@@ -207,7 +207,7 @@ public class ModelConfig {
public static final double IRRIGIATION_EFFICIENCY = getDoubleProperty("IRRIGIATION_EFFICIENCY", 0.5);
public static final double ENVIRONMENTAL_WATER_CONSTRAINT = getDoubleProperty("ENVIRONMENTAL_WATER_CONSTRAINT", 1.0);
public static final double WATER_AVAILIBILITY_RATE_OF_CHANGE = IS_CALIBRATION_RUN ? 0.0 : getDoubleProperty("WATER_AVAILIBILITY_RATE_OF_CHANGE", 0.0);
public static final boolean USE_BLUE_WATER_FILE_IRRIG_CONSTRAINT = getBooleanProperty("USE_BLUE_WATER_FILE_IRRIG_CONSTRAINT", true);;
public static final boolean USE_BLUE_WATER_FILE_IRRIG_CONSTRAINT = getBooleanProperty("USE_BLUE_WATER_FILE_IRRIG_CONSTRAINT", false);;
public static final double LAND_CHANGE_COST = getDoubleProperty("LAND_CHANGE_COST", 0.7);
public static final double CROP_TO_PASTURE_COST_FACTOR = getDoubleProperty("CROP_TO_PASTURE_COST_FACTOR", 1.0);
......
......@@ -91,6 +91,7 @@ public class FPUManager {
}
public double getOtherWaterUse(Integer fpuId, Integer year) {
LogWriter.println(fpuId + " " + year);
Double d = fpuOtherUses.get(fpuId).get(year);
return d;
}
......
......@@ -5,6 +5,7 @@ import java.util.Map;
import ac.ed.lurg.ModelConfig;
import ac.ed.lurg.Timestep;
import ac.ed.lurg.utils.LogWriter;
import ac.sac.raster.IntegerRasterItem;
import ac.sac.raster.RasterHeaderDetails;
import ac.sac.raster.RasterKey;
......@@ -41,6 +42,7 @@ public class IrrigationRasterSet extends RasterSet<IrrigationItem> {
double fpuRunOff = 0.0;
double otherUses = 0.0;
double waterAvailForIrrigPerCell = 0.0;
double waterAvailabileMm = 0.0;
int cellCount = 0;
for (Map.Entry<RasterKey, IrrigationItem> entry : irrigData.entrySet()) {
......@@ -59,10 +61,13 @@ public class IrrigationRasterSet extends RasterSet<IrrigationItem> {
waterAvailForIrrigPerCell = 0;
else
waterAvailForIrrigPerCell = (fpuRunOffAvailable - otherUses) / cellCount;
for (Map.Entry<RasterKey, IrrigationItem> entry : irrigData.entrySet()) {
if (entry.getValue() != null)
entry.getValue().setIrrigConstraint(waterAvailForIrrigPerCell);
if (entry.getValue() != null){
waterAvailabileMm = waterAvailForIrrigPerCell/fpuManager.fpuBoundaries.getAreaMha(entry.getKey())/0.01;
entry.getValue().setIrrigConstraint(waterAvailabileMm);
}
}
}
}
......
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