Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/respec/BASINS
Browse files Browse the repository at this point in the history
  • Loading branch information
jlkittle committed Feb 12, 2019
2 parents 7114173 + 384a230 commit 544acb2
Show file tree
Hide file tree
Showing 6 changed files with 3,058 additions and 3,035 deletions.
29 changes: 26 additions & 3 deletions HSPEXP/HSPFOutputReports.vb
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@ Module HSPFOutputReports
Directory.CreateDirectory(pOutFolderName)
File.Copy(pTestPath & pBaseName & ".uci", pOutFolderName & pBaseName & ".uci", overwrite:=True)

'read binary output files for later use in wq reports, qa reports, or receiving models
If pConstituents.Count > 0 Or pBATHTUB Or pWASP Or pModelQAQC Then
'read binary output files for later use in qa reports
If pModelQAQC Then
Dim lOpenHspfBinDataSource As New atcDataSource
Logger.Dbg(Now & " Opening the binary output files.")
For i As Integer = 0 To aHspfUci.FilesBlock.Count
Expand Down Expand Up @@ -260,6 +260,23 @@ Module HSPFOutputReports
DoExpertSystemStats(aHspfUci, lRunMade)
End If

'read binary output files again for later use in wq reports or receiving models
If pConstituents.Count > 0 Or pBATHTUB Or pWASP Then
Dim lOpenHspfBinDataSource As New atcDataSource
Logger.Dbg(Now & " Opening the binary output files.")
For i As Integer = 0 To aHspfUci.FilesBlock.Count
If aHspfUci.FilesBlock.Value(i).Typ = "BINO" Then
Dim lHspfBinFileName As String = AbsolutePath(aHspfUci.FilesBlock.Value(i).Name.Trim, CurDir())
lOpenHspfBinDataSource = atcDataManager.DataSourceBySpecification(lHspfBinFileName)
If lOpenHspfBinDataSource Is Nothing Then
If atcDataManager.OpenDataSource(lHspfBinFileName) Then
lOpenHspfBinDataSource = atcDataManager.DataSourceBySpecification(lHspfBinFileName)
End If
End If
End If
Next i
End If

'Write input file for BATHTUB
If pBATHTUB Then
If pOutputLocations.Count > 0 Then
Expand Down Expand Up @@ -318,7 +335,13 @@ Module HSPFOutputReports
Logger.Dbg(Now & " HSPEXP+ Complete")
Logger.Msg("HSPEXP+ is complete")

OpenFile(pOutFolderName)
If pWASP Then
Dim lOutputFolder As String = System.IO.Path.Combine(pTestPath, "WASP")
OpenFile(lOutputFolder)
Else
OpenFile(pOutFolderName)
End If

If pModelQAQC Then OpenFile(pOutFolderName & "ModelQAQC.htm")
End Using

Expand Down
2 changes: 0 additions & 2 deletions HSPEXP/StartUp.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions HSPEXP/WASP.vb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Module WASP
Dim lWaspProject As New atcWASPProject
Dim lOutputFolder As String = System.IO.Path.Combine(aOutputfolder, "WASP")
FileIO.FileSystem.CreateDirectory(lOutputFolder)
Dim lFileName As String = System.IO.Path.Combine(lOutputFolder, "WASP8_R" & aReachId.ToString & ".inp")
Dim lFileName As String = System.IO.Path.Combine(lOutputFolder, "WASP_R" & aReachId.ToString & ".inp")
lWaspProject.SDate = Date.FromOADate(aSDateJ)
lWaspProject.EDate = Date.FromOADate(aEDateJ)

Expand Down Expand Up @@ -64,7 +64,7 @@ Module WASP
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Inorganic Solids 3", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Phytoplankton 1", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Phytoplankton 2", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent(" Phytoplankton 3", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Phytoplankton 3", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Total Inorganic C", "", ""))
lWaspProject.WASPConstituents.Add(New clsWASPConstituent("Alkalinity", "", ""))

Expand Down Expand Up @@ -327,19 +327,19 @@ Module WASP
' End If
'Next
'alternate scheme to write individual and composite timeseries
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "RO", lConvFactF, aSDateJ, aEDateJ, lOutputFolder) 'Flow
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "TAM-INTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Ammonia Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "NO3-INTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Nitrate Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "N-TOTORG-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Organic Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "PO4-INTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Inorganic Phosphate
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "P-TOTORG-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Organic Phosphorus
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "PHYTO-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Phytoplankton Chla
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "BODIN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'CBOD 1(Ultimate)
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "DOXIN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Oxygen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "C-REFORG-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Carbon
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "N-REFORG-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "P-REFORG-IN", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Phosphorus
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "ISED-TOT", lConvFactT, aSDateJ, aEDateJ, lOutputFolder) 'Solids
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "RO", lConvFactF, aSDateJ, aEDateJ, lOutputFolder) 'Flow
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "TAM-OUTTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Ammonia Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "NO3-OUTTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Nitrate Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "N-TOTORG-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Organic Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "PO4-OUTTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Inorganic Phosphate
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "P-TOTORG-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Organic Phosphorus
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "PHYTO-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Phytoplankton Chla
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "BODOUTTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'CBOD 1(Ultimate)
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "DOXOUTTOT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Oxygen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "C-REFORG-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Carbon
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "N-REFORG-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Nitrogen
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "P-REFORG-OUT", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Detrital Phosphorus
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "R", "ROSED-TOT", lConvFactT, aSDateJ, aEDateJ, lOutputFolder) 'Solids
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "L", "PERO", lConvFactV, aSDateJ, aEDateJ, lOutputFolder) 'Flow
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "L", "SOSED", lConvFactT, aSDateJ, aEDateJ, lOutputFolder) 'Solids
WriteHSPFTimeseriesForWASP(aBinaryData, lReach, "L", "PODOXM", lConvFactP, aSDateJ, aEDateJ, lOutputFolder) 'Dissolved Oxygen
Expand Down Expand Up @@ -529,7 +529,7 @@ Module WASP
Dim lSW As IO.StreamWriter = Nothing
lSW = New IO.StreamWriter(lFileName, False)
For t As Integer = 1 To lTimeseries.Values.Count - 1
lSW.WriteLine("{0,8:0.000} {1,9:0.00000}", t, lTimeseries.Values(t))
lSW.WriteLine("{0,8:0.000},{1,9:0.00000}", t, lTimeseries.Values(t))
Next
lSW.Flush()
lSW.Close()
Expand Down Expand Up @@ -564,16 +564,16 @@ Module WASP
lConstituent = "SOQUAL-BOD"
End If
End If
Dim lFileName As String = System.IO.Path.Combine(aOutputfolder, "WASP_" & lContributingLandId.Replace(":", "") & "to" & lDownstreamReachId.Replace(":", "") & "_" & aConstituent & ".txt")
Dim lFileName As String = System.IO.Path.Combine(aOutputfolder, "WASP_" & lContributingLandId.Replace(":", "") & "to" & lDownstreamReachId.Replace(":", "") & "_" & lConstituent & ".txt")
Dim lTimeseries As atcTimeseries = Nothing
lTimeseries = aBinaryData.DataSets.FindData("Location", lContributingLandId).FindData("Constituent", aConstituent)(0)
lTimeseries = aBinaryData.DataSets.FindData("Location", lContributingLandId).FindData("Constituent", lConstituent)(0)
If lTimeseries IsNot Nothing Then
lTimeseries = Aggregate(lTimeseries, atcTimeUnit.TUDay, 1, atcTran.TranSumDiv) * aConvFact * lMult
lTimeseries = SubsetByDate(lTimeseries, aSDateJ, aEDateJ, Nothing)
Dim lSW As IO.StreamWriter = Nothing
lSW = New IO.StreamWriter(lFileName, False)
For t As Integer = 1 To lTimeseries.Values.Count - 1
lSW.WriteLine("{0,8:0.000} {1,9:0.00000}", t, lTimeseries.Values(t))
lSW.WriteLine("{0,8:0.000},{1,9:0.00000}", t, lTimeseries.Values(t))
Next
lSW.Flush()
lSW.Close()
Expand All @@ -596,7 +596,7 @@ Module WASP
Dim lSW As IO.StreamWriter = Nothing
lSW = New IO.StreamWriter(lFileName, False)
For t As Integer = 1 To lCompositeTimeseries.Values.Count - 1
lSW.WriteLine("{0,8:0.000} {1,9:0.00000}", t, lCompositeTimeseries.Values(t))
lSW.WriteLine("{0,8:0.000},{1,9:0.00000}", t, lCompositeTimeseries.Values(t))
Next
lSW.Flush()
lSW.Close()
Expand Down
4 changes: 3 additions & 1 deletion HSPEXP/install.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Date: 11/19/2018
Date: 2/1/2019
HSPEXP+3.0beta is the development version for the next version of HSPEXP+.

Features:
1. This version includes Model QA/QC report. The model QA/QC report is under development and it must be used with extreme caution.

Expand All @@ -8,6 +9,7 @@ Bugs Fixed:
2. The location of help file was not coded properly in the previous version. That has been fixed.
3. The reports did not include adsorption/desorption and scour/deposition of TAM and PO4. That has been fixed.
4. The reports did not output labile and refractory organic P data for impervious areas. That has been fixed.
5. The expert system statistics computation for percentiles now excludes missing observed values.

Date: 06/15/2018

Expand Down
Loading

0 comments on commit 544acb2

Please sign in to comment.