Package hec.rss.model

Class Routing

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable
Direct Known Subclasses:
CoefRouting, LagAndKRouting, MuskingumCunge8ptRouting, MuskingumCungePrismRouting, MuskingumCungeRouting, MuskingumRouting, NullRouting, PulsChannelRouting, PulsChannelRoutingWithLosses, SsarrRouting, VariableLagKRouting

public class Routing extends Function implements AltInputReportInfc
See Also:
  • Field Details

    • _shouldCheckHotstart

      protected transient boolean _shouldCheckHotstart
    • FLOW

      public static final String FLOW
      See Also:
  • Constructor Details

    • Routing

      public Routing()
    • Routing

      public Routing(Element elem)
  • Method Details

    • getDefaultCoefArray

      public double[] getDefaultCoefArray()
    • estimateCoefRouting

      public boolean estimateCoefRouting(RunTimeStep rts, double[] coef)
    • initialize

      public boolean initialize()
      initialize prior to a compute
      Overrides:
      initialize in class Function
    • computeHindcast

      public int computeHindcast(RunTimeWindow rtw, int computeFlag)
    • computeForecast

      public int computeForecast(RunTimeWindow rtw, int computeFlag)
    • computeRouting

      public int computeRouting(RunTimeStep rts)
    • computeRouting

      public int computeRouting(RunTimeStep rts, double[] inputTS, double[] outputTS, Object[] routingDataTS, double[] routed)
      Compute routing over the given time window using the provided input, output, and routing data object time series arrays
      Parameters:
      rts - time step and number of steps
      inputTS - upstream flow time series
      outputTS - previously computed downstream flow time series
      routingDataTS - additional time depended routing data if needed for the routing method
      routed - newly computed downstream flow (array size must be >= rts.nstep)
      Returns:
      return flag, RssReturnStatusConstants.RTN_NOPROBLEM if routing computed successfully
    • newRouteData

      public Object newRouteData()
    • checkForecastCalc

      public boolean checkForecastCalc(RunTime runtime, boolean preventNegFlow)
      check forecast flow calcs called by all routing elements from getForecastEquation
    • checkForecastCalc

      public int checkForecastCalc(RunTimeStep runtime, boolean preventNegFlow)
      check forecast flow calcs called by all routing elements from getForecastEquation
    • checkForecastStepCalc

      public int checkForecastStepCalc(RunTimeStep runtime, boolean preventNegFlow)
      check forecast flow calcs called by all routing elements from getForecastEquation
    • toString

      public String toString()
      Overrides:
      toString in class NamedType
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Overrides:
      getFieldObject in class Function
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Overrides:
      setFieldObject in class Function
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful
    • initializeStandalone

      public boolean initializeStandalone()
      Initialize routing object for standalone compute in offline WQ simulation Default method - implemented in individual subclasses
      Returns:
      true if initialization successful, false o.w.
    • getNumberSubreaches

      public int getNumberSubreaches()
      Get the number of subreaches in the routing reach Default method returns 1 - method implemented in individual subclasses
      Returns:
      number of subreaches in reach with routing
    • getSubreachFlowArray

      public double[] getSubreachFlowArray(double flowIn, double flowOut, int iStep)
    • computeRoutingStepStandalone

      public double computeRoutingStepStandalone(int rtsMinutes, double q0, double q1, double reachOutflow, double[] initSubOutflow, double[] finSubOutflow)
      Method to compute a time step of routing through a reach for an offline WQ simulation Default implementation - returns array of constant flows Actual routing methods implemented in individual subclasses
      Parameters:
      q0 - initial flow into upstream subreach
      q1 - flow at end of time step into upstream subreach
      reachOutflow - flow at end of the reach - used for coef routing
      initSubOutflow - array of subreach flows at start of time step
      finSubOutflow - array of subreach flows at end of time step
      deltaT - run time step in minutes
      Returns:
      flow at the end of the reach at end of time step
    • outputReport

      public void outputReport(AlternativeInputReport report, org.jdom.Element elem)
      Description copied from interface: AltInputReportInfc
      Alternative Input Report Interface for data.
      Specified by:
      outputReport in interface AltInputReportInfc