Skip to content
Snippets Groups Projects
Commit 3edd10dc authored by Peter Alexander's avatar Peter Alexander
Browse files

Changes to simplify configuration

parent c00b2be5
No related branches found
No related tags found
No related merge requests found
...@@ -73,6 +73,8 @@ if [ ! -d "$scenariodir" ]; then ...@@ -73,6 +73,8 @@ if [ ! -d "$scenariodir" ]; then
exit -1 exit -1
fi fi
cd $scenariodir
echo "starting" echo "starting"
runcmd="java -Xmx1G -XX:+PrintGC -classpath $GAMSPATH/apifiles/Java/api/GAMSJavaAPI.jar:$classesdir -DBUILDVER=$buildver -DCONFIG_FILE=$scenariodir/config.properties ac.ed.lurg.ModelMain" runcmd="java -Xmx1G -XX:+PrintGC -classpath $GAMSPATH/apifiles/Java/api/GAMSJavaAPI.jar:$classesdir -DBUILDVER=$buildver -DCONFIG_FILE=$scenariodir/config.properties ac.ed.lurg.ModelMain"
echo $runcmd echo $runcmd
......
...@@ -99,7 +99,7 @@ public class ModelConfig { ...@@ -99,7 +99,7 @@ public class ModelConfig {
// Directory information // Directory information
public static final String BASE_DIR = getProperty("BASE_DIR"); // this must to be set in config file public static final String BASE_DIR = getProperty("BASE_DIR"); // this must to be set in config file
public static final String OUTPUT_DIR = getProperty("OUTPUT_DIR", BASE_DIR + File.separator + "output"); public static final String OUTPUT_DIR = getProperty("OUTPUT_DIR", System.getProperty("user.dir"));
public static final String TEMP_DIR = getProperty("TEMP_DIR", OUTPUT_DIR + File.separator + "GamsTmp"); public static final String TEMP_DIR = getProperty("TEMP_DIR", OUTPUT_DIR + File.separator + "GamsTmp");
public static final String DATA_DIR = getProperty("DATA_DIR", BASE_DIR + File.separator + "data"); public static final String DATA_DIR = getProperty("DATA_DIR", BASE_DIR + File.separator + "data");
public static final String GAMS_DIR = getProperty("GAMS_DIR", BASE_DIR + File.separator + "GAMS"); public static final String GAMS_DIR = getProperty("GAMS_DIR", BASE_DIR + File.separator + "GAMS");
...@@ -233,13 +233,13 @@ public class ModelConfig { ...@@ -233,13 +233,13 @@ public class ModelConfig {
public static final double TECHNOLOGY_CHANGE_ANNUAL_RATE = getDoubleProperty("TECHNOLOGY_CHANGE_ANNUAL_RATE", 0.002); 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); public static final int TECHNOLOGY_CHANGE_START_STEP = getIntProperty("TECHNOLOGY_CHANGE_START_STEP", 0);
public static final boolean USE_BIOENERGY_TRAJECTORY = getBooleanProperty("USE_BIOENERGY_TRAJECTORY", false); // false is the old style, i.e. BIOENERGY_CHANGE_ANNUAL_RATE, BIOENERGY_CHANGE_START_YEAR and BIOENERGY_CHANGE_END_YEAR public static final boolean USE_BIOENERGY_TRAJECTORY = getBooleanProperty("USE_BIOENERGY_TRAJECTORY", true); // false is the old style, i.e. BIOENERGY_CHANGE_ANNUAL_RATE, BIOENERGY_CHANGE_START_YEAR and BIOENERGY_CHANGE_END_YEAR
// original way to specify changes in bioenergy // original way to specify changes in bioenergy
public static final double BIOENERGY_CHANGE_ANNUAL_RATE = IS_CALIBRATION_RUN ? 0.0 : getDoubleProperty("BIOENERGY_CHANGE_ANNUAL_RATE", 0.10); // 6.2/2.31/20 public static final double BIOENERGY_CHANGE_ANNUAL_RATE = IS_CALIBRATION_RUN ? 0.0 : getDoubleProperty("BIOENERGY_CHANGE_ANNUAL_RATE", 0.10); // 6.2/2.31/20
public static final int BIOENERGY_CHANGE_START_YEAR = getIntProperty("BIOENERGY_CHANGE_START_YEAR", 2010); public static final int BIOENERGY_CHANGE_START_YEAR = getIntProperty("BIOENERGY_CHANGE_START_YEAR", 2010);
public static final int BIOENERGY_CHANGE_END_YEAR = getIntProperty("BIOENERGY_CHANGE_END_YEAR", 2060); public static final int BIOENERGY_CHANGE_END_YEAR = getIntProperty("BIOENERGY_CHANGE_END_YEAR", 2060);
// newer way // newer way
public static final boolean ENABLE_GEN2_BIOENERGY = getBooleanProperty("ENABLE_GEN2_BIOENERGY", false); public static final boolean ENABLE_GEN2_BIOENERGY = getBooleanProperty("ENABLE_GEN2_BIOENERGY", true);
public static final String BIOENERGY_DEMAND_SCENARIO = getProperty("BIOENERGY_DEMAND_SCENARIO", "BAU"); public static final String BIOENERGY_DEMAND_SCENARIO = getProperty("BIOENERGY_DEMAND_SCENARIO", "BAU");
public static final double BIOENERGY_DEMAND_SHIFT = IS_CALIBRATION_RUN ? 1.0 : getDoubleProperty("BIOENERGY_DEMAND_SHIFT", 1.0); public static final double BIOENERGY_DEMAND_SHIFT = IS_CALIBRATION_RUN ? 1.0 : getDoubleProperty("BIOENERGY_DEMAND_SHIFT", 1.0);
// public static final double BIOENERGY_HEATING_VALUE_GJ_PER_T = getDoubleProperty("BIOENERGY_HEATING_VALUE_GJ_PER_T", 17.5); // GJ per t DM // public static final double BIOENERGY_HEATING_VALUE_GJ_PER_T = getDoubleProperty("BIOENERGY_HEATING_VALUE_GJ_PER_T", 17.5); // GJ per t DM
...@@ -277,6 +277,6 @@ public class ModelConfig { ...@@ -277,6 +277,6 @@ 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 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 = 5; public static final int LPJG_TIMESTEP_SIZE = 5;
public static final int NUM_YIELD_CLUSTERS = getIntProperty("NUM_YIELD_CLUSTERS", 5000); 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 public static final long RANDOM_SEED = getIntProperty("RANDOM_SEED", 1974329); // any number will do
} }
...@@ -81,6 +81,7 @@ public class ModelMain { ...@@ -81,6 +81,7 @@ public class ModelMain {
public static void main(String[] args) { public static void main(String[] args) {
ModelMain theModel = new ModelMain(); ModelMain theModel = new ModelMain();
System.out.println("Working Directory = " + System.getProperty("user.dir"));
theModel.setup(); theModel.setup();
theModel.run(); theModel.run();
} }
......
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