GetWaterThermalTankInput Subroutine

private subroutine GetWaterThermalTankInput()

proc~~getwaterthermaltankinput~~UsesGraph proc~getwaterthermaltankinput GetWaterThermalTankInput module~dataenvironment DataEnvironment module~dataenvironment->proc~getwaterthermaltankinput module~dxcoils DXCoils module~dataenvironment->module~dxcoils module~refrigeratedcase RefrigeratedCase module~dataenvironment->module~refrigeratedcase module~fans Fans module~dataenvironment->module~fans module~outairnodemanager OutAirNodeManager module~dataenvironment->module~outairnodemanager module~schedulemanager ScheduleManager module~dataenvironment->module~schedulemanager module~psychrometrics Psychrometrics module~dataenvironment->module~psychrometrics module~dxcoils->proc~getwaterthermaltankinput module~refrigeratedcase->proc~getwaterthermaltankinput module~general General module~general->proc~getwaterthermaltankinput module~nodeinputmanager NodeInputManager module~general->module~nodeinputmanager module~general->module~psychrometrics module~fluidproperties FluidProperties module~general->module~fluidproperties module~fans->proc~getwaterthermaltankinput module~dataglobals DataGlobals module~dataglobals->proc~getwaterthermaltankinput module~dataglobals->module~dataenvironment module~dataglobals->module~dxcoils module~dataglobals->module~refrigeratedcase module~dataglobals->module~fans module~dataglobals->module~outairnodemanager module~dataglobals->module~schedulemanager module~datahvacglobals DataHVACGlobals module~dataglobals->module~datahvacglobals module~dataglobals->module~nodeinputmanager module~dataloopnode DataLoopNode module~dataglobals->module~dataloopnode module~dataglobals->module~psychrometrics module~branchnodeconnections BranchNodeConnections module~dataglobals->module~branchnodeconnections module~dataipshortcuts DataIPShortCuts module~dataglobals->module~dataipshortcuts module~dataheatbalance DataHeatBalance module~dataglobals->module~dataheatbalance module~curvemanager CurveManager module~dataglobals->module~curvemanager module~globalnames GlobalNames module~dataglobals->module~globalnames module~datazoneequipment DataZoneEquipment module~dataglobals->module~datazoneequipment module~inputprocessor InputProcessor module~dataglobals->module~inputprocessor module~datasizing DataSizing module~dataglobals->module~datasizing module~dataglobals->module~fluidproperties module~emsmanager EMSManager module~dataglobals->module~emsmanager module~dataruntimelanguage DataRuntimeLanguage module~dataglobals->module~dataruntimelanguage module~datacontaminantbalance DataContaminantBalance module~dataglobals->module~datacontaminantbalance module~datasurfaces DataSurfaces module~dataglobals->module~datasurfaces module~databsdfwindow DataBSDFWindow module~dataglobals->module~databsdfwindow module~databranchnodeconnections DataBranchNodeConnections module~dataglobals->module~databranchnodeconnections module~datawindowequivalentlayer DataWindowEquivalentLayer module~dataglobals->module~datawindowequivalentlayer module~datacomplexfenestration DataComplexFenestration module~dataglobals->module~datacomplexfenestration module~databranchairloopplant DataBranchAirLoopPlant module~dataglobals->module~databranchairloopplant module~outairnodemanager->proc~getwaterthermaltankinput module~schedulemanager->proc~getwaterthermaltankinput module~schedulemanager->module~dxcoils module~schedulemanager->module~refrigeratedcase module~schedulemanager->module~fans module~datahvacglobals->proc~getwaterthermaltankinput module~datahvacglobals->module~dxcoils module~datahvacglobals->module~refrigeratedcase module~datahvacglobals->module~fans module~nodeinputmanager->proc~getwaterthermaltankinput module~dataloopnode->proc~getwaterthermaltankinput module~dataloopnode->module~dxcoils module~dataloopnode->module~refrigeratedcase module~dataloopnode->module~fans module~dataloopnode->module~outairnodemanager module~dataloopnode->module~nodeinputmanager module~dataloopnode->module~branchnodeconnections module~psychrometrics->proc~getwaterthermaltankinput module~psychrometrics->module~dxcoils module~psychrometrics->module~fans module~branchnodeconnections->proc~getwaterthermaltankinput module~branchnodeconnections->module~nodeinputmanager module~plantutilities PlantUtilities module~plantutilities->proc~getwaterthermaltankinput module~dataipshortcuts->proc~getwaterthermaltankinput module~dataipshortcuts->module~inputprocessor module~dataheatbalance->proc~getwaterthermaltankinput module~dataheatbalance->module~dxcoils module~dataheatbalance->module~refrigeratedcase module~curvemanager->proc~getwaterthermaltankinput module~globalnames->proc~getwaterthermaltankinput module~datazoneequipment->proc~getwaterthermaltankinput module~datainterfaces DataInterfaces module~datainterfaces->proc~getwaterthermaltankinput module~datainterfaces->module~dxcoils module~datainterfaces->module~refrigeratedcase module~datainterfaces->module~fans module~datainterfaces->module~outairnodemanager module~datainterfaces->module~schedulemanager module~datainterfaces->module~nodeinputmanager module~datainterfaces->module~psychrometrics module~datainterfaces->module~branchnodeconnections module~datainterfaces->module~plantutilities module~datainterfaces->module~curvemanager module~datainterfaces->module~globalnames module~datainterfaces->module~inputprocessor module~datainterfaces->module~fluidproperties module~datainterfaces->module~emsmanager module~inputprocessor->proc~getwaterthermaltankinput module~inputprocessor->module~nodeinputmanager module~inputprocessor->module~globalnames module~datasizing->proc~getwaterthermaltankinput module~datasizing->module~inputprocessor module~reportsizingmanager ReportSizingManager module~reportsizingmanager->proc~getwaterthermaltankinput module~fluidproperties->proc~getwaterthermaltankinput module~fluidproperties->module~refrigeratedcase module~dataprecisionglobals DataPrecisionGlobals module~dataprecisionglobals->module~dataenvironment module~dataprecisionglobals->module~dxcoils module~dataprecisionglobals->module~refrigeratedcase module~dataprecisionglobals->module~general module~dataprecisionglobals->module~fans module~dataprecisionglobals->module~dataglobals module~dataprecisionglobals->module~outairnodemanager module~dataprecisionglobals->module~schedulemanager module~dataprecisionglobals->module~datahvacglobals module~dataprecisionglobals->module~nodeinputmanager module~dataprecisionglobals->module~dataloopnode module~dataprecisionglobals->module~psychrometrics module~dataprecisionglobals->module~plantutilities module~dataprecisionglobals->module~dataipshortcuts module~dataprecisionglobals->module~dataheatbalance module~dataprecisionglobals->module~curvemanager module~dataprecisionglobals->module~globalnames module~dataprecisionglobals->module~datazoneequipment module~dataprecisionglobals->module~datainterfaces module~dataprecisionglobals->module~inputprocessor module~dataprecisionglobals->module~datasizing module~dataprecisionglobals->module~fluidproperties module~dataprecisionglobals->module~emsmanager module~dataprecisionglobals->module~dataruntimelanguage module~dataprecisionglobals->module~datacontaminantbalance module~dataprecisionglobals->module~datasurfaces module~dataprecisionglobals->module~databsdfwindow module~datavectortypes DataVectorTypes module~dataprecisionglobals->module~datavectortypes module~dataprecisionglobals->module~datawindowequivalentlayer module~dataprecisionglobals->module~datacomplexfenestration module~dataprecisionglobals->module~databranchairloopplant module~datasystemvariables DataSystemVariables module~dataprecisionglobals->module~datasystemvariables module~emsmanager->module~fans module~dataruntimelanguage->module~emsmanager module~datacontaminantbalance->module~outairnodemanager module~datasurfaces->module~dataheatbalance module~datasurfaces->module~datacontaminantbalance module~databsdfwindow->module~dataheatbalance module~databsdfwindow->module~datasurfaces module~datavectortypes->module~dataheatbalance module~datavectortypes->module~datasurfaces module~datavectortypes->module~databsdfwindow module~databranchnodeconnections->module~branchnodeconnections module~datawindowequivalentlayer->module~dataheatbalance module~datacomplexfenestration->module~dataheatbalance module~databranchairloopplant->module~curvemanager module~datastringglobals DataStringGlobals module~datastringglobals->module~inputprocessor module~datastringglobals->module~datasystemvariables module~datasystemvariables->module~inputprocessor
Help

!======= Get Coil:WaterHeating:Desuperheater ====================================================================== !======= Get HEAT PUMP:WATER HEATER ===============================================================================

!======= Get WATER HEATER:MIXED =================================================================================== !======= Get WATER HEATER:STRATIFIED ============================================================================== !======= Get Chilled Water :MIXED =================================================================================== end chilled water mixed storage

!======= Get 'ThermalStorage:ChilledWater:Stratified' ======================================================= end stratified chilled water storage

!======= Check Water Heaters ======================================================================================

now do calls to TestCompSet for tanks, depending on nodes and heat pump water heater

Arguments

None

Calls

proc~~getwaterthermaltankinput~~CallsGraph proc~getwaterthermaltankinput GetWaterThermalTankInput node node proc~getwaterthermaltankinput->node getdensityglycol getdensityglycol proc~getwaterthermaltankinput->getdensityglycol curvevalue curvevalue proc~getwaterthermaltankinput->curvevalue getzoneequipmentdata getzoneequipmentdata proc~getwaterthermaltankinput->getzoneequipmentdata 8 8 proc~getwaterthermaltankinput->8 finditeminlist finditeminlist proc~getwaterthermaltankinput->finditeminlist verifyname verifyname proc~getwaterthermaltankinput->verifyname calphafieldnames calphafieldnames proc~getwaterthermaltankinput->calphafieldnames getonlysinglenode getonlysinglenode proc~getwaterthermaltankinput->getonlysinglenode getfanvolflow getfanvolflow proc~getwaterthermaltankinput->getfanvolflow roundsigdigits roundsigdigits proc~getwaterthermaltankinput->roundsigdigits registerplantcompdesignflow registerplantcompdesignflow proc~getwaterthermaltankinput->registerplantcompdesignflow checkschedulevalueminmax checkschedulevalueminmax proc~getwaterthermaltankinput->checkschedulevalueminmax proc~setupstratifiednodes SetupStratifiedNodes proc~getwaterthermaltankinput->proc~setupstratifiednodes calphaargs calphaargs proc~getwaterthermaltankinput->calphaargs getfantype getfantype proc~getwaterthermaltankinput->getfantype proc~validateplfcurve ValidatePLFCurve proc~getwaterthermaltankinput->proc~validateplfcurve interface~setupoutputvariable SetupOutputVariable proc~getwaterthermaltankinput->interface~setupoutputvariable samestring samestring proc~getwaterthermaltankinput->samestring interface~showcontinueerror ShowContinueError proc~getwaterthermaltankinput->interface~showcontinueerror trimsigdigits trimsigdigits proc~getwaterthermaltankinput->trimsigdigits psyrhoairfnpbtdbw psyrhoairfnpbtdbw proc~getwaterthermaltankinput->psyrhoairfnpbtdbw interface~showwarningerror ShowWarningError proc~getwaterthermaltankinput->interface~showwarningerror getcurveindex getcurveindex proc~getwaterthermaltankinput->getcurveindex interface~setupzoneinternalgain SetupZoneInternalGain proc~getwaterthermaltankinput->interface~setupzoneinternalgain getdxcoilindex getdxcoilindex proc~getwaterthermaltankinput->getdxcoilindex lalphafieldblanks lalphafieldblanks proc~getwaterthermaltankinput->lalphafieldblanks zoneequipconfig zoneequipconfig proc~getwaterthermaltankinput->zoneequipconfig verifyuniquecoilname verifyuniquecoilname proc~getwaterthermaltankinput->verifyuniquecoilname rnumericargs rnumericargs proc~getwaterthermaltankinput->rnumericargs interface~showsevereerror ShowSevereError proc~getwaterthermaltankinput->interface~showsevereerror cnumericfieldnames cnumericfieldnames proc~getwaterthermaltankinput->cnumericfieldnames heatreclaimrefrigcondenser heatreclaimrefrigcondenser proc~getwaterthermaltankinput->heatreclaimrefrigcondenser lnumericfieldblanks lnumericfieldblanks proc~getwaterthermaltankinput->lnumericfieldblanks heatreclaimrefrigeratedrack heatreclaimrefrigeratedrack proc~getwaterthermaltankinput->heatreclaimrefrigeratedrack interface~showfatalerror ShowFatalError proc~getwaterthermaltankinput->interface~showfatalerror getfanindex getfanindex proc~getwaterthermaltankinput->getfanindex heatreclaimdxcoil heatreclaimdxcoil proc~getwaterthermaltankinput->heatreclaimdxcoil 6 6 proc~getwaterthermaltankinput->6 getscheduleindex getscheduleindex proc~getwaterthermaltankinput->getscheduleindex checkandaddairnodenumber checkandaddairnodenumber proc~getwaterthermaltankinput->checkandaddairnodenumber checkrefrigerationinput checkrefrigerationinput proc~getwaterthermaltankinput->checkrefrigerationinput checkoutairnodenumber checkoutairnodenumber proc~getwaterthermaltankinput->checkoutairnodenumber getnumobjectsfound getnumobjectsfound proc~getwaterthermaltankinput->getnumobjectsfound getobjectitem getobjectitem proc~getwaterthermaltankinput->getobjectitem getcurvetype getcurvetype proc~getwaterthermaltankinput->getcurvetype testcompset testcompset proc~getwaterthermaltankinput->testcompset dxcoil dxcoil proc~getwaterthermaltankinput->dxcoil setupcompsets setupcompsets proc~getwaterthermaltankinput->setupcompsets zoneequiplist zoneequiplist proc~getwaterthermaltankinput->zoneequiplist proc~setupstratifiednodes->getdensityglycol plantloop plantloop proc~setupstratifiednodes->plantloop proc~validateplfcurve->curvevalue proc~validateplfcurve->getcurvetype
Help

Called By

proc~~getwaterthermaltankinput~~CalledByGraph proc~getwaterthermaltankinput GetWaterThermalTankInput proc~calcwaterthermaltankzonegains CalcWaterThermalTankZoneGains proc~calcwaterthermaltankzonegains->proc~getwaterthermaltankinput proc~simheatpumpwaterheater SimHeatPumpWaterHeater proc~simheatpumpwaterheater->proc~getwaterthermaltankinput proc~simwaterthermaltank SimWaterThermalTank proc~simheatpumpwaterheater->proc~simwaterthermaltank proc~simwaterthermaltank->proc~getwaterthermaltankinput proc~simulatewaterheaterstandalone SimulateWaterHeaterStandAlone proc~simulatewaterheaterstandalone->proc~getwaterthermaltankinput proc~simulatewaterheaterstandalone->proc~simwaterthermaltank
Help


Source Code

SUBROUTINE GetWaterThermalTankInput

          ! SUBROUTINE INFORMATION:
          !       AUTHOR         Dan Fisher and Brandon Anderson
          !       DATE WRITTEN   May 2000
          !       MODIFIED       R. Raustad, June 2005, added HPWH and desuperheater water heating coils
          !                      B. Griffith, Oct. 2007 extensions for indirect water heaters
          !                      B. Griffith, Feb. 2008 extensions for autosizing water heaters
          !                      BG Mar 2009.  Trap for bad heater height input for stratefied water heater CR7718
          !       RE-ENGINEERED  na

          ! PURPOSE OF THIS SUBROUTINE:
          ! Gets the water heater, HPWH, and/or desuperheater heating coil input from the input file.

          ! METHODOLOGY EMPLOYED:
          ! Standard EnergyPlus methodology.

          ! USE STATEMENTS:
  USE DataGlobals,        ONLY: MaxNameLength, NumOfZones, AutoCalculate, ScheduleAlwaysOn, outputfiledebug
  USE DataInterfaces,     ONLY: ShowSevereError, ShowWarningError, ShowFatalError,  &
                                SetupOutputVariable, ShowContinueError
  USE InputProcessor,     ONLY: GetNumObjectsFound, GetObjectItem, VerifyName, FindItemInList, SameString, GetObjectDefMaxArgs
  USE DataIPShortCuts
  USE NodeInputManager,   ONLY: GetOnlySingleNode
  USE ScheduleManager,    ONLY: GetScheduleIndex, CheckScheduleValueMinMax
  USE BranchNodeConnections, ONLY: TestCompSet, SetUpCompSets
  USE Psychrometrics,     ONLY: PsyRhoAirFnPbTdbW
  USE FluidProperties,    ONLY: GetDensityGlycol
  USE DataLoopNode,       ONLY: Node, NodeType_Air, NodeType_Water, NodeConnectionType_Inlet, NodeConnectionType_Outlet, &
                                NodeConnectionType_ZoneExhaust,  NodeConnectionType_ReliefAir, & ! ,NodeConnectionType_Internal
                                NodeConnectionType_OutsideAir, NodeConnectionType_OutsideAirReference, &
                                ObjectIsParent, ObjectIsNotParent
  USE CurveManager,       ONLY: GetCurveIndex, GetCurveType, CurveValue
  USE DataHeatBalance,    ONLY: Zone, IntGainTypeOf_WaterHeaterMixed, IntGainTypeOf_WaterHeaterStratified, &
                                IntGainTypeOf_ThermalStorageChilledWaterMixed, IntGainTypeOf_ThermalStorageChilledWaterStratified
  USE DXCoils,            ONLY: DXCoil, GetDXCoilIndex, NumDXCoils
  USE General,            ONLY: TrimSigDigits,  RoundSigDigits
  USE ReportSizingManager, ONLY: ReportSizingOutput
  USE PlantUtilities,     ONLY: RegisterPlantCompDesignFlow
  USE Fans,               ONLY: GetFanType, GetFanIndex, GetFanVolFlow
  USE DataSizing,         ONLY: AutoSize
  USE DataZoneEquipment,  ONLY: ZoneEquipConfig, ZoneEquipList, ZoneEquipInputsFilled, GetZoneEquipmentData
  USE DataEnvironment,    ONLY: OutBaroPress
  USE DataHVACGlobals,    ONLY: FanType_SimpleOnOff, BlowThru, DrawThru
  USE OutAirNodeManager,  ONLY: CheckOutAirNodeNumber,CheckAndAddAirNodeNumber
  USE DataSizing,         ONLY: PlantSizData, NumPltSizInput
  USE RefrigeratedCase,   ONLY: CheckRefrigerationInput
  USE GlobalNames, ONLY: VerifyUniqueCoilName

  IMPLICIT NONE ! Enforce explicit typing of all variables in this routine

          ! SUBROUTINE ARGUMENT DEFINITIONS:
          ! na

          ! SUBROUTINE PARAMETER DEFINITIONS:
  CHARACTER(len=*), PARAMETER :: Blank = ' '
  CHARACTER(len=*), PARAMETER :: RoutineName = 'GetWaterThermalTankInput: '


          ! INTERFACE BLOCK SPECIFICATIONS:

          ! DERIVED TYPE DEFINITIONS:
  TYPE WaterHeaterSaveNodes
    CHARACTER(len=MaxNameLength) :: InletNodeName1      =' '
    CHARACTER(len=MaxNameLength) :: OutletNodeName1     =' '
    CHARACTER(len=MaxNameLength) :: InletNodeName2      =' '
    CHARACTER(len=MaxNameLength) :: OutletNodeName2     =' '
  END TYPE

          ! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
  INTEGER                     :: WaterThermalTankNum          ! Index to WATER HEATER:*
  INTEGER                     :: WHsizingNum             ! Index to Water Heater:Sizing, for the IDF objects--not data storage
  INTEGER                     :: NodeNum                 ! Index to a stratified thermal node
  INTEGER                     :: CheckWaterHeaterNum     ! Used to search WATER HEATER:* to find association with HP Water Heater
  INTEGER                     :: DesuperheaterNum        ! Index to Coil:WaterHeating:Desuperheater
  INTEGER                     :: HPWaterHeaterNum        ! Index to HEAT PUMP:WATER HEATER
  INTEGER                     :: HeatingSourceNum        ! Index to DX cooling coil (heat source for desuperheater)
  INTEGER                     :: NumAlphas               ! Number of elements in the alpha array
  INTEGER                     :: NumNums                 ! Number of elements in the numeric array
!unused1208  INTEGER                     :: NumArgs                 ! Number of elements in the object (alpha + numeric)
  INTEGER                     :: RackNum                 ! Index to refrigrated display case rack
  INTEGER                     :: CondNum                 ! Index to refrigration condenser
  INTEGER                     :: DXCoilNum               ! Index to DX coils
  INTEGER                     :: IOStat                  ! IO Status when calling get input subroutine
  LOGICAL                     :: IsNotOK                 ! Flag to verify name
  LOGICAL                     :: IsBlank                 ! Flag for blank name
  LOGICAL                     :: IsValid                 ! Flag for validating PLF curve, OutsideAirNode
  LOGICAL                     :: ErrorsFound = .FALSE.   ! Flag for any error found during GetWaterThermalTankInput
  CHARACTER(len=MaxNameLength):: FanInletNode = ' '      ! Used to set up comp set
  CHARACTER(len=MaxNameLength):: FanOutletNode = ' '     ! Used to set up comp set
  CHARACTER(len=MaxNameLength):: CoilInletNode = ' '     ! Used to set up comp set
  CHARACTER(len=MaxNameLength):: CoilOutletNode = ' '    ! Used to set up comp set
  INTEGER                     :: SupAirIn  = 0           ! Used for error checking HPWHs
  INTEGER                     :: ExhAirOut = 0           ! Used for error checking HPWHs
  LOGICAL                     :: FoundInletNode  = .FALSE. ! Used for error checking HPWHs
  LOGICAL                     :: FoundOutletNode = .FALSE. ! Used for error checking HPWHs
  INTEGER                     :: ZoneNum = 0               ! Used for error checking HPWHs
  LOGICAL                     :: ValidScheduleValue = .FALSE. ! Used for error checking HPWH's inlet air mixer schedule
  INTEGER                     :: ZoneEquipConfigNum = 0  ! Used to determine if HPWH tank is in a Zone Equipment List (ZEL)
  INTEGER                     :: ZoneEquipListNum = 0    ! Used to determine if HPWH tank is in a Zone Equipment List
  INTEGER                     :: EquipmentTypeNum = 0    ! Used to determine if HPWH tank is in a Zone Equipment List
  LOGICAL                     :: FoundTankInList = .FALSE.  ! Used to determine if HPWH tank is listed in a Zone Equipment List
  LOGICAL                     :: TankNotLowestPriority = .FALSE. ! Used to determine if HPWH tank is prioritized correctly in ZEL
  INTEGER                     :: TankCoolingPriority = 0 ! Used to determine if a HPWH tank is prioritized correctly in ZEL
  INTEGER                     :: TankHeatingPriority = 0 ! Used to determine if a HPWH tank is prioritized correctly in ZEL
  LOGICAL                     :: DXCoilErrFlag = .FALSE. ! Used for error checking DX coils used with HPWHs
  REAL(r64)                   :: FanVolFlow = 0.0d0        ! Used for error checking fans used with HPWHs
  LOGICAL                     :: ErrFlag = .FALSE.       ! Used for error checking used with HPWHs
  REAL(r64)                   :: HEffFTemp = 0.0d0         ! Used for error checking desuperheater heating coils
  LOGICAL                     :: Okay

  ! Following allow for temporary storage of character strings but not saved in main structure
  TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: HPWHSaveNodeNames  ! temporary for HPWH node names used in later checks
  TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: WHSaveNodeNames    ! temporary for WH node names used in later checks
  TYPE (WaterHeaterSaveNodes), ALLOCATABLE, DIMENSION(:) :: CoilSaveNodeNames  ! temporary for coil node names used in later checks
  REAL(r64)  :: rho ! local fluid density
  INTEGER    :: DummyWaterIndex = 1

          ! FLOW:

  ! Make sure refrigeration input is gotten before this input
  CALL CheckRefrigerationInput

  IF (GetWaterThermalTankInputFlag) THEN
    NumWaterHeaterMixed       = GetNumObjectsFound(cMixedWHModuleObj)
    NumWaterHeaterStratified  = GetNumObjectsFound(cStratifiedWHModuleObj)
    NumChilledWaterMixed      = GetNumObjectsFound(cMixedCWTankModuleObj)
    NumChilledWaterStratified = GetNumObjectsFound(cStratifiedCWTankModuleObj)
    NumWaterThermalTank       = NumWaterHeaterMixed + NumWaterHeaterStratified &
                                 + NumChilledWaterMixed + NumChilledWaterStratified
    NumHeatPumpWaterHeater = GetNumObjectsFound('WaterHeater:HeatPump')
    NumWaterHeaterDesuperheater = GetNumObjectsFound('Coil:WaterHeating:Desuperheater')


    IF (NumWaterThermalTank > 0) THEN
      ! Write water heater header for EIO
      If ((NumWaterHeaterMixed >0) .OR. (NumWaterHeaterStratified >0)) WRITE(OutputFileInits,720)
      IF (NumHeatPumpWaterHeater > 0)  WRITE(OutputFileInits,721)
      IF (NumWaterHeaterStratified > 0) WRITE(OutputFileInits,722)
      IF (NumChilledWaterMixed > 0) WRITE(OutputFileInits, 725 )
      IF (NumChilledWaterStratified > 0) WRITE(OutputFileInits, 726)


    END IF

720  FORMAT( '! <Water Heater Information>,Type,Name,Volume {m3},Maximum Capacity {W},Standard Rated Recovery Efficiency, ', &
              'Standard Rated Energy Factor')
721  FORMAT( '! <Heat Pump Water Heater Information>,Type,Name,Volume {m3},Maximum Capacity {W},', &
             'Standard Rated Recovery Efficiency,Standard Rated Energy Factor,"DX Coil Total Cooling Rate {W, HPWH Only}"')
722  FORMAT( '! <Water Heater Stratified Node Information>,Node Number,Height {m},Volume {m3},Maximum Capacity {W},', &
             'Off-Cycle UA {W/K},On-Cycle UA {W/K},Number Of Inlets,Number Of Outlets')
725  FORMAT('! <Chilled Water Tank Information>,Type,Name,Volume {m3},Use Side Design Flow Rate {m3/s}, ', &
             'Source Side Design Flow Rate {m3/s}')
726  FORMAT( '! <Chilled Water Tank Stratified Node Information>,Node Number,Height {m},Volume {m3},', &
             'UA {W/K},Number Of Inlets,Number Of Outlets')

    IF (NumWaterThermalTank > 0) THEN
      ALLOCATE(WaterThermalTank(NumWaterThermalTank))
      ALLOCATE(WHSaveNodeNames(NumWaterThermalTank))
      ALLOCATE(CheckWTTEquipName(NumWaterThermalTank))
      CheckWTTEquipName=.true.
    ENDIF
    IF (NumHeatPumpWaterHeater > 0)THEN
      ALLOCATE(HPWaterHeater(NumHeatPumpWaterHeater))
      ALLOCATE(MyHPSizeFlag(NumHeatPumpWaterHeater))
      MyHPSizeFlag=.true.
      ALLOCATE(CheckHPWHEquipName(NumHeatPumpWaterHeater))
      CheckHPWHEquipName=.true.
      ALLOCATE(HPWHSaveNodeNames(NumHeatPumpWaterHeater))
    END IF
    IF (NumWaterHeaterDesuperheater > 0) THEN
      ALLOCATE(WaterHeaterDesuperheater(NumWaterHeaterDesuperheater))
      ALLOCATE(ValidSourceType(NumWaterHeaterDesuperheater))
      ValidSourceType=.false.
      ALLOCATE(CoilSaveNodeNames(NumWaterHeaterDesuperheater))
    ENDIF

!!!=======   Get Coil:WaterHeating:Desuperheater ======================================================================
    IF (NumWaterHeaterDesuperheater > 0) THEN
      cCurrentModuleObject = 'Coil:WaterHeating:Desuperheater'
      DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater

        CALL GetObjectItem(cCurrentModuleObject,DesuperheaterNum,cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
                           NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
                           AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)

        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),WaterHeaterDesuperheater%Name,DesuperheaterNum-1, &
                        IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF
        CALL VerifyUniqueCoilName(cCurrentModuleObject,cAlphaArgs(1),errflag,TRIM(cCurrentModuleObject)//' Name')
        IF (errflag) THEN
          ErrorsFound=.true.
        ENDIF
        WaterHeaterDesuperheater(DesuperheaterNum)%Name = cAlphaArgs(1)
        WaterHeaterDesuperheater(DesuperheaterNum)%Type = cCurrentModuleObject

!       convert availability schedule name to pointer
        IF(.NOT. lAlphaFieldBlanks(2) )THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr = GetScheduleIndex(cAlphaArgs(2))
          IF (WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr .EQ. 0) THEN
            CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)))
            CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
            ErrorsFound=.TRUE.
          END IF
        ELSE
          WaterHeaterDesuperheater(DesuperheaterNum)%AvailSchedPtr = ScheduleAlwaysOn
        END IF

!       convert schedule name to pointer
        WaterHeaterDesuperheater(DesuperheaterNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
        IF (WaterHeaterDesuperheater(DesuperheaterNum)%SetpointTempSchedule .EQ. 0) THEN
           CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)))
           CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))
          ErrorsFound=.TRUE.
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff       = rNumericArgs(1)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff .LE.  0.0d0 .OR. &
           WaterHeaterDesuperheater(DesuperheaterNum)%DeadbandTempDiff .GT. 20.0d0) THEN
         CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                              ': '//TRIM(cNumericFieldNames(1))//' must be > 0 and <= 20. '//TRIM(cNumericFieldNames(1))//' = ' &
                              //TRIM(TrimSigDigits(rNumericArgs(1),1)))
          ErrorsFound=.TRUE.
        END IF

        !WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff       = rNumericArgs(2)
        ! Error limits on heat reclaim efficiency applied after source type identified

        WaterHeaterDesuperheater(DesuperheaterNum)%RatedInletWaterTemp = rNumericArgs(3)
        WaterHeaterDesuperheater(DesuperheaterNum)%RatedOutdoorAirTemp = rNumericArgs(4)
        WaterHeaterDesuperheater(DesuperheaterNum)%MaxInletWaterTemp   = rNumericArgs(5)

        IF (.NOT. lAlphaFieldBlanks(4) ) THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp = GetCurveIndex(cAlphaArgs(4))
          IF (WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                                 ':  '//TRIM(cAlphaFieldNames(4))//' not found = '//TRIM(cAlphaArgs(4)))
            ErrorsFound = .TRUE.
          ELSE
            ! Verify Curve Object, only legal type is Quadratic
            SELECT CASE(GetCurveType(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp))

            CASE('BIQUADRATIC')

              IF(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp .GT. 0)THEN
                HEffFTemp = MIN(1.0d0,MAX(0.0d0,CurveValue(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp, &
                                           WaterHeaterDesuperheater(DesuperheaterNum)%RatedInletWaterTemp, &
                                           WaterHeaterDesuperheater(DesuperheaterNum)%RatedOutdoorAirTemp)))
                IF(ABS(HEffFTemp - 1.0d0) .GT. 0.05d0)THEN
                  CALL ShowWarningError(TRIM(cCurrentModuleObject)//', "'//  &
                     TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//'":')
                  CALL ShowContinueError('The '//TRIM(cAlphaFieldNames(4))//' should be normalized ')
                  CALL ShowContinueError(' to 1.0 at the rating point. Curve output at the rating point = ' &
                                         //TrimSigDigits(HEffFTemp,3))
                  CALL ShowContinueError(' The simulation continues using the user-specified curve.')
                END IF
              END IF

            CASE DEFAULT
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                                   '" illegal '//TRIM(cAlphaFieldNames(4))//' type for this object = '// &
                                   TRIM(GetCurveType(WaterHeaterDesuperheater(DesuperheaterNum)%HEffFTemp)))
              ErrorsFound=.true.
            END SELECT
          END IF
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%WaterInletNode = &
               GetOnlySingleNode(cAlphaArgs(5),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsParent)

        WaterHeaterDesuperheater(DesuperheaterNum)%WaterOutletNode = &
               GetOnlySingleNode(cAlphaArgs(6),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsParent)

        CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1=cAlphaArgs(5)
        CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1=cAlphaArgs(6)

        WaterHeaterDesuperheater(DesuperheaterNum)%TankType = cAlphaArgs(7)

        IF (.NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType,cMixedWHModuleObj)  &
          .AND. .NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType,cStratifiedWHModuleObj)) THEN

          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(DesuperheaterNum)%Name)//':')
          CALL ShowContinueError('Desuperheater can only be used with '//cMixedWHModuleObj//' or '//cStratifiedWHModuleObj//'.')
          ErrorsFound = .TRUE.
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%TankName = cAlphaArgs(8)

!       get heat reclaim object
        IF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:SingleSpeed') .OR. &
           SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoSpeed') .OR. &
           SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoStageWithHumidityControlMode'))THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceType  = cAlphaArgs(9)
          WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName  = cAlphaArgs(10)
!         load DX coil structure for connection to desuperheater heating coil (refrigerated rack have been loaded)
          ErrFlag=.false.
          CALL GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName, &
                              HeatingSourceNum, ErrFlag, cCurrentModuleObject)
          IF (ErrFlag) THEN
            CALL ShowContinueError('...occurs in '//TRIM(cCurrentModuleObject)//'='// &
                                   TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name))
            ErrorsFound=.true.
          ENDIF
        ELSE IF((SameString(cAlphaArgs(9),'Refrigeration:CompressorRack')) .OR. &
                (SameString(cAlphaArgs(9),'Refrigeration:Condenser:AirCooled')).OR.&
                (SameString(cAlphaArgs(9),'Refrigeration:Condenser:EvaporativeCooled')).OR.&
                (SameString(cAlphaArgs(9),'Refrigeration:Condenser:WaterCooled')))&
        THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceType  = cAlphaArgs(9)
          WaterHeaterDesuperheater(DesuperheaterNum)%HeatingSourceName  = cAlphaArgs(10)
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
          CALL ShowContinueError(' desuperheater can only be used with Coil:Cooling:DX:SingleSpeed, ')
          CALL ShowContinueError(' Coil:Cooling:DX:TwoSpeed, Coil:Cooling:DX:TwoStageWithHumidityControlMode, '//  &
             'Refrigeration:CompressorRack,')
          CALL ShowContinueError(' Refrigeration:Condenser:AirCooled ,Refrigeration:Condenser:EvaporativeCooled, ')
          CALL ShowContinueError(' or Refrigeration:Condenser:WaterCooled.')
          ErrorsFound = .TRUE.
        END IF

!       Set up comp set for water side nodes (reverse inlet/outlet for water heater)
        CALL SetUpCompSets(WaterHeaterDesuperheater(DesuperheaterNum)%Type, WaterHeaterDesuperheater(DesuperheaterNum)%Name, &
                     WaterHeaterDesuperheater(DesuperheaterNum)%TankType, &
                     WaterHeaterDesuperheater(DesuperheaterNum)%TankName,cAlphaArgs(6),cAlphaArgs(5))

!       Find the DX equipment index associated with the desuperheater heating coil.
        IF(SameString(cAlphaArgs(9),'Refrigeration:CompressorRack'))THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COMPRESSORRACK_REFRIGERATEDCASE
          DO RackNum = 1,NumRefrigeratedRacks
            IF(.NOT. SameString(HeatReclaimRefrigeratedRack(RackNum)%Name,cAlphaArgs(10)))CYCLE
            WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = RackNum
            IF(ALLOCATED(HeatReclaimRefrigeratedRack))ValidSourceType(DesuperheaterNum) = .TRUE.
            EXIT
          END DO
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                        '" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
            ErrorsFound = .TRUE.
          END IF
        ELSEIF((SameString(cAlphaArgs(9),'Refrigeration:Condenser:AirCooled')).OR.&
                (SameString(cAlphaArgs(9),'Refrigeration:Condenser:EvaporativeCooled')).OR.&
                (SameString(cAlphaArgs(9),'Refrigeration:Condenser:WaterCooled')))&
        THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = CONDENSER_REFRIGERATION
          DO CondNum = 1,NumRefrigCondensers
            IF(.NOT. SameString(HeatReclaimRefrigCondenser(CondNum)%Name,cAlphaArgs(10)))CYCLE
            WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = CondNum
            IF(ALLOCATED(HeatReclaimRefrigCondenser))ValidSourceType(DesuperheaterNum) = .TRUE.
            EXIT
          END DO
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                        '" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
            ErrorsFound = .TRUE.
          END IF
        ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:SingleSpeed'))THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_COOLING
          DO DXCoilNum = 1, NumDXCoils
            IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
            WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
            IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
            EXIT
          END DO
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                        '" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
            ErrorsFound = .TRUE.
          END IF
        ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoSpeed'))THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_MULTISPEED
          DO DXCoilNum = 1, NumDXCoils
            IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
            WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
            IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
            EXIT
          END DO
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                        '" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
            ErrorsFound = .TRUE.
          END IF
        ELSEIF(SameString(cAlphaArgs(9),'Coil:Cooling:DX:TwoStageWithHumidityControlMode'))THEN
          WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource = COIL_DX_MULTIMODE
          DO DXCoilNum = 1, NumDXCoils
            IF(.NOT. SameString(HeatReclaimDXCoil(DXCoilNum)%Name,cAlphaArgs(10)))CYCLE
            WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum = DXCoilNum
            IF(ALLOCATED(HeatReclaimDXCoil))ValidSourceType(DesuperheaterNum) = .TRUE.
            EXIT
          END DO
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSourceIndexNum .EQ. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)// &
                        '" desuperheater heat source object not found: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
            ErrorsFound = .TRUE.
          END IF
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//', "'//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                           '" invalid desuperheater heat source object: '//TRIM(cAlphaArgs(9))//' "'//TRIM(cAlphaArgs(10))//'"')
          ErrorsFound = .TRUE.
        END IF

        !Now have source type, so set limits on heat recovery efficiency
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%ReclaimHeatingSource == CONDENSER_REFRIGERATION) THEN
          IF (lNumericFieldBlanks(2)) THEN
            WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff       = 0.8d0
          ELSE
            WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff       = rNumericArgs(2)
            IF(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .LE. 0.0d0 .OR. &
                 WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .GT. 0.9d0) THEN
               CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                                ': '//TRIM(cNumericFieldNames(2))//' must be > 0.0 and <= 0.9, Efficiency = ' &
                                //TRIM(TrimSigDigits(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff,3)))
               ErrorsFound=.TRUE.
            END IF
          END IF !Blank Num(2)
        ELSE ! max is 0.3 for all other sources
          IF (lNumericFieldBlanks(2)) THEN
            WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff       = 0.25d0
          ELSE
            WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff       = rNumericArgs(2)
            IF(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .LE. 0.0d0 .OR. &
               WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff .GT. 0.3d0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                                ': '//TRIM(cNumericFieldNames(2))//' must be > 0.0 and <= 0.3, '//TRIM(cNumericFieldNames(2))// &
                                ' = '//TRIM(TrimSigDigits(WaterHeaterDesuperheater(DesuperheaterNum)%HeatReclaimRecoveryEff,3)))
              ErrorsFound=.TRUE.
            END IF
          END IF !Blank Num(2)
        END IF  !setting limits on heat recovery efficiency

        WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate = rNumericArgs(6)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate .LE. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                           ': '//TRIM(cNumericFieldNames(6))//' must be greater than 0. '//TRIM(cNumericFieldNames(6))//' = ' &
                           //TRIM(TrimSigDigits(rNumericArgs(6),6)))
          ErrorsFound=.TRUE.
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower   = rNumericArgs(7)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower .LT. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                               ': '//TRIM(cNumericFieldNames(7))//' must be >= 0. '//TRIM(cNumericFieldNames(7))//' = ' &
                               //TRIM(TrimSigDigits(rNumericArgs(7),2)))
          ErrorsFound=.TRUE.
        END IF

        IF((WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower/ &
           WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate) .GT. 7.9264d6)THEN
          CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                                ': '//TRIM(cNumericFieldNames(7))//' to '//TRIM(cNumericFieldNames(6))//' ratio > 7.9264E6.' &
                                //' '//TRIM(cNumericFieldNames(7))//' to '//TRIM(cNumericFieldNames(6))//' = ' &
                                //TRIM(TrimSigDigits((WaterHeaterDesuperheater(DesuperheaterNum)%PumpElecPower/ &
                                                     WaterHeaterDesuperheater(DesuperheaterNum)%OperatingWaterFlowRate),3)))
          CALL ShowContinueError(' Suggest reducing '//TRIM(cNumericFieldNames(7))//' or increasing '// &
                                   TRIM(cNumericFieldNames(6))//'.')
          CALL ShowContinueError(' The simulation will continue using the user defined values.')
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater = rNumericArgs(8)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater .LT. 0.0d0 .OR. &
           WaterHeaterDesuperheater(DesuperheaterNum)%PumpFracToWater .GT. 1.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                               ': '//TRIM(cNumericFieldNames(8))//' must be >= 0 or <= 1. '//TRIM(cNumericFieldNames(8))//' = ' &
                               //TRIM(TrimSigDigits(rNumericArgs(8),3)))
          ErrorsFound=.TRUE.
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%OnCycParaLoad        = rNumericArgs(9)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%OnCycParaLoad .LT. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                               ': '//TRIM(cNumericFieldNames(9))//' must be >= 0. '//TRIM(cNumericFieldNames(9))//' = ' &
                               //TRIM(TrimSigDigits(rNumericArgs(9),2)))
          ErrorsFound=.TRUE.
        END IF

        WaterHeaterDesuperheater(DesuperheaterNum)%OffCycParaLoad        = rNumericArgs(10)
        IF(WaterHeaterDesuperheater(DesuperheaterNum)%OffCycParaLoad .LT. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//&
                               ': '//TRIM(cNumericFieldNames(10))//' must be >= 0. '//TRIM(cNumericFieldNames(10))//' = ' &
                               //TRIM(TrimSigDigits(rNumericArgs(10),2)))
          ErrorsFound=.TRUE.
        END IF

      END DO

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF

!!!=======   Get HEAT PUMP:WATER HEATER ===============================================================================

!   get input for heat pump water heater object
    IF (NumHeatPumpWaterHeater > 0) THEN
      cCurrentModuleObject = 'WaterHeater:HeatPump'
      DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater

        CALL GetObjectItem(cCurrentModuleObject,HPWaterHeaterNum, &
          cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
          NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
          AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)

        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),HPWaterHeater%Name, &
                        HPWaterHeaterNum-1,IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF

        HPWaterHeater(HPWaterHeaterNum)%Name    = cAlphaArgs(1)
        HPWaterHeater(HPWaterHeaterNum)%Type    = cCurrentModuleObject
        HPWaterHeater(HPWaterHeaterNum)%TypeNum = HeatPumpWaterHeater

!       convert schedule name to pointer
        IF (.not. lAlphaFieldBlanks(2)) THEN
          HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr = GetScheduleIndex(cAlphaArgs(2))
          IF (HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
            CALL ShowContinueError(trim(cAlphaFieldNames(2))//'="'//TRIM(cAlphaArgs(2))//'".')
            ErrorsFound=.TRUE.
          END IF
        ELSE
          HPWaterHeater(HPWaterHeaterNum)%AvailSchedPtr = ScheduleAlwaysOn
        ENDIF

!       convert schedule name to pointer
        IF (.not. lAlphaFieldBlanks(3)) THEN
          HPWaterHeater(HPWaterHeaterNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
          IF (HPWaterHeater(HPWaterHeaterNum)%SetpointTempSchedule .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
            CALL ShowContinueError(trim(cAlphaFieldNames(3))//'="'//TRIM(cAlphaArgs(3))//'".')
            ErrorsFound=.TRUE.
          ENDIF
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
          CALL ShowContinueError('required '//trim(cAlphaFieldNames(3))//' is blank.')
          ErrorsFound=.TRUE.
        END IF

        HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff       = rNumericArgs(1)
        IF(HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff .LE.  0.0d0 .OR. &
           HPWaterHeater(HPWaterHeaterNum)%DeadbandTempDiff .GT. 20.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
          CALL ShowContinueError(trim(cNumericFieldNames(1))//' difference must be > 0 and <= 20. Dead band = ' &
                         //TRIM(TrimSigDigits(rNumericArgs(1),1)))
          ErrorsFound=.TRUE.
        END IF

        HPWaterHeater(HPWaterHeaterNum)%CondWaterInletNode = &
               GetOnlySingleNode(cAlphaArgs(4),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Inlet,2,ObjectIsParent)
        HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1=cAlphaArgs(4)
        HPWaterHeater(HPWaterHeaterNum)%CondWaterOutletNode = &
               GetOnlySingleNode(cAlphaArgs(5),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Outlet,2,ObjectIsParent)
        HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1=cAlphaArgs(5)

        HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate = rNumericArgs(2)
        IF(HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate .LE. 0.0d0 .AND. rNumericArgs(2) /= AutoCalculate) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
          CALL ShowContinueError(trim(cNumericFieldNames(2))//' must be greater than 0. Condenser water flow rate = ' &
                         //TRIM(TrimSigDigits(rNumericArgs(2),6)))
          ErrorsFound=.TRUE.
        END IF

        HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate   = rNumericArgs(3)
        IF(HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate .LE. 0.0d0 .AND. rNumericArgs(3) /= AutoCalculate) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
          CALL ShowContinueError(trim(cNumericFieldNames(3))//' must be greater than 0. Evaporator air flow rate = ' &
                         //TRIM(TrimSigDigits(rNumericArgs(3),6)))
          ErrorsFound=.TRUE.
        END IF

        SELECT CASE (cAlphaArgs(6))

          CASE ('SCHEDULE')
            HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempSchedule
            IF (.not. lAlphaFieldBlanks(11)) THEN
              HPWaterHeater(HPWaterHeaterNum)%AmbientTempSchedule   = GetScheduleIndex(cAlphaArgs(11))
              IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempSchedule .EQ. 0) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
                CALL ShowContinueError(trim(cAlphaFieldNames(11))//'="'//TRIM(cAlphaArgs(11))//'".')
                ErrorsFound = .TRUE.
              ENDIF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
              CALL ShowContinueError('required '//trim(cAlphaFieldNames(11))//' is blank.')
              ErrorsFound=.TRUE.
            END IF
            IF (.not. lAlphaFieldBlanks(12)) THEN
              HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule = GetScheduleIndex(cAlphaArgs(12))
              IF (HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule .EQ. 0) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
                CALL ShowContinueError(trim(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'".')
                ErrorsFound = .TRUE.
              ELSE
                IF (.NOT. CheckScheduleValueMinMax(HPWaterHeater(HPWaterHeaterNum)%AmbientRHSchedule,'>=',0.0d0,'<=',1.0d0)) THEN
                  CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//  &
                     '", invalid values')
                  CALL ShowContinueError(trim(cAlphaFieldNames(12))//'="'//TRIM(cAlphaArgs(12))//'",'//  &
                                  ' schedule values must be (>=0., <=1.)')
                  ErrorsFound=.true.
                END IF
              END IF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
              CALL ShowContinueError('required '//trim(cAlphaFieldNames(12))//' is blank.')
              ErrorsFound=.TRUE.
            END IF

          CASE ('ZONEAIRONLY')
            HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempZone
            IF (.not. lAlphaFieldBlanks(13)) THEN
              HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone = FindItemInList(cAlphaArgs(13),Zone%Name,NumOfZones)
              IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. 0) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
                CALL ShowContinueError(trim(cAlphaFieldNames(13))//'="'//TRIM(cAlphaArgs(13))//'".')
                ErrorsFound = .TRUE.
              END IF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
              CALL ShowContinueError('required '//trim(cAlphaFieldNames(13))//' is blank.')
              ErrorsFound=.TRUE.
            ENDIF

          CASE ('OUTDOORAIRONLY')
            HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempOutsideAir

          CASE ('ZONEANDOUTDOORAIR')
            HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration = AmbientTempZoneAndOA
            IF (.not. lAlphaFieldBlanks(13)) THEN
              HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone = FindItemInList(cAlphaArgs(13),Zone%Name,NumOfZones)
              IF (HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. 0) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
                CALL ShowContinueError(trim(cAlphaFieldNames(13))//'="'//TRIM(cAlphaArgs(13))//'".')
                ErrorsFound = .TRUE.
              END IF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
              CALL ShowContinueError('required '//trim(cAlphaFieldNames(13))//' is blank.')
              ErrorsFound=.TRUE.
            ENDIF

        END SELECT

!       Read air inlet nodes after mixer/splitter nodes have been read in (cAlphaArgs 7-10),
!       Node_ConnectionType differs for inlet node if mixer/splitter node exists

        HPWaterHeater(HPWaterHeaterNum)%TankType = cAlphaArgs(14)

        IF (.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType,cMixedWHModuleObj)  &
          .AND. .NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType,cStratifiedWHModuleObj)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
          CALL ShowContinueError('Heat pump water heater can only be used with '//  &
                                  cMixedWHModuleObj//' or '//cStratifiedWHModuleObj//'.')
          ErrorsFound = .TRUE.
        END IF

!       Verify tank name after Water Heater:Mixed objects have been read in
        HPWaterHeater(HPWaterHeaterNum)%TankName = cAlphaArgs(15)

!       Get the water heater tank use side inlet node names for HPWHs connected to a plant loop
!       Save the name of the node for use with set up comp sets
        HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName2=cAlphaArgs(16)
        HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName2=cAlphaArgs(17)

        IF(.not. lAlphaFieldBlanks(16) .AND. .not. lAlphaFieldBlanks(17))THEN
          HPWaterHeater(HPWaterHeaterNum)%WHUseInletNode = &
               GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Inlet,1,ObjectIsParent)
          HPWaterHeater(HPWaterHeaterNum)%WHUseOutletNode = &
               GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Water,NodeConnectionType_Outlet,1,ObjectIsParent)
        END IF

!       get Coil:DX:HeatPumpWaterHeater object
        HPWaterHeater(HPWaterHeaterNum)%DXCoilType = cAlphaArgs(18)
        HPWaterHeater(HPWaterHeaterNum)%DXCoilName = cAlphaArgs(19)

!       check that the DX Coil exists
        IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%DXCoilType,'Coil:WaterHeating:AirToWaterHeatPump'))THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
          CALL ShowContinueError('Heat pump water heater can only be used with Coil:WaterHeating:AirToWaterHeatPump.')
          ErrorsFound = .TRUE.
        END IF

        DXCoilErrFlag=.false.
        CALL GetDXCoilIndex(HPWaterHeater(HPWaterHeaterNum)%DXCoilName, &
                            HPWaterHeater(HPWaterHeaterNum)%DXCoilNum, DXCoilErrFlag, cCurrentModuleObject)
        IF (DXCoilErrFlag) THEN
          CALL ShowContinueError('...occurs in WaterHeater:HeatPump ='//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
          CALL ShowContinueError('...entered DX CoilType='//TRIM(HPWaterHeater(HPWaterHeaterNum)%DXCoilType))
          ErrorsFound   = .TRUE.
        END IF

!       Set up comp set for condenser water side nodes (reverse inlet/outlet for water heater)
        CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
                     HPWaterHeater(HPWaterHeaterNum)%DXCoilType, &
                     HPWaterHeater(HPWaterHeaterNum)%DXCoilName,cAlphaArgs(4),cAlphaArgs(5))

        CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
                     HPWaterHeater(HPWaterHeaterNum)%TankType, &
                     HPWaterHeater(HPWaterHeaterNum)%TankName,cAlphaArgs(5),cAlphaArgs(4))

        HPWaterHeater(HPWaterHeaterNum)%MinAirTempForHPOperation = rNumericArgs(4)
        IF(HPWaterHeater(HPWaterHeaterNum)%MinAirTempForHPOperation .LT. 5) THEN
          CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//&
               '": minimum inlet air temperature for heat pump compressor operation must be greater than or equal to 5 C.')
          CALL ShowContinueError('...Minimum inlet air temperature = '//TRIM(TrimSigDigits(rNumericArgs(4),1)))
        END IF

!       Get compressor location
        SELECT CASE (cAlphaArgs(20))
          CASE ('SCHEDULE')
            HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempSchedule
            IF (.not. lAlphaFieldBlanks(21)) THEN
              HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempSchedule = GetScheduleIndex(cAlphaArgs(21))
              IF (HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempSchedule .EQ. 0) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
                CALL ShowContinueError(trim(cAlphaFieldNames(21))//'="'//TRIM(cAlphaArgs(21))//'".')
                ErrorsFound = .TRUE.
              END IF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", ')
              CALL ShowContinueError('required '//trim(cAlphaFieldNames(21))//' is blank.')
              ErrorsFound=.TRUE.
            ENDIF

          CASE ('ZONE')
            HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempZone
            IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir .OR. &
               HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
                                   '":  Inlet Air Configuration must be Zone Air Only or Zone And')
              CALL ShowContinueError(' Outdoor Air when compressor location equals ZONE.')
              ErrorsFound = .TRUE.
            END IF

            IF(.not. lAlphaFieldBlanks(21))THEN
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
                        '"  '//trim(cAlphaFieldNames(21))//' was provided but will not be used based'// &
                        ' on compressor location input="'//TRIM(cAlphaArgs(20))//'".')
            END IF
          CASE ('OUTDOORS')
            HPWaterHeater(HPWaterHeaterNum)%CrankcaseTempIndicator = CrankcaseTempExterior
            IF(.not. lAlphaFieldBlanks(21))THEN
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
                        '"  '//trim(cAlphaFieldNames(21))//' was provided but will not be used based'// &
                        ' on '//trim(cAlphaFieldNames(21))//'="'//TRIM(cAlphaArgs(20))//'".')
            END IF

        END SELECT

        HPWaterHeater(HPWaterHeaterNum)%FanType = cAlphaArgs(22)
        HPWaterHeater(HPWaterHeaterNum)%FanName = cAlphaArgs(23)

!       check that the fan exists
        ErrFlag=.false.
        CALL GetFanIndex(HPWaterHeater(HPWaterHeaterNum)%FanName, &
                         HPWaterHeater(HPWaterHeaterNum)%FanNum, ErrFlag,cCurrentModuleObject)
        IF (ErrFlag) THEN
          CALL ShowContinueError('...occurs in unit="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'".')
          ErrorsFound=.TRUE.
        ENDIF

        ErrFlag=.false.
        CALL GetFanType(HPWaterHeater(HPWaterHeaterNum)%FanName,HPWaterHeater(HPWaterHeaterNum)%FanType_Num,ErrFlag, &
                       cCurrentModuleObject,HPWaterHeater(HPWaterHeaterNum)%Name)

        IF(ErrFlag)THEN
          ErrorsFound=.TRUE.
        ELSE
          IF(HPWaterHeater(HPWaterHeaterNum)%FanType_Num .NE. FanType_SimpleOnOff)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' illegal fan type specified.')
            CALL ShowContinueError('Occurs in unit="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'".')
            CALL ShowContinueError(' The fan object ('//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
                                   ') type must be Fan:OnOff when used with a heat pump water heater')
            ErrorsFound = .TRUE.
          ELSE
            IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%FanType,'Fan:OnOff'))THEN
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//' illegal fan type = '//  &
                 TRIM(HPWaterHeater(HPWaterHeaterNum)%FanType))
              CALL ShowContinueError('Occurs in unit = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
              CALL ShowContinueError(' The fan object ('//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
                                     ') is actually the correct fan type and the simulation continues.')
              CALL ShowContinueError(' Node connection errors will result due to the inconsistent fan type.')
            END IF
          END IF
        END IF

        CALL GetFanVolFlow(HPWaterHeater(HPWaterHeaterNum)%FanNum,FanVolFlow)

        IF(FanVolFlow .NE. AutoSize .AND. .NOT. ErrFlag)THEN
          IF(FanVolFlow .LT. HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' - air flow rate = '//TRIM(TrimSigDigits(FanVolFlow,7))// &
              ' in fan object '//TRIM(HPWaterHeater(HPWaterHeaterNum)%FanName)// &
              ' is less than the  HPWHs evaporator air flow rate.')
            CALL ShowContinueError(' The fan flow rate must be >= to the HPWHs evaporator volumetric air flow rate.')
            CALL ShowContinueError(' Occurs in unit = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name))
            ErrorsFound = .TRUE.
          END IF
        END IF

        IF(SameString(cAlphaArgs(24),'BlowThrough')) THEN
          HPWaterHeater(HPWaterHeaterNum)%FanPlacement = BlowThru

        ELSEIF(SameString(cAlphaArgs(24),'DrawThrough')) THEN
          HPWaterHeater(HPWaterHeaterNum)%FanPlacement = DrawThru

        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", invalid ')
          CALL ShowContinueError(trim(cAlphaFieldNames(24))//'="'//TRIM(cAlphaArgs(24))//'".')
          ErrorsFound = .TRUE.
        END IF

        IF(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum .GT. 0)THEN
!         get HPWH capacity, air inlet node, and PLF curve info from DX coil object
          HPWaterHeater(HPWaterHeaterNum)%Capacity = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2
          HPWaterHeater(HPWaterHeaterNum)%DXCoilAirInletNode = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%AirInNode
          HPWaterHeater(HPWaterHeaterNum)%DXCoilPLFFPLR = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%PLFFPLR(1)
!         check the range of condenser pump power to be <= 5 gpm/ton
          IF(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%HPWHCondPumpElecNomPower/ &
             DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2 .GT. 0.1422d0)THEN
            CALL ShowWarningError(TRIM(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%DXCoilType)// &
                 '= '//TRIM(DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%Name)//&
                ': Rated condenser pump power per watt of rated heating capacity has exceeded the recommended'// &
                ' maximum of 0.1422 W/W (41.67 watt/MBH). Condenser pump power per watt = ' &
                //TRIM(TrimSigDigits((DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%HPWHCondPumpElecNomPower/ &
                                      DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%RatedTotCap2),4)))
          END IF
        END IF

        IF (HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate == AutoCalculate) THEN
          HPWaterHeater(HPWaterHeaterNum)%OperatingWaterFlowRate = 0.00000004487d0 * HPWaterHeater(HPWaterHeaterNum)%Capacity
          HPWaterHeater(HPWaterHeaterNum)%WaterFlowRateAutosized = .TRUE.
        END IF

        IF (HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate == AutoCalculate) THEN
          HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate = 0.00005035d0 * HPWaterHeater(HPWaterHeaterNum)%Capacity
          HPWaterHeater(HPWaterHeaterNum)%AirFlowRateAutosized = .TRUE.
        END IF

        HPWaterHeater(HPWaterHeaterNum)%OnCycParaLoad  = rNumericArgs(5)
        IF(HPWaterHeater(HPWaterHeaterNum)%OnCycParaLoad .LT. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
          CALL ShowContinueError(trim(cNumericFieldNames(5))//' must be >= 0. '//trim(cNumericFieldNames(5))//' = ' &
                         //TRIM(TrimSigDigits(rNumericArgs(5),2)))
          ErrorsFound=.TRUE.
        END IF

        HPWaterHeater(HPWaterHeaterNum)%OffCycParaLoad = rNumericArgs(6)
        IF(HPWaterHeater(HPWaterHeaterNum)%OffCycParaLoad .LT. 0.0d0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
          CALL ShowContinueError(trim(cNumericFieldNames(6))//' must be >= 0. '//trim(cNumericFieldNames(6))//' = ' &
                         //TRIM(TrimSigDigits(rNumericArgs(6),2)))
          ErrorsFound=.TRUE.
        END IF

        IF(SameString(cAlphaArgs(25),'Zone'))THEN
          HPWaterHeater(HPWaterHeaterNum)%ParasiticTempIndicator = AmbientTempZone
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir .OR. &
             HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'",')
            CALL ShowContinueError(trim(cAlphaFieldNames(25))//' must be ZoneAirOnly or ZoneAndOutdoorAir')
            CALL ShowContinueError(' when parasitic heat rejection location equals Zone.')
            ErrorsFound = .TRUE.
          END IF
        ELSEIF(SameString(cAlphaArgs(25),'Outdoors'))THEN
          HPWaterHeater(HPWaterHeaterNum)%ParasiticTempIndicator = AmbientTempOutsideAir
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
          CALL ShowContinueError(' parasitic heat rejection location must be either Zone or Outdoors.')
          ErrorsFound = .TRUE.
        END IF

!       get mixer/splitter nodes only when Inlet Air Configuration is ZoneAndOutdoorAir
        IF (.not. lAlphaFieldBlanks(26)) THEN
!         For the inlet air mixer node, NodeConnectionType is outlet from the HPWH inlet air node
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
            HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode = &
               GetOnlySingleNode(cAlphaArgs(26),ErrorsFound,'WaterHeater:HeatPump inlet air mixer',cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
          ELSE
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
            CALL ShowContinueError('Inlet air mixer node name specified but only required '//  &
               'when Inlet Air Configuration is selected'// &
               ' as Zone and OutdoorAir. Node name disregarded and simulation continues.')
          END IF
        ELSEIF(lAlphaFieldBlanks(26).AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
            CALL ShowContinueError('Inlet air mixer node name required '//  &
               'when Inlet Air Configuration is selected as ZoneAndOutdoorAir.')
            ErrorsFound = .TRUE.
        END IF

        IF (.not. lAlphaFieldBlanks(27)) THEN
!         For the outlet air splitter node, NodeConnectionType is inlet to the HPWH outlet air node
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
            HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode = &
              GetOnlySingleNode(cAlphaArgs(27),ErrorsFound,TRIM(cCurrentModuleObject)//'-OUTLET AIR SPLITTER',cAlphaArgs(1), &
                          NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
          ELSE
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
            CALL ShowContinueError('Outlet air splitter node name specified but only required when '//  &
               'Inlet Air Configuration is selected'// &
               ' as ZoneAndOutdoorAir. Node name disregarded and simulation continues.')
          END IF
        ELSEIF(lAlphaFieldBlanks(27) .AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
            CALL ShowContinueError('Outlet air splitter node name required when '//  &
               'Inlet Air Configuration is selected as ZoneAndOutdoorAir.')
            ErrorsFound = .TRUE.
        END IF

!       get node data for HPWH
        IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode /= 0) THEN
!         when mixer/splitter nodes are used the HPWH's inlet/outlet node are set up as ObjectIsNotParent

          HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
               GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject)//'-INLET AIR MIXER',cAlphaArgs(1), &
                           NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)

          HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
               GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject)//'-OUTLET AIR SPLITTER',cAlphaArgs(1), &
                           NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)

          HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode = &
             GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                         NodeType_Air,NodeConnectionType_OutsideAirReference,1,ObjectIsParent)
          IF (cAlphaArgs(9) /= ' ') THEN
            Call CheckAndAddAirNodeNumber(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode,Okay)
            IF (.not. Okay) THEN
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
                 '": Adding outdoor air node='//TRIM(cAlphaArgs(9)))
            ENDIF
          ENDIF

          HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode = &
             GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                        NodeType_Air,NodeConnectionType_ReliefAir,1,ObjectIsParent)

        ELSE
!         when mixer/splitter nodes are NOT used the HPWH's inlet/outlet nodes are set up as ObjectIsParent
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempSchedule)THEN
!           for scheduled HPWH's the inlet node is not on any branch or parent object, make it an outlet node
!           to avoid node connection errors
            HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
               GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)

            HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
               GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)

          ELSE ! HPWH is connected to a zone with no mixer/splitter nodes
            IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone)THEN
              HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode = &
                 GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsParent)

              HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode = &
                 GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsParent)
            ELSE ! HPWH is located outdoors
              HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode = &
                 GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_OutsideAirReference,1,ObjectIsParent)
              IF (.not. lAlphaFieldBlanks(9)) THEN
                CALL CheckAndAddAirNodeNumber(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode,Okay)
                IF (.not. Okay) THEN
                  CALL ShowWarningError(TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))// &
                     '": Adding outdoor air node ='//TRIM(cAlphaArgs(9)))
                ENDIF
              ENDIF

             HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode = &
                 GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
                            NodeType_Air,NodeConnectionType_ReliefAir,1,ObjectIsParent)
            END IF
          END IF
        END IF

!       check that the HPWH inlet and outlet nodes are in the same zone (ZoneHVAC:EquipmentConnections) when
!       Inlet Air Configuration is Zone Air Only or Zone and Outdoor Air
        IF((HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone .OR. &
           HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) .AND. &
           HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .GT. 0)THEN
          IF (.not. ZoneEquipInputsFilled) THEN
            CALL GetZoneEquipmentData
            ZoneEquipInputsFilled=.true.
          ENDIF
          IF(ALLOCATED(ZoneEquipConfig))THEN
            FoundInletNode  = .FALSE.
            FoundOutletNode = .FALSE.
            DO ZoneNum = 1, NumOfZones
              IF(HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone .EQ. ZoneEquipConfig(ZoneNum)%ActualZoneNum)EXIT
            END DO
            IF(ZoneNum .LE. NumOfZones)THEN
              DO SupAirIn  = 1,ZoneEquipConfig(ZoneNum)%NumInletNodes
                IF(HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode .NE. ZoneEquipConfig(ZoneNum)%InletNode(SupAirIn))CYCLE
                FoundOutletNode = .TRUE.
              END DO
              DO ExhAirOut = 1,ZoneEquipConfig(ZoneNum)%NumExhaustNodes
                IF(HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirInletNode .NE. ZoneEquipConfig(ZoneNum)%ExhaustNode(ExhAirOut))CYCLE
                FoundInletNode = .TRUE.
              END DO
              IF(.NOT. FoundInletNode)THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
                CALL ShowContinueError('The HPWH''s air inlet node name = '//TRIM(cAlphaArgs(7))//' was not properly specified ')
                CALL ShowContinueError('as an exhaust air node for zone = '//TRIM(cAlphaArgs(13))//' in a '// &
                                       'ZoneHVAC:EquipmentConnections object.')
                ErrorsFound = .TRUE.
              END IF
              IF(.NOT. FoundOutletNode)THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
                CALL ShowContinueError('The HPWH''s air outlet node name = '//TRIM(cAlphaArgs(8))//' was not properly specified ')
                CALL ShowContinueError('as an inlet air node for zone = '//TRIM(cAlphaArgs(13))//' in a '// &
                                       'ZoneHVAC:EquipmentConnections object.')
                ErrorsFound = .TRUE.
              END IF
            END IF
          ELSE
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'":')
            CALL ShowContinueError('Heat pump water heater air inlet node name and air outlet node name must be'// &
                                   ' listed in a ZoneHVAC:EquipmentConnections object when Inlet Air Configuration'// &
                                   ' is equal to ZoneAirOnly or ZoneAndOutdoorAir.')
            ErrorsFound = .TRUE.
          END IF
        END IF

!       only get the inlet air mixer schedule if the inlet air configuration is zone and outdoor air
        IF (.not. lAlphaFieldBlanks(28) .AND. HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA) THEN
          HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr = GetScheduleIndex(cAlphaArgs(28))
          IF (HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
              CALL ShowContinueError(trim(cAlphaFieldNames(28))//'="'//TRIM(cAlphaArgs(28))//'",')
            ErrorsFound = .TRUE.
          ELSE
!           check schedule values to be between 0 and 1
            ValidScheduleValue=CheckScheduleValueMinMax(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerSchPtr,'>=',0.0d0, '<=',1.0d0)
            IF (.not. ValidScheduleValue) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", not found')
              CALL ShowContinueError(trim(cAlphaFieldNames(28))//' values out of range of 0 to 1, Schedule="'//  &
                 TRIM(cAlphaArgs(28))//'".')
              ErrorsFound=.TRUE.
            ENDIF
!           set outlet air splitter schedule index equal to inlet air mixer schedule index
!           (place holder for when zone pressurization/depressurization is allowed and different schedules can be used)
            HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterSchPtr = GetScheduleIndex(cAlphaArgs(28))
          END IF
        END IF

!       set fan outlet node variable for use in setting Node(FanOutletNode)%MassFlowRateMax for fan object
        IF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. DrawThru)THEN
           IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .NE. 0) THEN
             HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode
           ELSE
             IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempOutsideAir)THEN
               HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%ExhaustAirNode
             ELSE
               HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = HPWaterHeater(HPWaterHeaterNum)%HeatPumpAirOutletNode
             END IF
           END IF
        ELSEIF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. BlowThru) THEN
!           set fan outlet node variable for use in setting Node(FanOutletNode)%MassFlowRateMax for fan object
            HPWaterHeater(HPWaterHeaterNum)%FanOutletNode = DXCoil(HPWaterHeater(HPWaterHeaterNum)%DXCoilNum)%AirInNode
        END IF

!       set the max mass flow rate for outdoor fans
        Node(HPWaterHeater(HPWaterHeaterNum)%FanOutletNode)%MassFlowRateMax =    &
                HPWaterHeater(HPWaterHeaterNum)%OperatingAirFlowRate *   &
                    PsyRhoAirFnPbTdbW(OutBaroPress,20.0d0, 0.0d0)

        IF(HPWaterHeater(HPWaterHeaterNum)%FanPlacement .EQ. BlowThru)THEN
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode .GT. 0)THEN
!           cAlphaArgs(26) = Inlet Air Mixer Node
            FanInletNode = cAlphaArgs(26)
            FanOutletNode = 'UNDEFINED'
          ELSE
            IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
!             cAlphaArgs(7) = Heat Pump Air Inlet Node
              FanInletNode = cAlphaArgs(7)
              FanOutletNode = 'UNDEFINED'
            ELSE
!             cAlphaArgs(9) = Outside Air Node
              FanInletNode = cAlphaArgs(9)
              FanOutletNode = 'UNDEFINED'
            END IF
          END IF
          IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .GT. 0)THEN
!           cAlphaArgs(27) = Outlet Air Splitter Node
            CoilInletNode = 'UNDEFINED'
            CoilOutletNode = cAlphaArgs(27)
          ELSE
            IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
!             cAlphaArgs(8) = Heat Pump Air Outlet Node
              CoilInletNode = 'UNDEFINED'
              CoilOutletNode = cAlphaArgs(8)
            ELSE
              CoilInletNode = 'UNDEFINED'
!             cAlphaArgs(10) = Exhaust Air Node
              CoilOutletNode = cAlphaArgs(10)
            END IF
          END IF
        ELSE
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirMixerNode .GT. 0)THEN
            CoilInletNode = cAlphaArgs(26)
            CoilOutletNode = 'UNDEFINED'
          ELSE
            IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
              CoilInletNode = cAlphaArgs(7)
              CoilOutletNode = 'UNDEFINED'
            ELSE
              CoilInletNode = cAlphaArgs(9)
              CoilOutletNode = 'UNDEFINED'
            END IF
          END IF
          IF(HPWaterHeater(HPWaterHeaterNum)%OutletAirSplitterNode .GT. 0)THEN
            FanInletNode = 'UNDEFINED'
            FanOutletNode = cAlphaArgs(27)
          ELSE
            IF(HPWaterHeater(HPWaterHeaterNum)%OutsideAirNode .EQ. 0)THEN
              FanInletNode = 'UNDEFINED'
              FanOutletNode = cAlphaArgs(8)
            ELSE
              FanInletNode = 'UNDEFINED'
              FanOutletNode = cAlphaArgs(10)
            END IF
          END IF
        END IF

!       set up comp set for air side nodes (can be blow thru or draw thru, may or may not have damper nodes)
        CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, &
                           HPWaterHeater(HPWaterHeaterNum)%Name, &
                           HPWaterHeater(HPWaterHeaterNum)%DXCoilType, &
                           HPWaterHeater(HPWaterHeaterNum)%DXCoilName, &
                           CoilInletNode,CoilOutletNode)

        CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, &
                           HPWaterHeater(HPWaterHeaterNum)%Name, &
                           HPWaterHeater(HPWaterHeaterNum)%FanType, &
                           HPWaterHeater(HPWaterHeaterNum)%FanName, &
                           FanInletNode,FanOutletNode)

        IF (.not. lAlphaFieldBlanks(29)) THEN
          SELECT CASE (cAlphaArgs(29))
          CASE ('HEATER1')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = Heater1HPWHControl
          CASE ('HEATER2')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = Heater2HPWHControl
          CASE ('SOURCEINLET')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = SourceInletHPWHControl
          CASE ('SOURCEOUTLET')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = SourceOutletHPWHControl
          CASE ('USEINLET')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = UseInletHPWHControl
          CASE ('USEOUTLET')
            HPWaterHeater(HPWaterHeaterNum)%ControlSensorLocation = UseOutletHPWHControl
          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//'="'//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//'", invalid ')
            CALL ShowContinueError(trim(cAlphaFieldNames(29))//'="'//TRIM(cAlphaArgs(29))//'".')
            ErrorsFound=.TRUE.
          END SELECT

        ENDIF

      END DO ! DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF !IF (NumHeatPumpWaterHeater > 0) THEN


!!!=======   Get WATER HEATER:MIXED ===================================================================================
    IF (NumWaterHeaterMixed > 0) THEN
      cCurrentModuleObject = cMixedWHModuleObj
      DO WaterThermalTankNum = 1, NumWaterHeaterMixed

        CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum, &
          cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
                           NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
                           AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)


        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,IsNotOK,IsBlank,  &
           TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF
        WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
        WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
        WaterThermalTank(WaterThermalTankNum)%TypeNum = MixedWaterHeater

        ! default to always on
        WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn

          ! A user field will be added in a later release
        WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Water Heater'

        WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
        IF (rNumericArgs(1) == 0.0d0) THEN
          ! Set volume to a really small number to simulate a tankless/instantaneous water heater
          WaterThermalTank(WaterThermalTankNum)%Volume = 0.000001d0 ! = 1 cm3
        END IF

        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(2))
        IF (lAlphaFieldBlanks(2)) THEN
          CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
          CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(2))//' is required')
          ErrorsFound = .TRUE.
        ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  '//trim(cAlphaFieldNames(2))//' not found = '//TRIM(cAlphaArgs(2)))
          ErrorsFound = .TRUE.
        END IF

        IF (rNumericArgs(2) > 0.0001d0) THEN
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(2)
        ELSE
          ! Default to very small number (however it can't be TINY or it will break the algorithm)
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.5d0
        END IF

        IF (rNumericArgs(3) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(3)
        ELSE
          ! Default to very large number
          ! BG comment why a large number here why not boilng point of water?
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 100.0d0 !1.0E9
        END IF

        WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(4)

        IF ((rNumericArgs(5) > WaterThermalTank(WaterThermalTankNum)%MaxCapacity)   &
           .AND. (WaterThermalTank(WaterThermalTankNum)%MaxCapacity /= autosize)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  Heater Minimum Capacity cannot be greater than Heater Maximum Capacity')
          ErrorsFound = .TRUE.
        ELSE
          WaterThermalTank(WaterThermalTankNum)%MinCapacity = rNumericArgs(5)
        END IF

        ! Validate Heater Control Type
        SELECT CASE (cAlphaArgs(3))
          CASE ('CYCLE')
            WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeCycle
            WaterThermalTank(WaterThermalTankNum)%MinCapacity = WaterThermalTank(WaterThermalTankNum)%MaxCapacity

          CASE ('MODULATE')
            WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeModulate

          !CASE ('MODULATE WITH OVERHEAT')  ! Not yet implemented

          !CASE ('MODULATE WITH UNDERHEAT')  ! Not yet implemented

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Control Type entered='//TRIM(cAlphaArgs(3)))
            ErrorsFound = .TRUE.
        END SELECT
        WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin = rNumericArgs(6)
        WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin = MAX(0.d0, WaterThermalTank(WaterThermalTankNum)%VolFlowRateMin)
!        rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
!        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMin = rNumericArgs(6) * rho   ! Not yet implemented
        WaterThermalTank(WaterThermalTankNum)%IgnitionDelay = rNumericArgs(7)  ! Not yet implemented

        ! Validate Heater Fuel Type
        SELECT CASE (cAlphaArgs(4))
          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Heater Fuel Type entered='//TRIM(cAlphaArgs(4)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT


        IF (rNumericArgs(8) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%Efficiency = rNumericArgs(8)
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))//  &
             ':  Heater Thermal Efficiency must be greater than zero')
          ErrorsFound = .TRUE.
        END IF

        IF (cAlphaArgs(5) /= Blank) THEN
          WaterThermalTank(WaterThermalTankNum)%PLFCurve = GetCurveIndex(cAlphaArgs(5))
          IF (WaterThermalTank(WaterThermalTankNum)%PLFCurve .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Part Load Factor curve not found = '//TRIM(cAlphaArgs(5)))
            ErrorsFound = .TRUE.
          ELSE
            CALL ValidatePLFCurve(WaterThermalTank(WaterThermalTankNum)%PLFCurve, IsValid)

            IF (.NOT. IsValid) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Part Load Factor curve failed to evaluate to greater than zero for all numbers in the domain of 0 to 1')
              ErrorsFound = .TRUE.
            END IF
          END IF
        END IF

        WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = rNumericArgs(9)

        ! Validate Off-Cycle Parasitic Fuel Type
        SELECT CASE (cAlphaArgs(6))
          CASE ('')  ! If blank, default to Fuel Type for heater
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType

          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Off-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(6)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = rNumericArgs(10)


        WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = rNumericArgs(11)

        ! Validate On-Cycle Parasitic Fuel Type
        SELECT CASE (cAlphaArgs(7))
          CASE ('')  ! If blank, default to Fuel Type for heater
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType

          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid On-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(7)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = rNumericArgs(12)

        SELECT CASE (cAlphaArgs(8))
          CASE ('SCHEDULE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
            WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(9))
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Ambient Temperature Schedule not found = '//TRIM(cAlphaArgs(9)))
              ErrorsFound = .TRUE.
            END IF

          CASE ('ZONE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
            WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(10),Zone%Name,NumOfZones)
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Ambient Temperature Zone not found = '//TRIM(cAlphaArgs(10)))
              ErrorsFound = .TRUE.
            END IF

          CASE ('OUTDOORS')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
            WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(11), ErrorsFound, &
              TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_OutsideAirReference, 1, ObjectIsNotParent)
            IF (cAlphaArgs(11) /= ' ') THEN
              IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                   ': Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
                CALL ShowContinueError('...Referenced Node Name='//TRIM(cAlphaArgs(11)))
                ErrorsFound=.true.
              ENDIF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
                               ' the Ambient Temperature Indicator is Outdoors.')
              ErrorsFound = .TRUE.
            ENDIF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(8)))
            CALL ShowContinueError(' Valid entries are SCHEDULE, ZONE, and OUTDOORS.')
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff = rNumericArgs(13)
        WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = rNumericArgs(14)

        WaterThermalTank(WaterThermalTankNum)%OnCycLossCoeff = rNumericArgs(15)
        WaterThermalTank(WaterThermalTankNum)%OnCycLossFracToZone = rNumericArgs(16)
        rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = rNumericArgs(17) * rho

        IF ((cAlphaArgs(14) == Blank) .AND. (cAlphaArgs(15) == Blank)) THEN
          IF (cAlphaArgs(12) /= Blank) THEN
            WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = GetScheduleIndex(cAlphaArgs(12))
            IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Flow Rate Schedule not found = '//TRIM(cAlphaArgs(12)))
              ErrorsFound = .TRUE.
            END IF
          END IF
        END IF

        IF (cAlphaArgs(13) /= Blank) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = GetScheduleIndex(cAlphaArgs(13))
          IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Cold Water Supply Temperature Schedule not found = '//TRIM(cAlphaArgs(13)))
            ErrorsFound = .TRUE.
          END IF
        END IF

        IF (NumNums > 17) THEN
          IF ((rNumericArgs(18) > 1) .OR. (rNumericArgs(18) < 0)) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use Side Effectiveness is out of bounds (0 to 1)')
            ErrorsFound = .TRUE.
          END IF
          WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(18)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = 1.0d0 ! Default for stand-alone mode
        END IF

        IF ((rNumericArgs(19) > 1) .OR. (rNumericArgs(19) < 0)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  Source Side Effectiveness is out of bounds (0 to 1)')
          ErrorsFound = .TRUE.
        END IF
        WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(19)

        ! If no plant nodes are connected, simulate in stand-alone mode.
        IF (cAlphaArgs(14) == Blank .AND. cAlphaArgs(15) == Blank .AND. cAlphaArgs(16) == Blank .AND. cAlphaArgs(17) == Blank) THEN
          WaterThermalTank(WaterThermalTankNum)%StandAlone = .TRUE.
        ENDIF

        IF (.NOT. lNumericFieldBlanks(20)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = rNumericArgs(20)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = 0.d0
        ENDIF
        WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No

        IF (.NOT. lNumericFieldBlanks(21)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(21)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
        END IF
        WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No

        If (.NOT. lNumericFieldBlanks(22)) then
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime      = rNumericArgs(22)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime      = 1.5d0
        END IF

        IF ((cAlphaArgs(14) /= Blank) .OR. (cAlphaArgs(15) /= Blank)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
            GetOnlySingleNode(cAlphaArgs(14),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(14)
          WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
            GetOnlySingleNode(cAlphaArgs(15),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(15)

          IF (rNumericArgs(17) > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Peak Volumetric Use Flow Rate will not be used')
          END IF

          IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Use Flow Rate Fraction Schedule will not be used')
          END IF

          IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Cold Water Supply Temperature Schedule will not be used')
          END IF
        END IF

        IF ((cAlphaArgs(16) /= Blank) .OR. (cAlphaArgs(17) /= Blank)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
            GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(16)
          WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
            GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(17)

        END IF

        IF (.NOT. lAlphaFieldBlanks(18)) THEN
          SELECT CASE (cAlphaArgs(18))
          CASE ('STORAGETANK' )
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideStorageTank
          CASE ('INDIRECTHEATPRIMARYSETPOINT')
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
          CASE ('INDIRECTHEATALTERNATESETPOINT' )
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatAltSetpoint
          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Control Mode entered='//TRIM(cAlphaArgs(18)))
            ErrorsFound = .TRUE.
          END SELECT
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
        ENDIF

        IF (.NOT. lAlphaFieldBlanks(19)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum = GetScheduleIndex(cAlphaArgs(19))
          IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum == 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  '//trim(cAlphaFieldNames(19))//' not found = '//TRIM(cAlphaArgs(19)))
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF


      END DO ! WaterThermalTankNum

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF


!!!=======   Get WATER HEATER:STRATIFIED ==============================================================================
    IF (NumWaterHeaterStratified > 0) THEN
      cCurrentModuleObject = cStratifiedWHModuleObj !'WaterHeater:Stratified'

      DO WaterThermalTankNum = NumWaterHeaterMixed + 1, NumWaterHeaterMixed + NumWaterHeaterStratified

        CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum-NumWaterHeaterMixed,  &
          cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
                           NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
                           AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)

        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-NumWaterHeaterMixed-1,IsNotOK,IsBlank,  &
                      TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF
        WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
        WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
        WaterThermalTank(WaterThermalTankNum)%TypeNum = StratifiedWaterHeater

        ! default to always on
        WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn

        WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = cAlphaArgs(2)

        WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
        rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
        WaterThermalTank(WaterThermalTankNum)%Mass = WaterThermalTank(WaterThermalTankNum)%Volume * rho
        WaterThermalTank(WaterThermalTankNum)%Height = rNumericArgs(2)

        SELECT CASE (cAlphaArgs(3))
          CASE ('VERTICALCYLINDER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder

          CASE ('HORIZONTALCYLINDER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeHorizCylinder

          CASE ('OTHER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeOther
            IF (rNumericArgs(3) > 0.0d0) THEN
              WaterThermalTank(WaterThermalTankNum)%Perimeter = rNumericArgs(3)
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Tank Perimeter must be greater than zero for Tank Shape=OTHER')
              ErrorsFound = .TRUE.
            END IF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Tank Shape entered='//TRIM(cAlphaArgs(3)))
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
            ErrorsFound = .TRUE.
        END SELECT

        IF (rNumericArgs(4) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(4)
        ELSE
          ! Default to very large number
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0d9
        END IF

        ! Validate Heater Priority Control
        SELECT CASE (cAlphaArgs(4))
          CASE ('MASTERSLAVE')
            WaterThermalTank(WaterThermalTankNum)%ControlType = PriorityMasterSlave

          CASE ('SIMULTANEOUS')
            WaterThermalTank(WaterThermalTankNum)%ControlType = PrioritySimultaneous

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Heater Priority Control entered='//TRIM(cAlphaArgs(4)))
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(5))
        IF (lAlphaFieldBlanks(5)) THEN
          CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
          CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(5))//' is required')
          ErrorsFound = .TRUE.
        ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': '//trim(cAlphaFieldNames(5))//' not found = '//TRIM(cAlphaArgs(5)))
          ErrorsFound = .TRUE.
        END IF

        IF (rNumericArgs(5) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(5)
        ELSE
          ! Default to very small number (however it can't be TINY or it will break the algorithm)
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.0001d0
        END IF

        WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(6)
        WaterThermalTank(WaterThermalTankNum)%HeaterHeight1 = rNumericArgs(7)

        !Test if Heater height is within range
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%HeaterHeight1 &
                >  WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Heater 1 is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(7))//' = '//TRIM(RoundSigDigits(rNumericArgs(7), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 = GetScheduleIndex(cAlphaArgs(6))
        IF (lAlphaFieldBlanks(6)) THEN
          CALL ShowSevereError(RoutineName//TRIM(cCurrentModuleObject)//'="'//TRIM(cAlphaArgs(1))//'", missing data.')
          CALL ShowContinueError('blank field, missing '//TRIM(cAlphaFieldNames(6))//' is required')
          ErrorsFound = .TRUE.
        ELSEIF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 .EQ. 0) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  '//trim(cAlphaFieldNames(6))//' not found = '//TRIM(cAlphaArgs(6)))
          ErrorsFound = .TRUE.
        END IF

        IF (rNumericArgs(5) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp2 = rNumericArgs(8)
        ELSE
          ! Default to very small number (however it can't be TINY or it will break the algorithm)
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp2 = 0.0001d0
        END IF

        WaterThermalTank(WaterThermalTankNum)%MaxCapacity2 = rNumericArgs(9)
        WaterThermalTank(WaterThermalTankNum)%HeaterHeight2 = rNumericArgs(10)

        !Test if Heater height is within range
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%HeaterHeight2 &
                 >  WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Heater 2 is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(10))//' = '//TRIM(RoundSigDigits(rNumericArgs(10), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        ! Validate Heater Fuel Type
        SELECT CASE (cAlphaArgs(7))
          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Heater Fuel Type entered='//TRIM(cAlphaArgs(7)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT

        IF (rNumericArgs(11) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%Efficiency = rNumericArgs(11)
        ELSE
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))//  &
             ':  Heater Thermal Efficiency must be greater than zero')
          ErrorsFound = .TRUE.
        END IF

        WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = rNumericArgs(12)

        ! Validate Off-Cycle Parasitic Fuel Type
        SELECT CASE (cAlphaArgs(8))
          CASE ('')  ! If blank, default to Fuel Type for heater
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType

          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Off-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(8)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = rNumericArgs(13)
        WaterThermalTank(WaterThermalTankNum)%OffCycParaHeight = rNumericArgs(14)

        WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = rNumericArgs(15)

        ! Validate On-Cycle Parasitic Fuel Type
        SELECT CASE (cAlphaArgs(9))
          CASE ('')  ! If blank, default to Fuel Type for heater
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = WaterThermalTank(WaterThermalTankNum)%FuelType

          CASE ('ELECTRICITY','ELECTRIC','ELEC')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'

          CASE ('GAS','NATURALGAS','NATURAL GAS')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gas'

          CASE ('DIESEL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Diesel'

          CASE ('GASOLINE')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Gasoline'

          CASE ('COAL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Coal'

          CASE ('FUEL OIL #1','FUELOIL#1','FUEL OIL','DISTILLATE OIL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#1'

          CASE ('FUEL OIL #2','FUELOIL#2','RESIDUAL OIL')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'FuelOil#2'

          CASE ('PROPANE','LPG','PROPANEGAS','PROPANE GAS')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Propane'

          CASE ('OTHERFUEL1')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel1'

          CASE ('OTHERFUEL2')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'OtherFuel2'

          CASE ('STEAM')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Steam'

          CASE ('DISTRICTHEATING')
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'DistrictHeating'

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid On-Cycle Parasitic Fuel Type entered='//TRIM(cAlphaArgs(9)))
            ! Set to Electric to avoid errors when setting up output variables
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = rNumericArgs(16)
        WaterThermalTank(WaterThermalTankNum)%OnCycParaHeight = rNumericArgs(17)


        SELECT CASE (cAlphaArgs(10))
          CASE ('SCHEDULE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
            WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(11))
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Ambient Temperature Schedule not found = '//TRIM(cAlphaArgs(11)))
              ErrorsFound = .TRUE.
            END IF

          CASE ('ZONE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
            WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(12),Zone%Name,NumOfZones)
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Ambient Temperature Zone not found = '//TRIM(cAlphaArgs(12)))
              ErrorsFound = .TRUE.
            END IF

          CASE ('OUTDOORS')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
            WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(13), ErrorsFound, &
              TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent)
            IF (cAlphaArgs(13) /= ' ') THEN
              IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
                CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                   ': Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
                CALL ShowContinueError('...Referenced Node Name='//TRIM(cAlphaArgs(13)))
                ErrorsFound=.true.
              ENDIF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
                               ' the Ambient Temperature Indicator is Outdoors.')
              ErrorsFound = .TRUE.
            ENDIF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(10)))
            CALL ShowContinueError(' Valid entries are Schedule, Zone, and Outdoors.')
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%SkinLossCoeff = rNumericArgs(18)
        WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone = rNumericArgs(19)
        WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossCoeff = rNumericArgs(20)
        WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossFracToZone = rNumericArgs(21)

        !this is temporary until we know fluid type
        rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = rNumericArgs(22) * rho

        IF ((cAlphaArgs(16) == Blank) .AND. (cAlphaArgs(17) == Blank)) THEN
          IF (cAlphaArgs(14) /= Blank) THEN
            WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = GetScheduleIndex(cAlphaArgs(14))
            IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule .EQ. 0) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Flow Rate Schedule not found = '//TRIM(cAlphaArgs(14)))
              ErrorsFound = .TRUE.
            END IF
          END IF
        END IF

        IF (cAlphaArgs(15) /= Blank) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = GetScheduleIndex(cAlphaArgs(15))
          IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule .EQ. 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Cold Water Supply Temperature Schedule not found = '//TRIM(cAlphaArgs(15)))
            ErrorsFound = .TRUE.
          END IF
        END IF

        IF (NumNums > 22) THEN
          WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(23)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = 1.0d0  ! Default for stand-alone mode
        END IF

        IF (NumNums > 23) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletHeight = rNumericArgs(24)
        ELSE
         ! Defaults to bottom of tank
          WaterThermalTank(WaterThermalTankNum)%UseInletHeight = 0.0d0
        END IF
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%UseInletHeight &
                   > WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Use inlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(24))//' = '//TRIM(RoundSigDigits(rNumericArgs(24), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        IF ((NumNums > 24) .AND. (rNumericArgs(25) /= Autocalculate)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = rNumericArgs(25)
        ELSE
          ! Defaults to top of tank
          WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = WaterThermalTank(WaterThermalTankNum)%Height
        END IF
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%UseOutletHeight &
              > WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Use outlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(25))//' = '//TRIM(RoundSigDigits(rNumericArgs(25), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        IF (NumNums > 25) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(26)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = 1.0D0
        END IF

        IF ((NumNums > 26) .AND. (rNumericArgs(27) /= Autocalculate)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = rNumericArgs(27)
        ELSE
          ! Defaults to top of tank
          WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = WaterThermalTank(WaterThermalTankNum)%Height
        END IF
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%SourceInletHeight &
              > WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Source inlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(27))//' = '//TRIM(RoundSigDigits(rNumericArgs(27), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        IF ((NumNums > 27) .AND. (rNumericArgs(28) /= Autocalculate)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = rNumericArgs(28)
        ELSE
          ! Defaults to bottom of tank
          WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = 0.0D0
        END IF
        IF ((WaterThermalTank(WaterThermalTankNum)%Height /= Autosize) .AND. &
            (WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight &
              > WaterThermalTank(WaterThermalTankNum)%Height)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Source outlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(28))//' = '//TRIM(RoundSigDigits(rNumericArgs(28), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        ! If no plant nodes are connected, simulate in stand-alone mode.
        IF (cAlphaArgs(16) == Blank .AND. cAlphaArgs(17) == Blank .AND. cAlphaArgs(18) == Blank .AND. cAlphaArgs(19) == Blank) &
          WaterThermalTank(WaterThermalTankNum)%StandAlone = .TRUE.

        IF (.NOT. lNumericFieldBlanks(29)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = rNumericArgs(29)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = 0.d0
        END IF

        WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No

        IF (.NOT.  lNumericFieldBlanks(30) ) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(30)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
        END IF

        If (NumNums > 30) then
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime      = rNumericArgs(31)
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime      = 1.5d0
        END IF

          WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No

        IF ((cAlphaArgs(16) /= Blank) .OR. (cAlphaArgs(17) /= Blank)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
            GetOnlySingleNode(cAlphaArgs(16),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(16)
          WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
            GetOnlySingleNode(cAlphaArgs(17),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(17)

          IF (rNumericArgs(22) > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Peak Volumetric Use Flow Rate will not be used')
          END IF

          IF (WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Use Flow Rate Fraction Schedule will not be used')
          END IF

          IF (WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule > 0) THEN
            CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Use side nodes are specified; Cold Water Supply Temperature Schedule will not be used')
          END IF
        END IF

        IF ((cAlphaArgs(18) /= Blank) .OR. (cAlphaArgs(19) /= Blank)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
            GetOnlySingleNode(cAlphaArgs(18),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(18)
          WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
            GetOnlySingleNode(cAlphaArgs(19),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(19)

        END IF

        ! Validate inlet mode
        SELECT CASE (cAlphaArgs(20))
          CASE ('FIXED')
            WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeFixed

          CASE ('SEEKING')
            WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeSeeking
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%Nodes = rNumericArgs(32)
        WaterThermalTank(WaterThermalTankNum)%AdditionalCond = rNumericArgs(33)

        ALLOCATE(WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(WaterThermalTank(WaterThermalTankNum)%Nodes))
        WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff = 0.0d0
        DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
          IF (NumNums > 32 + NodeNum) THEN
            WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(NodeNum) = rNumericArgs(33 + NodeNum)
          ELSE
            EXIT
          END IF
        END DO

        IF (NumNums > 33 + WaterThermalTank(WaterThermalTankNum)%Nodes) THEN
          CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used')
        END IF

        CALL SetupStratifiedNodes(WaterThermalTankNum)

        IF (.NOT. lAlphaFieldBlanks(21)) THEN
          SELECT CASE (cAlphaArgs(21))
          CASE ('STORAGETANK' )
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideStorageTank
          CASE ('INDIRECTHEATPRIMARYSETPOINT')
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
          CASE ('INDIRECTHEATALTERNATESETPOINT' )
            WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatAltSetpoint
          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Control Mode entered='//TRIM(cAlphaArgs(21)))
            ErrorsFound = .TRUE.
          END SELECT
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceSideControlMode = SourceSideIndirectHeatPrimarySetpoint
        ENDIF

        IF (.NOT. lAlphaFieldBlanks(22)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum = GetScheduleIndex(cAlphaArgs(22))
          IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAltSetpointSchedNum == 0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  '//trim(cAlphaFieldNames(22))//' not found = '//TRIM(cAlphaArgs(22)))
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF


      END DO ! WaterThermalTankNum

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF

!!!=======   Get Chilled Water :MIXED ===================================================================================
    IF (NumChilledWaterMixed > 0) THEN
      cCurrentModuleObject = cMixedCWTankModuleObj  ! 'ThermalStorage:ChilledWater:Mixed'
      DO WaterThermalTankNum = NumWaterHeaterMixed + NumWaterHeaterStratified + 1, &
                                   NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed

        CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum - (NumWaterHeaterMixed + NumWaterHeaterStratified), &
                           cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
                           NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
                           AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)

        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,&
                               IsNotOK,IsBlank,TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF
        WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
        WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
        WaterThermalTank(WaterThermalTankNum)%TypeNum = MixedChilledWaterStorage
        WaterThermalTank(WaterThermalTankNum)%IsChilledWaterTank = .TRUE.
        WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Chilled Water Storage'

        WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
        IF (rNumericArgs(1) == 0.0d0) THEN
          ! Set volume to a really small number to continue simulation
          WaterThermalTank(WaterThermalTankNum)%Volume = 0.000001d0 ! = 1 cm3
        END IF

        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(2))
        IF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
          CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(2))//' = '//TRIM(cAlphaArgs(2)))
          CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//'='//TRIM(cAlphaArgs(1)))

          ErrorsFound = .TRUE.
        END IF

        IF (rNumericArgs(2) > 0.0001d0) THEN
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(2)
        ELSE
          ! Default to very small number (however it can't be TINY or it will break the algorithm)
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.5d0
        END IF

        IF (rNumericArgs(3) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(3)
        ELSE
          ! default to just above freezing
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0D0
        END IF

        WaterThermalTank(WaterThermalTankNum)%MaxCapacity = rNumericArgs(4)
        WaterThermalTank(WaterThermalTankNum)%MinCapacity = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%ControlType = ControlTypeCycle

        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMin = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%IgnitionDelay   = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%FuelType        = 'Electric'
        WaterThermalTank(WaterThermalTankNum)%Efficiency      = 1.0D0
        WaterThermalTank(WaterThermalTankNum)%PLFCurve        = 0
        WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad  = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
        WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad   = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
        WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = 0.0D0

        SELECT CASE (cAlphaArgs(3))
          CASE ('SCHEDULE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
            WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(4))
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
              CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(4))//' = '//TRIM(cAlphaArgs(4)))
              CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('Schedule was not found.')
              ErrorsFound = .TRUE.
            END IF

          CASE ('ZONE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
            WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(5),Zone%Name,NumOfZones)
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
              CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)))
              CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('Zone was not found.')
              ErrorsFound = .TRUE.
            END IF

          CASE ('OUTDOORS')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
            WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(6), ErrorsFound, &
              TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_OutsideAirReference, 1, ObjectIsNotParent)
            IF (.NOT. lAlphaFieldBlanks(6) ) THEN
              IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
                CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(cAlphaArgs(6)))
                CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
                CALL ShowContinueError('Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
                ErrorsFound=.true.
              ENDIF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
                               ' the Ambient Temperature Indicator is Outdoors.')
              ErrorsFound = .TRUE.
            ENDIF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(3)))
            CALL ShowContinueError(' Valid entries are Schedule, Zone, and Outdoors.')
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%OffCycLossCoeff = rNumericArgs(5)
        WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = 1.0D0

        WaterThermalTank(WaterThermalTankNum)%OnCycLossCoeff = rNumericArgs(5)
        WaterThermalTank(WaterThermalTankNum)%OnCycLossFracToZone =1.0D0

        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = 0
        WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = 0

        ! default to always on
        WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn

        IF ((rNumericArgs(6) > 1) .OR. (rNumericArgs(6) < 0)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  Use Side Effectiveness is out of bounds (0 to 1)')
          ErrorsFound = .TRUE.
        END IF
        WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(6)


        IF ((rNumericArgs(8) > 1) .OR. (rNumericArgs(8) < 0)) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  Source Side Effectiveness is out of bounds (0 to 1)')
          ErrorsFound = .TRUE.
        END IF
        WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(8)

        IF (lNumericFieldBlanks(7)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = 0.d0
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = rNumericArgs(7)
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No

        IF (lAlphaFieldBlanks(9)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(9))
          IF (WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum == 0) Then
            CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(9))//' = '//TRIM(cAlphaArgs(9)))
            CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
            CALL ShowContinueError('Schedule was not found.')
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No

        IF (lNumericFieldBlanks(9)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(9)
        ENDIF

        IF (lAlphaFieldBlanks(12)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(12))
          IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum == 0) Then
            CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(12))//' = '//TRIM(cAlphaArgs(12)))
            CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
            CALL ShowContinueError('Schedule was not found.')
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF
        IF (lNumericFieldBlanks(10)) THEN
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime   = 4.0D0
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime   =  rNumericArgs(10)
        ENDIF

        IF ((.NOT. lAlphaFieldBlanks(7) ) .OR. (.NOT. lAlphaFieldBlanks(8) )) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
            GetOnlySingleNode(cAlphaArgs(7),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(7)
          WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
            GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(8)

        END IF

        IF ((.NOT. lAlphaFieldBlanks(10) ) .OR. (.NOT. lAlphaFieldBlanks(11))) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
            GetOnlySingleNode(cAlphaArgs(10),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(10)
          WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
            GetOnlySingleNode(cAlphaArgs(11),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(11)

        END IF

        IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide   &
            .and. WaterThermalTank(WaterThermalTankNum)%SourceInletNode /= 0) THEN
          CALL RegisterPlantCompDesignFlow(WaterThermalTank(WaterThermalTankNum)%SourceInletNode,  &
                                    WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
        ENDIF

      END DO ! WaterThermalTankNum

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF

!! end chilled water mixed storage

!!!=======   Get 'ThermalStorage:ChilledWater:Stratified' =======================================================
    IF (NumChilledWaterStratified > 0) THEN
      cCurrentModuleObject = cStratifiedCWTankModuleObj ! 'ThermalStorage:ChilledWater:Stratified'

      DO WaterThermalTankNum = NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed + 1 &
                              , NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed + NumChilledWaterStratified

        CALL GetObjectItem(cCurrentModuleObject,WaterThermalTankNum  &
                            -  (NumWaterHeaterMixed + NumWaterHeaterStratified + NumChilledWaterMixed),  &
                              cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT, &
                           NumBlank=lNumericFieldBlanks,AlphaBlank=lAlphaFieldBlanks, &
                           AlphaFieldNames=cAlphaFieldNames,NumericFieldNames=cNumericFieldNames)

        IsNotOK = .FALSE.
        IsBlank = .FALSE.
        CALL VerifyName(cAlphaArgs(1),WaterThermalTank%Name,WaterThermalTankNum-1,IsNotOK,IsBlank,  &
                      TRIM(cCurrentModuleObject)//' Name')
        IF (IsNotOK) THEN
          ErrorsFound = .TRUE.
          IF (IsBlank) cAlphaArgs(1) = 'xxxxx'
        END IF
        WaterThermalTank(WaterThermalTankNum)%Name = cAlphaArgs(1)
        WaterThermalTank(WaterThermalTankNum)%Type = cCurrentModuleObject
        WaterThermalTank(WaterThermalTankNum)%TypeNum = StratifiedChilledWaterStorage
        WaterThermalTank(WaterThermalTankNum)%IsChilledWaterTank = .TRUE.
        WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName = 'Chilled Water Storage'

        WaterThermalTank(WaterThermalTankNum)%Volume = rNumericArgs(1)
        rho = GetDensityGlycol('WATER', InitConvTemp, DummyWaterIndex, 'GetWaterThermalTankInput')
        WaterThermalTank(WaterThermalTankNum)%Mass = WaterThermalTank(WaterThermalTankNum)%Volume * rho
        WaterThermalTank(WaterThermalTankNum)%Height = rNumericArgs(2)

        SELECT CASE (cAlphaArgs(2))
          CASE ('VERTICALCYLINDER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder

          CASE ('HORIZONTALCYLINDER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeHorizCylinder

          CASE ('OTHER')
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeOther
            IF (rNumericArgs(3) > 0.0d0) THEN
              WaterThermalTank(WaterThermalTankNum)%Perimeter = rNumericArgs(3)
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
                ':  Tank Perimeter must be greater than zero for Tank Shape=OTHER')
              ErrorsFound = .TRUE.
            END IF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Tank Shape entered='//TRIM(cAlphaArgs(2)))
            WaterThermalTank(WaterThermalTankNum)%Shape = TankShapeVertCylinder
            ErrorsFound = .TRUE.
        END SELECT

        IF (rNumericArgs(6) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = rNumericArgs(6)
        ELSE
          ! default to just above freezing
          WaterThermalTank(WaterThermalTankNum)%TankTempLimit = 1.0D0
        END IF

        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule = GetScheduleIndex(cAlphaArgs(3))
        IF (WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule .EQ. 0) THEN
              CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(3))//' = '//TRIM(cAlphaArgs(3)))
              CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('Schedule was not found.')
          ErrorsFound = .TRUE.
        END IF

        IF (rNumericArgs(4) > 0.0d0) THEN
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = rNumericArgs(4)
        ELSE
          ! Default to very small number (however it can't be TINY or it will break the algorithm)
          WaterThermalTank(WaterThermalTankNum)%DeadbandDeltaTemp = 0.0001d0
        END IF

        WaterThermalTank(WaterThermalTankNum)%HeaterHeight1         = rNumericArgs(5)
        WaterThermalTank(WaterThermalTankNum)%MaxCapacity          =  rNumericArgs(7)
        WaterThermalTank(WaterThermalTankNum)%Efficiency            = 1.0D0
        WaterThermalTank(WaterThermalTankNum)%SetpointTempSchedule2 = 0
        WaterThermalTank(WaterThermalTankNum)%MaxCapacity2          = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%HeaterHeight2         = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%FuelType = 'Electric'

        WaterThermalTank(WaterThermalTankNum)%OffCycParaLoad = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType = 'Electric'
        WaterThermalTank(WaterThermalTankNum)%OffCycParaFracToTank = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OffCycParaHeight =0.0D0
        WaterThermalTank(WaterThermalTankNum)%OnCycParaLoad = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType = 'Electric'
        WaterThermalTank(WaterThermalTankNum)%OnCycParaFracToTank = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OnCycParaHeight = 0.0D0


        SELECT CASE (cAlphaArgs(4))
          CASE ('SCHEDULE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempSchedule
            WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule = GetScheduleIndex(cAlphaArgs(5))
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempSchedule .EQ. 0) THEN
              CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(5))//' = '//TRIM(cAlphaArgs(5)))
              CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('Schedule was not found.')
              ErrorsFound = .TRUE.
            END IF

          CASE ('ZONE')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempZone
            WaterThermalTank(WaterThermalTankNum)%AmbientTempZone = FindItemInList(cAlphaArgs(6),Zone%Name,NumOfZones)
            IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone .EQ. 0) THEN
              CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(6))//' = '//TRIM(cAlphaArgs(6)))
              CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('Zone was not found.')
              ErrorsFound = .TRUE.
            END IF
            WaterThermalTank(WaterThermalTankNum)%OffCycLossFracToZone = 1.0D0

          CASE ('OUTDOORS')
            WaterThermalTank(WaterThermalTankNum)%AmbientTempIndicator = AmbientTempOutsideAir
            WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode = GetOnlySingleNode(cAlphaArgs(7), ErrorsFound, &
              TRIM(cCurrentModuleObject), cAlphaArgs(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent)
            IF (.NOT. lAlphaFieldBlanks(7) ) THEN
              IF (.not. CheckOutAirNodeNumber(WaterThermalTank(WaterThermalTankNum)%AmbientTempOutsideAirNode)) THEN
                CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(7))//' = '//TRIM(cAlphaArgs(7)))
                CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
                CALL ShowContinueError('Outdoor Air Node not on OutdoorAir:NodeList or OutdoorAir:Node')
                ErrorsFound=.true.
              ENDIF
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
              CALL ShowContinueError('An Ambient Outdoor Air Node name must be used when' // &
                               ' the Ambient Temperature Indicator is Outdoors.')
              ErrorsFound = .TRUE.
            ENDIF

          CASE DEFAULT
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
              ':  Invalid Ambient Temperature Indicator entered='//TRIM(cAlphaArgs(4)))
            CALL ShowContinueError('  Valid entries are Schedule, Zone, and Outdoors.')
            ErrorsFound = .TRUE.
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%SkinLossCoeff = rNumericArgs(8)
        WaterThermalTank(WaterThermalTankNum)%SkinLossFracToZone = 1.0D0
        WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossCoeff = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%OffCycFlueLossFracToZone = 0.0D0

        WaterThermalTank(WaterThermalTankNum)%MassFlowRateMax = 0.0D0
        WaterThermalTank(WaterThermalTankNum)%FlowRateSchedule = 0
        WaterThermalTank(WaterThermalTankNum)%UseInletTempSchedule = 0
        WaterThermalTank(WaterThermalTankNum)%UseEffectiveness = rNumericArgs(9)
        WaterThermalTank(WaterThermalTankNum)%UseInletHeight = rNumericArgs(10)

        ! default to always on
        WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn

        IF (rNumericArgs(10) == Autocalculate) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletHeight = WaterThermalTank(WaterThermalTankNum)%Height  ! top of tank
        ENDIF
        IF (WaterThermalTank(WaterThermalTankNum)%UseInletHeight &
             > WaterThermalTank(WaterThermalTankNum)%Height) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Use inlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(10))//' = '//TRIM(RoundSigDigits(rNumericArgs(10), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%UseOutletHeight = rNumericArgs(11)
        IF (WaterThermalTank(WaterThermalTankNum)%UseOutletHeight &
             > WaterThermalTank(WaterThermalTankNum)%Height) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Use outlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(11))//' = '//TRIM(RoundSigDigits(rNumericArgs(11), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%SourceEffectiveness = rNumericArgs(13)

        WaterThermalTank(WaterThermalTankNum)%SourceInletHeight = rNumericArgs(14)
        IF (WaterThermalTank(WaterThermalTankNum)%SourceInletHeight &
             > WaterThermalTank(WaterThermalTankNum)%Height) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Source inlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(14))//' = '//TRIM(RoundSigDigits(rNumericArgs(14), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = rNumericArgs(15)
        IF (rNumericArgs(15) == Autocalculate) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight = WaterThermalTank(WaterThermalTankNum)%Height  ! top of tank
        ENDIF
        IF (WaterThermalTank(WaterThermalTankNum)%SourceOutletHeight &
             > WaterThermalTank(WaterThermalTankNum)%Height) THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ': Source outlet is located higher than overall tank height.' )
          CALL ShowContinueError( TRIM(cNumericFieldNames(2))//' = '//TRIM(RoundSigDigits(rNumericArgs(2), 4)) )
          CALL ShowContinueError( TRIM(cNumericFieldNames(15))//' = '//TRIM(RoundSigDigits(rNumericArgs(15), 4)) )
          ErrorsFound = .TRUE.
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%StandAlone = .FALSE.

        IF (lNumericFieldBlanks(12)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = 0.d0
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate    = rNumericArgs(12)
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide = DemandSupply_No

        IF (lNumericFieldBlanks(16)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = 0.d0
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate = rNumericArgs(16)
        ENDIF

        WaterThermalTank(WaterThermalTankNum)%SizingRecoveryTime      = rNumericArgs(17)

        WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide = DemandSupply_No

        IF ((.NOT. lAlphaFieldBlanks(8) ) .OR. (.NOT. lAlphaFieldBlanks(9) )) THEN
          WaterThermalTank(WaterThermalTankNum)%UseInletNode = &
            GetOnlySingleNode(cAlphaArgs(8),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 = cAlphaArgs(8)
          WaterThermalTank(WaterThermalTankNum)%UseOutletNode = &
            GetOnlySingleNode(cAlphaArgs(9),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 1, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1 = cAlphaArgs(9)

        ENDIF

        IF ((.NOT. lAlphaFieldBlanks(11) ) .OR. (.NOT. lAlphaFieldBlanks(12))) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceInletNode = &
            GetOnlySingleNode(cAlphaArgs(11),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Inlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 = cAlphaArgs(11)
          WaterThermalTank(WaterThermalTankNum)%SourceOutletNode = &
            GetOnlySingleNode(cAlphaArgs(12),ErrorsFound,TRIM(cCurrentModuleObject),cAlphaArgs(1), &
            NodeType_Water,NodeConnectionType_Outlet, 2, ObjectIsNotParent)
          WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2 = cAlphaArgs(12)

        END IF

        IF (lAlphaFieldBlanks(10)) THEN
          WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = ScheduleAlwaysOn
        ELSE
          WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(10))
          IF (WaterThermalTank(WaterThermalTankNum)%UseSideAvailSchedNum == 0) Then
            CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(10))//' = '//TRIM(cAlphaArgs(10)))
            CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
            CALL ShowContinueError('Schedule was not found.')
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF

        IF (WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide   &
            .and. WaterThermalTank(WaterThermalTankNum)%SourceInletNode /= 0) THEN
          CALL RegisterPlantCompDesignFlow(WaterThermalTank(WaterThermalTankNum)%SourceInletNode,  &
                                    WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate)
        ENDIF

        IF (lAlphaFieldBlanks(13)) THEN
          WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = ScheduleAlwaysOn
        ELSE
          WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum = GetScheduleIndex(cAlphaArgs(13))
          IF (WaterThermalTank(WaterThermalTankNum)%SourceSideAvailSchedNum == 0) Then
            CALL ShowSevereError('Invalid, '//TRIM(cAlphaFieldNames(13))//' = '//TRIM(cAlphaArgs(13)))
            CALL ShowContinueError('Entered in '//TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1)))
            CALL ShowContinueError('Schedule was not found.')
            ErrorsFound = .TRUE.
          ENDIF
        ENDIF

        ! Validate inlet mode
        SELECT CASE (cAlphaArgs(14))
          CASE ('FIXED')
            WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeFixed

          CASE ('SEEKING')
            WaterThermalTank(WaterThermalTankNum)%InletMode = InletModeSeeking
        END SELECT

        WaterThermalTank(WaterThermalTankNum)%Nodes = rNumericArgs(18)
        WaterThermalTank(WaterThermalTankNum)%AdditionalCond = rNumericArgs(19)

        ALLOCATE(WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(WaterThermalTank(WaterThermalTankNum)%Nodes))
        WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff = 0.0d0
        DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
          IF (NumNums > 19 + NodeNum) THEN
            WaterThermalTank(WaterThermalTankNum)%AdditionalLossCoeff(NodeNum) = rNumericArgs(19 + NodeNum)
          ELSE
            EXIT
          END IF
        END DO

        IF (NumNums > 19 + WaterThermalTank(WaterThermalTankNum)%Nodes) THEN
          CALL ShowWarningError(TRIM(cCurrentModuleObject)//' = '//TRIM(cAlphaArgs(1))// &
            ':  More Additional Loss Coefficients were entered than the number of nodes; extra coefficients will not be used')
        END IF

        CALL SetupStratifiedNodes(WaterThermalTankNum)

      END DO ! WaterThermalTankNum

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF
!!  end stratified chilled water storage

!!!=======   Check Water Heaters ======================================================================================

!   Loop through all desuperheating coils and then search all water heaters for the tank connected to the desuperheating coil
    IF (NumWaterHeaterDesuperheater > 0) THEN
      cCurrentModuleObject = 'Coil:WaterHeating:Desuperheater'
      DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater

        DO CheckWaterHeaterNum = 1, NumWaterThermalTank
          IF(.NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankName, WaterThermalTank(CheckWaterHeaterNum)%Name)  &
             .OR. &
             .NOT. SameString(WaterHeaterDesuperheater(DesuperheaterNum)%TankType, WaterThermalTank(CheckWaterHeaterNum)%Type))   &
                CYCLE
            WaterThermalTank(CheckWaterHeaterNum)%DesuperheaterNum = DesuperheaterNum
            WaterHeaterDesuperheater(DesuperheaterNum)%WaterHeaterTankNum = CheckWaterHeaterNum
            WaterHeaterDesuperheater(DesuperheaterNum)%TankTypeNum = WaterThermalTank(CheckWaterHeaterNum)%TypeNum
            WaterHeaterDesuperheater(DesuperheaterNum)%BackupElementCapacity = WaterThermalTank(CheckWaterHeaterNum)%MaxCapacity
            IF (WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .EQ. 0 &
              .AND. WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode .EQ. 0) &
                WaterHeaterDesuperheater(DesuperheaterNum)%StandAlone = .TRUE.

!         verify Desuperheater/tank source node connections
          IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterInletNode .NE.   &
             WaterThermalTank(CheckWaterHeaterNum)%SourceOutletNode) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
            CALL ShowContinueError('Desuperheater inlet node name does not match '// &
                                   ' thermal tank source outlet node name.')
            CALL ShowContinueError('Desuperheater water inlet and outlet node names = '// &
                                   TRIM(CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1)//' and '// &
                                   TRIM(CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1))
            CALL ShowContinueError('Thermal tank source side inlet and outlet node names      = '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
            ErrorsFound = .TRUE.
          END IF

          IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterOutletNode .NE.   &
             WaterThermalTank(CheckWaterHeaterNum)%SourceInletNode) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
            CALL ShowContinueError('Desuperheater water outlet node name does not match thermal'// &
                                   ' tank source inlet node name.')
            CALL ShowContinueError('Desuperheater water inlet and outlet node names = '// &
                                   TRIM(CoilSaveNodeNames(DesuperheaterNum)%InletNodeName1)//' and '// &
                                   TRIM(CoilSaveNodeNames(DesuperheaterNum)%OutletNodeName1))
            CALL ShowContinueError('Thermal tank source side inlet and outlet node names      = '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
            ErrorsFound = .TRUE.
          END IF

        END DO ! DO CheckWaterHeaterNum = 1, NumWaterHeater

        IF(WaterHeaterDesuperheater(DesuperheaterNum)%WaterHeaterTankNum .EQ. 0)THEN
         CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%Name)//':')
         CALL ShowContinueError(' Water heater tank = '//TRIM(WaterHeaterDesuperheater(DesuperheaterNum)%TankName)//' not found.')
         ErrorsFound = .TRUE.
        END IF

      END DO ! DO DesuperheaterNum = 1, NumWaterHeaterDesuperheater
    END IF

!   Loop through HPWH's and then search all water heaters for the tank connected to the HPWH
    IF (NumHeatPumpWaterHeater > 0) THEN

      cCurrentModuleObject = 'WaterHeater:HeatPump'

      DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater

!       find the tank associated with the heat pump water heater and change its %TYPE to HEAT PUMP:WATER HEATER
        DO CheckWaterHeaterNum = 1, NumWaterThermalTank
          IF(.NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankName, WaterThermalTank(CheckWaterHeaterNum)%Name) .OR. &
             .NOT. SameString(HPWaterHeater(HPWaterHeaterNum)%TankType, WaterThermalTank(CheckWaterHeaterNum)%Type)) CYCLE

!         save backup element and on/off-cycle parasitic properties for use during standard rating procedure
          HPWaterHeater(HPWaterHeaterNum)%BackupElementCapacity   = WaterThermalTank(CheckWaterHeaterNum)%MaxCapacity
          HPWaterHeater(HPWaterHeaterNum)%BackupElementEfficiency = WaterThermalTank(CheckWaterHeaterNum)%Efficiency
          HPWaterHeater(HPWaterHeaterNum)%WHOnCycParaLoad         = WaterThermalTank(CheckWaterHeaterNum)%OnCycParaLoad
          HPWaterHeater(HPWaterHeaterNum)%WHOffCycParaLoad        = WaterThermalTank(CheckWaterHeaterNum)%OffCycParaLoad
          HPWaterHeater(HPWaterHeaterNum)%WHOnCycParaFracToTank   = WaterThermalTank(CheckWaterHeaterNum)%OnCycParaFracToTank
          HPWaterHeater(HPWaterHeaterNum)%WHOffCycParaFracToTank  = WaterThermalTank(CheckWaterHeaterNum)%OffCycParaFracToTank
          HPWaterHeater(HPWaterHeaterNum)%WHPLFCurve              = WaterThermalTank(CheckWaterHeaterNum)%PLFCurve

          IF(WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. 'WATER HEATER:SIMPLE')THEN  ! name change issue here.
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('WaterHeater:HeatPump cannot be used with WATER HEATER:SIMPLE.')
            ErrorsFound = .TRUE.
          ELSEIF ((WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. cMixedWHModuleObj)  &
            .OR. (WaterThermalTank(CheckWaterHeaterNum)%Type .EQ. cStratifiedWHModuleObj)) THEN
            HPWaterHeater(HPWaterHeaterNum)%TankTypeNum = WaterThermalTank(CheckWaterHeaterNum)%TypeNum
!           use typenum parameter to simulate heatpumpwaterheater in standard ratings procedure
!           WaterThermalTank%TypeNum = HeatPumpWaterHeater for a HPWH
!            WaterThermalTank(CheckWaterHeaterNum)%TypeNum = HPWaterHeater(HPWaterHeaterNum)%TypeNum
          ELSE
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('Invalid water heater tank type ='//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Type))
            ErrorsFound = .TRUE.
          END IF

!         do not allow modulating control for HPWH's (i.e. modulating control usually used for tankless WH's)
          IF(WaterThermalTank(CheckWaterHeaterNum)%ControlType .EQ. ControlTypeModulate)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('Heater Control Type for '//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Type)//' = '// &
                                    TRIM(WaterThermalTank(CheckWaterHeaterNum)%Name)//' must be CYCLE.')
            ErrorsFound = .TRUE.
          END IF

          WaterThermalTank(CheckWaterHeaterNum)%HeatPumpNum = HPWaterHeaterNum
          HPWaterHeater(HPWaterHeaterNum)%WaterHeaterTankNum = CheckWaterHeaterNum

          IF(WaterThermalTank(CheckWaterHeaterNum)%DesuperheaterNum .GT. 0)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)// &
               'and Coil:WaterHeating:Desuperheater = '//TRIM(WaterHeaterDesuperheater(CheckWaterHeaterNum)%Name)// &
               ':  cannot be connected to the same water heater tank = '//TRIM(WaterThermalTank(CheckWaterHeaterNum)%Name))
          END IF

!         check that water heater source side effectiveness is greater than 0
          IF(WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness .LE. 0.0d0) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)// &
               ':  Invalid source side effectiveness for heat pump water heater = ' &
                 //TrimSigDigits(WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness,3))
            CALL ShowContinueError(' water heater source effectiveness will default to 1.0 and simulation continues.')
             WaterThermalTank(CheckWaterHeaterNum)%SourceEffectiveness = 1.0d0
          END IF

!         Set HPWH structure variable StandAlone to TRUE if use nodes are not connected
          IF (WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .EQ. 0 .AND.   &
             WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode .EQ. 0) &
            HPWaterHeater(HPWaterHeaterNum)%StandAlone = .TRUE.

          IF(HPWaterHeater(HPWaterHeaterNum)%WHUseInletNode /= WaterThermalTank(CheckWaterHeaterNum)%UseInletNode .OR. &
             HPWaterHeater(HPWaterHeaterNum)%WHUseOutletNode /= WaterThermalTank(CheckWaterHeaterNum)%UseOutletNode)THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('Heat pump water heater tank use side inlet and outlet node names must match'// &
                                   ' the use side inlet and outlet node names for water heater tank = '// &
                                   TRIM(HPWaterHeater(HPWaterHeaterNum)%TankType)//': ' &
                                 //TRIM(HPWaterHeater(HPWaterHeaterNum)%TankName))
            CALL ShowContinueError('Heat pump water heater use side inlet and outlet node names = '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName2)//' and '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName2))
            CALL ShowContinueError('Water heater tank use side inlet and outlet node names      = '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1)//' and '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1))
            ErrorsFound = .TRUE.
          ELSE
            IF(.NOT. HPWaterHeater(HPWaterHeaterNum)%StandAlone)THEN
!              removed next to avoid duplicate comp set issue, (should change so that Branch has tank object)
!              CALL SetUpCompSets(HPWaterHeater(HPWaterHeaterNum)%Type, HPWaterHeater(HPWaterHeaterNum)%Name, &
!                     HPWaterHeater(HPWaterHeaterNum)%TankType, &
!                     HPWaterHeater(HPWaterHeaterNum)%TankName, &
!                     WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1,WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1)
              CALL TestCompSet(HPWaterHeater(HPWaterHeaterNum)%Type,HPWaterHeater(HPWaterHeaterNum)%Name, &
                     WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName1,WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName1, &
                    'Water Nodes')
            END IF
          END IF

!         verify HP/tank source node connections
          IF(HPWaterHeater(HPWaterHeaterNum)%CondWaterInletNode .NE. WaterThermalTank(CheckWaterHeaterNum)%SourceOutletNode) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('Heat Pump condenser water inlet node name does not match water'// &
                                   ' heater tank source outlet node name.')
            CALL ShowContinueError('Heat pump condenser water inlet and outlet node names = '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1)//' and '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1))
            CALL ShowContinueError('Water heater tank source side inlet and outlet node names      = '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
            ErrorsFound = .TRUE.
          END IF

          IF(HPWaterHeater(HPWaterHeaterNum)%CondWaterOutletNode .NE. WaterThermalTank(CheckWaterHeaterNum)%SourceInletNode) THEN
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
            CALL ShowContinueError('Heat Pump condenser water outlet node name does not match water heater'// &
                                   ' tank source inlet node name.')
            CALL ShowContinueError('Heat pump condenser water inlet and outlet node names = '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%InletNodeName1)//' and '// &
                                   TRIM(HPWHSaveNodeNames(HPWaterHeaterNum)%OutletNodeName1))
            CALL ShowContinueError('Water heater tank source side inlet and outlet node names      = '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%InletNodeName2)//' and '// &
                                   TRIM(WHSaveNodeNames(CheckWaterHeaterNum)%OutletNodeName2))
            ErrorsFound = .TRUE.
          END IF

          HPWaterHeater(HPWaterHeaterNum)%FoundTank = .TRUE.

!         Verify tank name is in a zone equipment list if HPWH Inlet Air Configuration is Zone Air Only or Zone and Outdoor Air
          IF(HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZone .OR. &
             HPWaterHeater(HPWaterHeaterNum)%InletAirConfiguration .EQ. AmbientTempZoneAndOA)THEN
            IF(ALLOCATED(ZoneEquipConfig) .AND. ALLOCATED(ZoneEquipList))THEN
              FoundTankInList = .FALSE.
              TankNotLowestPriority = .FALSE.
              DO ZoneEquipConfigNum = 1, NumOfZones
                IF(ZoneEquipConfig(ZoneEquipConfigNum)%ActualZoneNum .NE. HPWaterHeater(HPWaterHeaterNum)%AmbientTempZone)CYCLE
                IF(ZoneEquipConfigNum .LE. NumOfZones)THEN
                  DO ZoneEquipListNum = 1, NumOfZones
                    IF(ZoneEquipConfig(ZoneEquipConfigNum)%EquipListName .NE. ZoneEquipList(ZoneEquipListNum)%Name)CYCLE
                    IF(ZoneEquipConfigNum .LE. NumOfZones)THEN
                      DO EquipmentTypeNum = 1, ZoneEquipList(ZoneEquipListNum)%NumOfEquipTypes
                        IF(ZoneEquipList(ZoneEquipListNum)%EquipName(EquipmentTypeNum) .NE. &
                           HPWaterHeater(HPWaterHeaterNum)%Name)CYCLE
                        FoundTankInList = .TRUE.
                        TankCoolingPriority = ZoneEquipList(ZoneEquipListNum)%CoolingPriority(EquipmentTypeNum)
                        TankHeatingPriority = ZoneEquipList(ZoneEquipListNum)%HeatingPriority(EquipmentTypeNum)
                        EXIT
                      END DO ! EquipmentTypeNum
                      IF(.NOT. FoundTankInList)THEN
                        CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
                        CALL ShowContinueError('Heat pump water heater type and name must be listed in the correct'// &
                                               ' ZoneHVAC:EquipmentList object when Inlet Air Configuration is equal'// &
                                               ' to ZoneAirOnly or ZoneAndOutdoorAir.')
                        ErrorsFound = .TRUE.
                      END IF
!                     check that tank has lower priority than all other non-HPWH objects in Zone Equipment List
                      DO EquipmentTypeNum = 1, ZoneEquipList(ZoneEquipListNum)%NumOfEquipTypes
                        IF(SameString(ZoneEquipList(ZoneEquipListNum)%EquipType(EquipmentTypeNum),cCurrentModuleObject))CYCLE
                          IF(TankCoolingPriority .GT. ZoneEquipList(ZoneEquipListNum)%CoolingPriority(EquipmentTypeNum) .OR. &
                             TankHeatingPriority .GT. ZoneEquipList(ZoneEquipListNum)%HeatingPriority(EquipmentTypeNum))THEN
                            TankNotLowestPriority = .TRUE.
                        END IF
                      END DO ! EquipmentTypeNum
                      IF(TankNotLowestPriority .AND. FoundTankInList)THEN
                          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
                          CALL ShowContinueError('Heat pump water heaters must have lower priorities than'// &
                                                 ' all other equipment types in a ZoneHVAC:EquipmentList.')
                        ErrorsFound = .TRUE.
                      END IF
                      EXIT
                   END IF ! ZoneEquipConfigNum .LE. NumOfZoneEquipLists
                  END DO ! ZoneEquipListNum
                  EXIT
                END IF ! ZoneEquipConfigNum .LE. NumOfZones
              END DO ! ZoneEquipConfigNum
            ELSE
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
              CALL ShowContinueError('ZoneHVAC:EquipmentList and ZoneHVAC:EquipmentConnections objects are '// &
                                     ' required when Inlet Air Configuration is either ZoneAirOnly or ZoneAndOutdoorAir.')
              ErrorsFound = .TRUE.
            END IF ! ALLOCATED
          END IF !InletAirConfiguration

        END DO ! DO CheckWaterHeaterNum = 1, NumWaterHeater

        IF(.NOT. HPWaterHeater(HPWaterHeaterNum)%FoundTank)THEN
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%Name)//':')
          CALL ShowContinueError('Water heater tank object not found = '//TRIM(HPWaterHeater(HPWaterHeaterNum)%TankType)&
                                //', '//TRIM(HPWaterHeater(HPWaterHeaterNum)%TankName))
          ErrorsFound = .TRUE.
        END IF

      END DO ! DO HPWaterHeaterNum = 1, NumHeatPumpWaterHeater

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    END IF

   !Get water heater sizing input.
    cCurrentModuleObject='WaterHeater:Sizing'
    NumWaterHeaterSizing  = GetNumObjectsFound(cCurrentModuleObject)

    If (NumWaterHeaterSizing > 0) then

      DO WHsizingNum = 1, NumWaterHeaterSizing
        CALL GetObjectItem(cCurrentModuleObject, WHsizingNum, cAlphaArgs,NumAlphas,rNumericArgs,NumNums,IOSTAT)

        ! find which water heater this object is for
        WaterThermalTankNum = FindItemInList(cAlphaArgs(1),WaterThermalTank%Name, NumWaterThermalTank)
        IF (WaterThermalTankNum == 0) then
          ! did not match name throw warning.
          CALL ShowSevereError(TRIM(cCurrentModuleObject)//' object name: '//TRIM(cAlphaArgs(1))// ' does not match ' &
               //'any of the water heaters defined in the file')
          ErrorsFound = .TRUE.
          cycle
        ELSE ! we have a match
          ! store the sizing data in "sizing" nested derived type for the correct water heater

          IF (SameString(cAlphaArgs(2), 'PeakDraw')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePeakDraw
          ELSEIF (SameString(cAlphaArgs(2), 'ResidentialHUD-FHAMinimum')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizeResidentialMin
          ELSEIF (SameString(cAlphaArgs(2), 'PerPerson')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerPerson
          ELSEIF (SameString(cAlphaArgs(2), 'PerFloorArea')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerFloorArea
          ELSEIF (SameString(cAlphaArgs(2), 'PerUnit')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerUnit
          ELSEIF (SameString(cAlphaArgs(2), 'PerSolarCollectorArea')) THEN
            WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode = SizePerSolarColArea
          ELSE
            ! wrong design mode entered, throw error
            CALL ShowSevereError(TRIM(cCurrentModuleObject)//' object named: '//TRIM(cAlphaArgs(1))  &
              // ' contains an incorrect Design Mode of: ' //Trim(cAlphaArgs(2) ) )
            ErrorsFound = .TRUE.
          ENDIF

          WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime              = rNumericArgs(1)
          WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryTime              = rNumericArgs(2)
          WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow = rNumericArgs(3)
          WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms          = INT(rNumericArgs(4))
          WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBathrooms         = INT(rNumericArgs(5))
          WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerPerson     = rNumericArgs(6)
          WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerPerson = rNumericArgs(7)
          WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerArea       = rNumericArgs(8)
          WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerArea   = rNumericArgs(9)
          WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfUnits             = rNumericArgs(10)
          WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerUnit       = rNumericArgs(11)
          WaterThermalTank(WaterThermalTankNum)%Sizing%RecoveryCapacityPerUnit   = rNumericArgs(12)
          WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerCollectorArea = rNumericArgs(13)
          WaterThermalTank(WaterThermalTankNum)%Sizing%HeightAspectRatio         = rNumericArgs(14)

          Select Case (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode)

          CASE (SizeNotSet)
            ! do nothing, error thrown if design mode not found
          CASE (SizePeakDraw) ! need to have entered a reasonable value for TankDrawTime
            IF (WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime <= 0.0D0 ) then
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                 ', design mode set to Peak Draw but needs a positive value for tank draw time' )
              ErrorsFound = .true.
            ENDIF
            !constrain crazy sizes by limiting to 10 years or 8760*10
            IF (WaterThermalTank(WaterThermalTankNum)%Sizing%TankDrawTime > 87600.0D0 )THEN
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))//  &
                ',  has input with an unreasonably large Tank Draw Time, more than 10 years')
              ErrorsFound = .true.
            ENDIF
            ! if both volume and demand side flow connections are autosized, must be a good NominalVolForSizingDemandSideFlow
            If ((WaterThermalTank(WaterThermalTankNum)%UseSidePlantLoopSide == DemandSide) .AND. &
                (WaterThermalTank(WaterThermalTankNum)%UseDesignVolFlowRate == AutoSize)) Then
                IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow <= 0.0D0) then
                  Call ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))//  &
                    ' needs a value for Nominal Tank Volume for Autosizing Plant Connections')
                  ErrorsFound = .true.
                ENDIF
            ENDIF
            If ((WaterThermalTank(WaterThermalTankNum)%SourceSidePlantLoopSide == DemandSide) .AND. &
                (WaterThermalTank(WaterThermalTankNum)%SourceDesignVolFlowRate == AutoSize)) Then
                IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NominalVolForSizingDemandSideFlow <= 0.0D0) then
                  Call ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))//  &
                    ' needs a value for Nominal Tank Volume for Autosizing Plant Connections')
                  ErrorsFound = .true.
                ENDIF
            ENDIF

          CASE (SizeResidentialMin)
            ! it would have to have at least on bedroom and any more than 10 is crazy for this mode
            IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms < 1 ) then
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', mode needs at least one bedroom')
              ErrorsFound = .true.
            ENDIF
            IF (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfBedrooms > 10 ) then
              CALL ShowWarningError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', probably has too many bedrooms for the selected design mode')
            ENDIF

          CASE (SizePerPerson)

            IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
                 (WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerPerson <= 0.d0)) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerPerson mode needs positive value input for storage capacity per person')
              ErrorsFound = .true.
            ENDIF

            IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize)  .AND. &
                (WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerPerson <= 0.d0) ) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerPerson mode needs positive value input for recovery capacity per person')
              ErrorsFound = .true.
            ENDIF

          CASE (SizePerFloorArea)
            IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
                 (WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerArea <= 0.d0)) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerArea mode needs positive value input for storage capacity per floor area')
              ErrorsFound = .true.
            ENDIF
            IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize)  .AND. &
                (WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerArea <= 0.d0) ) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerArea mode needs positive value input for recovery capacity per floor area')
              ErrorsFound = .true.
            ENDIF

          CASE (SizePerUnit)
            IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
                 (WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerUnit <= 0.d0)) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerUnit mode needs positive value input for storage capacity per unit')
              ErrorsFound = .true.
            ENDIF
            IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
                 (WaterThermalTank(WaterThermalTankNum)%Sizing%NumberOfUnits <= 0.d0)) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerUnit mode needs positive value input for number of units')
              ErrorsFound = .true.
            ENDIF
            IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize)  .AND. &
                (WaterThermalTank(WaterThermalTankNum)%sizing%RecoveryCapacityPerUnit <= 0.d0) ) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerUnit mode needs positive value input for recovery capacity per unit')
              ErrorsFound = .true.
            ENDIF
            IF ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize)  .AND. &
                (WaterThermalTank(WaterThermalTankNum)%sizing%NumberOfUnits <= 0.d0) ) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerUnit mode needs positive value input for number of units')
              ErrorsFound = .true.
            ENDIF
          CASE (SizePerSolarColArea)
            IF ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) .AND. &
                 (WaterThermalTank(WaterThermalTankNum)%Sizing%TankCapacityPerCollectorArea <= 0.d0)) THEN
              CALL ShowSevereError(TRIM(cCurrentModuleObject)//', named '//TRIM(cAlphaArgs(1))// &
                ', PerSolarCollectorArea mode needs positive value input for storage capacity per collector area')
              ErrorsFound = .true.
            ENDIF
          END SELECT


        ENDIF !found water heater num okay
      ENDDO ! loop over sizing objects

      IF (ErrorsFound) THEN
        CALL ShowFatalError('Errors found in getting '//TRIM(cCurrentModuleObject)//  &
           ' input. Preceding condition causes termination.')
      END IF

    ENDIF ! any water heater sizing objects

    !now check that if water heater fields were autosized, that there was also a sizing object for that water heater
    IF (NumWaterThermalTank > 0) THEN
      DO WaterThermalTankNum = 1, NumWaterThermalTank

        If ((WaterThermalTank(WaterThermalTankNum)%Volume == Autosize) &
           .AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
          CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
                'has tank volume set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
          ErrorsFound = .TRUE.
        ENDIF
        If ((WaterThermalTank(WaterThermalTankNum)%MaxCapacity == Autosize) &
           .AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
          CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
                'has heater capacity set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
          ErrorsFound = .TRUE.
        ENDIF
        If ((WaterThermalTank(WaterThermalTankNum)%Height == Autosize) &
           .AND. (WaterThermalTank(WaterThermalTankNum)%Sizing%DesignMode == SizeNotSet)) then
          CALL ShowWarningError('Water heater named '//TRIM(WaterThermalTank(WaterThermalTankNum)%Name) // &
                'has tank height set to AUTOSIZE but it is missing associated WaterHeater:Sizing object')
          ErrorsFound = .TRUE.
        ENDIF
      ENDDO

      If (ErrorsFound) then
        CALL ShowFatalError('Errors found in water heater input. Preceding condition causes termination.')
      ENDIF
    ENDIF

!!   now do calls to TestCompSet for tanks, depending on nodes and heat pump water heater
    IF (NumWaterThermalTank > 0) THEN
      DO WaterThermalTankNum = 1, NumWaterThermalTank
        IF ( WaterThermalTank(WaterThermalTankNum)%UseInletNode > 0  &
             .AND. WaterThermalTank(WaterThermalTankNum)%UseOutletNode > 0) THEN
          IF (WaterThermalTank(WaterThermalTankNum)%HeatPumpNum > 0) THEN
            ! do nothing, Use nodes are tested for HeatPump:WaterHeater not tank
          ELSE
            CALL TestCompSet(WaterThermalTank(WaterThermalTankNum)%Type,  &
                             WaterThermalTank(WaterThermalTankNum)%Name,  &
                             WHSaveNodeNames(WaterThermalTankNum)%InletNodeName1 , &
                             WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName1, &
                            'Use Side Water Nodes')
          ENDIF
        ENDIF
        IF ( WaterThermalTank(WaterThermalTankNum)%SourceInletNode > 0  &
             .AND. WaterThermalTank(WaterThermalTankNum)%SourceOutletNode > 0) THEN

          CALL TestCompSet(WaterThermalTank(WaterThermalTankNum)%Type,  &
                           WaterThermalTank(WaterThermalTankNum)%Name,  &
                           WHSaveNodeNames(WaterThermalTankNum)%InletNodeName2 , &
                           WHSaveNodeNames(WaterThermalTankNum)%OutletNodeName2, &
                          'Source Side Water Nodes')
        ENDIF
      ENDDO
    ENDIF

    IF (NumWaterThermalTank > 0) THEN
      DO WaterThermalTankNum = 1, NumWaterThermalTank
        IF ((WaterThermalTank(WaterThermalTankNum)%TypeNum /= MixedChilledWaterStorage)   &
             .AND. (WaterThermalTank(WaterThermalTankNum)%TypeNum /= StratifiedChilledWaterStorage) ) THEN
          ! Setup report variables for WaterHeater:Mixed
          ! CurrentModuleObject='WaterHeater:Mixed'
          CALL SetupOutputVariable('Water Heater Tank Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%TankTempAvg,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Final Tank Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%TankTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Heat Loss Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%LossRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Heat Loss Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%LossEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Use Side Mass Flow Rate [kg/s]', &
            WaterThermalTank(WaterThermalTankNum)%UseMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Use Side Inlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%UseInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Use Side Outlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%UseOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Use Side Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%UseRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Use Side Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%UseEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Source Side Mass Flow Rate [kg/s]', &
            WaterThermalTank(WaterThermalTankNum)%SourceMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Source Side Inlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%SourceInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Source Side Outlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%SourceOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Source Side Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%SourceRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Source Side Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%SourceEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name, &
            ResourceTypeKey='PLANTLOOPHEATINGDEMAND',GroupKey='Plant', &
            EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)

          CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Tank Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%OffCycParaRateToTank,'System','Average',  &
               WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Tank Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%OffCycParaEnergyToTank,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater On Cycle Parasitic Tank Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%OnCycParaRateToTank,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater On Cycle Parasitic Tank Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%OnCycParaEnergyToTank,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Total Demand Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%TotalDemandRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Total Demand Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%TotalDemandEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Heating Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%HeaterRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Heating Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%HeaterEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Unmet Demand Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%UnmetRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Unmet Demand Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%UnmetEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Venting Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%VentRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Venting Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%VentEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Net Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%NetHeatTransferRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Net Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%NetHeatTransferEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Water Heater Cycle On Count []', &
            WaterThermalTank(WaterThermalTankNum)%CycleOnCount,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Runtime Fraction []', &
            WaterThermalTank(WaterThermalTankNum)%RuntimeFraction,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Part Load Ratio []', &
            WaterThermalTank(WaterThermalTankNum)%PartLoadRatio,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          IF (SameString(WaterThermalTank(WaterThermalTankNum)%FuelType, 'Electric') ) THEN
            CALL SetupOutputVariable('Water Heater Electric Power [W]', &
              WaterThermalTank(WaterThermalTankNum)%FuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ELSE
            CALL SetupOutputVariable('Water Heater '//TRIM(WaterThermalTank(WaterThermalTankNum)%FuelType)//' Rate [W]', &
              WaterThermalTank(WaterThermalTankNum)%FuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ENDIF
          CALL SetupOutputVariable('Water Heater '//TRIM(WaterThermalTank(WaterThermalTankNum)%FuelType)//' Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%FuelEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name,  &
            ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%FuelType,GroupKey='Plant', &
            EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
          IF (SameString(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType, 'Electric') ) THEN
            CALL SetupOutputVariable( &
              'Water Heater Off Cycle Parasitic Electric Power [W]', &
              WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelRate, &
             'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ELSE
            CALL SetupOutputVariable( &
              'Water Heater Off Cycle Parasitic '//  &
                 TRIM(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType)//' Rate [W]', &
              WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelRate,&
              'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ENDIF
          CALL SetupOutputVariable( &
              'Water Heater Off Cycle Parasitic '//  &
                 TRIM(WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType)//' Energy [J]', &
              WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelEnergy,'System','Sum', &
              WaterThermalTank(WaterThermalTankNum)%Name, &
              ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%OffCycParaFuelType,GroupKey='Plant', &
              EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
          IF (SameString(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType, 'Electric') ) THEN
            CALL SetupOutputVariable( &
              'Water Heater On Cycle Parasitic Electric Power [W]', &
              WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ELSE
            CALL SetupOutputVariable( &
              'Water Heater On Cycle Parasitic '//TRIM(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType)//  &
                 ' Rate [W]', &
              WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          ENDIF

          CALL SetupOutputVariable( &
            'Water Heater On Cycle Parasitic '//TRIM(WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType)//  &
               ' Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name, &
            ResourceTypeKey=WaterThermalTank(WaterThermalTankNum)%OnCycParaFuelType,GroupKey='Plant', &
            EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)

          CALL SetupOutputVariable('Water Heater Water Volume Flow Rate [m3/s]', &
            WaterThermalTank(WaterThermalTankNum)%VolFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Water Heater Water Volume [m3]',WaterThermalTank(WaterThermalTankNum)%VolumeConsumed, &
            'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name,ResourceTypeKey='Water',GroupKey='Plant', &
            EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)
          CALL SetupOutputVariable('Water Heater Mains Water Volume [m3]',  &
             WaterThermalTank(WaterThermalTankNum)%VolumeConsumed, &
            'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name,ResourceTypeKey='MainsWater',GroupKey='Plant', &
            EndUseKey='DHW',EndUseSubKey=WaterThermalTank(WaterThermalTankNum)%EndUseSubcategoryName)

          IF(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum .GT. 0) THEN
            !CurrentModuleObject='WaterHeater:HeatPump'
            CALL SetupOutputVariable('Water Heater Compressor Part Load Ratio []', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%HeatingPLR,'System','Average', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
            CALL SetupOutputVariable('Water Heater Off Cycle Ancillary Electric Power [W]', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OffCycParaFuelRate,'System','Average', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
            CALL SetupOutputVariable('Water Heater Off Cycle Ancillary Electric Energy [J]', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OffCycParaFuelEnergy,'System','Sum', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name, &
              ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic', GroupKey='Plant')
            CALL SetupOutputVariable('Water Heater On Cycle Ancillary Electric Power [W]', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OnCycParaFuelRate,'System','Average', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name)
            CALL SetupOutputVariable('Water Heater On Cycle Ancillary Electric Energy [J]', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%OnCycParaFuelEnergy,'System','Sum', &
              HPWaterHeater(WaterThermalTank(WaterThermalTankNum)%HeatPumpNum)%Name, &
              ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic',GroupKey='Plant')
          END IF

         IF(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum .GT. 0) THEN
            !CurrentModuleObject='Coil:WaterHeating:Desuperheater'
            CALL SetupOutputVariable('Water Heater Part Load Ratio []', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%DesuperheaterPLR,  &
                 'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater On Cycle Parasitic Electric Power [W]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OnCycParaFuelRate,  &
                 'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater On Cycle Parasitic Electric Energy [J]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OnCycParaFuelEnergy,  &
                 'System','Sum', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
              ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic',GroupKey='Plant')
            CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Electric Power [W]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OffCycParaFuelRate,  &
                 'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater Off Cycle Parasitic Electric Energy [J]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%OffCycParaFuelEnergy,  &
                 'System','Sum', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
              ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Water Heater Parasitic', GroupKey='Plant')
            CALL SetupOutputVariable('Water Heater Heat Reclaim Efficiency Modifier Multiplier []', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HEffFTempOutput,  &
                 'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater Pump Electric Power [W]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%PumpPower,'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater Pump Electric Energy [J]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%PumpEnergy,'System','Sum', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
              ResourceTypeKey='Electric',EndUseKey='DHW',EndUseSubKey='Desuperheater Pump', GroupKey='Plant')
            CALL SetupOutputVariable('Water Heater Heating Rate [W]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HeaterRate,'System','Average', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name)
            CALL SetupOutputVariable('Water Heater Heating Energy [J]', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%HeaterEnergy,'System','Sum', &
              WaterHeaterDesuperheater(WaterThermalTank(WaterThermalTankNum)%DesuperheaterNum)%Name, &
              ResourceTypeKey='EnergyTransfer',EndUseKey='DHW',EndUseSubKey='Water Heater', GroupKey='Plant')
          END IF

          ! Setup report variables for WaterHeater:Stratified
          ! CurrentModuleObject='WaterHeater:Stratified'
          IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedWaterHeater) THEN

            CALL SetupOutputVariable('Water Heater Heater 1 Heating Rate [W]', &
              WaterThermalTank(WaterThermalTankNum)%HeaterRate1,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
            CALL SetupOutputVariable('Water Heater Heater 2 Heating Rate [W]', &
              WaterThermalTank(WaterThermalTankNum)%HeaterRate2,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

            CALL SetupOutputVariable('Water Heater Heater 1 Heating Energy [J]', &
              WaterThermalTank(WaterThermalTankNum)%HeaterEnergy1,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
            CALL SetupOutputVariable('Water Heater Heater 2 Heating Energy [J]', &
              WaterThermalTank(WaterThermalTankNum)%HeaterEnergy2,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

            CALL SetupOutputVariable('Water Heater Heater 1 Cycle On Count []', &
              WaterThermalTank(WaterThermalTankNum)%CycleOnCount1,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)
            CALL SetupOutputVariable('Water Heater Heater 2 Cycle On Count  []', &
              WaterThermalTank(WaterThermalTankNum)%CycleOnCount2,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

            CALL SetupOutputVariable('Water Heater Heater 1 Runtime Fraction []', &
              WaterThermalTank(WaterThermalTankNum)%RuntimeFraction1,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
            CALL SetupOutputVariable('Water Heater Heater 2 Runtime Fraction []', &
              WaterThermalTank(WaterThermalTankNum)%RuntimeFraction2,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              CALL SetupOutputVariable('Water Heater Temperature Node '//TRIM(TrimSigDigits(NodeNum))//' [C]', &
                WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%TempAvg,'System','Average',  &
                   WaterThermalTank(WaterThermalTankNum)%Name)
            END DO

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              CALL SetupOutputVariable('Water Heater Final Temperature Node '//TRIM(TrimSigDigits(NodeNum))//'  [C]', &
                WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Temp,'System','Average',  &
                   WaterThermalTank(WaterThermalTankNum)%Name)
            END DO
          END IF


          IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedWaterHeater) THEN

    723 FORMAT('Water Heater Stratified Node Information',8(',',A))

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              WRITE(OutputFileInits,723) TRIM(TrimSigDigits(NodeNum)),                            &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Height,4)),          &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Volume,4)),          &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%MaxCapacity,3)),     &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OffCycLossCoeff,4)), &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OnCycLossCoeff,4)),  &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Inlets)),            &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Outlets))
            END DO
          END IF

          IF (ErrorsFound) THEN
            CALL ShowFatalError('Errors found in getting water heater input. Preceding condition causes termination.')
          END IF

        ELSEIF ((WaterThermalTank(WaterThermalTankNum)%TypeNum == MixedChilledWaterStorage)        &
                .OR. (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) ) THEN
          ! CurrentModuleObject='ThermalStorage:ChilledWater:Mixed/ThermalStorage:ChilledWater:Stratified'
          CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%TankTempAvg,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Final Tank Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%TankTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Heat Gain Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%LossRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Chilled Water Thermal Storage Tank Heat Gain Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%LossEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Mass Flow Rate [kg/s]', &
            WaterThermalTank(WaterThermalTankNum)%UseMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Inlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%UseInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Outlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%UseOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%UseRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Chilled Water Thermal Storage Use Side Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%UseEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Mass Flow Rate [kg/s]', &
            WaterThermalTank(WaterThermalTankNum)%SourceMassFlowRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Inlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%SourceInletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Outlet Temperature [C]', &
            WaterThermalTank(WaterThermalTankNum)%SourceOutletTemp,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)

          CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Heat Transfer Rate [W]', &
            WaterThermalTank(WaterThermalTankNum)%SourceRate,'System','Average',WaterThermalTank(WaterThermalTankNum)%Name)
          CALL SetupOutputVariable('Chilled Water Thermal Storage Source Side Heat Transfer Energy [J]', &
            WaterThermalTank(WaterThermalTankNum)%SourceEnergy,'System','Sum',WaterThermalTank(WaterThermalTankNum)%Name)

          IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) THEN

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              CALL SetupOutputVariable('Chilled Water Thermal Storage Temperature Node '//TRIM(TrimSigDigits(NodeNum))//' [C]', &
                WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%TempAvg,'System','Average',  &
                   WaterThermalTank(WaterThermalTankNum)%Name)
            END DO

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              CALL SetupOutputVariable('Chilled Water Thermal Storage Final Temperature Node ' &
                                      //TRIM(TrimSigDigits(NodeNum))//' [C]', &
                WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Temp,'System','Average',  &
                   WaterThermalTank(WaterThermalTankNum)%Name)
            END DO
          END IF


          IF (WaterThermalTank(WaterThermalTankNum)%TypeNum == StratifiedChilledWaterStorage) THEN

    724 FORMAT('Chilled Water Tank Stratified Node Information',6(',',A))

            DO NodeNum = 1, WaterThermalTank(WaterThermalTankNum)%Nodes
              WRITE(OutputFileInits,724) TRIM(TrimSigDigits(NodeNum)),                            &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Height,4)),          &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Volume,4)),          &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%OffCycLossCoeff,4)), &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Inlets)),            &
                TRIM(TrimSigDigits(WaterThermalTank(WaterThermalTankNum)%Node(NodeNum)%Outlets))
            END DO
          END IF

          IF (ErrorsFound) THEN
            CALL ShowFatalError('Errors found in getting chilled water tank input. Preceding condition causes termination.')
          END IF
        ENDIF

        ! set up internal gains if tank is in a thermal zone
        IF (WaterThermalTank(WaterThermalTankNum)%AmbientTempZone > 0) THEN
          SELECT CASE (WaterThermalTank(WaterThermalTankNum)%TypeNum)

          CASE (MixedWaterHeater)
            CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
                                   'WaterHeater:Mixed', &
                                   WaterThermalTank(WaterThermalTankNum)%Name, &
                                   IntGainTypeOf_WaterHeaterMixed, &
                                   ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
          CASE (StratifiedWaterHeater)
            CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
                                   'WaterHeater:Stratified', &
                                   WaterThermalTank(WaterThermalTankNum)%Name, &
                                   IntGainTypeOf_WaterHeaterStratified, &
                                   ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
          CASE (MixedChilledWaterStorage)
            CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
                                   'ThermalStorage:ChilledWater:Mixed', &
                                   WaterThermalTank(WaterThermalTankNum)%Name, &
                                   IntGainTypeOf_ThermalStorageChilledWaterMixed, &
                                   ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
          CASE (StratifiedChilledWaterStorage)
            CALL SetupZoneInternalGain(WaterThermalTank(WaterThermalTankNum)%AmbientTempZone, &
                                   'ThermalStorage:ChilledWater:Stratified', &
                                   WaterThermalTank(WaterThermalTankNum)%Name, &
                                   IntGainTypeOf_ThermalStorageChilledWaterStratified, &
                                   ConvectionGainRate = WaterThermalTank(WaterThermalTankNum)%AmbientZoneGain )
          END SELECT

        ENDIF

      END DO ! WaterThermalTankNum
    END IF

  END IF ! get input flag

  IF (ALLOCATED(HPWHSaveNodeNames)) DEALLOCATE(HPWHSaveNodeNames)
  IF (ALLOCATED(WHSaveNodeNames)) DEALLOCATE(WHSaveNodeNames)
  IF (ALLOCATED(CoilSaveNodeNames)) DEALLOCATE(CoilSaveNodeNames)

  RETURN

END SUBROUTINE GetWaterThermalTankInput


AbortEnergyPlus AbsoluteAirMass ActivateDemandManagers ActivateEMSControls AddBlankKeys addChargesToOperand AddCompSizeTableEntry AddEndUseSubcategory AddError addFootNoteSubTable AddInstruction AddMeter addMonthlyCharge AddMonthlyFieldSetInput AddMonthlyReport AddNeighborInformation AddObjectDefandParse addOperand AddRecordFromSection AddRecordToOutputVariableStructure AddSectionDef AddShadowRelateTableEntry AddSQLiteComponentSizingRecord AddSQLiteComponentSizingRecord AddSQLiteSystemSizingRecord AddSQLiteSystemSizingRecord AddSQLiteZoneSizingRecord AddSQLiteZoneSizingRecord AddTOCEntry AddTOCZoneLoadComponentTable AddToOutputVariableList AddVariablesForMonthlyReport AddVariableSlatBlind AddWindow AdjustAirSetpointsforOpTempCntrl AdjustCBF AdjustCBF AdjustChangeInLoadByEMSControls AdjustChangeInLoadByHowServed AdjustChangeInLoadForLastStageUpperRangeLimit AdjustCoolingSetPointforTempAndHumidityControl adjusthhat AdjustPumpFlowRequestByEMSControls AdjustReportingHourAndMinutes AdjustVBGap AdvanceRootFinder AFECFR AFECOI AFECPD AFECPF AFEDMP AFEDOP AFEDWC AFEELR AFEEXF AFEFAN AFEHEX AFEHOP AFEPLR AFESCR AFESEL AFESOP AFETMU AirflowNetworkVentingControl AirMass AIRMOV AllocateAirflowNetworkData AllocateAirHeatBalArrays AllocateAndInitData AllocateAndSetUpVentReports AllocateCFSStateHourlyData AllocateForCFSRefPointsGeometry AllocateForCFSRefPointsState AllocateHeatBalArrays AllocateLoadComponentArrays AllocateModuleArrays AllocateModuleArrays AllocateSurfaceHeatBalArrays AllocateWeatherData angle_2dvector AnisoSkyViewFactors AnyPlantLoopSidesNeedSim AnyPlantSplitterMixerLacksContinuity AreaPolygon ArgCheck array_to_vector ASHRAETauModel ASHWAT_OffNormalProperties ASHWAT_Solar ASHWAT_Thermal ASSIGNMENT (=) AssignNodeNumber AssignReportNumber AssignResourceTypeNum AssignReverseConstructionNumber AssignVariablePt AttachCustomMeters AttachMeters AuditBranches AUTOTDMA BaseThermalPropertySet_Diffusivity BeginEnvrnInitializeRuntimeLanguage BetweenDates BetweenGlassForcedFlow BetweenGlassShadeForcedFlow BetweenGlassShadeNaturalFlow BisectionMethod BlindBeamBeamTrans BlindOpticsBeam BlindOpticsDiffuse BoreholeResistance BoundValueToNodeMinMaxAvail BoundValueToWithinTwoValues BracketRoot BranchPressureDrop BrentMethod BuildGap BuildKeyVarList Calc4PipeFanCoil Calc_EN673 Calc_ISO15099 CalcActiveTranspiredCollector CalcAggregateLoad CalcAirflowNetworkAirBalance CalcAirflowNetworkCO2Balance CalcAirflowNetworkGCBalance CalcAirflowNetworkHeatBalance CalcAirflowNetworkMoisBalance CalcAirFlowSimple CalcAirLoopSplitter CalcAirMixer CalcAirToAirGenericHeatExch CalcAirToAirPlateHeatExch CalcAirZoneReturnPlenum CalcAirZoneSupplyPlenum CalcAlamdariHammondStableHorizontal CalcAlamdariHammondUnstableHorizontal CalcAlamdariHammondVerticalWall CalcAngleFactorMRT CalcApproximateViewFactors CalcASHRAEDetailedIntConvCoeff CalcASHRAESimpExtConvectCoeff CalcASHRAESimpleIntConvCoeff CalcASHRAEVerticalWall CalcATMixer CalcAwbiHattonHeatedFloor CalcAwbiHattonHeatedWall CalcBasinHeaterPower CalcBasinHeaterPowerForMultiModeDXCoil CalcBeamSolarOnWinRevealSurface CalcBeamSolDiffuseReflFactors CalcBeamSolSpecularReflFactors CalcBeausoleilMorrisonMixedAssistedWall CalcBeausoleilMorrisonMixedOpposingWall CalcBeausoleilMorrisonMixedStableCeiling CalcBeausoleilMorrisonMixedStableFloor CalcBeausoleilMorrisonMixedUnstableCeiling CalcBeausoleilMorrisonMixedUnstableFloor CalcBLASTAbsorberModel CalcBlockenWindward CalcBoilerModel CalcBoilerModel CalcBottomFluxCoefficents CalcBottomSurfTemp CalcBuriedPipeSoil CalcCBF CalcCBF CalcCBVAV CalcCeilingDiffuserInletCorr CalcCeilingDiffuserIntConvCoeff CalcChillerHeaterModel CalcChillerIPLV CalcChillerModel CalcClearRoof CalcCoilUAbyEffectNTU CalcColdestSetPoint CalcComplexWindowOverlap CalcComplexWindowThermal CalcCompSuctionTempResidual CalcCondEntSetPoint CalcConnectionsDrainTemp CalcConnectionsFlowRates CalcConnectionsHeatRecovery CalcConstCOPChillerModel CalcConvCoeffAbsPlateAndWater CalcConvCoeffBetweenPlates CalcCoolBeam CalcCoolTower CalcCoordinateTransformation CalcCoPlanarNess CalcCostEstimate CalcCTGeneratorModel CalcDayltgCoefficients CalcDayltgCoeffsMapPoints CalcDayltgCoeffsRefMapPoints CalcDayltgCoeffsRefPoints CalcDesiccantBalancedHeatExch CalcDesignSpecificationOutdoorAir CalcDesuperheaterHeatingCoil CalcDesuperheaterWaterHeater CalcDetailedHcInForDVModel CalcDetailedSystem CalcDetailedTransSystem CalcDetailFlatFinCoolingCoil CalcDetIceStorLMTDstar CalcDiffTSysAvailMgr CalcDirectAir CalcDirectEvapCooler CalcDirectResearchSpecialEvapCooler CalcDoe2DXCoil CalcDOE2Leeward CalcDOE2Windward CalcDryFinEffCoef CalcDryIndirectEvapCooler CalcDuct CalcDXCoilStandardRating CalcDXHeatingCoil CalcEarthTube CalcEcoRoof CalcEffectiveness CalcEffectiveSHR CalcEffectiveSHR CalcEffectiveSHR CalcEffectiveSHR CalcElecSteamHumidifier CalcElectricBaseboard CalcElectricChillerHeatRecovery CalcElectricChillerModel CalcElectricEIRChillerModel CalcElectricHeatingCoil CalcEmmelRoof CalcEmmelVertical CalcEngineChillerHeatRec CalcEngineDrivenChillerModel CalcEQLOpticalProperty CalcEQLWindowOpticalProperty CalcEQLWindowSHGCAndTransNormal CalcEQLWindowStandardRatings CalcEQLWindowUvalue CalcEquipmentDrainTemp CalcEquipmentFlowRates CalcExhaustAbsorberChillerModel CalcExhaustAbsorberHeaterModel CalcExteriorVentedCavity CalcFisherPedersenCeilDiffuserCeiling CalcFisherPedersenCeilDiffuserFloor CalcFisherPedersenCeilDiffuserWalls CalcFluidHeatExchanger CalcFohannoPolidoriVerticalWall CalcFollowOATempSetPoint CalcFollowSysNodeTempSetPoint CalcFourPipeIndUnit CalcFrameDividerShadow CalcFuelCellAuxHeater CalcFuelCellGeneratorModel CalcFuelCellGenHeatRecovery CalcFurnaceOutput CalcFurnaceResidual CalcGasAbsorberChillerModel CalcGasAbsorberHeaterModel CalcGasCooler CalcGasHeatingCoil CalcGenericDesiccantDehumidifier CalcGoldsteinNovoselacCeilingDiffuserFloor CalcGoldsteinNovoselacCeilingDiffuserWall CalcGoldsteinNovoselacCeilingDiffuserWindow CalcGroundTempSetPoint CalcGroundwaterWell CalcGshpModel CalcGshpModel CalcGTChillerModel CalcHeatBalanceAir CalcHeatBalanceInsideSurf CalcHeatBalanceInsideSurf CalcHeatBalanceOutsideSurf CalcHeatBalanceOutsideSurf CalcHeatBalFiniteDiff CalcHeatBalHAMT CalcHeatPumpWaterHeater CalcHeatTransCoeffAndCoverTemp CalcHfExteriorSparrow CalcHighTempRadiantSystem CalcHighTempRadiantSystemSP CalcHiTurnOffSysAvailMgr CalcHiTurnOnSysAvailMgr CalcHnASHRAETARPExterior CalcHPCoolingSimple CalcHPHeatingSimple CalcHPWHDXCoil CalcHWBaseboard CalcHXAssistedCoolingCoil CalcHXEffectTerm CalcHybridVentSysAvailMgr CalcIBesselFunc CalcICEngineGeneratorModel CalcICEngineGenHeatRecovery CalcIceStorageCapacity CalcIceStorageCharge CalcIceStorageDischarge CalcIceStorageDormant CalcICSSolarCollector CalcIdealCondEntSetPoint CalcIfSetpointMet CalcIndirectAbsorberModel CalcIndirectResearchSpecialEvapCooler CalcInteriorRadExchange CalcInteriorSolarDistribution CalcInteriorSolarOverlaps CalcInteriorWinTransDifSolInitialDistribution CalcISO15099WindowIntConvCoeff CalcKaradagChilledCeiling CalcKBesselFunc CalcKhalifaEq3WallAwayFromHeat CalcKhalifaEq4CeilingAwayFromHeat CalcKhalifaEq5WallsNearHeat CalcKhalifaEq6NonHeatedWalls CalcKhalifaEq7Ceiling CalcLoadCenterThermalLoad CalcLoTurnOffSysAvailMgr CalcLoTurnOnSysAvailMgr CalcLowTempCFloRadiantSystem CalcLowTempCFloRadSysComps CalcLowTempElecRadiantSystem CalcLowTempHydrRadiantSystem CalcLowTempHydrRadSysComps CalcMatrixInverse CalcMcAdams CalcMerkelVariableSpeedTower CalcMicroCHPNoNormalizeGeneratorModel CalcMinIntWinSolidAngs CalcMitchell CalcMixedAirSetPoint CalcMoistureBalanceEMPD CalcMoreNodeInfo CalcMoWITTLeeward CalcMoWITTWindward CalcMSHeatPump CalcMTGeneratorModel CalcMultiSpeedDXCoil CalcMultiSpeedDXCoilCooling CalcMultiSpeedDXCoilHeating CalcMultiStageElectricHeatingCoil CalcMultiStageGasHeatingCoil CalcMultiZoneAverageCoolingSetPoint CalcMultiZoneAverageHeatingSetPoint CalcMultiZoneAverageMaxHumSetPoint CalcMultiZoneAverageMinHumSetPoint CalcMultiZoneMaxHumSetPoint CalcMultiZoneMinHumSetPoint CalcMundtModel CalcNCycSysAvailMgr CalcNewZoneHeatCoolFlowRates CalcNewZoneHeatOnlyFlowRates CalcNodeMassFlows CalcNominalWindowCond CalcNonDXHeatingCoils CalcNonDXHeatingCoils CalcNonDXHeatingCoils CalcNonDXHeatingCoils CalcNusselt CalcNusseltJurges CalcNVentSysAvailMgr CalcOAController CalcOAMassFlow CalcOAMassFlow CalcOAMixer CalcOAOnlyMassFlow CalcOAPretreatSetPoint CalcOAUnitCoilComps CalcObstrMultiplier CalcOptStartSysAvailMgr CalcOtherSideDemand CalcOutdoorAirUnit CalcOutsideAirSetPoint CalcOutsideSurfTemp CalcParallelPIU CalcPassiveExteriorBaffleGap CalcPassiveSystem CalcPassiveTranspiredCollector CalcPerSolarBeam CalcPipeHeatTransCoef CalcPipesHeatTransfer CalcPipeTransBeam CalcPlantValves CalcPollution CalcPolyhedronVolume CalcPolynomCoef CalcPondGroundHeatExchanger CalcPredictedHumidityRatio CalcPredictedSystemLoad CalcPTUnit CalcPumps CalcPurchAirLoads CalcPurchAirMinOAMassFlow CalcPurchAirMixedAir CalcPVTcollectors CalcQiceChargeMaxByChiller CalcQiceChargeMaxByITS CalcQiceDischageMax CalcRABFlowSetPoint CalcRackSystem CalcRadSysHXEffectTerm CalcRadTemp CalcRainCollector CalcReformEIRChillerModel CalcResearchSpecialPartLoad CalcReturnAirPath CalcRfFlrCoordinateTransformation CalcSandiaPV CalcSatVapPressFromTemp CalcSchedOffSysAvailMgr CalcSchedOnSysAvailMgr CalcSchedSysAvailMgr CalcScheduledDualSetPoint CalcScheduledSetPoint CalcScreenTransmittance CalcScriptF CalcSeriesPIU CalcSetpointTempTarget CalcSHRUserDefinedCurves CalcSimpleController CalcSimpleHeatingCoil CalcSimplePV CalcSingleSpeedEvapFluidCooler CalcSingleSpeedTower CalcSingZoneClSetPoint CalcSingZoneHtSetPoint CalcSingZoneMaxHumSetPoint CalcSingZoneMinHumSetPoint CalcSingZoneRhSetPoint CalcSkySolDiffuseReflFactors CalcSolarCollector CalcSolarFlux CalcSolidDesiccantDehumidifier CalcSourceFlux CalcSourceTempCoefficents CalcSparrowLeeward CalcSparrowWindward CalcSpecialDayTypes CalcStandAloneERV CalcStandardRatings CalcStaticProperties CalcSteamAirCoil CalcSteamBaseboard CalcSurfaceCentroid CalcSurfaceGroundHeatExchanger CalcSystemEnergyUse CalcSZOneStageCoolingSetPt CalcSZOneStageHeatingSetPt CalcTankTemp CalcTDDTransSolAniso CalcTDDTransSolHorizon CalcTDDTransSolIso CalcTempDistModel CalcTempIntegral CalcTESCoilChargeOnlyMode CalcTESCoilCoolingAndChargeMode CalcTESCoilCoolingAndDischargeMode CalcTESCoilCoolingOnlyMode CalcTESCoilDischargeOnlyMode CalcTESCoilOffMode CalcTESIceStorageTank CalcTESWaterStorageTank CalcThermalChimney CalcThermalComfortAdaptiveASH55 CalcThermalComfortAdaptiveCEN15251 CalcThermalComfortFanger CalcThermalComfortKSU CalcThermalComfortPierce CalcThermalComfortSimpleASH55 CalcTimeNeeded CalcTopFluxCoefficents CalcTopSurfTemp CalcTotalFLux CalcTotCapSHR CalcTotCapSHR_VSWSHP CalcTransAbsorProduct CalcTransRefAbsOfCover CalcTRNSYSPV CalcTrombeWallIntConvCoeff CalcTwoSpeedDXCoilIEERResidual CalcTwoSpeedDXCoilStandardRating CalcTwoSpeedEvapFluidCooler CalcTwoSpeedTower CalcUAIce CalcUCSDCV CalcUCSDDV CalcUCSDUE CalcUCSDUI CalculateAirChillerSets CalculateBasisLength CalculateCase CalculateCoil CalculateCompressors CalculateCondensers CalculateCTFs CalculateDailySolarCoeffs CalculateDayOfWeek CalculateEpsFromNTUandZ CalculateExponentialMatrix CalculateFuncResults CalculateGammas CalculateInverseMatrix CalculateMoodyFrictionFactor CalculateNTUfromEpsAndZ CalculatePollution CalculateSecondary CalculateSubcoolers CalculateSunDirectionCosines CalculateTransCompressors CalculateWalkIn CalculateWaterUseage CalculateWaterUseage CalculateWindowBeamProperties CalculateZoneMRT CalculateZoneVolume CalcUnitaryCoolingSystem CalcUnitaryHeatingSystem CalcUnitarySuppHeatingSystem CalcUnitarySuppSystemtoSP CalcUnitarySystemLoadResidual CalcUnitarySystemToLoad CalcUnitHeater CalcUnitHeaterComponents CalcUnitVentilator CalcUnitVentilatorComponents CalcUnmetPlantDemand CalcUpdateHeatRecovery CalcUpdateHeatRecovery CalcUserDefinedInsideHcModel CalcUserDefinedOutsideHcModel CalcVariableSpeedTower CalcVarSpeedCoilCooling CalcVarSpeedCoilHeating CalcVarSpeedHeatPump CalcVarSpeedHeatPump CalcVAVVS CalcVentilatedSlab CalcVentilatedSlabComps CalcVentilatedSlabRadComps CalcVentSlabHXEffectTerm CalcVerticalGroundHeatExchanger CalcViewFactorToShelf CalcVRF CalcVRFCondenser CalcVRFCoolingCoil CalcVSTowerApproach CalcWallCoordinateTransformation CalcWaltonStableHorizontalOrTilt CalcWaltonUnstableHorizontalOrTilt CalcWarmestSetPoint CalcWarmestSetPointTempFlow CalcWaterMainsTemp CalcWaterSource CalcWaterStorageTank CalcWaterThermalTankMixed CalcWaterThermalTankStratified CalcWaterThermalTankZoneGains CalcWaterToAirHeatpump CalcWatertoAirHPCooling CalcWatertoAirHPHeating CalcWaterToAirResidual CalcWatertoWaterHPCooling CalcWatertoWaterHPHeating CalcWaterUseZoneGains CalcWetIndirectEvapCooler CalcWindowACOutput CalcWindowBlindProperties CalcWindowHeatBalance CalcWindowProfileAngles CalcWindowScreenProperties CalcWindowStaticProperties CalcWindPressure CalcWindPressureCoeffs CalcWindTurbine CalcWinFrameAndDividerTemps CalcWinTransDifSolInitialDistribution CalcWrapperModel CalcZoneAirComfortSetpoints CalcZoneAirTempSetpoints CalcZoneComponentLoadSums CalcZoneDehumidifier CalcZoneEvaporativeCoolerUnit CalcZoneLeavingConditions CalcZoneMassBalance CalcZonePipesHeatGain CalcZoneSums CartesianPipeCellInformation_ctor CellType_IsFieldCell CFSHasControlledShade CFSNGlz CFSRefPointPosFactor CFSRefPointSolidAngle CFSShadeAndBeamInitialization CFSUFactor cGetCoilAirOutletNode cGetCoilSteamInletNode cGetCoilSteamOutletNode CharPreDefTableEntry CheckActuatorNode CheckAndAddAirNodeNumber CheckAndFixCFSLayer CheckAndReadCustomSprectrumData CheckAndReadFaults CheckAndSetConstructionProperties CheckBracketRoundOff CheckBranchForOASys CheckCachedIPErrors CheckCFSStates CheckCoilWaterInletNode CheckControllerListOrder CheckControllerLists CheckConvexity CheckCostEstimateInput CheckCreatedZoneItemName CheckCurveLimitsForIPLV CheckCurveLimitsForStandardRatings CheckDayScheduleValueMinMax CheckDXCoolingCoilInOASysExists CheckFDSurfaceTempLimits CheckFFSchedule CheckFluidPropertyName CheckForActualFileName CheckForBalancedFlow CheckForControllerWaterCoil CheckForGeometricTransform CheckForGeometricTransform CheckForMisMatchedEnvironmentSpecifications CheckForOutOfRangeTempResult CheckForOutOfRangeTemps CheckForRequestedReporting CheckForRunawayPlantTemps CheckForSensorAndSetpointNode CheckGasCoefs CheckHeatingCoilSchedule CheckHXAssistedCoolingCoilSchedule CheckIFAnyEMS CheckIFAnyIdealCondEntSetPoint CheckIfAnyPlant CheckIfNodeSetpointManagedByEMS CheckIncrementRoundOff CheckInternalConsistency CheckLightsReplaceableMinMaxForZone CheckLocationValidity CheckLoopExitNode CheckLowerUpperBracket CheckMarkedNodes CheckMaxActiveController CheckMaxConstraint CheckMicroCHPThermalBalance CheckMinActiveController CheckMinConstraint checkMinimumMonthlyCharge CheckMinMaxCurveBoundaries CheckMinMaxRange CheckModelBoundOutput_HumRat CheckModelBoundOutput_Temp CheckModelBounds CheckModelBoundsHumRatEq CheckModelBoundsRH_HumRatEq CheckModelBoundsRH_TempEq CheckModelBoundsTempEq CheckNodeConnections CheckNodeSetPoint CheckNonSingularity CheckOAControllerName CheckOutAirNodeNumber CheckPlantConvergence CheckPlantMixerSplitterConsistency CheckPlantOnAbort CheckPollutionMeterReporting CheckRefrigerationInput CheckReportVariable CheckRootFinderCandidate CheckRootFinderConvergence CheckScheduledSurfaceGains CheckScheduleValue CheckScheduleValueMinMax Checksetpoints CheckSimpleController CheckSlope CheckSteamCoilSchedule CheckSubSurfaceMiscellaneous CheckSysSizing CheckSystemBranchFlow CheckTDDsAndLightShelvesInDaylitZones CheckThisAirSystemForSizing CheckThisZoneForSizing CheckThreading CheckUniqueNodes CheckUnitarySysCoilInOASysExists CheckUsedConstructions CheckValidSimulationObjects CheckWarmupConvergence CheckWaterCoilSchedule CheckWeatherFileValidity CheckWindowShadingControlFrameDivider CheckZoneEquipmentList CheckZoneSizing CHKBKS CHKGSS CHKSBS CLIP CLIPPOLY CloseDFSFile CloseMiscOpenFiles CloseMoistureBalanceEMPD CloseOutOpenFiles CloseOutputFiles CloseOutputTabularFile CloseReportIllumMaps CloseSocket CloseWeatherFile CoilAreaFracIter CoilCompletelyDry CoilCompletelyWet CoilOutletStreamCondition CoilPartWetPartDry COMMAND_ARGUMENT_COUNT CompactObjectsCheck CompareTwoVectors ComplexFenestrationLuminances ComputeDelayedComponents ComputeDifSolExcZonesWIZWindows ComputeIntSolarAbsorpFactors ComputeIntSWAbsorpFactors ComputeIntThermalAbsorpFactors ComputeLifeCycleCostAndReport ComputeLoadComponentDecayCurve ComputeNominalUwithConvCoeffs ComputePresentValue ComputeTariff ComputeTaxAndDepreciation ComputeWinShadeAbsorpFactors CondOutTempResidual ConstructBasis ControlCBVAVOutput ControlCompOutput ControlCompOutput ControlCoolBeam ControlCoolingSystem ControlCycWindACOutput ControlDesiccantDehumidifier ControlDXHeatingSystem ControlDXSystem ControlFluidHeatExchanger ControlHeatingSystem ControlHumidifier ControlMSHPOutput ControlPTUnitOutput ControlPVTcollector ControlReformEIRChillerModel ControlSuppHeatSystem ControlUnitarySystemOutput ControlUnitarySystemtoLoad ControlUnitarySystemtoSP ControlVRF ControlVSEvapUnitToMeetLoad ControlVSHPOutput ControlVSHPOutput ConvectionFactor ConvertCasetoLower ConvertCasetoUpper ConvertIP ConvertIPdelta ConvertToElementTag ConvertToEscaped CoolBeamResidual CoolingCoil CoolWaterHumRatResidual CoolWaterTempResidual CoolWatertoAirHPHumRatResidual CoolWatertoAirHPTempResidual CorrectZoneAirTemp CorrectZoneContaminants CorrectZoneHumRat CostInfoOut CPCW CPHW CreateBoundaryList CreateBoundaryListCount CreateCategoryNativeVariables CreateCellArray CreateCurrentDateTimeString CreateDefaultComputation CreateEnergyReportStructure CreateFCfactorConstructions CreateHVACStepFullString CreateHVACTimeIntervalString CreateHVACTimeString CreateNewellAreaVector CreateNewellSurfaceNormalVector CreatePartitionCenterList CreatePartitionRegionList CreatePredefinedMonthlyReports CreateRegionList CreateRegionListCount CreateShadedWindowConstruction CreateSQLiteConstructionsTable CreateSQLiteConstructionsTable CreateSQLiteDatabase CreateSQLiteDatabase CreateSQLiteDaylightMap CreateSQLiteDaylightMap CreateSQLiteDaylightMapTitle CreateSQLiteDaylightMapTitle CreateSQLiteEnvironmentPeriodRecord CreateSQLiteEnvironmentPeriodRecord CreateSQLiteErrorRecord CreateSQLiteErrorRecord CreateSQLiteInfiltrationTable CreateSQLiteInfiltrationTable CreateSQLiteMaterialsTable CreateSQLiteMaterialsTable CreateSQLiteMeterDictionaryRecord CreateSQLiteMeterDictionaryRecord CreateSQLiteMeterRecord CreateSQLiteMeterRecord CreateSQLiteNominalBaseboardHeatTable CreateSQLiteNominalBaseboardHeatTable CreateSQLiteNominalElectricEquipmentTable CreateSQLiteNominalElectricEquipmentTable CreateSQLiteNominalGasEquipmentTable CreateSQLiteNominalGasEquipmentTable CreateSQLiteNominalHotWaterEquipmentTable CreateSQLiteNominalHotWaterEquipmentTable CreateSQLiteNominalLightingTable CreateSQLiteNominalLightingTable CreateSQLiteNominalOtherEquipmentTable CreateSQLiteNominalOtherEquipmentTable CreateSQLiteNominalPeopleTable CreateSQLiteNominalPeopleTable CreateSQLiteNominalSteamEquipmentTable CreateSQLiteNominalSteamEquipmentTable CreateSQLiteReportVariableDataRecord CreateSQLiteReportVariableDataRecord CreateSQLiteReportVariableDictionaryRecord CreateSQLiteReportVariableDictionaryRecord CreateSQLiteRoomAirModelTable CreateSQLiteRoomAirModelTable CreateSQLiteSchedulesTable CreateSQLiteSimulationsRecord CreateSQLiteSimulationsRecord CreateSQLiteStringTableRecord CreateSQLiteSurfacesTable CreateSQLiteSurfacesTable CreateSQLiteTabularDataRecords CreateSQLiteTabularDataRecords CreateSQLiteTimeIndexRecord CreateSQLiteTimeIndexRecord CreateSQLiteVentilationTable CreateSQLiteVentilationTable CreateSQLiteZoneGroupTable CreateSQLiteZoneGroupTable CreateSQLiteZoneListTable CreateSQLiteZoneListTable CreateSQLiteZoneTable CreateSQLiteZoneTable CreateStormWindowConstructions CreateSysTimeIntervalString CreateTCConstructions CreateTimeIntervalString CreateTimeString CreatExtBooundCondName CreateZoneExtendedOutput CreateZoneExtendedOutput CrossProduct CrossProduct cSurfaceClass CTRANS CurveValue DateToString DateToStringWithMonth DaylghtAltAndAzimuth DayltgAveInteriorReflectance DayltgClosestObstruction DayltgCrossProduct DayltgCurrentExtHorizIllum DayltgDirectIllumComplexFenestration DayltgDirectSunDiskComplexFenestration DayltgElecLightingControl DayltgExtHorizIllum DayltgGlare DayltgGlarePositionFactor DayltgGlareWithIntWins DayltgHitBetWinObstruction DayltgHitInteriorObstruction DayltgHitObstruction DayltgInteriorIllum DayltgInteriorMapIllum DayltgInteriorTDDIllum DayltgInterReflectedIllum DayltgInterReflectedIllumComplexFenestration DayltgInterReflIllFrIntWins DayltgLuminousEfficacy DayltgPierceSurface DayltgSetupAdjZoneListsAndPointers DayltgSkyLuminance DayltgSurfaceLumFromSun dCheckScheduleValueMinMax1 dCheckScheduleValueMinMax2 DeallocateLoadComponentArrays DebugRootFinder DecodeHHMMField DecodeMonDayHrMin DeflectionTemperatures DeflectionWidths DegradF DElightDaylightCoefficients DElightDaylightCoefficients DElightElecLtgCtrl DElightElecLtgCtrl DElightFreeMemory DElightFreeMemory DElightInputGenerator DElightInputGenerator DElightOutputGenerator DElightOutputGenerator DensityCFSFillGas Depth DERIV DetailsForSurfaces DetectOscillatingZoneTemp DetermineAzimuthAndTilt DetermineBranchFlowRequest DetermineBuildingFloorArea DetermineDateTokens DetermineFrequency DetermineIndexGroupFromMeterGroup DetermineIndexGroupKeyFromMeterName DetermineMaxBackSurfaces DetermineMeterIPUnits DetermineMinuteForReporting DeterminePolygonOverlap DetermineShadowingCombinations DetermineSunUpDown DevelopMesh DiffuseAverage DiffuseAverageProfAngGnd DiffuseAverageProfAngSky DisplayMaterialRoughness DisplayNumberandString DisplaySimDaysProgress DisplayString distance DistributeBBElecRadGains DistributeBBRadGains DistributeBBSteamRadGains DistributeHTRadGains DistributePlantLoad DistributePressureOnBranch DistributeTDDAbsorbedSolar DistributeUserDefinedPlantLoad DL_RES_r2 DLAG DOE2DXCoilHumRatResidual DOE2DXCoilHumRatResidual DOE2DXCoilResidual DOE2DXCoilResidual DOE2DXCoilResidual DoEndOfIterationOperations DomainRectangle_Contains DOMakeUPPERCase DoOneTimeInitializations DOSameString DoShadeControl DoStartOfTimeStepInitializations DownInterpolate4HistoryValues DumpAirLoopStatistics DumpCurrentLineBuffer DUMPVD DUMPVR DXCoilCyclingHumRatResidual DXCoilCyclingHumRatResidual DXCoilCyclingResidual DXCoilCyclingResidual DXCoilVarSpeedHumRatResidual DXCoilVarSpeedHumRatResidual DXCoilVarSpeedResidual DXCoilVarSpeedResidual DXFOut DXFOutLines DXFOutWireFrame DXHeatingCoilResidual DXHeatingCoilResidual DXHeatingCoilResidual DynamicClothingModel DynamicExtConvSurfaceClassification DynamicIntConvSurfaceClassification EchoOutActuatorKeyChoices EchoOutInternalVariableChoices EffectiveEPSLB EffectiveEPSLF EIRChillerHeatRecovery EN673ISO10292 EncodeMonDayHrMin EndEnergyPlus EndUniqueNodeCheck EnthalpyResidual epElapsedTime epGetTimeUsed epGetTimeUsedperCall epStartTime epStopTime epSummaryTimes eptime EQLWindowInsideEffectiveEmiss EQLWindowOutsideEffectiveEmiss EQLWindowSurfaceHeatBalance EquationsSolver ERF EstimateHEXSurfaceArea EvalInsideMovableInsulation EvalOutsideMovableInsulation EvaluateAdiabaticSurfaceTemperature EvaluateBasementCellTemperature EvaluateCellNeighborDirections evaluateChargeBlock evaluateChargeSimple EvaluateExpression EvaluateExtHcModels EvaluateFarfieldBoundaryTemperature EvaluateFarfieldCharacteristics EvaluateFieldCellTemperature EvaluateGroundSurfaceTemperature EvaluateIntHcModels EvaluateLoopSetPointLoad EvaluateNeighborCharacteristics evaluateQualify evaluateRatchet EvaluateSoilRhoCp EvaluateStack EvolveParaUCSDCV ExitCalcController ExpandComplexState ExpressAsCashFlows ExtendObjectDefinition ExteriorBCEqns ExternalInterfaceExchangeVariables ExternalInterfaceInitializeErlVariable ExternalInterfaceSetErlVariable ExternalInterfaceSetSchedule ExtOrIntShadeNaturalFlow Fabric_EstimateDiffuseProps FACSKY FalsePositionMethod FEQX FI FigureACAncillaries FigureAirEnthalpy FigureAirHeatCap FigureAuxilHeatGasHeatCap FigureBeamSolDiffuseReflFactors FigureBeamSolSpecularReflFactors FigureConstGradPattern FigureDayltgCoeffsAtPointsForSunPosition FigureDayltgCoeffsAtPointsForWindowElements FigureDayltgCoeffsAtPointsSetupForWindow FigureElectricalStorageZoneGains FigureFuelCellZoneGains FigureFuelEnthalpy FigureFuelHeatCap FigureGaseousWaterEnthalpy FigureHeightPattern FigureHXleavingGasHeatCap FigureInverterZoneGains FigureLHVofFuel FigureLiquidWaterEnthalpy FigureLiquidWaterHeatCap FigureMapPointDayltgFactorsToAddIllums FigureMicroCHPZoneGains FigureNDheightInZone FigurePowerConditioningLosses FigureProductGasesEnthalpy FigureProductGasHeatCap FigureRefPointDayltgFactorsToAddIllums FigureRefrigerationZoneGains FigureSolarBeamAtTimestep FigureSunCosines FigureSurfMapPattern FigureTDDZoneGains FigureTransformerZoneGains FigureTransientConstraints FigureTwoGradInterpPattern FILJAC FillBasisElement FillDefaultsSWP FillRemainingPredefinedEntries FillWeatherPredefinedEntries film filmg filmi filmPillar FILSKY FinalizeCFS FinalizeCFSLAYER FinalRateCoils FindAirLoopBranchConnection FindAirPlantCondenserLoopFromBranchList FindAllNumbersinList FindArrayIndex FindCompSPInput FindCompSPLoad FindCondenserLoopBranchConnection FindControlledZoneIndexFromSystemNodeNumberForZone FindDeltaTempRangeInput FindDemandSideMatch FindEMSVariable FindFirstLastPtr FindFirstRecord FindGlycol FindHXDemandSideLoopFlow FindInBasis FindItem FindIteminList FindIteminSortedList FindItemInVariableList FindLoopSideInCallingOrder FindNextRecord FindNonSpace FindNumberinList FindOAMixerMatchForOASystem FindPlantLoopBranchConnection FindRangeBasedOrUncontrolledInput FindRangeVariable FindRefrigerant FindRootSimpleController FindStratifiedTankSensedTemp FindTariffIndex FindTDDPipe FindUnitNumber FinishDebugOutputFiles FixViewFactors FluidCellInformation_ctor FM_BEAM FM_DIFF FM_F FNU forcedventilation FourPipeInductionUnitHasMixer FourPipeIUCoolingResidual FourPipeIUHeatingResidual FRA FrostControl FrostControlSetPointLimit FrostControlSetPointLimit FuelCellProductGasEnthResidual FUN FuncDetermineCoolantWaterExitTemp FuncDetermineCWMdotForInternalFlowControl FuncDetermineEngineTemp FV GasElecHeatingCoilResidual GASSES90 GassesLow GatherBEPSResultsForTimestep GatherBinResultsForTimestep GatherComponentLoadsHVAC GatherComponentLoadsIntGain GatherComponentLoadsSurfAbsFact GatherComponentLoadsSurface GatherForEconomics GatherForPredefinedReport GatherHeatGainReport GatherMonthlyResultsForTimestep GatherPeakDemandForTimestep GatherSourceEnergyEndUseResultsForTimestep GaussElimination generate_ears GenerateDElightDaylightCoefficients GenerateDElightDaylightCoefficients GeneratorPowerOutput GenericCrack GenOutputVariablesAuditReport Get2DMatrix Get2DMatrixDimensions GET_COMMAND GET_COMMAND_ARGUMENT Get_Environment_Variable GetActualDXCoilIndex GetAirBranchIndex GetAirFlowFlag GetAirflowNetworkInput GetAirHeatBalanceInput GetAirLoopAvailabilityManager GetAirModelDatas GetAirNodeData GetAirPathData GetAngleFactorList GetATMixer GetATMixerOutNode GetATMixerPriNode GetATMixers GetATMixerSecNode GetAttShdSurfaceData GetAverageTempByType GetBaseboardInput GetBaseboardInput GetBasementFloorHeatFlux GetBasementWallHeatFlux GetBLASTAbsorberInput GetBoilerInput GetBoilerInput GetBranchData GetBranchFanTypeName GetBranchFlow GetBranchInput GetBranchList GetBranchListInput GetBuildingData GetCBVAV GetCellWidths GetCellWidthsCount GetChildrenData GetChillerheaterInput GetCoilAirFlowRate GetCoilAirFlowRateVariableSpeed GetCoilAirInletNode GetCoilAirOutletNode GetCoilAvailScheduleIndex GetCoilCapacity GetCoilCapacity GetCoilCapacity GetCoilCapacity GetCoilCapacity GetCoilCapacity GetCoilCapacityByIndexType GetCoilCapacityVariableSpeed GetCoilCondenserInletNode GetCoilControlNodeNum GetCoilGroupTypeNum GetCoilIndex GetCoilIndex GetCoilIndex GetCoilIndexVariableSpeed GetCoilInletNode GetCoilInletNode GetCoilInletNode GetCoilInletNode GetCoilInletNode GetCoilInletNode GetCoilInletNodeVariableSpeed GetCoilMaxSteamFlowRate GetCoilMaxWaterFlowRate GetCoilMaxWaterFlowRate GetCoilMaxWaterFlowRate GetCoilObjectTypeNum GetCoilOutletNode GetCoilOutletNode GetCoilOutletNode GetCoilOutletNode GetCoilOutletNode GetCoilOutletNode GetCoilOutletNodeVariableSpeed GetCoilSteamInletNode GetCoilSteamOutletNode GetCoilTypeNum GetCoilWaterInletNode GetCoilWaterInletNode GetCoilWaterOutletNode GetColumnUsingTabs GetComfortSetpoints GetComponentData GetCondFDInput GetConductivityGlycol GetConnectorList GetConnectorListInput GetConstCOPChillerInput GetConstructData GetControlledZoneIndex GetControllerActuatorNodeNum GetControllerInput GetCoolBeams GetCoolingCoilTypeNameAndIndex GetCooltower GetCostEstimateInput GetCrossVentData GetCTGeneratorInput GetCTGeneratorResults GetCurrentHVACTime GetCurrentMeterValue GetCurrentScheduleValue GetCurveCheck GetCurveIndex GetCurveInput GetCurveMinMaxValues GetCurveName GetCurveObjectTypeNum GetCurveType GetCustomMeterInput GetDaylightingParametersDetaild GetDaylightingParametersInput GetDayScheduleIndex GetDemandManagerInput GetDemandManagerListInput GetDensityGlycol GetDesiccantDehumidifierInput GetDesignDayData GetDesignLightingLevelForZone GetDetShdSurfaceData GetDirectAirInput GetDisplacementVentData GetDSTData GetDualDuctInput GetDualDuctOutdoorAirRecircUse GetDuctInput GetDXCoilAirFlow GetDXCoilAvailSchPtr GetDXCoilBypassedFlowFrac GetDXCoilCapFTCurveIndex GetDXCoilIndex GetDXCoilNumberOfSpeeds GetDXCoils GetDXCoolingSystemInput GetDXHeatPumpSystemInput GetEarthTube GetElecReformEIRChillerInput GetElectricBaseboardInput GetElectricChillerInput GetElectricEIRChillerInput GetEMSInput GetEngineDrivenChillerInput GetEnvironmentalImpactFactorInfo GetEvapFluidCoolerInput GetEvapInput GetExhaustAbsorberInput GetExhaustAirInletNode GetExteriorEnergyUseInput GetExtVentedCavityIndex GetExtVentedCavityIndex GetExtVentedCavityTsColl GetExtVentedCavityTsColl GetFanAvailSchPtr GetFanCoilIndex GetFanCoilInletAirNode GetFanCoilMixedAirNode GetFanCoilOutAirNode GetFanCoilReturnAirNode GetFanCoilUnits GetFanCoilZoneInletAirNode GetFanDesignVolumeFlowRate GetFanIndex GetFanIndexForTwoSpeedCoil GetFanInletNode GetFanInput GetFanOutletNode GetFanPower GetFanSpeedRatioCurveIndex GetFanType GetFanVolFlow GetFarfieldTemp GetFirstBranchInletNodeName GetFluidCoolerInput GetFluidDensityTemperatureLimits GetFluidHeatExchangerInput GetFluidPropertiesData GetFluidSpecificHeatTemperatureLimits GetFrameAndDividerData GetFuelCellGeneratorInput GetFuelCellGeneratorResults GetFuelFactorInfo GetFurnaceInput GetGasAbsorberInput GetGeneratorFuelSupplyInput GetGeometryParameters GetGlycolNameByIndex GetGroundheatExchangerInput GetGroundReflectances GetGroundTemps GetGshpInput GetGshpInput GetGTChillerInput GetHeatBalanceInput GetHeatBalHAMTInput GetHeatExchangerObjectTypeNum GetHeatingCoilIndex GetHeatingCoilInput GetHeatingCoilNumberOfStages GetHeatingCoilPLFCurveIndex GetHeatingCoilTypeNum GetHeatReclaimSourceIndex GetHeatRecoveryInput GetHighTempRadiantSystem GetHPCoolingCoilIndex GetHTSubSurfaceData GetHTSurfaceData GetHTSurfExtVentedCavityData GetHumidifierInput GetHVACSingleDuctSysIndex GetHWBaseboardInput GetHXAssistedCoolingCoilInput GetHXCoilAirFlowRate GetHXCoilType GetHXCoilTypeAndName GetHXDXCoilIndex GetHXDXCoilName GetHybridVentilationControlStatus GetHybridVentilationInputs GetICEGeneratorResults GetICEngineGeneratorInput GetIceStorageInput GetIDFRecordsStats GetIndirectAbsorberInput GetIndUnits GetInputEconomicsChargeBlock GetInputEconomicsChargeSimple GetInputEconomicsComputation GetInputEconomicsCurrencyType GetInputEconomicsQualify GetInputEconomicsRatchet GetInputEconomicsTariff GetInputEconomicsVariable GetInputForLifeCycleCost GetInputFuelAndPollutionFactors GetInputLifeCycleCostNonrecurringCost GetInputLifeCycleCostParameters GetInputLifeCycleCostRecurringCosts GetInputLifeCycleCostUseAdjustment GetInputLifeCycleCostUsePriceEscalation GetInputTabularMonthly GetInputTabularPredefined GetInputTabularStyle GetInputTabularTimeBins GetInputViewFactors GetInputViewFactorsbyName GetInputZoneEvaporativeCoolerUnit GetInstantMeterValue GetInternalBranchData GetInternalHeatGainsInput GetInternalVariableValue GetInternalVariableValue GetInternalVariableValueExternalInterface GetInternalVariableValueExternalInterface GetInterpolatedSatProp GetInterpValue GetIntMassSurfaceData GetLastBranchOutletNodeName GetLastWord GetLightWellData GetListOfObjectsInIDD GetListofSectionsinInput GetLocationInfo GetLoopMixer GetLoopSidePumpIndex GetLoopSplitter GetLowTempRadiantSystem GetMaterialData GetMatrixInput getMaxAndSum GetMeteredVariables GetMeterIndex GetMeterResourceType GetMicroCHPGeneratorInput GetMicroCHPGeneratorResults GetMinOATCompressor GetMixerInput GetMixerInput GetMoistureBalanceEMPDInput GetMonthlyCostForResource GetMovableInsulationData GetMSHeatPumpInput GetMTGeneratorExhaustNode GetMTGeneratorInput GetMTGeneratorResults GetMundtData GetNewUnitNumber GetNextEnvironment GetNodeConnectionType GetNodeList GetNodeListsInput GetNodeNums GetNTUforCrossFlowBothUnmixed GetNumberOfSchedules GetNumberOfSurfaceLists GetNumberOfSurfListVentSlab GetNumChildren GetNumMeteredVariables GetNumOAControllers GetNumOAMixers GetNumOASystems GetNumObjectsFound GetNumObjectsInIDD GetNumRangeCheckErrorsFound GetNumSectionsFound GetNumSectionsinInput GetNumSegmentsForHorizontalTrenches GetNumSplitterMixerInConntrList GetOACompListNumber GetOACompName GetOACompType GetOACompTypeNum GetOAControllerInputs GetOAMixerIndex GetOAMixerInletNodeNumber GetOAMixerInputs GetOAMixerMixedNodeNumber GetOAMixerNodeNumbers GetOAMixerReliefNodeNumber GetOAMixerReturnNodeNumber GetOARequirements GetOASysControllerListIndex GetOASysNumCoolingCoils GetOASysNumHeatingCoils GetOASysNumSimpControllers GetOASystemNumber GetObjectDefInIDD GetObjectDefMaxArgs GetObjectItem GetObjectItemfromFile GetObjectItemNum GetOnlySingleNode GetOperationSchemeInput GetOSCData GetOSCMData GetOutAirNodesInput GetOutdoorAirUnitInputs GetOutdoorAirUnitOutAirNode GetOutdoorAirUnitReturnAirNode GetOutdoorAirUnitZoneInletNode GetOutsideAirSysInputs GetOutsideEnergySourcesInput GetParentData GetPipeInput GetPipesHeatTransfer GetPipingSystemsInput GetPIUs GetPlantAvailabilityManager GetPlantInput GetPlantLoopData GetPlantOperationInput GetPlantProfileInput GetPlantSizingInput GetPlantValvesInput GetPollutionFactorInput GetPondGroundHeatExchanger GetPowerManagerInput GetPressureCurveTypeAndIndex GetPressureSystemInput GetPreviousHVACTime GetProjectControlData GetProjectData GetPTUnit GetPTUnitMixedAirNode GetPTUnitOutAirNode GetPTUnitReturnAirNode GetPTUnitZoneInletAirNode GetPumpInput GetPurchasedAir GetPurchasedAirMixedAirHumRat GetPurchasedAirMixedAirTemp GetPurchasedAirOutAirMassFlow GetPurchasedAirReturnAirNode GetPurchasedAirZoneInletAirNode GetPVGeneratorResults GetPVInput GetPVTcollectorsInput GetPVTThermalPowerProduction GetQualityRefrig GetRecordLocations GetRectDetShdSurfaceData GetRectSubSurfaces GetRectSurfaces GetRefrigeratedRackIndex GetRefrigerationInput GetReportVariableInput GetRequiredMassFlowRate GetResidCrossFlowBothUnmixed GetResourceTypeChar GetReturnAirNodeForZone GetReturnAirPathInput GetRoomAirModelParameters GetRunPeriodData GetRunPeriodDesignData GetRuntimeLanguageUserInput GetSatDensityRefrig GetSatEnthalpyRefrig GetSatPressureRefrig GetSatSpecificHeatRefrig GetSatTemperatureRefrig GetScheduledSurfaceGains GetScheduleIndex GetScheduleMaxValue GetScheduleMinValue GetScheduleName GetScheduleType GetScheduleValuesForDay GetSecondaryInletNode GetSecondaryOutletNode GetSetPointManagerInputs GetShadingSurfReflectanceData GetShadowingInput GetShelfInput GetSimpleAirModelInputs GetSimpleShdSurfaceData GetSimpleWatertoAirHPInput GetSingleDayScheduleValues GetSiteAtmosphereData GetSizingParams GetSnowGroundRefModifiers GetSolarCollectorInput GetSpecialDayPeriodData GetSpecificHeatGlycol getSpecificUnitDivider getSpecificUnitIndex getSpecificUnitMultiplier GetSplitterInput GetSplitterInput GetSplitterNodeNumbers GetSplitterOutletNumber GetStandAloneERV GetStandAloneERVNodes GetStandAloneERVOutAirNode GetStandAloneERVReturnAirNode GetStandAloneERVZoneInletAirNode GetStandardMeterResourceType GetSteamBaseboardInput GetSteamCoilAvailScheduleIndex GetSteamCoilControlNodeNum GetSteamCoilIndex GetSteamCoilInput GetSTM GetStormWindowData GetSupHeatDensityRefrig GetSupHeatEnthalpyRefrig GetSupHeatPressureRefrig GetSupplyAirFlowRate GetSupplyAirFlowRate GetSupplyAirInletNode GetSupplyInletNode GetSupplyOutletNode GetSurfaceCountForOSCM GetSurfaceData GetSurfaceGroundHeatExchanger GetSurfaceHeatTransferAlgorithmOverrides GetSurfaceIndecesForOSCM GetSurfaceListsInputs GetSurfHBDataForMundtModel GetSurfHBDataForTempDistModel GetSysAvailManagerInputs GetSysAvailManagerListInputs GetSysInput GetSystemNodeNumberForZone GetSystemSizingInput GetTDDInput GetTESCoilIndex GetTESCoilInput GetThermalChimney GetTowerInput GetTranspiredCollectorIndex GetTranspiredCollectorInput GetTypeOfCoil GetUFADZoneData GetUnitarySystemDXCoolingCoilIndex GetUnitarySystemInput GetUnitarySystemOAHeatCoolCoil GetUnitConversion GetUnitHeaterInput GetUnitsString GetUnitSubString GetUnitVentilatorInput GetUnitVentilatorMixedAirNode GetUnitVentilatorOutAirNode GetUnitVentilatorReturnAirNode GetUnitVentilatorZoneInletAirNode GetUserConvectionCoefficients GetUserDefinedComponents GetUserDefinedOpSchemeInput GetUserDefinedPatternData GetUTSCTsColl GetVariableKeyCountandType GetVariableKeyCountandType GetVariableKeys GetVariableKeys GetVariableTypeAndIndex GetVariableUnitsString GetVarSpeedCoilInput GetVentilatedSlabInput GetVertices GetViscosityGlycol GetVRFInput GetVSCoilCondenserInletNode GetVSCoilMinOATCompressor GetVSCoilNumOfSpeeds GetWaterCoilAvailScheduleIndex GetWaterCoilCapacity GetWaterCoilIndex GetWaterCoilInput GetWaterMainsTemperatures GetWaterManagerInput GetWaterSource GetWaterThermalTankInput GetWatertoAirHPInput GetWatertoWaterHPInput GetWaterUseInput GetWeatherProperties GetWeatherStation GetWindowAC GetWindowACMixedAirNode GetWindowACOutAirNode GetWindowACReturnAirNode GetWindowACZoneInletAirNode GetWindowGapAirflowControlData GetWindowGlassSpectralData GetWindowShadingControlData GetWindTurbineInput GetWrapperInput GetWTGeneratorResults GetZoneAirDistribution GetZoneAirLoopEquipment GetZoneAirSetpoints GetZoneAndZoneListNames GetZoneContaminanInputs GetZoneContaminanSetpoints GetZoneData GetZoneDehumidifierInput GetZoneDehumidifierNodeNumber GetZoneEqAvailabilityManager GetZoneEquipment GetZoneEquipmentData GetZoneEquipmentData1 GetZoneInfilAirChangeRate GetZoneLoads GetZonePlenumInput GetZoneSizingInput GLtoAMB GoAhead guess HasFractionalScheduleValue hatter HCInWindowStandardRatings HConvGap HcUCSDCV HcUCSDDV HcUCSDUF HeatingCoilVarSpeedCycResidual HeatingCoilVarSpeedResidual HeatPumpRunFrac HeatPumpRunFrac HeatPumpRunFrac HeatWatertoAirHPTempResidual Height HEMINT HIC_ASHRAE HotWaterCoilResidual HotWaterCoilResidual HotWaterCoilResidual HotWaterCoilResidual HotWaterCoilResidual HotWaterHeatingCoilResidual HRadPar HTRANS HTRANS0 HTRANS1 HWBaseboardUAResidual HXAssistDXCoilResidual HXAssistedCoolCoilHRResidual HXAssistedCoolCoilHRResidual HXAssistedCoolCoilTempResidual HXAssistedCoolCoilTempResidual HXDemandSideLoopFlowResidual HybridVentilationControl IAM iCheckScheduleValue ICSCollectorAnalyticalSoluton iGetCoilAirOutletNode iGetCoilSteamInletNode iGetCoilSteamOutletNode INCLOS incrementEconVar IncrementInstMeterCache incrementSteps incrementTableEntry InitAirflowNetwork InitAirflowNetworkData InitAirHeatBalance InitAirLoops InitAirLoopSplitter InitAirMixer InitAirTerminalUserDefined InitAirZoneReturnPlenum InitAirZoneSupplyPlenum InitATMixer InitBaseboard InitBaseboard InitBLASTAbsorberModel InitBoiler InitBoiler InitBoreholeHXSimVars InitBSDFWindows InitCBVAV InitCoilUserDefined InitComplexWindows InitComponentNodes InitConductionTransferFunctions InitConnections InitConstCOPChiller InitController InitCoolBeam InitCTGenerators InitCurveReporting InitDaylightingDevices InitDemandManagers InitDesiccantDehumidifier InitDetailedIceStorage InitDirectAir InitDualDuct InitDuct InitDXCoil InitDXCoolingSystem InitDXHeatPumpSystem InitElecReformEIRChiller InitElectricBaseboard InitElectricChiller InitElectricEIRChiller InitEMS InitEMSControlledConstructions InitEMSControlledSurfaceProperties InitEnergyReports InitEngineDrivenChiller InitEquivalentLayerWindowCalculations InitEvapCooler InitEvapFluidCooler InitExhaustAbsorber InitExteriorConvectionCoeff InitFan InitFanCoilUnits InitFluidCooler InitFluidHeatExchanger InitFuelCellGenerators InitFurnace InitGasAbsorber InitGlassOpticalCalculations InitGshp InitGshp InitGTChiller InitHeatBalance InitHeatBalFiniteDiff InitHeatBalHAMT InitHeatingCoil InitHeatRecovery InitHighTempRadiantSystem InitHumidifier InitHWBaseboard InitHXAssistedCoolingCoil InitHybridVentSysAvailMgr InitialInitHeatBalFiniteDiff InitializeCFSDaylighting InitializeCFSStateData InitializeComponentSizingTable InitializeConstructionsTables InitializeDaylightMapTables InitializeEnvironmentPeriodsTable InitializeErrorsTable InitializeGlycolTempLimits InitializeHeatTransferPipes InitializeIndexes InitializeIndexes InitializeLoops InitializeMaterialsTable InitializeMeters initializeMonetaryUnit InitializeNominalBaseboardHeatTable InitializeNominalElectricEquipmentTable InitializeNominalGasEquipmentTable InitializeNominalHotWaterEquipmentTable InitializeNominalInfiltrationTable InitializeNominalLightingTable InitializeNominalOtherEquipmentTable InitializeNominalPeopleTable InitializeNominalSteamEquipmentTable InitializeNominalVentilationTable InitializeOperatingMode InitializeOutput InitializePipes InitializePredefinedMonthlyTitles InitializePsychRoutines InitializePumps InitializeRefrigerantLimits InitializeReportMeterDataDictionaryTable InitializeReportMeterDataTables InitializeReportVariableDataDictionaryTable InitializeReportVariableDataTables InitializeRoomAirModelTable InitializeRootFinder InitializeRuntimeLanguage InitializeSchedulesTable InitializeSimulationsTable InitializeSQLiteTables InitializeSurfacesTable InitializeSystemSizingTable InitializeTabularDataTable InitializeTabularDataTable InitializeTabularDataView InitializeTabularDataView InitializeTabularMonthly InitializeTimeIndicesTable InitializeViews InitializeWeather InitializeZoneGroupTable InitializeZoneInfoTable InitializeZoneListTable InitializeZoneSizingTable InitICEngineGenerators InitIndirectAbsorpChiller InitIndUnit InitInteriorConvectionCoeffs InitInteriorRadExchange InitInternalHeatGains InitIntSolarDistribution InitLoadBasedControl InitLoadDistribution InitLowTempRadiantSystem InitMicroCHPNoNormalizeGenerators InitMoistureBalanceEMPD InitMSHeatPump InitMTGenerators InitMundtModel InitOAController InitOAMixer InitOneTimePlantSizingInfo InitOutAirNodes InitOutdoorAirUnit InitOutsideAirSys InitPipesHeatTransfer InitPipingSystems InitPIU InitPlantProfile InitPlantUserComponent InitPlantValves InitPollutionMeterReporting InitPondGroundHeatExchanger InitPressureDrop InitPTUnit InitPurchasedAir InitPVTcollectors InitRefrigeration InitRefrigerationPlantConnections InitReturnAirPath InitSecretObjects InitSetPointManagers InitSimpleIceStorage InitSimpleMixingConvectiveHeatGains InitSimpleWatertoAirHP InitSimVars InitSimVars InitSimVars InitSimVars InitSolarCalculations InitSolarCollector InitSolarHeatGains InitSolReflRecSurf InitStandAloneERV InitSteamBaseboard InitSteamCoil InitSurfaceGroundHeatExchanger InitSurfaceHeatBalance InitSys InitSysAvailManagers InitSystemOutputRequired InitTempDistModel InitTESCoil InitThermalAndFluxHistories InitThermalComfort InitTower InitTranspiredCollector InitTRNSYSPV InitUCSDCV InitUCSDDV InitUCSDUF InitUniqueNodeCheck InitUnitarySystems InitUnitHeater InitUnitVentilator InitVarSpeedCoil InitVentilatedSlab InitVRF InitWaterCoil InitWaterSource InitWaterThermalTank InitWatertoAirHP InitWatertoWaterHP InitWindowAC InitWindTurbine InitWrapper InitZoneAirLoopEquipment InitZoneAirSetpoints InitZoneAirUserDefined InitZoneContSetpoints InitZoneDehumidifier InitZoneEquipment InitZoneEvaporativeCoolerUnit InPolygon InsertCurrencySymbol int_times_vector INTCPT Integer_IsInRange IntegerIsWithinTwoValues IntegerToString InterConnectTwoPlantLoopSides InteriorBCEqns InteriorNodeEqns InternalRangeCheck InternalSetupTankDemandComponent InternalSetupTankSupplyComponent interp INTERP InterpBlind InterpDefValuesForGlycolConc Interpolate Interpolate_Lagrange InterpolateBetweenFourValues InterpolateBetweenTwoValues InterpolatePipeTransBeam InterpProfAng InterpProfSlatAng InterpretWeatherDataLine InterpSlatAng InterpSw InterpValuesForGlycolConc IntInterfaceNodeEqns IntPreDefTableEntry IntToStr Invert3By3Matrix InvertMatrix InvJulianDay IPTrimSigDigits iRoundSigDigits IS_BEAM IS_DIFF IS_DSRATIO IS_F IS_LWP IS_OPENNESS IS_SWP isCompLoadRepReq IsControlledShade IsConverged_CurrentToPrevIteration IsConverged_PipeCurrentToPrevIteration IsCurveInputTypeValid IsCurveOutputTypeValid isExternalInterfaceErlVariable IsGlazeLayerX IsGZSLayer isInQuadrilateral IsInRange isInTriangle IsLeapYear IsNodeOnSetPtManager IsParentObject IsParentObjectCompSet IsShadingLayer IssueSevereAlphaInputFieldError IssueSevereInputFieldError IssueSevereRealInputFieldError IsValidConnectionType IsVBLayer isWithinRange ITERATE IterateRootFinder iTrimSigDigits JGDate JulianDay LClimb LDSumMax LDSumMean LEEDtariffReporting LimitCoilCapacity LimitController LimitTUCapacity LinesOut linint LoadEquipList LoadInterface LogicalToInteger LogicalToInteger LogPlantConvergencePoints lookupOperator LookUpScheduleValue LookUpSeason LookupSItoIP lubksb LUBKSB ludcmp LUDCMP LUdecomposition LUsolution MakeAnchorName MakeHVACTimeIntervalString MakeMirrorSurface MakeRectangularVertices MakeRelativeRectangularVertices MakeTransition MakeUPPERCase ManageAirflowNetworkBalance ManageAirHeatBalance ManageAirLoops ManageAirModel ManageBranchInput ManageControllers ManageCoolTower ManageDemand ManageEarthTube ManageElectCenterStorageInteractions ManageElectricLoadCenters ManageElectStorInteractions ManageEMS ManageExteriorEnergyUse ManageGeneratorControlState ManageGeneratorFuelFlow ManageHeatBalance ManageHeatBalFiniteDiff ManageHeatBalHAMT ManageHVAC ManageHybridVentilation ManageInsideAdaptiveConvectionAlgo ManageInternalHeatGains ManageInverter ManageMundtModel ManageNonZoneEquipment ManageOutsideAdaptiveConvectionAlgo ManageOutsideAirSystem ManagePlantLoadDistribution ManagePlantLoops ManageRefrigeratedCaseRacks ManageSetPoints ManageSimulation ManageSingleCommonPipe ManageSizing ManageSurfaceHeatBalance ManageSystemAvailability ManageThermalChimney ManageThermalComfort ManageTransformers ManageTwoWayCommonPipe ManageUCSDCVModel ManageUCSDDVModel ManageUCSDUFModels ManageUserDefinedPatterns ManageWater ManageWaterInits ManageWeather ManageZoneAirLoopEquipment ManageZoneAirUpdates ManageZoneContaminanUpdates ManageZoneEquipment MapExtConvClassificationToHcModels MapIntConvClassificationToHcModels MarkNode MatchAndSetColorTextString MatchPlantSys MatrixIndex matrixQBalance MeshPartition_CompareByDimension MeshPartition_SelectionSort MeshPartitionArray_Contains MinePlantStructForInfo MixedAirControlTempResidual ModifyWindow Modulus MonthToMonthNumber MovingAvg MRXINV MSHPCyclingResidual MSHPHeatRecovery MSHPVarSpeedResidual MultiModeDXCoilHumRatResidual MultiModeDXCoilHumRatResidual MultiModeDXCoilResidual MultiModeDXCoilResidual MultiModeDXCoilResidual MultiSpeedDXCoolingCoilStandardRatings MultiSpeedDXHeatingCoilStandardRatings MULTOL MyPlantSizingIndex NeighborInformationArray_Value NETRAD NewEMSVariable NewExpression newPreDefColumn newPreDefReport newPreDefSubTable NEWTON NodeHasSPMCtrlVarType NormalArea NumBranchesInBranchList NumCompsInBranch nusselt NusseltNumber OpenEPlusWeatherFile OPENNESS_LW OpenOutputFiles OpenOutputTabularFile OpenWeatherFile OPERATOR (*) OPERATOR (+) OPERATOR (-) OPERATOR (.dot.) OPERATOR (.twodcross.) OPERATOR (.twoddot.) OPERATOR (/) ORDER OutBaroPressAt OutDewPointTempAt OutDryBulbTempAt OutsidePipeHeatTransCoef OutWetBulbTempAt P01 PanesDeflection ParametricObjectsCheck parseComputeLine ParseExpression ParseStack ParseTime PartLoadFactor PassiveGapNusseltNumber PassPressureAcrossInterface PassPressureAcrossMixer PassPressureAcrossSplitter PD_BEAM PD_BEAM_CASE_I PD_BEAM_CASE_II PD_BEAM_CASE_III PD_BEAM_CASE_IV PD_BEAM_CASE_V PD_BEAM_CASE_VI PD_DIFF PD_LW PD_LWP PD_SWP PerformanceCurveObject PerformanceTableObject PerformIterationLoop PerformPipeCellSimulation PerformPipeCircuitSimulation PerformSolarCalculations PerformTemperatureFieldUpdate PierceSurface PierceSurfaceVector PipeCircuitInfo_InitInOutCells PipeSegmentInfo_InitPipeCells PIUInducesPlenumAir PIUnitHasMixer PlaneEquation PlantHalfLoopSolver PlantMassFlowRatesFunc PLRResidual PLRResidual PLRResidualMixedTank PLRResidualStratifiedTank PMVResidual POLY1F POLY2F POLYF polygon_contains_point_2d popStack pos PostIPProcessing POWER PreDefTableEntry PredictSystemLoads PredictZoneContaminants PreparePipeCircuitSimulation PrepDebugFilesAndVariables PreProcessorCheck PrepVariablesISO15099 PreScanReportingVariables PresProfile PressureCurveValue ProcessDataDicFile ProcessDateString ProcessEMSInput ProcessEPWHeader ProcessForDayTypes ProcessInput ProcessInputDataFile ProcessIntervalFields ProcessMinMaxDefLine ProcessNumber ProcessScheduleInput ProcessSurfaceVertices ProcessTokens ProduceMinMaxString ProduceMinMaxStringWStartMinute ProduceRDDMDD ProfileAngle PropagateResolvedFlow PStack PsyCpAirFnWTdb PsyHfgAirFnWTdb PsyHFnTdbRhPb PsyHFnTdbW PsyHgAirFnWTdb PsyPsatFnTemp PsyPsatFnTemp_raw PsyRhFnTdbRhov PsyRhFnTdbRhovLBnd0C PsyRhFnTdbWPb PsyRhoAirFnPbTdbW PsyRhovFnTdbRh PsyRhovFnTdbRhLBnd0C PsyRhovFnTdbWPb PsyTdbFnHW PsyTdpFnTdbTwbPb PsyTdpFnWPb PsyTsatFnHPb PsyTsatFnPb PsyTwbFnTdbWPb PsyTwbFnTdbWPb_raw PsyVFnTdbWPb PsyWFnTdbH PsyWFnTdbRhPb PsyWFnTdbTwbPb PsyWFnTdpPb psz Pt2Plane PullCompInterconnectTrigger PumpDataForTable PushBranchFlowCharacteristics PushInnerTimeStepArrays pushStack PushSystemTimestepHistories PushSystemTimestepHistories PushZoneTimestepHistories PushZoneTimestepHistories QsortC QsortPartition RadialCellInfo_XY_CrossSectArea RadialCellInformation_ctor RadialSizing_Thickness Rainflow RangeCheck RB_BEAM RB_DIFF RB_F RB_LWP RB_SWP rCheckDayScheduleValueMinMax rCheckScheduleValue rCheckScheduleValueMinMax1 rCheckScheduleValueMinMax2 ReadEnergyMeters ReadEPlusWeatherForDay ReadGeneralDomainInputs ReadHorizontalTrenchInputs ReadINIFile ReadInputLine ReadPipeCircuitInputs ReadPipeSegmentInputs ReadTableData ReadUserWeatherInput ReadWeatherForDay Real_ConstrainTo Real_IsInRange real_times_vector ReAllocateAndPreserveOutputVariablesForSimulation ReallocateIntegerArray ReallocateIVar ReallocateRealArray ReallocateRVar RealPreDefTableEntry RealToStr RecKeepHeatBalance RecordOutput RectangleF_Contains ReformEIRChillerCondInletTempResidual ReformEIRChillerHeatRecovery RegisterNodeConnection RegisterPlantCompDesignFlow RegulateCondenserCompFlowReqOp ReInitPlantLoopsAtFirstHVACIteration RemoveSpaces RemoveTrailingZeros reorder ReplaceBlanksWithUnderscores ReplaceBlanksWithUnderscores ReportAirflowNetwork ReportAirHeatBalance ReportAirLoopConnections ReportAirTerminalUserDefined ReportAndTestGlycols ReportAndTestRefrigerants ReportBaseboard ReportBaseboard ReportCBVAV ReportChillerIPLV ReportCoilUserDefined ReportCompSetMeterVariables ReportController ReportCoolBeam ReportCoolTower ReportCTFs ReportCWTankInits ReportDemandManagerList ReportDesiccantDehumidifier ReportDetailedIceStorage ReportDirectAir ReportDualDuct ReportDualDuctConnections ReportDuct ReportDXCoil ReportDXCoilRating ReportDYMeters ReportEarthTube ReportEconomicVariable ReportElectricBaseboard ReportEMS ReportEvapCooler ReportEvapFluidCooler ReportExteriorEnergyUse ReportFan ReportFanCoilUnit ReportFatalGlycolErrors ReportFatalRefrigerantErrors ReportFiniteDiffInits ReportFluidCooler ReportFluidHeatExchanger ReportForTabularReports ReportFurnace ReportGlass ReportHeatBalance ReportHeatingCoil ReportHeatRecovery ReportHighTempRadiantSystem ReportHRMeters ReportHumidifier ReportHWBaseboard ReportIllumMap ReportingFreqName ReportingThisVariable ReportInternalHeatGains ReportLoopConnections ReportLowTempRadiantSystem ReportMaxVentilationLoads ReportMeterDetails ReportMissing_RangeData ReportMixer ReportMNMeters ReportMoistureBalanceEMPD ReportMSHeatPump ReportNodeConnections ReportOAController ReportOAMixer ReportOrphanFluids ReportOrphanRecordObjects ReportOrphanSchedules ReportOutdoorAirUnit ReportOutputFileHeaders ReportParentChildren ReportPipesHeatTransfer ReportPIU ReportPlantProfile ReportPlantUserComponent ReportPlantValves ReportPondGroundHeatExchanger ReportPTUnit ReportPumps ReportPurchasedAir ReportPV ReportRackSystem ReportRefrigerationComponents ReportReturnAirPath ReportRuntimeLanguage ReportScheduleDetails ReportScheduleValues ReportSizingOutput ReportSMMeters ReportSolarCollector ReportSplitter ReportStandAloneERV ReportStandAloneWaterUse ReportSteamBaseboard ReportSteamCoil ReportSurfaceErrors ReportSurfaceGroundHeatExchngr ReportSurfaceHeatBalance ReportSurfaces ReportSurfaceShading ReportSys ReportSysSizing ReportSystemEnergyUse ReportThermalChimney ReportTowers ReportTSMeters ReportUnitarySystem ReportUnitHeater ReportUnitVentilator ReportVentilatedSlab ReportVRFCondenser ReportVRFTerminalUnit ReportWarmupConvergence ReportWaterCoil ReportWaterManager ReportWaterThermalTank ReportWaterUse ReportWeatherAndTimeInformation ReportWindowAC ReportWindTurbine ReportZoneAirLoopEquipment ReportZoneAirUserDefined ReportZoneDehumidifier ReportZoneEquipment ReportZoneEvaporativeCoolerUnit ReportZoneMeanAirTemp ReportZoneReturnPlenum ReportZoneSizing ReportZoneSupplyPlenum ResetAllPlantInterConnectFlags ResetController ResetEnvironmentCounter ResetHVACControl ResetNodeData ResetPerformanceCurveOutput ResetRootFinder ResetTerminalUnitFlowLimits ResetWeekDaysByMonth Resimulate resist ReSolveAirLoopControllers ResolveAirLoopFlowLimits ResolveLocationInformation ResolveLockoutFlags ResolveLoopFlowVsPressure ResolveParallelFlows ResolveSysFlow ReverseAndRecalculate RevertZoneTimestepHistories RevertZoneTimestepHistories RevisePlantCallingOrder RezeroZoneSizingArrays RhoH2O RHtoVP RKG RoundSigDigits rRoundSigDigits rTrimSigDigits SafeCopyPlantNode SafeDiv SafeDivide SameString SandiaCellTemperature SandiaEffectiveIrradiance SandiaF1 SandiaF2 SandiaImp SandiaIsc SandiaIx SandiaIxx SandiaModuleTemperature SandiaTcellFromTmodule SandiaVmp SandiaVoc SaveSimpleController ScanForReports ScanPlantLoopsForNodeNum ScanPlantLoopsForObject sCheckDayScheduleValueMinMax ScheduleAverageHoursPerWeek SEARCH SearchAscTable SearchWindow5DataFile SecantFormula SecantMethod selectTariff SetActuatedBranchFlowRate SetAdditionalNeighborData SetAllFlowLocks SetAllPlantSimFlagsToValue SetATMixerPriFlow SetATMixerPriFlow SetAverageAirFlow SetAverageAirFlow SetAverageAirFlow SetAverageAirFlow SetAverageAirFlow SetAverageAirFlow SetCoilDesFlow SetCoilSystemCoolingData SetCoilSystemHeatingDXFlag SetCompFlowRate SetComponentFlowRate SetCurrentWeather SetCurveOutputMinMaxValues SetDSTDateRanges SetDXCoilTypeData SetDXCoolingCoilData SetEquivalentLayerWindowProperties SetErlValueNumber SetExtConvectionCoeff SetFanData SetHeatExchangerData SetHeatToReturnAirFlag SetInitialMeterReportingAndOutputNames SetIntConvectionCoeff SetInternalVariableValue SetMinMax setNativeVariables SetNodeResult SetOAControllerData SetOnOffMassFlowRate SetOnOffMassFlowRate SetOnOffMassFlowRate SetOnOffMassFlowRateVSCoil SetOnOffMassFlowRateVSCoil SetOutAirNodes SetOutBulbTempAt SetPredefinedTables SetSimpleWSHPData SETSKY SetSpecialDayDates SetSpeedVariables SetStormWindowControl SetSurfHBDataForMundtModel SetSurfHBDataForTempDistModel SetSurfTmeanAir SETUP4x4_A SetupAdaptiveConvectionRadiantSurfaceData SetupAdaptiveConvectionStaticMetaData SetupAirLoopControllersTracer SetupAllOutputVariables SetUpAndSort SetupBranchControlTypes SetupCellNeighbors SetupCommonPipes SetupComplexFenestrationMaterialInput SetupComplexFenestrationStateInput SetupComplexWindowStateGeometry SetUpCompSets SetupDElightOutput4EPlus SetupDElightOutput4EPlus SetUpDesignDay SetupEMSActuator SetupEMSIntegerActuator SetupEMSIntegerInternalVariable SetupEMSInternalVariable SetupEMSLogicalActuator SetupEMSRealActuator SetupEMSRealInternalVariable SetupEnvironmentTypes SetupFuelConstituentData SetupGeneratorControlStateManager SetupIndividualControllerTracer SetupInitialPlantCallingOrder SetupIntegerOutputVariable SetupInterpolationValues SetupLoopFlowRequest SetupMeteredVarsForSetPt SetupMundtModel SetupNodeSetpointsAsActuators SetupNodeVarsForReporting SetupOutputVariable SetupPipeCircuitInOutCells SetupPlantEMSActuators SetupPollutionCalculations SetupPollutionMeterReporting SetupPossibleOperators SetupPrimaryAirSystemAvailMgrAsActuators SetupPumpMinMaxFlows SetupRealOutputVariable SetupRealOutputVariable_IntKey SetupReportInput SetupReports SetupRootFinder SetUpSchemeColors SetupShadeSurfacesForSolarCalcs SetupSimpleWindowGlazingSystem SetupSimulation SetupStratifiedNodes SetupSurfaceConstructionActuators SetupSurfaceConvectionActuators SetupSurfaceOutdoorBoundaryConditionActuators SetUpSysSizingArrays SetupTankDemandComponent SetupTankSupplyComponent SetupThermostatActuators SetupTimePointers SetupUnitConversions SetupWeekDaysByMonth SetupWindowShadingControlActuators SetupZoneEquipmentForConvectionFlowRegime SetupZoneGeometry SetupZoneInfoAsInternalDataAvail SetupZoneInternalGain SetupZoneInternalGain SetupZoneSizing SetUpZoneSizingArrays SetUTSCQdotSource SetVarSpeedCoilData SetVentedModuleQdotSource SetVSHPAirFlow SetVSHPAirFlow SetWindSpeedAt SetZoneEquipSimOrder shading shadingedge shadingin SHADOW SharedDVCVUFDataInit SHDBKS SHDGSS SHDRVL SHDSBS shift ShiftPipeTemperaturesForNewIteration ShiftPlantLoopSideCallingOrder ShiftTemperaturesForNewIteration ShiftTemperaturesForNewTimeStep ShowAuditErrorMessage ShowBranchesOnLoop ShowContinueError ShowContinueError ShowContinueErrorTimeStamp ShowContinueErrorTimeStamp ShowErrorMessage ShowErrorMessage ShowFatalError ShowFatalError ShowMessage ShowMessage ShowPsychrometricSummary ShowRecurringContinueErrorAtEnd ShowRecurringContinueErrorAtEnd ShowRecurringErrors ShowRecurringSevereErrorAtEnd ShowRecurringSevereErrorAtEnd ShowRecurringWarningErrorAtEnd ShowRecurringWarningErrorAtEnd ShowSevereError ShowSevereError ShowSevereMessage ShowSevereMessage ShowWarningError ShowWarningError ShowWarningMessage ShowWarningMessage showWarningsBasedOnTotal Sim4PipeFanCoil SimAirChillerSet SimAirLoop SimAirLoopComponent SimAirLoopComponents SimAirLoops SimAirLoopSplitter SimAirMixer SimAirTerminalUserDefined SimAirZonePlenum SimATMixer SimBaseboard SimBLASTAbsorber SimBoiler SimCBVAV SimCBVAV SimCentralGroundSourceHeatPump SimChiller SimCoilUserDefined SimComponentModelFan SimConstVol SimCoolBeam SimCostEstimate SimCTGenerator SimCTPlantHeatRecovery SimCyclingWindowAC SimDesiccantDehumidifier SimDetailedIceStorage SimDirectAir SimDistrictEnergy SimDualDuctConstVol SimDualDuctVarVol SimDualDuctVAVOutdoorAir SimDuct SimDXCoil SimDXCoilMultiMode SimDXCoilMultiSpeed SimDXCoolingSystem SimDXHeatPumpSystem SimElecBaseBoard SimElectricBaseBoard SimElectricConvective SimElectricEIRChiller SimEvapCooler SimEvapFluidCoolers SimExhaustAbsorber SimFanCoilUnit SimFluidCoolers SimFluidHeatExchanger SimFourPipeIndUnit SimFuelCellGenerator SimFuelCellPlantHeatRecovery SimFurnace SimGasAbsorber SimGroundHeatExchangers SimHeatPumpWaterHeater SimHeatRecovery SimHighTempRadiantSystem SimHPWatertoWaterCOOLING SimHPWatertoWaterHEATING SimHPWatertoWaterSimple SimHumidifier SimHVAC SimHWBaseboard SimHWConvective SimHXAssistedCoolingCoil SimICEngineGenerator SimICEPlantHeatRecovery SimIceStorage SimIndirectAbsorber SimIndUnit SimLowTempRadiantSystem SimMicroCHPGenerator SimMicroCHPPlantHeatRecovery SimMSHeatPump SimMSHP SimMTGenerator SimMTPlantHeatRecovery SimMultiSpeedCoils SimOAComponent SimOAController SimOAMixer SimOnOffFan SimOutdoorAirEquipComps SimOutdoorAirUnit SimOutsideAirSys SimOutsideEnergy SimPackagedTerminalUnit SimPipes SimPipesHeatTransfer SimPipingSystemCircuit SimPIU SimPlantEquip SimPlantValves SimpleCoolingCoilUAResidual SimpleEvapFluidCoolerUAResidual SimpleFluidCoolerUAResidual SimpleHeatingCoilUAResidual SimpleTowerApproachResidual SimpleTowerTrResidual SimpleTowerUAResidual SimPondGroundHeatExchanger SimPressureDropSystem SimPTUnit SimPumps SimPurchasedAir SimPVGenerator SimPVTcollectors SimReformulatedEIRChiller SimRefrigCondenser SimReturnAirPath SimSelectedEquipment SimSetPointManagers SimSimpleEvapFluidCooler SimSimpleFan SimSimpleFluidCooler SimSimpleTower SimSolarCollector SimStandAloneERV SimSteamBaseboard SimSteamBoiler SimSteamCoils SimSurfaceGroundHeatExchanger SimSysAvailManager SimTESCoil SimTowers SimTranspiredCollector SimulateAllInteriorRadialSoilSlices SimulateAllLoopSideBranches SimulateAllLoopSidePumps SimulateDemandManagerList SimulateDetailedRefrigerationSystems SimulateDetailedTransRefrigSystems SimulateDualDuct SimulateFanComponents SimulateFluidCell SimulateHeatingCoilComponents SimulateInnerMostRadialSoilSlice SimulateLoopSideBranchGroup SimulateOuterMostRadialSoilSlice SimulatePlantProfile SimulateRadialInsulationCell SimulateRadialPipeCell SimulateRadialToCartesianInterface SimulateSingleDuct SimulateSteamCoilComponents SimulateVRF SimulateWaterCoilComponents SimulateWaterHeaterStandAlone SimulateWaterUse SimulateWaterUseConnection SimUnitaryBypassVAV SimUnitarySystem SimUnitHeater SimUnitVentilator SimUnitVentOAMixer SimUserDefinedPlantComponent SimVariableSpeedCoils SimVariableSpeedHP SimVariableSpeedHP SimVariableTower SimVariableVolumeFan SimVAV SimVAVVS SimVentilatedSlab SimVentSlabOAMixer SimVRF SimVRFCondenserPlant SimWaterCoils SimWaterSource SimWaterThermalTank SimWatertoAirHP SimWatertoAirHPSimple SimWindowAC SimWindTurbine SimZoneAirLoopEquipment SimZoneAirUserDefined SimZoneDehumidifier SimZoneEquipment SimZoneEvaporativeCoolerUnit SimZoneExhaustFan SimZoneOutAirUnitComps SingelSpeedDXCoolingCoilStandardRatings SingleSpeedDXHeatingCoilStandardRatings SingleSpeedFluidCooler SizeAbsorpChiller SizeAirLoopBranches SizeAirLoops SizeBaseboard SizeBoiler SizeBoiler SizeCBVAV SizeConstCOPChiller SizeController SizeCoolBeam SizeDemandSidePlantConnections SizeDirectAir SizeDualDuct SizeDXCoil SizeElecReformEIRChiller SizeElectricBaseboard SizeElectricBaseboard SizeElectricChiller SizeElectricEIRChiller SizeEngineDrivenChiller SizeEvapCooler SizeEvapFluidCooler SizeExhaustAbsorber SizeFan SizeFanCoilUnit SizeFluidCooler SizeFluidHeatExchanger SizeFurnace SizeGasAbsorber SizeGTChiller SizeHeatingCoil SizeHeatRecovery SizeHighTempRadiantSystem SizeHumidifier SizeHVACWaterToAir SizeHWBaseboard SizeIndirectAbsorpChiller SizeIndUnit SizeLowTempRadiantSystem SizeMSHeatPump SizeOAController SizeOutdoorAirUnit SizePIU SizePlantLoop SizePTUnit SizePump SizePurchasedAir SizePVT SizeStandAloneERV SizeStandAloneWaterHeater SizeSteamBaseboard SizeSteamCoil SizeSupplySidePlantConnections SizeSys SizeTankForDemandSide SizeTankForSupplySide SizeTESCoil SizeTower SizeUCSDUF SizeUnitarySystem SizeUnitHeater SizeUnitVentilator SizeVarSpeedCoil SizeVentilatedSlab SizeVRF SizeVRFCondenser SizeVSMerkelTower SizeWaterCoil SizeWaterManager SizeWaterSource SizeWindowAC SizeWrapper SizeZoneDehumidifier SizeZoneEquipment SizeZoneEvaporativeCoolerUnit SkipEPlusWFHeader SkyDifSolarShading SkyGndWeight SkyWeight SLtoAMB SLtoGL SLVSKY solar_EN673 solarISO15099 SolarSprectrumAverage SOLMATS SolveAirLoopControllers SolveForWindowTemperatures SolveRegression SolveRegulaFalsi SolverMoistureBalanceEMPD SOLVZP SortHistory Specular_Adjust Specular_EstimateDiffuseProps Specular_F Specular_OffNormal Specular_RATDiff Specular_SWP SQLiteBegin SQLiteBegin SQLiteBindDouble SQLiteBindInteger SQLiteBindLogicalMacro SQLiteBindNULL SQLiteBindText SQLiteBindTextMacro SQLiteClearBindings SQLiteCloseDatabase SQLiteColumnInt SQLiteColumnIntMacro SQLiteCommit SQLiteCommit SQLiteExecuteCommand SQLiteExecuteCommandMacro SQLiteFinalizeCommand SQLiteOpenDatabase SQLiteOpenDatabaseMacro SQLitePrepareStatement SQLitePrepareStatementMacro SQLiteResetCommand SQLiteStepCommand SQLiteWriteMessage SQLiteWriteMessageMacro SQLiteWriteMessageMacro StandardIndexTypeKey StandardVariableTypeKey StartingWindowTemps StartingWinTempsForNominalCond SteamHeatingCoilResidual StorageType StoreAPumpOnCurrentTempLoop storeIterationResults StoreRecurringErrorMessage StringValue StrToReal SumAllInternalCO2Gains SumAllInternalConvectionGains SumAllInternalGenericContamGains SumAllInternalLatentGains SumAllInternalRadiationGains SumAllReturnAirConvectionGains SumAllReturnAirLatentGains SumHATsurf SumHATsurf SumHATsurf SumHATsurf SumHATsurf SumHATsurf SumInternalCO2GainsByTypes SumInternalConvectionGainsByTypes SumInternalLatentGainsByTypes SumInternalRadiationGainsByTypes SummarizeErrors SumReturnAirConvectionGainsByTypes SumZoneImpacts SUN3 SUN4 SupSATResidual SurfaceScheduledSolarInc SurveyDemandManagers SystemPropertiesAtLambdaAndPhi SystemSpectralPropertiesAtPhi TableLookupObject TARCOG90 TBND TdbFnHRhPb TDMA TDMA_R TellMeHowManyObjectItemArgs TemperaturesFromEnergy TempIPtoSI TempSItoIP terpld TESCoilHumRatResidual TESCoilResidual TestAirPathIntegrity TestBranchIntegrity TestCompSet TestCompSetInletOutletNodes TestInletOutletNodes TestReturnAirPathIntegrity TestSupplyAirPathIntegrity therm1d TightenNodeMinMaxAvails TimestepInitComplexFenestration TimestepTypeName TraceAirLoopController TraceAirLoopControllers TraceIndividualController TraceIterationStamp TrackAirLoopController TrackAirLoopControllers TRadC TransAndReflAtPhi TransformVertsByAspect TransTDD Triangulate TrimSigDigits TurnOffLoopEquipment TurnOffLoopSideEquipment TurnOffReportRangeCheckErrors TurnOnPlantLoopPipes TurnOnReportRangeCheckErrors TwoSpeedFluidCooler UnitarySystemHeatRecovery UpdateAbsorberChillerComponentGeneratorSide UpdateAirflowNetwork UpdateAirMixer UpdateAirSysCompPtrArray UpdateAirSysSubCompPtrArray UpdateAirSysSubSubCompPtrArray UpdateAirZoneReturnPlenum UpdateAirZoneSupplyPlenum UpdateAnyLoopDemandAlterations UpdateATMixer UpdateBaseboard UpdateBaseboardPlantConnection UpdateBasementSurfaceTemperatures UpdateBBElecRadSourceValAvg UpdateBBRadSourceValAvg UpdateBBSteamRadSourceValAvg UpdateBLASTAbsorberRecords UpdateBoilerRecords UpdateBoilerRecords UpdateBracket UpdateBranchConnections UpdateChillerComponentCondenserSide UpdateChillerheaterRecords UpdateChillerRecords UpdateColdWeatherProtection UpdateCommonPipe UpdateComplexWindows UpdateComponentHeatRecoverySide UpdateConstCOPChillerRecords UpdateController UpdateCoolBeam UpdateCoolTower UpdateCTGeneratorRecords UpdateDataandReport UpdateDemandManagers UpdateDesiccantDehumidifier UpdateDetailedIceStorage UpdateDualDuct UpdateDuct UpdateDXCoil UpdateElectricBaseboard UpdateElectricChillerRecords UpdateElectricEIRChillerRecords UpdateEMSTrendVariables UpdateEngineDrivenChiller UpdateEvapCooler UpdateEvapFluidCooler UpdateEvaporativeCondenserBasinHeater UpdateEvaporativeCondenserWaterUse UpdateExhaustAbsorberCoolRecords UpdateExhaustAbsorberHeatRecords UpdateExhaustAirFlows UpdateFan UpdateFinalSurfaceHeatBalance UpdateFluidCooler UpdateFluidHeatExchanger UpdateFuelCellGeneratorRecords UpdateGasAbsorberCoolRecords UpdateGasAbsorberHeatRecords UpdateGSHPRecords UpdateGSHPRecords UpdateGSHPRecords UpdateGTChillerRecords UpdateHalfLoopInletTemp UpdateHeatBalHAMT UpdateHeatingCoil UpdateHeatRecovery UpdateHighTempRadiantSystem UpdateHistories UpdateHistory UpdateHTRadSourceValAvg UpdateHumidifier UpdateHVACInterface UpdateHWBaseboard UpdateHWBaseboardPlantConnection UpdateIceFractions UpdateICEngineGeneratorRecords UpdateIndirectAbsorberRecords UpdateInternalGainValues UpdateIrrigation UpdateLoadCenterRecords UpdateLoopSideReportVars UpdateLowTempRadiantSystem UpdateMeterReporting UpdateMeters UpdateMeterValues UpdateMicroCHPGeneratorRecords UpdateMinMax UpdateMixedAirSetPoints UpdateMoistureBalanceEMPD UpdateMoistureBalanceFD UpdateMSHeatPump UpdateMTGeneratorRecords UpdateNode UpdateNodeThermalHistory UpdateOAController UpdateOAMixer UpdateOAPretreatSetPoints UpdatePipesHeatTransfer UpdatePipingSystems UpdatePlantLoopInterface UpdatePlantMixer UpdatePlantProfile UpdatePlantSplitter UpdatePlantValves UpdatePondGroundHeatExchanger UpdatePrecipitation UpdatePressureDrop UpdatePurchasedAir UpdatePVTcollectors UpdateRadSysSourceValAvg UpdateRecords UpdateReformEIRChillerRecords UpdateRefrigCondenser UpdateReportWaterSystem UpdateRootFinder UpdateScheduleValues UpdateSetPointManagers UpdateSimpleWatertoAirHP UpdateSoilProps UpdateSolarCollector UpdateSplitter UpdateSQLiteErrorRecord UpdateSQLiteErrorRecord UpdateSQLiteSimulationRecord UpdateSQLiteSimulationRecord UpdateSteamBaseboard UpdateSteamBaseboardPlantConnection UpdateSteamCoil UpdateSurfaceGroundHeatExchngr UpdateSys UpdateSysSizing UpdateSystemOutputRequired UpdateTabularReports UpdateTEStorage UpdateThermalHistories UpdateTowers UpdateTranspiredCollector UpdateUnitarySystemControl UpdateUtilityBills UpdateVarSpeedCoil UpdateVentilatedSlab UpdateVerticalGroundHeatExchanger UpdateVRFCondenser UpdateWaterCoil UpdateWaterConnections UpdateWaterManager UpdateWaterSource UpdateWaterThermalTank UpdateWaterToAirCoilPlantConnection UpdateWatertoAirHP UpdateWeatherData UpdateWholeBuildingRecords UpdateZoneAirLoopEquipment UpdateZoneCompPtrArray UpdateZoneDehumidifier UpdateZoneEquipment UpdateZoneInletConvergenceLog UpdateZoneListAndGroupLoads UpdateZoneSizing UpdateZoneSubCompPtrArray UpdateZoneSubSubCompPtrArray ValidateAndSetSysAvailabilityManagerType ValidateComponent ValidateDistributionSystem ValidateEMSProgramName ValidateEMSVariableName ValidateExhaustFanInput ValidateFlowControlPaths ValidateFuelType ValidateIndexType ValidateMaterialRoughness ValidateMonthDay ValidateNStandardizeMeterTitles ValidateObjectandParse ValidatePipeConstruction ValidatePLFCurve ValidateSection ValidateSectionsInput ValidateVariableType value_to_vector ValueToString VAVVSCoolingResidual VAVVSHCFanOnResidual VAVVSHWFanOnResidual VAVVSHWNoFanResidual VB_CriticalSlatAngle VB_DIFF VB_LWP VB_ShadeControl VB_SLAT_RADIUS_RATIO VB_SOL4 VB_SOL46_CURVE VB_SOL6 VB_SWP vec2d_cross_product vec2d_dot_product vec_cross_product vec_dot_product VecLength VecNegate VecNormalize VecRound VecSquaredLength vector_add vector_div_int vector_div_real vector_subtract vector_times_int vector_times_real vector_to_array VerifyControlledZoneForThermostat VerifyCustomMetersElecPowerMgr VerifyHeatExchangerParent VerifyName VerifySetPointManagers VerifyThermostatInZone VerifyUniqueBaseboardName VerifyUniqueBoilerName VerifyUniqueChillerName VerifyUniqueCoilName ViewFac VisibleSprectrumAverage Volume VRMLOut VSCoilCyclingHumResidual VSCoilCyclingResidual VSCoilCyclingResidual VSCoilSpeedHumResidual VSCoilSpeedResidual VSCoilSpeedResidual VSEvapUnitLoadResidual VSHPCyclingResidual VSHPCyclingResidual VSHPSpeedResidual VSHPSpeedResidual VSMerkelResidual W5InitGlassParameters W5LsqFit W5LsqFit2 W6CoordsFromWorldVect warnIfNativeVarname WetCoilOutletCondition WhichCompSet WhichParentCompSet WhichParentSet Width WindowGapAirflowControl WindowGasConductance WindowGasPropertiesAtTemp WindowHeatBalanceEquations WindowScheduledSolarAbs WindowShadingManager WindowTempsForNominalCond WindSpeedAt Windward WorldVectFromW6 WriteAdaptiveComfortTable WriteAirLoopStatistics WriteBEPSTable WriteCompCostTable WriteComponentSizing WriteCumulativeReportMeterData WriteDaylightMapTitle WriteDemandEndUseSummary WriteInputArguments WriteIntegerData WriteIntegerVariableOutput WriteMeterDictionaryItem WriteModifiedArguments WriteMonthlyTables WriteOutputArguments WriteOutputEN673 WritePoint WritePredefinedTables WriteRealData WriteRealVariableOutput WriteReportHeaders WriteReportIntegerData WriteReportMeterData WriteReportRealData WriteReportVariableDictionaryItem WriteRootFinderStatus WriteRootFinderTrace WriteRootFinderTraceHeader WriteSourceEnergyEndUseSummary writeSubtitle WriteSurfaceShadowing WriteTable WriteTableOfContents WriteTabularLifeCycleCostReport WriteTabularReports WriteTabularTariffReports WriteTARCOGInputFile writeTextLine WriteTimeBinTables WriteTimeStampFormatData WriteTrace WriteVeriSumTable WriteZoneLoadComponentTable WVDC XNormalArea XYRectangle XZRectangle YNormalArea YZRectangle ZeroHVACValues ZNormalArea