@@ -11,10 +11,10 @@ |
*/ |
package m.rhem.rhem01_runmodel; |
|
-import csip.Executable; |
+import csip.api.server.Executable; |
import csip.ModelDataService; |
-import csip.ModelDataServiceCall; |
-import csip.ServiceException; |
+import csip.api.client.ModelDataServiceCall; |
+import csip.api.server.ServiceException; |
import csip.annotations.Polling; |
import csip.annotations.Resource; |
import java.io.IOException; |
@@ -226,7 +226,7 @@ |
results().put("POR", parameter.getPor(), "porosity"); |
results().put("FRACT", parameter.getFract(), "list of particle class fractions"); |
|
- double asl = new TextParser(sumFile).toLineContaining("Avg-Soil-Loss").rightOf("=").asDouble(); |
+ double asl = new TextParser(sumFile).toLineContaining("Avg-Soil-Loss").rightOfFirst("=").asDouble(); |
results().put("TDS", Double.parseDouble(rhemModel.getTDS(asl)), "total dissolved solids"); |
|
results().put("cli_station_id", res.getInt("stationId", 0)); |
@@ -241,7 +241,7 @@ |
results().put("monthly_avg_precip", mavg, "monthly average precip", "mm"); |
|
e = new TextParser(workspace().getFile(summaryFileName)); |
- double yavg = e.toLineContaining("Avg. Precipitation").rightOf("=").asDouble(); |
+ double yavg = e.toLineContaining("Avg. Precipitation").rightOfFirst("=").asDouble(); |
results().put("yearly_avg_precip", yavg, "yearly average precip", "mm"); |
|
results().put(workspace().getFile(parameterFileName), "Parameter input file"); |
@@ -11,10 +11,10 @@ |
*/ |
package m.rhem.rhem01_runmodel; |
|
-import csip.Executable; |
+import csip.api.server.Executable; |
import csip.ModelDataService; |
-import csip.ModelDataServiceCall; |
-import csip.ServiceException; |
+import csip.api.client.ModelDataServiceCall; |
+import csip.api.server.ServiceException; |
import csip.annotations.Polling; |
import csip.annotations.Resource; |
import java.io.IOException; |
@@ -229,7 +229,7 @@ |
results().put("fract", new TextParser(parameter.getFract(), "fract").nextLine().tokens().asDoubleArray(), |
"list of particle class fractions"); |
|
- double asl = new TextParser(sumFile).toLineContaining("Avg-Soil-Loss").rightOf("=").asDouble(); |
+ double asl = new TextParser(sumFile).toLineContaining("Avg-Soil-Loss").rightOfFirst("=").asDouble(); |
results().put("tds", Double.parseDouble(rhemModel.getTDS(asl)), "total dissolved solids"); |
|
results().put("cli_station_id", res.getInt("stationId", 0)); |
@@ -247,52 +247,52 @@ |
try (TextParser tp = new TextParser(sumFile).autoClose(false)) { |
|
// Avg. Precipitation (mm/year) = 335.49133 |
- double avg = tp.toLineContaining("Avg. Precipitation").rightOf("=").asDouble(); |
+ double avg = tp.toLineContaining("Avg. Precipitation").rightOfFirst("=").asDouble(); |
results().put("avg_precip", avg, "yearly average precip", "mm/y"); |
|
// Avg-Runoff(mm/year)= 26.79858 |
- avg = tp.toLineContaining("Avg-Runoff").rightOf("=").asDouble(); |
+ avg = tp.toLineContaining("Avg-Runoff").rightOfFirst("=").asDouble(); |
results().put("avg_runoff", avg, "yearly average runoff", "mm/y"); |
|
// Avg-Soil-Loss(Mg/ha/year)= 0.32337 |
- avg = tp.toLineContaining("Avg-Soil-Loss").rightOf("=").asDouble(); |
+ avg = tp.toLineContaining("Avg-Soil-Loss").rightOfFirst("=").asDouble(); |
results().put("avg_soilloss", avg, "yearly average soil loss", "Mg/ha/y"); |
|
// Avg-SY(Mg/ha/year)= 0.32165 |
- avg = tp.toLineContaining("Avg-SY").rightOf("=").asDouble(); |
+ avg = tp.toLineContaining("Avg-SY").rightOfFirst("=").asDouble(); |
results().put("avg_sy", avg, "yearly sediment yield", "Mg/ha/y"); |
|
// RETURN-FREQUENCY-RESULTS-YEARLY TOTALS |
// Rain (mm) 326.50723 397.08432 434.37115 488.36038 506.88202 545.54865 |
- double[] rf = tp.toLineContaining("Rain").rightOf(")").tokens().asDoubleArray(); |
+ double[] rf = tp.toLineContaining("Rain").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_total_rain", rf, "rain return frequency, totals for years 2, 5, 10, 25, 50, 100", "mm"); |
|
// Runoff(mm) 22.74758 39.80891 51.82090 67.55290 80.73241 97.35841 |
- rf = tp.toLineContaining("Runoff").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Runoff").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_total_runoff", rf, "runoff return frequency, totals for years 2, 5, 10, 25, 50, 100", "mm"); |
|
// Soil-Loss(Mg/ha) 0.25164 0.48592 0.72893 0.98490 1.19312 1.60915 |
- rf = tp.toLineContaining("Soil-Loss").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Soil-Loss").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_total_soilloss", rf, "soil loss return frequency, totals for years 2, 5, 10, 25, 50, 100", "Mg/ha"); |
|
// Sediment-Yield(Mg/ha) 0.25011 0.48314 0.72740 0.98077 1.18747 1.60272 |
- rf = tp.toLineContaining("Sediment-Yield").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Sediment-Yield").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_total_sy", rf, "sediment yield return frequency, totals for years 2, 5, 10, 25, 50, 100", "Mg/ha"); |
|
// RETURN-FREQUENCY-RESULTS-YEARLY MAXIMUM DAILY |
- rf = tp.toLineContaining("Rain").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Rain").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_dailymax_rain", rf, "rain return frequency, max daily for years 2, 5, 10, 25, 50, 100 ", "mm"); |
|
// Runoff(mm) 22.74758 39.80891 51.82090 67.55290 80.73241 97.35841 |
- rf = tp.toLineContaining("Runoff").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Runoff").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_dailymax_runoff", rf, "runoff return frequency, max daily for years 2, 5, 10, 25, 50, 100", "mm"); |
|
// Soil-Loss(Mg/ha) 0.25164 0.48592 0.72893 0.98490 1.19312 1.60915 |
- rf = tp.toLineContaining("Soil-Loss").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Soil-Loss").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_dailymax_soilloss", rf, "soil loss return frequency, max daily for years 2, 5, 10, 25, 50, 100", "Mg/ha"); |
|
// Sediment-Yield(Mg/ha) 0.25011 0.48314 0.72740 0.98077 1.18747 1.60272 |
- rf = tp.toLineContaining("Sediment-Yield").rightOf(")").tokens().asDoubleArray(); |
+ rf = tp.toLineContaining("Sediment-Yield").rightOfFirst(")").tokens().asDoubleArray(); |
results().put("retfreq_dailymax_sy", rf, "sediment yield return frequency, max daily for years 2, 5, 10, 25, 50, 100", "Mg/ha"); |
} |
|