@@ -176,7 +176,7 @@ |
try (PrintWriter writer = new PrintWriter(tempSummaryFile)) { |
writer.println(" -ANNUAL-AVERAGES-"); |
writer.println(); |
- writer.println("Avg-Precipitation(mm/year)= " + df.format(avgYearlyPrecip)); |
+ writer.println("Avg. Precipitation(mm/year)= " + df.format(avgYearlyPrecip)); |
try (BufferedReader bufferedReader = new BufferedReader(new FileReader(summaryFile))) { |
for (int i = 0; i < 3; i++) { |
bufferedReader.readLine(); |
@@ -216,8 +216,8 @@ |
} catch (IOException E) { |
throw new ServiceException("Problem in editing the summary file.", E); |
} |
-// summaryFile.delete(); |
-// tempSummaryFile.renameTo(summaryFile); |
+ summaryFile.delete(); |
+ tempSummaryFile.renameTo(summaryFile); |
} |
|
|
@@ -230,26 +230,25 @@ |
return stateId.toLowerCase().startsWith("intl_"); |
} |
|
- |
- public double getYearlyPrecipIntl() throws Exception { |
- File sf = new File(workSpaceDir, stormFileName); |
- try (BufferedReader r = new BufferedReader(new FileReader(sf))) { |
- String line; |
- while ((line = r.readLine()) != null) { |
- if (line.contains("Observed monthly ave precipitation (mm)")) { |
- line = r.readLine(); |
- String v[] = line.trim().split("\\s+"); |
- if (v.length != 12) { |
- throw new ServiceException("cannot find monthly ave precip in " + sf.toString()); |
- } |
- double sum = 0.0; |
- for (int i = 0; i < v.length; i++) { |
- sum += Double.parseDouble(v[i]); |
- } |
- return sum; |
- } |
- } |
- } |
- throw new ServiceException("cannot find monthly ave precip in " + sf.toString()); |
- } |
+// public double getYearlyPrecipIntl() throws Exception { |
+// File sf = new File(workSpaceDir, stormFileName); |
+// try (BufferedReader r = new BufferedReader(new FileReader(sf))) { |
+// String line; |
+// while ((line = r.readLine()) != null) { |
+// if (line.contains("Observed monthly ave precipitation (mm)")) { |
+// line = r.readLine(); |
+// String v[] = line.trim().split("\\s+"); |
+// if (v.length != 12) { |
+// throw new ServiceException("cannot find monthly ave precip in " + sf.toString()); |
+// } |
+// double sum = 0.0; |
+// for (int i = 0; i < v.length; i++) { |
+// sum += Double.parseDouble(v[i]); |
+// } |
+// return sum; |
+// } |
+// } |
+// } |
+// throw new ServiceException("cannot find monthly ave precip in " + sf.toString()); |
+// } |
} |
@@ -168,10 +168,10 @@ |
runModel(); |
|
//If the run is successful then edit the summary file. |
- double avgYearlyPrecip = 0.0; |
- if (rhemModel.isIntl()) { |
- avgYearlyPrecip = rhemModel.getYearlyPrecipIntl(); |
- } else { |
+ if (!rhemModel.isIntl()) { |
+// avgYearlyPrecip = rhemModel.getYearlyPrecipIntl(); |
+// } else { |
+ double avgYearlyPrecip = 0.0; |
try (Connection connection = resources().getJDBC(DBResources.CRDB); |
Statement statement = connection.createStatement();) { |
try (ResultSet rs = statement.executeQuery(DBResources.RHEM01Query02(aoa.getClimateStationId()))) { |
@@ -180,8 +180,8 @@ |
} |
} |
} |
+ rhemModel.appendToSumFile(avgYearlyPrecip); |
} |
- rhemModel.appendToSumFile(avgYearlyPrecip); |
} |
|
|
@@ -217,7 +217,7 @@ |
results().put(getWorkspaceFile(parameterFileName), "Parameter input file"); |
results().put(getWorkspaceFile(stormFileName), "Storm input file"); |
results().put(getWorkspaceFile(summaryFileName), "Summary file"); |
- results().put(getWorkspaceFile("temp_" + summaryFileName), "Temp Summary file"); |
+// results().put(getWorkspaceFile("temp_" + summaryFileName), "Temp Summary file"); |
results().put(getWorkspaceFile(detailedOutputFileName), "Detailed summary file"); |
} |
} |
@@ -1,5 +1,5 @@ |
{ |
- "csip.context.version": "$version: 2.1.9 default 183 5b3dddef0245 2020-07-20 od, built at 2020-11-17 13:14 by od$", |
+ "csip.context.version": "$version: 2.1.10 default 184 381faace63dd 2020-11-17 od, built at 2020-11-17 14:00 by od$", |
"csip.archive.max.filesize": "1KB", |
"esd.db": "jdbc:sqlserver://129.82.20.129:1433;databaseName=esd;user=sa;password=csurams#1", |
"crdb.db": "jdbc:sqlserver://129.82.20.129:1433;databaseName=conservation_resources;user=sa;password=csurams#1", |