forked from respec/HSPsquared
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from respec/master
Pull updates from respec master
- Loading branch information
Showing
18 changed files
with
8,589 additions
and
39,614 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
''' Copyright (c) 2020 by RESPEC, INC. | ||
Author: Robert Heaphy, Ph.D. | ||
License: LGPL2 | ||
''' | ||
|
||
from numpy import zeros | ||
|
||
|
||
# new activity modules must be added here and in *activites* below | ||
from HSP2.ATEMP import atemp | ||
from HSP2.SNOW import snow | ||
from HSP2.PWATER import pwater | ||
from HSP2.IWATER import iwater | ||
from HSP2.HYDR import hydr | ||
|
||
def noop (store, siminfo, ui, ts): | ||
ERRMSGS = [] | ||
errors = zeros(len(ERRMSGS), dtype=int) | ||
return errors, ERRMSGS | ||
|
||
# Note: This is the ONLY place in HSP2 that defines activity execution order | ||
activities = { | ||
'PERLND': {'ATEMP':atemp, 'SNOW':snow, 'PWATER':pwater, 'SEDMNT':noop, | ||
'PSTEMP':noop, 'PWTGAS':noop, 'PQUAL':noop, 'MSTLAY':noop, 'PEST':noop, | ||
'NITR':noop, 'PHOS':noop, 'TRACER':noop}, | ||
'IMPLND': {'ATEMP':atemp, 'SNOW':snow, 'IWATER':iwater, 'SOLIDS':noop, | ||
'IWTGAS':noop, 'IQUAL':noop}, | ||
'RCHRES': {'HYDR':hydr, 'ADCALC':noop, 'CONS':noop, 'HTRCH':noop, | ||
'SEDTRN':noop, 'GQUAL':noop, 'OXRX':noop, 'NUTRX':noop, 'PLANK':noop, | ||
'PHCARB':noop}} | ||
|
||
|
||
# NOTE: the flowtype (Python set) at the top of utilities.py may need to be | ||
# updated for new types of flows in new or modified HSP2 modules. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import os, sys | ||
|
||
# print('in HSP2_Driver') | ||
command_line = "" | ||
# print('arg count ' + str(len(sys.argv))) | ||
if len(sys.argv) >= 2: | ||
# see if anything on command line | ||
command_line = sys.argv[1] | ||
print('command line' + command_line) | ||
|
||
# if given UCI, import to h5 file | ||
# if given WDM, import to h5 file | ||
# if given h5, run HSP2 | ||
|
||
from PyQt5.QtWidgets import QFileDialog, QApplication | ||
|
||
application = QApplication(sys.argv) | ||
|
||
if command_line == '': | ||
file_filter = "Run HDF5 (*.h5);;" \ | ||
"Import UCI to HDF5 (*.uci);;" \ | ||
"Import WDM to HDF5 (*.wdm)" | ||
filename, filetype = QFileDialog.getOpenFileName(None, 'HSP2 Open File...', '', file_filter) | ||
else: | ||
filename = command_line | ||
|
||
file_ext = filename[-3:] | ||
dir_name = os.path.dirname(filename) | ||
os.chdir(dir_name) | ||
|
||
if file_ext.upper() == "UCI": | ||
h5_name = filename[:-3] + "h5" | ||
from HSP2tools.readUCI import readUCI | ||
readUCI(filename, h5_name) | ||
# readUCI('HSPF.uci', 'test.h5') | ||
|
||
if file_ext.upper() == "WDM": | ||
h5_name = filename[:-3] + "h5" | ||
from HSP2tools.readWDM import readWDM | ||
readWDM(filename, h5_name) | ||
# readWDM('GRICM.wdm', 'test.h5') | ||
# readWDM('ZUMBROSCEN.WDM', 'test.h5') | ||
|
||
if file_ext.upper() == ".H5": | ||
from HSP2.main import main | ||
main(filename, saveall=True) | ||
# main('test.h5', saveall=True) | ||
|
||
|
||
|
||
|
Oops, something went wrong.