From 000ddea1bc7b4e83692429335eac2422c9d412ce Mon Sep 17 00:00:00 2001
From: Peter Alexander <peter@blackhillock.co.uk>
Date: Sat, 30 Jun 2018 05:28:27 +0100
Subject: [PATCH] Apply unhandled crop adjustment to irrigation water
 constraint

---
 GAMS/IntExtOpt.gms              |  6 +++---
 GAMS/LUOpt.gms                  |  6 +++---
 src/ac/ed/lurg/ModelConfig.java | 11 +++++++----
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/GAMS/IntExtOpt.gms b/GAMS/IntExtOpt.gms
index aa59fdb6..7f0df3c1 100644
--- a/GAMS/IntExtOpt.gms
+++ b/GAMS/IntExtOpt.gms
@@ -83,8 +83,8 @@ $gdxin
 
  PARAMETER baseCost(crop);
  PARAMETER otherIntCost(crop);
- baseCost(crop) = prodCost(crop)*0.35;
- otherIntCost(crop) = baseCost(crop)*0.65 + otherICost;
+ baseCost(crop) = prodCost(crop)*0.5;
+ otherIntCost(crop) = baseCost(crop)*0.5 + otherICost;
  baseCost('pasture') = 0.03;
  otherIntCost('pasture') = 0.8 + otherICost;
                               
@@ -181,7 +181,7 @@ $gdxin
  PASTURE_IMPORT_CONSTRAINT .. importAmount('pasture') =E= 0;
  PASTURE_EXPORT_CONSTRAINT ..  exportAmount('pasture') =E= 0;
   
- IRRIGATION_CONSTRAINT(location) .. irrigConstraint(location) * suitableLandArea(location) =G= sum(crop, irrigMaxRate(crop, location) * irrigI(crop, location) * area(crop, location));
+ IRRIGATION_CONSTRAINT(location) .. irrigConstraint(location) * suitableLandArea(location) * (1.0 - unhandledCropArea) =G= sum(crop, irrigMaxRate(crop, location) * irrigI(crop, location) * area(crop, location));
 
  AGRI_LAND_EXPANSION_CALC(location) .. agriLandExpansion(location) =G= sum(crop, area(crop, location) - previousArea(crop, location)); 
  
diff --git a/GAMS/LUOpt.gms b/GAMS/LUOpt.gms
index 7c9ace73..c2e35705 100644
--- a/GAMS/LUOpt.gms
+++ b/GAMS/LUOpt.gms
@@ -84,8 +84,8 @@ $gdxin
 
  PARAMETER baseCost(crop);
  PARAMETER otherIntCost(crop);
- baseCost(crop) = prodCost(crop)*0.35;
- otherIntCost(crop) = baseCost(crop)*0.65 + otherICost;
+ baseCost(crop) = prodCost(crop)*0.5;
+ otherIntCost(crop) = baseCost(crop)*0.5 + otherICost;
  baseCost('pasture') = 0.03;
  otherIntCost('pasture') = 0.8 + otherICost;
                               
@@ -174,7 +174,7 @@ $gdxin
  MAX_PRODUCTION_CONSTRAINT(traded_commodity) .. netProduction(traded_commodity) =L= maxProduction(traded_commodity);
  MIN_PRODUCTION_CONSTRAINT(traded_commodity) .. netProduction(traded_commodity) =G= minProduction(traded_commodity);
   
- IRRIGATION_CONSTRAINT(location) .. irrigConstraint(location) * suitableLandArea(location) =G= sum(crop, irrigMaxRate(crop, location) * irrigI(crop, location) * area(crop, location));
+ IRRIGATION_CONSTRAINT(location) .. irrigConstraint(location) * suitableLandArea(location) * (1.0 - unhandledCropArea) =G= sum(crop, irrigMaxRate(crop, location) * irrigI(crop, location) * area(crop, location));
 
  AGRI_LAND_EXPANSION_CALC(location) .. agriLandExpansion(location) =G= sum(crop, area(crop, location) - previousArea(crop, location)); 
  
diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java
index 2771e2a9..c8ffd221 100644
--- a/src/ac/ed/lurg/ModelConfig.java
+++ b/src/ac/ed/lurg/ModelConfig.java
@@ -210,7 +210,7 @@ public class ModelConfig {
 	public static final ModelFitType DEMAND_ANIMAL_PROD_FIT = ModelFitType.findByName(getProperty("DEMAND_ANIMAL_PROD_FIT", "loglinear"));
 	public static final ModelFitType DEMAND_NON_ANIMAL_PROD_FIT = ModelFitType.findByName(getProperty("DEMAND_NON_ANIMAL_PROD_FIT", "loglinear"));
 	public static final double TOTAL_MAX_CEREAL_CHANGE = getDoubleProperty("TOTAL_MAX_CEREAL_CHANGE", 0.5);
-	public static final double ANNUAL_MAX_CEREAL_CHANGE = getDoubleProperty("ANNUAL_MAX_CEREAL_CHANGE", 0.02);
+	public static final double ANNUAL_MAX_CEREAL_CHANGE = getDoubleProperty("ANNUAL_MAX_CEREAL_CHANGE", 0.0);
 	public static final boolean LIMIT_CEREAL_FRACTION = getBooleanProperty("LIMIT_CEREAL_FRACTION", true);
 
 	public static final double PASTURE_HARVEST_FRACTION = getDoubleProperty("PASTURE_HARVEST_FRACTION", 0.5);
@@ -232,7 +232,8 @@ public class ModelConfig {
 	public static final double AGRI_EXPANSION_COST_BASE = getDoubleProperty("AGRI_EXPANSION_COST_BASE", 0.04 * LAND_CHANGE_COST * AGRI_LAND_EXPANSION_COST_FACTOR);
 	public static final double AGRI_EXPANSION_COST_BASE_MANAGED_FOREST = getDoubleProperty("AGRI_EXPANSION_COST_BASE_MANAGED_FOREST", 0.5 * LAND_CHANGE_COST * AGRI_LAND_EXPANSION_COST_FACTOR);
 
-	public static final double SEED_AND_WASTE_FRACTION = getDoubleProperty("SEED_AND_WASTE_FRACTION", 0.1);  
+	//processedFull$com_bal[Country =="World" & Item %in% itemGroupMapping$combalItem, list(sum(seed+waste)/sum(supply))]
+	public static final double SEED_AND_WASTE_FRACTION = getDoubleProperty("SEED_AND_WASTE_FRACTION", 0.08);  
 
 	public static final double TECHNOLOGY_CHANGE_ANNUAL_RATE = getDoubleProperty("TECHNOLOGY_CHANGE_ANNUAL_RATE", 0.002);
 	public static final int TECHNOLOGY_CHANGE_START_STEP = getIntProperty("TECHNOLOGY_CHANGE_START_STEP", 0);
@@ -280,13 +281,15 @@ public class ModelConfig {
 	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 boolean PREDEFINED_COUNTRY_GROUPING = getBooleanProperty("PREDEFINED_COUNTRY_GROUPING", true);
 
-	public static final double UNHANDLED_CROP_AREA = getDoubleProperty("UNHANDLED_CROP_AREA", 0.3);  // includes fruit veg forage crops set aside and failed crop
+	// All cropland LUH2 1536.7 Mha, crop_prod[Country =="World" & Item %in% itemGroupMapping$cropProdItem & Year == 2011, sum(area)] is 1105.6 so unhandled is .2805
+	// 1377.6 Mha is area of crops in FAO crop production.  So we do not represent crops covering (1377.6-1105.6)/1536.7=17.7% of cropland.  Additional 'unhandled' is for set aside and failed crops, 10.3% of cropland.
+	public static final double UNHANDLED_CROP_AREA = getDoubleProperty("UNHANDLED_CROP_AREA", 0.28);  // includes fruit veg forage crops set aside and failed crop
 	
 	public static final double OTHER_INTENSITY_COST = getDoubleProperty("OTHER_INTENSITY_COST", 0.6);
 	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.0005);
-	public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 1.8); // $500/t, 18% N/t
+	public static final double FERTILISER_COST_PER_T = getDoubleProperty("FERTILISER_COST_PER_T", 1.9); // $500/t, 18% N/t
 	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.0);
-- 
GitLab