From 6ef910e85c100d57682ae68611512b4cf7b925e6 Mon Sep 17 00:00:00 2001
From: Peter Alexander <peter@blackhillock.co.uk>
Date: Fri, 5 Feb 2016 09:09:23 +0000
Subject: [PATCH] Some logging changes and change fertilisation amounts

---
 config.properties                      | 13 +++++--------
 debug_config.properties                | 22 ++++++++++++++++++++++
 src/ac/ed/lurg/ModelConfig.java        |  4 ++--
 src/ac/ed/lurg/utils/WatchDir.java     |  2 +-
 src/ac/ed/lurg/utils/WatchForFile.java |  6 ++++--
 5 files changed, 34 insertions(+), 13 deletions(-)
 create mode 100644 debug_config.properties

diff --git a/config.properties b/config.properties
index 9e02a900..e7cabbf3 100644
--- a/config.properties
+++ b/config.properties
@@ -1,21 +1,18 @@
 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=true
+
+CHANGE_YIELD_DATA_YEAR=true
 KEEP_DEMAND_FIXED=false
-DEBUG_LIMIT_COUNTRIES=true
+DEBUG_LIMIT_COUNTRIES=false
 MAX_IMPORT_CHANGE=0.10
 SEED_AND_WASTE_FRACTION=0.15
-SSP_SCENARIO=SSP4_v9_130325
 
-END_TIMESTEP=1
+END_TIMESTEP=0
 TIMESTEP_SIZE=10
 POPULATION_AGGREG_LIMIT=60
 
 NUM_CEREAL_CATEGORIES=10
 NUM_PASTURE_CATEGORIES=1
 
-YIELD_FILENAME = yield_plum_Sep9.out
-INTERPOLATE_OUTPUT_YEARS = false
\ No newline at end of file
diff --git a/debug_config.properties b/debug_config.properties
new file mode 100644
index 00000000..59bd90af
--- /dev/null
+++ b/debug_config.properties
@@ -0,0 +1,22 @@
+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=true
+KEEP_DEMAND_FIXED=false
+DEBUG_LIMIT_COUNTRIES=true
+MAX_IMPORT_CHANGE=0.10
+SEED_AND_WASTE_FRACTION=0.15
+SSP_SCENARIO=SSP4_v9_130325
+
+END_TIMESTEP=2
+TIMESTEP_SIZE=10
+POPULATION_AGGREG_LIMIT=60
+
+NUM_CEREAL_CATEGORIES=5
+NUM_PASTURE_CATEGORIES=3
+
+IRRIG_MAX_WATER_FILENAME = gsirrigation_plum.out
+
+INTERPOLATE_OUTPUT_YEARS = false
\ No newline at end of file
diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java
index aba91b80..f6deb7c8 100644
--- a/src/ac/ed/lurg/ModelConfig.java
+++ b/src/ac/ed/lurg/ModelConfig.java
@@ -130,8 +130,8 @@ public class ModelConfig {
 
 	// Fertiliser application rates in kg/ha
 	public static final double MIN_FERT_AMOUNT = 5;
-	public static final double MID_FERT_AMOUNT = 50;
-	public static final double MAX_FERT_AMOUNT = 500;
+	public static final double MID_FERT_AMOUNT = 20;
+	public static final double MAX_FERT_AMOUNT = 200;
 
 	// Other model parameters
 	public static final boolean KEEP_DEMAND_FIXED = getBooleanProperty("KEEP_DEMAND_FIXED", false);
diff --git a/src/ac/ed/lurg/utils/WatchDir.java b/src/ac/ed/lurg/utils/WatchDir.java
index 6e1d13c9..c9d1ef09 100644
--- a/src/ac/ed/lurg/utils/WatchDir.java
+++ b/src/ac/ed/lurg/utils/WatchDir.java
@@ -80,7 +80,7 @@ public class WatchDir {
 		this.recursive = recursive;
 
 		if (recursive) {
-			LogWriter.println(String.format("Scanning %s ...", dir));
+			//LogWriter.println(String.format("Scanning %s ...", dir));
 			registerAll(dir, events);
 		}
 		else {
diff --git a/src/ac/ed/lurg/utils/WatchForFile.java b/src/ac/ed/lurg/utils/WatchForFile.java
index d6de47c6..cd360015 100644
--- a/src/ac/ed/lurg/utils/WatchForFile.java
+++ b/src/ac/ed/lurg/utils/WatchForFile.java
@@ -28,10 +28,12 @@ public class WatchForFile extends Observable implements WatchDir.Callback {
 				
 				Path dirToMonitor = fileToWaitFor.getParentFile().getParentFile().toPath(); // goes up a directory level as lowest directory not always exists before
 				
+				LogWriter.println(String.format("Scanning %s ... for %s ", dirToMonitor, fileToWaitFor));
+
 				try {
 					watchDir = new WatchDir(dirToMonitor, true, WatchForFile.this, StandardWatchEventKinds.ENTRY_CREATE); 
 					checkForFile(); // just in case file has been created before we get here
-					watchDir.processEvents();
+					watchDir.processEvents(); // in here while (!stop)
 				} 
 				catch (IOException e) {
 					LogWriter.printlnError("Problem watching directory " + e.getMessage());
@@ -53,7 +55,7 @@ public class WatchForFile extends Observable implements WatchDir.Callback {
 	
 	public synchronized boolean checkForFile() {
 		if (fileToWaitFor.exists()) {
-			LogWriter.println("Found our marker file");
+			LogWriter.println("Found our marker file: " + fileToWaitFor);
 			stop();
 			notify();
 			return true;
-- 
GitLab