4.2.2. RCHRES Water Movement and Storage

Water movement and storage calculations, logic, and data structures for stream segments and well mixed reservoirs (RCHRES).

4.2.2.1. locaHrchhyd.py

Replacement for HSPsquared hrchhyd that represents water movement and storage in stream segments and well mixed reservoirs, or RCHRES.

Had to replace HSPsquared hrchhyd so that can break into the main time loop at the beginning and end of each day.This required fundamentally restructuring the storage and memory allocation within HSPsquared.

locaHrchhyd functions as a module handling storage for global RCHRES variables as well as for parameter and constant definitions.

Internal time units are in seconds, DELTS. Internal length units are feet and all areas, volumes, and lengths are converted to feet for internal calculations and then reconverted back to acres and acre-ft for areas and volumes respectively.

locaHrchhyd.AFACT = 43560.0

Acres to square feet conversion

locaHrchhyd.AFACTA = 2.295684113865932e-05

Area conversion factor

locaHrchhyd.AKAPPA = 0.4

Von Karmann’s constant

locaHrchhyd.AUX1FG = None

Flag identifying if certain flow outputs will be calculated

locaHrchhyd.AUX2FG = None

Flag identifying if certain flow outputs will be calculated

locaHrchhyd.AUX3FG = None

Flag identifying if certain flow outputs will be calculated

locaHrchhyd.AVDEP = None

Average depth in ft

locaHrchhyd.AVVEL = None

Average velocity in ft/s

locaHrchhyd.BAD_OUTPUT_LIST = ['AVSECT', 'CDFVOL1', 'CDFVOL2', 'CDFVOL3', 'CDFVOL4', 'CDFVOL5', 'CIVOL', 'CO1', 'CO2', 'CO3', 'CO4', 'CO5', 'COVOL1', 'COVOL2', 'COVOL3', 'COVOL4', 'COVOL5', 'CRO', 'CROVOL', 'CVOL', 'RIRDEM', 'RIRSHT']

Currently unsupported outputs

locaHrchhyd.COLIN1 = None

Initial value of COLIND for exit 1

locaHrchhyd.COLIN2 = None

Initial value of COLIND for exit 1

locaHrchhyd.COLIN3 = None

Initial value of COLIND for exit 1

locaHrchhyd.COLIN4 = None

Initial value of COLIND for exit 1

locaHrchhyd.COLIN5 = None

Initial value of COLIND for exit 1

locaHrchhyd.COLIND1 = None

COLIND external time series index ratio for exit 1

locaHrchhyd.COLIND2 = None

COLIND external time series index ratio for exit 2

locaHrchhyd.COLIND3 = None

COLIND external time series index ratio for exit 3

locaHrchhyd.COLIND4 = None

COLIND external time series index ratio for exit 4

locaHrchhyd.COLIND5 = None

COLIND external time series index ratio for exit 5

locaHrchhyd.DB50 = None

Sediment median grain diameter Specified in inches in inputs and converted to feet for calcs

locaHrchhyd.DEF_DT = None

The data type specification for time series structured array or record array

locaHrchhyd.DELTH = None

Drop in water elevation from upstream to downstream

locaHrchhyd.DELTS = 0.0

RCHRES calculation time step in seconds

locaHrchhyd.DEP = None

Dpeth in feet in rchres

locaHrchhyd.ERRMSG = ['HYDR: SOLVE equations are indeterminate', 'HYDR: extrapolation of rchtab will take place', 'HYDR: SOLVE trapped with an oscillating condition', 'HYDR: Solve did not converge', 'HYDR: Solve converged to point outside valid range']

Defined error messages.

Used with errorsV for error handling. Currently these errors, if occur, are written to the log file.

locaHrchhyd.EXIVOL = None

External time series inflow, acre-feet per time interval

locaHrchhyd.EXTERNAL_TS_GOOD = ['PREC', 'POTEV', 'IVOL', 'COLIND', 'OUTDGT']

All supported external time series

locaHrchhyd.EXTERNAL_TS_UNUSED = ['COTDGT', 'CIVOL', 'ICON', 'GATMP', 'DEWTMP', 'SOLRAD', 'CLOUD', 'WIND', 'TGRND', 'PHVAL', 'ROC', 'BIO', 'COADFX', 'COADCN', 'GQADFX', 'GQADCN', 'NUADFX', 'NUADCN', 'PLADFX', 'PLADCN']

Unsupported external time series

locaHrchhyd.FLAG_DT = None

The data type specification for flag record arrays

locaHrchhyd.FLAG_GOOD = ['AUX1FG', 'AUX2FG', 'AUX3FG', 'FUNCT', 'ODFVF', 'ODGTF']

Flags that are at least referenced in mHSP2

locaHrchhyd.FLAG_UNUSED = ['ICAT', 'VCONFG']

Unused flags in mHSP2

locaHrchhyd.FTABNO = None

FTABLE id for each RCHRES

locaHrchhyd.FUNCT1 = None

Flag identifying functional relationship for combining time and vol for exit 1

locaHrchhyd.FUNCT2 = None

Flag identifying functional relationship for combining time and vol for exit 2

locaHrchhyd.FUNCT3 = None

Flag identifying functional relationship for combining time and vol for exit 3

locaHrchhyd.FUNCT4 = None

Flag identifying functional relationship for combining time and vol for exit 4

locaHrchhyd.FUNCT5 = None

Flag identifying functional relationship for combining time and vol for exit 5

locaHrchhyd.GAM = 62.4

Unit weight or density of water in lb/ft3

locaHrchhyd.GOOD_OUTPUT_LIST = ['AVDEP', 'AVVEL', 'DEP', 'HRAD', 'IVOL', 'O1', 'O2', 'O3', 'O4', 'O5', 'OVOL1', 'OVOL2', 'OVOL3', 'OVOL4', 'OVOL5', 'PRSUPY', 'RO', 'ROVOL', 'SAREA', 'STAGE', 'VOL', 'TAU', 'TWID', 'USTAR', 'VOLEV']

List of currently supported outputs and thus calculated values

locaHrchhyd.GRAV = 32.2

Accleration due to earth’s gravity ft/s2

locaHrchhyd.HOLD_OS1 = None

Value of OS for exit 1 to hold over

locaHrchhyd.HOLD_OS2 = None

Value of OS for exit 1 to hold over

locaHrchhyd.HOLD_OS3 = None

Value of OS for exit 1 to hold over

locaHrchhyd.HOLD_OS4 = None

Value of OS for exit 1 to hold over

locaHrchhyd.HOLD_OS5 = None

Value of OS for exit 1 to hold over

locaHrchhyd.HOLD_RO = None

Value of RO to cover over between time steps

locaHrchhyd.HRAD = None

Hydraulic radius in ft

locaHrchhyd.INIT_PARMS = ['COLIN', 'OUTDG', 'VOL']

The list of initial parameters that suppported

locaHrchhyd.INIT_PARMS_UNUSED = ['CAT', 'ICAT ']

Unused initial parameters in mHSP2

locaHrchhyd.IVOL = None

Inflow to RCHRES, acre-feet per time interval

locaHrchhyd.I_VOL = None

Initial volume of water in the RCHRES

locaHrchhyd.KEY_TS_COLIND = 'COLIND'

External time series key for COLIND

locaHrchhyd.KEY_TS_OUTDGT = 'OUTDGT'

External time series key for OUTDGT

locaHrchhyd.KEY_TS_PET = 'POTEV'

External time series key for PET

locaHrchhyd.KEY_TS_PRECIP = 'PREC'

External time series key for precipitation

locaHrchhyd.KS = None

Weighting factor for hydraulic routing

locaHrchhyd.LEN = None

Length for each RCHRES

locaHrchhyd.LFACTA = 1.0

Length conversion factor

locaHrchhyd.LKFG = None

Lake flag; 0 == stream and 1 == lake

locaHrchhyd.MAXLOOPS = 100

Newton method maximum number of iterations.

Only used in the auxil function which has been replaced with npAuxil.

locaHrchhyd.MAX_EXITS = 5

Maximum number of exits for a RCHRES

locaHrchhyd.NEXITS = None

Data structure to hold number of exits for each RCHRES

locaHrchhyd.O1 = None

Rate of outflow through exit 1, ft3/s

locaHrchhyd.O2 = None

Rate of outflow through exit 2, ft3/s

locaHrchhyd.O3 = None

Rate of outflow through exit 3, ft3/s

locaHrchhyd.O4 = None

Rate of outflow through exit 4, ft3/s

locaHrchhyd.O5 = None

Rate of outflow through exit 5, ft3/s

locaHrchhyd.ODFVFG1 = None

Flag identifying FTAB output for each RCHRES for exit 1

locaHrchhyd.ODFVFG2 = None

Flag identifying FTAB output for each RCHRES for exit 2

locaHrchhyd.ODFVFG3 = None

Flag identifying FTAB output for each RCHRES for exit 3

locaHrchhyd.ODFVFG4 = None

Flag identifying FTAB output for each RCHRES for exit 4

locaHrchhyd.ODFVFG5 = None

Flag identifying FTAB output for each RCHRES for exit 5

locaHrchhyd.ODGTFG1 = None

Flag identifying time series output for each RCHRES for exit 1

locaHrchhyd.ODGTFG2 = None

Flag identifying time series output for each RCHRES for exit 2

locaHrchhyd.ODGTFG3 = None

Flag identifying time series output for each RCHRES for exit 3

locaHrchhyd.ODGTFG4 = None

Flag identifying time series output for each RCHRES for exit 4

locaHrchhyd.ODGTFG5 = None

Flag identifying time series output for each RCHRES for exit 5

locaHrchhyd.ORG_SSA_CALC = False

Switch to determine lookup table calculation metod.

If true, use the original auxil function to calculate surface area and depth from volume. If false use the np array lookup function interp.

locaHrchhyd.OUTDG1 = None

Initial demand for time dependenent outflow exit 1

locaHrchhyd.OUTDG2 = None

Initial demand for time dependenent outflow exit 2

locaHrchhyd.OUTDG3 = None

Initial demand for time dependenent outflow exit 3

locaHrchhyd.OUTDG4 = None

Initial demand for time dependenent outflow exit 4

locaHrchhyd.OUTDG5 = None

Initial demand for time dependenent outflow exit 5

locaHrchhyd.OUTDGT1 = None

OUTDGT time varying external time series for exit 1

locaHrchhyd.OUTDGT2 = None

OUTDGT time varying external time series for exit 2

locaHrchhyd.OUTDGT3 = None

OUTDGT time varying external time series for exit 3

locaHrchhyd.OUTDGT4 = None

OUTDGT time varying external time series for exit 4

locaHrchhyd.OUTDGT5 = None

OUTDGT time varying external time series for exit 5

locaHrchhyd.OUTPUT_CONTROL = None

Control structure telling which time series are to be output

locaHrchhyd.OVOL1 = None

Volume of outflow through exit 1, af/day

locaHrchhyd.OVOL2 = None

Volume of outflow through exit 2, af/day

locaHrchhyd.OVOL3 = None

Volume of outflow through exit 3, af/day

locaHrchhyd.OVOL4 = None

Volume of outflow through exit 4, af/day

locaHrchhyd.OVOL5 = None

Volume of outflow through exit 5, af/day

locaHrchhyd.PARAM_GOOD = ['DB50', 'DELTH', 'FTBUCI', 'KS', 'LEN', 'STCOR']

Input, non-state parameters that are used in mHSP2

locaHrchhyd.PARAM_UNUSED = ['CONVFM', 'FTBW', 'IREXIT', 'IRMINV']

Input parameters that unused in mHSP2

locaHrchhyd.POTEV = None

Input time series of potential evaporation from reservoir surface, inches per interval

locaHrchhyd.PREC = None

Input time series of precipitation to RCHRES, inches per interval

locaHrchhyd.PRSUPY = None

Volume of water contributed by precipitation to the surface, af/day

locaHrchhyd.RO = None

Total rate of outflow from RCHRES, ft3/s

locaHrchhyd.ROVOL = None

Total volume of outflow from RCHRES, af/day

locaHrchhyd.RR_TGRPN_SUPP = 'INFLOW'

Only supported mass link target or destination group name

locaHrchhyd.RR_TMEMN_SUPP = 'IVOL'

Only supported mass link target destination group member

locaHrchhyd.SAREA = None

Surface area of RCHRES in acres

locaHrchhyd.SCHEMATIC_MAP = {}

Schematic map for identifying inflow locations to each RCHRES.

Keys are target IDs and values are list, enumerated below.

  1. (str): source volume type

  2. (str): source volume ID

  3. (str): source volume output time series

  4. (list): integer exit ID

  5. (float): AFACTOR, area conversion multiplier

  6. (float): MFACTOR, conversion multiplier

locaHrchhyd.SFACTA = 1.0

Conversion factor

locaHrchhyd.SPEC_DT = None

The data type specification for the calculation and input record arrays

locaHrchhyd.STAGE = None

Stage of RCHRES = DEP + STCOR, ft

locaHrchhyd.STCOR = None

Correction to RCHRES depth to calculate stage

locaHrchhyd.TAU = None

Bed shear stress

locaHrchhyd.TFACTA = 1.0

Conversion factor

locaHrchhyd.TOLERANCE = 0.001

Newton method convergence closure criterion.

Only used in the auxil function which has been replaced with npAuxil.

locaHrchhyd.TWID = None

Stream top width, ft

locaHrchhyd.USTAR = None

Shear velocity

locaHrchhyd.VFACT = 43560.0

Acre-ft to cubic feet conversion

locaHrchhyd.VFACTA = 2.295684113865932e-05

Volume conversion factor

locaHrchhyd.VOL = None

Volume of water in the RCHRES, af

locaHrchhyd.VOLEV = None

Volume of water lost by evaporation, af/day

locaHrchhyd.addInflowMap(targID, sVolType, sVolID, aFactor, massLink)

Add an inflow mapping to the schematic map.

This tells a RCHRES where to collect inflows from that are part of the internal routing.

Parameters
  • targID (str) – target ID

  • sVolType (str) – source type (PERLND, IMPLND, RCHRES)

  • sVolID (str) – source ID

  • aFactor (float) – area factor for value adjustment

  • massLink (list) –

    parsed MASS LINK definition list.

    1. (str): destination type

    2. (str): destination category

    3. (str): destination sub category

    4. (float): mfactor

    5. (str): source type

    6. (str): source category

    7. (str): source sub category

    8. (list): source exit

Returns

function status; success == 0

Return type

int

locaHrchhyd.auxil(volumeFT, depthFT, sareaFT, indx, vol, AUX1FG)

Compute depth and surface area

Modified real number comparisons to be more numerically reliable.

Parameters
  • volumeFT (np.array) – volume vector from FTABLE

  • depthFT (np.array) – depth vector from FTABLE

  • sareaFT (np.array) – surface area vector from FTABLE

  • indx (int) – current index for volume bigger than current value

  • vol (float) – current volume in rchres

  • AUX1FG (int) – flag for auxiliary calculations

Returns

calculated hydraulic characteristics from FTAB interp

  1. (float): depth in feet

  2. (float): surface area in sq. ft.

Return type

tuple

locaHrchhyd.configExternalTS(sim_len, TSMapList, AllTSDict)

Transfer external time series from HDF5 input to module data structures

Parameters
  • sim_len (int) – the length of the simulation

  • TSMapList (list) –

    nested list with sublists, L, of time series metadata for a particular target ID

    1. time series type

    2. time series ID

    3. target ID

  • AllTSDict (dict) – dictionary of time series by time series ID

Returns

function status; 0 == success

Return type

int

locaHrchhyd.configFlagsParams(targID, cFlagVals, allIndexes, hdfType)

Set and configure flags and parameters for RCHRES.

The new HDF5 file format contains numerous differences in the way that various flags and states are represented relative to the original.

Parameters
  • targID (str) – the target location ID

  • cFlagVals (dict) – collected flag values

  • allIndexes (list) – list of indexes for cFlagVals

  • hdfType (int) – type of HDF5 file; 0 == original format; 1 == new format

locaHrchhyd.createTSIVOL(targID, iI)

Set the IVOL input to a RCHRES target by simulation time step This needs to account for external time series IVOL entries and the internal routing between structures.

Parameters
  • targID (str) – target RCHRES ID

  • iI (int) – current time step

Returns

input ivol in ft3/day

Return type

float

locaHrchhyd.demand(vol, rowFT, funct, nexits, delts, convf, colind, outdgt, ODGTF)

Calculate outflow demand for one FTAB row.

Interpolate the row from the volume and pass as rowFT. Modified real number comparisons to be more numerically reliable.

Parameters
  • vol (float) – current volume

  • rowFT (np.array) – array of FTAB row

  • funct (int) – the value for combined type calculation switch

  • nexits (int) – number of exits

  • delts (float) – time step in seconds

  • convf (int) – float multiplier - flag and values different from 1.0 not supported

  • colind (np.array) – Array for number of exits this RR that has a number identifying the ODFVFG calculation rule to use for this exit. If colind is 0 there is no fN(Vol) component. If colind is positive integer then it is the value of column index in the FTAB table to use for fN(Vol) interpolation. If colind is negative then it needs to have the form of X.Y where this X.Y value is taken from a time series specified by the user. X denotes the first FTAB column to use and 0.Y dentoes the proportion for this X column. The fN(Vol) discharge is calculated, in this case, as (X column value * (1.0 - 0.Y ) ) + ( X + 1 column value * 0.Y ).

  • outdgt (np.array) – Array for number of exits this RR that has COLIND time series for this time

  • ODGTF (np.array) – flag for whether to use outdgt which should be MAX_EXITS

Returns

calculated outflow demands.

  1. (float): ro, or total, demand

  2. (np.array): o, demand by exit, array

Return type

tuple

locaHrchhyd.errorsV = array([0, 0, 0, 0, 0])

Error handling in liftedloop.

This has been largely replaced but is maintained for backwards compatibility/tracing.

locaHrchhyd.fndrow(v, volFT)

Finds highest index in FTable volume column whose volume < v.

Modified to use numpy argmax

Parameters
  • v (float) – volume to check

  • volFT (np.array) – volume table vector

locaHrchhyd.getCOLIND(targID, nexits, iI, odfvf)

Get the COLIND array for active exits and this time interval

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

  • iI (int) – current time step

  • odfvf (np.array) – array of ODVFG flags by exit

Returns

input ivol in ft3/day

Return type

float

locaHrchhyd.getFUNCT(targID, nexits)

Get the FUNCT flags by exit for a particular target

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

Returns

flag values by exit

Return type

np.array

locaHrchhyd.getODFVFG(targID, nexits)

Get the ODFVF flags by exit for a particular target

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

Returns

flag values by exit

Return type

np.array

locaHrchhyd.getODGTFG(targID, nexits)

Get the ODGTF flags by exit for a particular target

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

Returns

flag values by exit

Return type

np.array

locaHrchhyd.getOSEffHO(targID, nexits)

Get the oseff hold over array

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

Returns

hold overs by exit

Return type

np.array

locaHrchhyd.getOUTDGT(targID, nexits, iI, odgtf)

Get the OUTDGT array for active exits and this time interval

Parameters
  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

  • iI (int) – current time step

  • odgtf (np.array) – array of ODGTF flags by exit

Returns

input ivol in ft3/day

Return type

float

locaHrchhyd.getOVOLbyExit(nExit)

Return the OVOL data structure for a specified exit

Parameters

nExit (int) – the exit number

Returns

OVOL, outflow volume data storage structure

Return type

np.recarray

locaHrchhyd.hydr_liftedloop(iI, targID, fTabDict)

Modified version of liftedloop to do a single time step and return to the main time loop.

Module-wide recarrays are used to store all results and calculation variables between calls. Modified real number comparisons to be more numerically reliable.

Parameters
  • iI (int) – index of current time step (0 to (sim_len-1))

  • targID (str) – ID for recarray columns

  • fTabDict (dict) – dictionary of FTABLE recarrays

Returns

count of the number of errors. Should generally be 0 but

used this to reference errorsV for error handling

Return type

int

locaHrchhyd.makeRowFT(vol, volumeFT, depthFT, sareaFT, dischList)

Make a row array representing the interpolated values from the FTAB for this volume

Parameters
  • vol (float) – current volume in rchres

  • volumeFT (np.array) – volume vector from FTABLE

  • depthFT (np.array) – depth vector from FTABLE

  • sareaFT (np.array) – surface area vector from FTABLE

  • dischList (list) – list of np.array that have discharge values

Returns

interpolated FTAB row

Return type

np.array

locaHrchhyd.makeRowFTbyIndx(indx, volumeFT, depthFT, sareaFT, dischList)

Make a row array representing the extracted values from the FTAB for this index

Parameters
  • indx (int) – index or row for FTAB

  • volumeFT (np.array) – volume vector from FTABLE

  • depthFT (np.array) – depth vector from FTABLE

  • sareaFT (np.array) – surface area vector from FTABLE

  • dischList (list) – list of np.array that have discharge values

Returns

extracted FTAB row

Return type

np.array

locaHrchhyd.nCOLIN_STATE = ['COLIN1', 'COLIN2', 'COLIN3', 'COLIN4', 'COLIN5']

New HDF5 format, COLIN state parameters

locaHrchhyd.nFLAG_GOOD = ['AUX1FG', 'AUX2FG', 'AUX3FG', 'FUNCT1', 'FUNCT2', 'FUNCT3', 'FUNCT4', 'FUNCT5', 'ODFVF1', 'ODFVF2', 'ODFVF3', 'ODFVF4', 'ODFVF5', 'ODGTF1', 'ODGTF2', 'ODGTF3', 'ODGTF4', 'ODGTF5']

New HDF5 format, flags that at least referenced in mHSP2

locaHrchhyd.nFUNCT_FLAG = ['FUNCT1', 'FUNCT2', 'FUNCT3', 'FUNCT4', 'FUNCT5']

New HDF5 format, FUNCT flags; One for each exit rather than a column

locaHrchhyd.nINIT_PARMS = ['VOL', 'COLIN1', 'COLIN2', 'COLIN3', 'COLIN4', 'COLIN5', 'OUTDG1', 'OUTDG2', 'OUTDG3', 'OUTDG4', 'OUTDG5']

New HDF5 format, list of initial parameters that suppported

locaHrchhyd.nODFVF_FLAG = ['ODFVF1', 'ODFVF2', 'ODFVF3', 'ODFVF4', 'ODFVF5']

New HDF5 format, ODFVF flags; One for each exit rather than a column

locaHrchhyd.nODGTF_FLAG = ['ODGTF1', 'ODGTF2', 'ODGTF3', 'ODGTF4', 'ODGTF5']

New HDF5 format, ODGTF flags; One for each exit rather than a column

locaHrchhyd.nOUTDG_STATE = ['OUTDG1', 'OUTDG2', 'OUTDG3', 'OUTDG4', 'OUTDG5']

New HDF5 format, COLIN state parameters

locaHrchhyd.npAuxil(volumeFT, depthFT, sareaFT, vol)

Compute depth and surface area using built in numpy methods

Parameters
  • volumeFT (np.array) – volume vector from FTABLE

  • depthFT (np.array) – depth vector from FTABLE

  • sareaFT (np.array) – surface area vector from FTABLE

  • vol (float) – current volume in rchres

Returns

calculated hydraulic characteristics from FTAB interp

  1. (float): depth in feet

  2. (float): surface area in sq. ft.

Return type

tuple

locaHrchhyd.setCOLINDTS(targID, npTS, nExit)

Set the COLIND time series from one data set to one target and exit number.

Parameters
  • targID (str) – the target identifier - must be same as used to create the rec array

  • npTS (np.array) – 1D array with the time series values

  • nExit (int) – the COLIND index number for this RR

locaHrchhyd.setDelT(sim_delt)

Set the pervious land delt for calculations.

The delt is stored as a module wide global. Sets DELTS module-wide global.

Parameters

sim_delt (float) – overall simulation time step in minutes

locaHrchhyd.setExInTS(targID, npTS)

Set the external inflow time series from one data set to one target. PET is where pet is stored for calculations. Might be adjusted by various activities.

Parameters
  • targID (str) – the target identifier - must be same as used to create the rec array

  • npTS (np.array) – 1D array with the time series values

locaHrchhyd.setGoodFlag(targID, tFlag, tfVal)

Set the value for the specified flag structure

Parameters
  • targID (str) – ID or recarray header to set

  • tFlag (str) – flag string to identify the data structure

  • tfVal (tuple or int) – flag value to set

locaHrchhyd.setGoodParam(targID, tParam, pVal)

Set the value for the specified parameter structure

Parameters
  • targID (str) – ID or recarray header to set

  • tParam (str) – param string to identify the data structure

  • pVal (float) – parameter value to set

locaHrchhyd.setInitialParams(targID, tParam, pVal)

Set the value for the specified initial values

Parameters
  • targID (str) – ID or recarray header to set

  • tParam (str) – param string to identify the data structure

  • pVal (float or tuple) – parameter value(s) to set

locaHrchhyd.setLakeFlag(targID, lFlag)

Set the lake flag for each RCHRES

Parameters
  • targID (str) – the target iD

  • lFlag (int) – the number of exits

locaHrchhyd.setNExits(targID, numExit)

Set the number of exits for each RCHRES

Parameters
  • targID (str) – the target iD

  • numExit (int) – the number of exits

locaHrchhyd.setOSEffHO(o, targID, nexits)

Set the oseff hold over array

Parameters
  • o (np.array) – calculated outflow array

  • targID (str) – target RCHRES ID

  • nexits (int) – number of exits

locaHrchhyd.setOUTDGTTS(targID, npTS, nExit)

Set the OUTDGT time series from one data set to one target and exit number.

Parameters
  • targID (str) – the target identifier - must be same as used to create the rec array

  • npTS (np.array) – 1D array with the time series values

  • nExit (int) – the ODGTFG index number for this RR

locaHrchhyd.setOutputControlFlags(targID, savetable, stTypes)

Set the output control flags

Parameters
  • targID (str) – target id

  • savetable (np.array or dict) – which outputs to save, bools

  • stTypes (list) – keys or indexes to save

Returns

function status; 0 == success

Return type

int

locaHrchhyd.setPETTS(targID, npTS)

Set the PET time series from one data set to one target. PET is where pet is stored for calculations. Might be adjusted by various activities.

Parameters
  • targID (str) – the target identifier - must be same as used to create the rec array

  • npTS (np.array) – 1D array with the time series values

locaHrchhyd.setPrecipTS(targID, npTS)

Set the precipitation time series from one data set to one target. SUPY is where precipitation is stored for calculations

Parameters
  • targID (str) – the target identifier - must be same as used to create the rec array

  • npTS (np.array) – 1D array with the time series values

locaHrchhyd.setUpRecArrays(pwList, sim_len)

Create and initialize pervious land output arrays

Parameters
  • pwList (list) – list of IDs for this target type

  • sim_len (int) – number of output intervals in the simulation

locaHrchhyd.writeOutputs(store, tIndex)

Write the outputs to the hdf file at the end of the simulation

Parameters
  • store (pd.HDFStore) – hdf5 file store to write to

  • tIndex (pd.DateIndex) – time index for the simulation

Returns

function status; 0 == success

Return type

int