Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specl functions defined and initial testing successful #22

Merged
merged 2 commits into from
Aug 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions HSP2/HYDR.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from numba import njit
from numba.typed import List
from HSP2.utilities import initm, make_numba_dict
from HSP2.SPECL import specl, _specl_


ERRMSGS =('HYDR: SOLVE equations are indeterminate', #ERRMSG0
Expand Down Expand Up @@ -258,12 +259,18 @@ def _hydr_(ui, ts, COLIND, OUTDGT, rowsFT, funct, Olabels, OVOLlabels):

# HYDR (except where noted)
for step in range(steps):
print('\n', 'step: ', step, ' of: ', steps, ' steps')
convf = CONVF[step]
outdgt[:] = OUTDGT[step, :]
colind[:] = COLIND[step, :]
roseff = ro
oseff[:] = o[:]

print('Trying specl')
test_param = array([10, 15, 20, step])
specl_test = specl(test_param)
print(specl_test)

# vols, sas variables and their initializations not needed.
if irexit >= 0: # irrigation exit is set, zero based number
if rirwdl > 0.0: # equivalent to OVOL for the irrigation exit
Expand Down
38 changes: 38 additions & 0 deletions HSP2/SPECL.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
''' process special actions in this domain

CALL: specl(io_manager, siminfo, uci, ts, state, specl_actions)
store is the Pandas/PyTable open store
siminfo is a dictionary with simulation level infor (OP_SEQUENCE for example)
ui is a dictionary with RID specific HSPF UCI like data
ts is a dictionary with RID specific timeseries
state is a dictionary with value of ts[step - 1]
specl_actions is a dictionary with all SPEC-ACTIONS entries
'''

from numba import njit

# def specl(io_manager, siminfo, uci, ts, state, specl_actions):
@njit
def specl(test_param):

print('Made it to specl()')

# run _specl_()
###########################################################################
test_run = _specl_(test_param)
###########################################################################

# return errors, ERRMSGS
return test_run



# def _specl_(ui, ts, COLIND, OUTDGT, rowsFT, funct, Olabels, OVOLlabels):
@njit
def _specl_(test_param):

print('Made it to _specl_()')
paramx2 = test_param * 2

# return errors
return paramx2