Skip to content

Commit 8cd3486

Browse files
Added Ads/Des and Scour/Dep or PO4 and TAM
1. Worked on scatter graphs to improve plotting the graph. It may still need work. 2. Started adding the function for Checking the Diurnal pattern. 3. Updated the install.txt. Will compile this version and send to Mark Evenson.
1 parent 01edeaa commit 8cd3486

File tree

5 files changed

+147
-78
lines changed

5 files changed

+147
-78
lines changed

HSPEXP/CookieCutterGraphs.vb

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ Public Module CookieCutterGraphs
4141
Dim lLocations As New atcCollection
4242
Dim lScenarioResults As New atcDataSource
4343

44-
Dim lWDMDataSource As atcDataSource
45-
44+
Dim lWDMDataSource As New atcDataSource
4645

4746
For i As Integer = 0 To aHSPFUCI.FilesBlock.Count
4847
If aHSPFUCI.FilesBlock.Value(i).Typ = "BINO" Then
@@ -80,7 +79,7 @@ Public Module CookieCutterGraphs
8079
Dim lTimeSeries As atcTimeseries = Nothing
8180
Dim lFoundTheTimeSeriesinWDMFile As Boolean = False
8281

83-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK", "BALCLA", 4, 1, lFoundTheTimeSeriesinWDMFile)
82+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK", "BALCLA", 4, 1, lFoundTheTimeSeriesinWDMFile)
8483

8584
If lFoundTheTimeSeriesinWDMFile = False Then
8685
'Reading the required time series from Binary file and resetting the flag to false
@@ -97,7 +96,7 @@ Public Module CookieCutterGraphs
9796
lTimeseriesGroup.Add(lTimeSeries)
9897
End If
9998

100-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK", "PHYCLA", 1, 1, lFoundTheTimeSeriesinWDMFile)
99+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK", "PHYCLA", 1, 1, lFoundTheTimeSeriesinWDMFile)
101100

102101
If lFoundTheTimeSeriesinWDMFile = False Then
103102
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "PHYCLA")(0)
@@ -112,7 +111,7 @@ Public Module CookieCutterGraphs
112111
lTimeseriesGroup.Add(lTimeSeries)
113112
End If
114113

115-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX", "DNUST", 4, 1, lFoundTheTimeSeriesinWDMFile)
114+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX", "DNUST", 4, 1, lFoundTheTimeSeriesinWDMFile)
116115
If lFoundTheTimeSeriesinWDMFile = False Then
117116
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "PO4-CONCDIS")(0)
118117

@@ -127,7 +126,7 @@ Public Module CookieCutterGraphs
127126
lTimeseriesGroup.Add(lTimeSeries)
128127
End If
129128

130-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX", "DNUST", 2, 1, lFoundTheTimeSeriesinWDMFile)
129+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX", "DNUST", 2, 1, lFoundTheTimeSeriesinWDMFile)
131130
If lFoundTheTimeSeriesinWDMFile = False Then
132131
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "TAM-CONCDIS")(0)
133132
End If
@@ -141,7 +140,7 @@ Public Module CookieCutterGraphs
141140
lTimeseriesGroup.Add(lTimeSeries)
142141
End If
143142

144-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "NUTRX", "DNUST", 1, 1, lFoundTheTimeSeriesinWDMFile)
143+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "NUTRX", "DNUST", 1, 1, lFoundTheTimeSeriesinWDMFile)
145144
If lFoundTheTimeSeriesinWDMFile = False Then
146145
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "NO3-CONCDIS")(0)
147146
End If
@@ -215,7 +214,7 @@ Public Module CookieCutterGraphs
215214
#Region "Plotting TSS Curve"
216215

217216
lTimeseriesGroup = New atcTimeseriesGroup
218-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "HYDR", "RO", 1, 1, lFoundTheTimeSeriesinWDMFile)
217+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "HYDR", "RO", 1, 1, lFoundTheTimeSeriesinWDMFile)
219218
If lFoundTheTimeSeriesinWDMFile = False Then
220219
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "RO")(0)
221220
End If
@@ -229,7 +228,7 @@ Public Module CookieCutterGraphs
229228
lTimeseriesGroup.Add(lTimeSeries)
230229
End If
231230

232-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "SEDTRN", "SSED", 4, 1, lFoundTheTimeSeriesinWDMFile)
231+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "SEDTRN", "SSED", 4, 1, lFoundTheTimeSeriesinWDMFile)
233232

234233
If lFoundTheTimeSeriesinWDMFile = False Then
235234
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "SSED-TOT")(0)
@@ -244,7 +243,7 @@ Public Module CookieCutterGraphs
244243
lTimeSeries.Attributes.SetValue("YAxis", "Left")
245244
lTimeseriesGroup.Add(lTimeSeries)
246245
End If
247-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "SEDTRN", "BEDDEP", 1, 1, lFoundTheTimeSeriesinWDMFile)
246+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "SEDTRN", "BEDDEP", 1, 1, lFoundTheTimeSeriesinWDMFile)
248247
If lFoundTheTimeSeriesinWDMFile = False Then
249248
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "BEDDEP")(0)
250249
End If
@@ -299,7 +298,7 @@ Public Module CookieCutterGraphs
299298
Dim lTimeseriesGroupDO As New atcTimeseriesGroup
300299
Dim lTimeSeriesDO As New atcTimeseries(Nothing)
301300
Dim lTimeSeriesTimeUnit As Integer
302-
lTimeSeriesDO = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "OXRX", "DOX", 1, 1, lFoundTheTimeSeriesinWDMFile)
301+
lTimeSeriesDO = LocateTheTimeSeries(aHSPFUCI, lRchId, "OXRX", "DOX", 1, 1, lFoundTheTimeSeriesinWDMFile)
303302

304303
If lFoundTheTimeSeriesinWDMFile = False OrElse lTimeSeriesTimeUnit < 3 Then
305304
lTimeSeriesDO = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "DOXCONC")(0)
@@ -404,7 +403,7 @@ Public Module CookieCutterGraphs
404403

405404

406405
lTimeseriesGroup = New atcTimeseriesGroup
407-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "HYDR", "IVOL", 1, 1, lFoundTheTimeSeriesinWDMFile)
406+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "HYDR", "IVOL", 1, 1, lFoundTheTimeSeriesinWDMFile)
408407
If lFoundTheTimeSeriesinWDMFile = False Then
409408
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "IVOL")(0)
410409
End If
@@ -418,7 +417,7 @@ Public Module CookieCutterGraphs
418417
lTimeseriesGroup.Add(lTimeSeries)
419418
End If
420419
End If
421-
lTimeSeries = LocateTheTimeSeries(lDataSource, aHSPFUCI, lRchId, "PLANK", "TPKIF", 5, 1, lFoundTheTimeSeriesinWDMFile)
420+
lTimeSeries = LocateTheTimeSeries(aHSPFUCI, lRchId, "PLANK", "TPKIF", 5, 1, lFoundTheTimeSeriesinWDMFile)
422421
If lFoundTheTimeSeriesinWDMFile = False Then
423422
lTimeSeries = lScenarioResults.DataSets.FindData("Location", RCHRES).FindData("Constituent", "P-TOT-IN")(0)
424423
End If
@@ -460,7 +459,7 @@ Public Module CookieCutterGraphs
460459
Logger.Dbg("Generated graph " & lOutputFolder & "LoadDurationTP_RCHRES_" & lRchId & ".png")
461460
End If
462461

463-
End If
462+
End If
464463

465464

466465

@@ -482,10 +481,11 @@ Public Module CookieCutterGraphs
482481
'Dim lRCH As HspfOperation
483482

484483
End Sub
485-
Private Function LocateTheTimeSeries(ByRef aDataSource As atcDataSource, ByVal aHSPFUCI As HspfUci,
484+
Friend Function LocateTheTimeSeries(ByVal aHSPFUCI As HspfUci,
486485
ByVal aRCHId As Integer, ByVal aGroupName As String,
487486
ByVal aMemberName As String, ByVal aMemSub1 As Integer,
488-
ByVal aMemSub2 As Integer, ByRef aFoundTheTS As Boolean)
487+
ByVal aMemSub2 As Integer, ByRef aFoundTheTS As Boolean) As atcTimeseries
488+
Dim lDataSource As New atcDataSource
489489
Dim aTimeSeries As atcTimeseries = Nothing
490490
aFoundTheTS = False
491491
Dim lDataID As Integer = 0
@@ -498,10 +498,10 @@ Public Module CookieCutterGraphs
498498
For i As Integer = 0 To aHSPFUCI.FilesBlock.Count
499499
If aHSPFUCI.FilesBlock.Value(i).Typ = lconnection.Target.VolName Then
500500
Dim lFileName As String = AbsolutePath(aHSPFUCI.FilesBlock.Value(i).Name.Trim, CurDir())
501-
aDataSource = atcDataManager.DataSourceBySpecification(lFileName)
502-
If aDataSource Is Nothing Then
501+
lDataSource = atcDataManager.DataSourceBySpecification(lFileName)
502+
If lDataSource Is Nothing Then
503503
If atcDataManager.OpenDataSource(lFileName) Then
504-
aDataSource = atcDataManager.DataSourceBySpecification(lFileName)
504+
lDataSource = atcDataManager.DataSourceBySpecification(lFileName)
505505
End If
506506
End If
507507
Exit For
@@ -512,7 +512,7 @@ Public Module CookieCutterGraphs
512512
End If
513513
Next lconnection
514514
If lDataID > 0 Then
515-
aTimeSeries = aDataSource.DataSets.FindData("ID", lDataID)(0)
515+
aTimeSeries = lDataSource.DataSets.FindData("ID", lDataID)(0)
516516
aFoundTheTS = True
517517
End If
518518

HSPEXP/HSPFOutputReports.vb

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1669,6 +1669,38 @@ Module HSPFOutputReports
16691669
myHtmlFile = myBuilder.ToString()
16701670
Return myHtmlFile
16711671
End Function
1672+
Private Function CheckDiurnalPattern(ByVal aBinaryData As atcDataSource, ByVal aUCI As HspfUci, ByVal aConstituent As String) As String
1673+
Dim lDiurnalPattern As New Text.StringBuilder
1674+
Dim lFoundTheTS As Boolean = False
1675+
Dim lGroupName As String = ""
1676+
Dim lMemberName As String = ""
1677+
Dim lMemSub1 As Integer = 0
1678+
Dim lMemSub2 As Integer = 0
1679+
Select Case aConstituent
1680+
Case "DO"
1681+
lGroupName = "OXRX"
1682+
lMemberName = "DOX"
1683+
lMemSub1 = 1
1684+
lMemSub2 = 1
1685+
Case "Water Temperature"
1686+
lGroupName = "OXRX"
1687+
lMemberName = "DOX"
1688+
lMemSub1 = 1
1689+
lMemSub2 = 1
1690+
End Select
1691+
For Each lRCHRES As HspfOperation In aUCI.OpnBlks("RCHRES").Ids
1692+
1693+
LocateTheTimeSeries(aUCI, lRCHRES.Id, lGroupName, lMemberName, lMemSub1, lMemSub2, lFoundTheTS)
1694+
1695+
1696+
1697+
Next
1698+
1699+
1700+
1701+
1702+
Return lDiurnalPattern.ToString
1703+
End Function
16721704
End Module
16731705

16741706

HSPEXP/install.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Features:
66
Bugs Fixed:
77
1. The expert statistic calculated the years of simulation as an integer. This skewed calculations for models with very small model span. That has been fixed.
88
2. The location of help file was not coded properly in the previous version. That has been fixed.
9+
3. The reports did not include adsorption/desorption and scour/deposition of TAM and PO4. That has been fixed.
10+
4. The reports did not output labile and refractory organic P data for impervious areas. That has been fixed.
911

1012
Date: 06/15/2018
1113

0 commit comments

Comments
 (0)