src/java/m/oms/ages/V1_0.java
@@ -330,10 +330,15 @@ |
// e.g. output/csip_run/out/Outlet.csv/output/catchmentSimRunoff |
double[] simData = Utils.getData(sim, getWorkspaceDir(), start, end); |
double result = of.calculate(obsData, simData, parameter().getDouble("missing", -9999d)); |
- if (Double.isNaN(result)) { |
- result = -99; |
+ return checkForNaN(result); |
+ } |
+ |
+ public static double checkForNaN(double result) { |
+ double checkedResult = -999.0; |
+ if (!Double.isNaN(result)) { |
+ checkedResult = result; |
} |
- return result; |
+ return checkedResult; |
} |
|
} |
src/java/oms/utils/Utils.java
@@ -314,13 +314,13 @@ |
// Create/execute a Ages. |
Executable p = createProcess(dsl, ws, param, res, LOG); |
int result = p.exec(); |
- if (result != 0) { |
- File f = p.stderr(); |
- if (f.exists() && f.length() > 10) { |
- String err = FileUtils.readFileToString(f, "UTF-8"); |
- LOG.info("Ages execution error. " + f + ":\n" + err); |
- throw new ServiceException("Ages execution error. " + f + ":\n" + err); |
- } |
+ if (result > 0) { |
+// File f = p.stderr(); |
+// if (f.exists() && f.length() > 10) { |
+// String err = FileUtils.readFileToString(f, "UTF-8"); |
+// LOG.info("Ages execution error. " + f + ":\n" + err); |
+// throw new ServiceException("Ages execution error. " + f + ":\n" + err); |
+// } |
throw new ServiceException("Ages execution error." + result); |
} |
} |