From 54728f4fc6f3a652462d307b61c2a53deee17b3c Mon Sep 17 00:00:00 2001
From: Peter Alexander <>
Date: Tue, 15 Jun 2021 10:28:24 +0100
Subject: [PATCH] Allow year offset for LPJ-GUESS directories, used in GGCMI

---
 src/ac/ed/lurg/ModelConfig.java | 1 +
 src/ac/ed/lurg/Timestep.java    | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/ac/ed/lurg/ModelConfig.java b/src/ac/ed/lurg/ModelConfig.java
index 05544ea4..d8e32ced 100755
--- a/src/ac/ed/lurg/ModelConfig.java
+++ b/src/ac/ed/lurg/ModelConfig.java
@@ -376,6 +376,7 @@ public class ModelConfig {
 
 	public static final double PASTURE_MAX_IRRIGATION_RATE = getDoubleProperty("DEFAULT_MAX_IRRIGATION_RATE", 50.0); // shouldn't need this but some areas crops don't have a value, but was causing them to be selected
 	public static final int LPJG_TIMESTEP_SIZE = getIntProperty("LPJG_TIMESTEP_SIZE", 5);
+	public static final int LPJ_YEAR_OFFSET = getIntProperty("LPJ_YEAR_OFFSET", 0);;
 
 	public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 8000);
 	public static final long RANDOM_SEED = getIntProperty("RANDOM_SEED", 1974329);  // any number will do
diff --git a/src/ac/ed/lurg/Timestep.java b/src/ac/ed/lurg/Timestep.java
index fe6b49ec..f2ffcdfe 100644
--- a/src/ac/ed/lurg/Timestep.java
+++ b/src/ac/ed/lurg/Timestep.java
@@ -98,6 +98,7 @@ public class Timestep {
 	}
 	
 	public static String getYearSubDir(String rootDir, int endYear) {
+		endYear += ModelConfig.LPJ_YEAR_OFFSET;
 		return rootDir + File.separator + (endYear-ModelConfig.LPJG_TIMESTEP_SIZE+1) + "-" + endYear;
 	}
 }
-- 
GitLab