SUBROUTINE GetHeatingCoilInput
! SUBROUTINE INFORMATION:
! AUTHOR Richard Liesen
! DATE WRITTEN May 2000
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS SUBROUTINE:
! Obtains input data for coils and stores it in coil data structures
! METHODOLOGY EMPLOYED:
! Uses "Get" routines to read in data.
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor
USE NodeInputManager, ONLY: GetOnlySingleNode
USE BranchNodeConnections, ONLY: TestCompSet
USE CurveManager, ONLY: GetCurveIndex
USE DataIPShortCuts
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 :: RoutineName='GetHeatingCoilInput: ' ! include trailing blank space
! INTERFACE BLOCK SPECIFICATIONS
! na
! DERIVED TYPE DEFINITIONS
! na
! SUBROUTINE LOCAL VARIABLE DECLARATIONS:
INTEGER :: CoilNum ! The HeatingCoil that you are currently loading input into
INTEGER :: NumElecCoil
INTEGER :: NumElecCoilMultiStage
INTEGER :: NumGasCoil
INTEGER :: NumGasCoilMultiStage
INTEGER :: ElecCoilNum
INTEGER :: GasCoilNum
INTEGER :: DesuperheaterCoilNum ! Index to desuperheater heating coil
INTEGER :: RemainingCoils ! Index for error checking DO loop for desuperheater coils on remaining heating coil
INTEGER :: SourceIndexNum = 0 ! Index to reclaim heating source (condenser) of a specific type
CHARACTER(len=MaxNameLength) :: SourceTypeString ! character string used in error message for desuperheating coil
CHARACTER(len=MaxNameLength) :: SourceNameString ! character string used in error message for desuperheating coil
CHARACTER(len=MaxNameLength) :: CurrentModuleObject ! for ease in getting objects
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: Alphas ! Alpha input items for object
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cAlphaFields ! Alpha field names
CHARACTER(len=MaxNameLength), ALLOCATABLE, DIMENSION(:) :: cNumericFields ! Numeric field names
REAL(r64), ALLOCATABLE, DIMENSION(:) :: Numbers ! Numeric input items for object
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lAlphaBlanks ! Logical array, alpha field input BLANK = .true.
LOGICAL, ALLOCATABLE, DIMENSION(:) :: lNumericBlanks ! Logical array, numeric field input BLANK = .true.
INTEGER :: MaxNums=0 ! Maximum number of numeric input fields
INTEGER :: MaxAlphas=0 ! Maximum number of alpha input fields
INTEGER :: TotalArgs=0 ! Total number of alpha and numeric arguments (max) for a
! certain object in the input file
INTEGER :: NumAlphas
INTEGER :: NumNums
INTEGER :: IOSTAT
INTEGER :: StageNum
LOGICAL :: ErrorsFound = .false. ! If errors detected in input
LOGICAL :: IsNotOK ! Flag to verify name
LOGICAL :: IsBlank ! Flag for blank name
LOGICAL :: DXCoilErrFlag ! Used in GetDXCoil mining functions
LOGICAL :: errflag
! Flow
NumElecCoil = GetNumObjectsFound('Coil:Heating:Electric')
NumElecCoilMultiStage = GetNumObjectsFound('Coil:Heating:Electric:MultiStage')
NumGasCoil = GetNumObjectsFound('Coil:Heating:Gas')
NumGasCoilMultiStage = GetNumObjectsFound('Coil:Heating:Gas:MultiStage')
NumDesuperheaterCoil = GetNumObjectsFound('Coil:Heating:Desuperheater')
NumHeatingCoils = NumElecCoil + NumElecCoilMultiStage + NumGasCoil + NumGasCoilMultiStage + NumDesuperheaterCoil
IF (NumHeatingCoils.GT.0) THEN
ALLOCATE(HeatingCoil(NumHeatingCoils))
ALLOCATE(ValidSourceType(NumHeatingCoils))
ValidSourceType = .FALSE.
ALLOCATE(CheckEquipName(NumHeatingCoils))
CheckEquipName=.true.
ENDIF
CALL GetObjectDefMaxArgs('Coil:Heating:Electric',TotalArgs,NumAlphas,NumNums)
MaxNums=MAX(MaxNums,NumNums)
MaxAlphas=MAX(MaxAlphas,NumAlphas)
CALL GetObjectDefMaxArgs('Coil:Heating:Electric:MultiStage',TotalArgs,NumAlphas,NumNums)
MaxNums=MAX(MaxNums,NumNums)
MaxAlphas=MAX(MaxAlphas,NumAlphas)
CALL GetObjectDefMaxArgs('Coil:Heating:Gas',TotalArgs,NumAlphas,NumNums)
MaxNums=MAX(MaxNums,NumNums)
MaxAlphas=MAX(MaxAlphas,NumAlphas)
CALL GetObjectDefMaxArgs('Coil:Heating:Gas:MultiStage',TotalArgs,NumAlphas,NumNums)
MaxNums=MAX(MaxNums,NumNums)
MaxAlphas=MAX(MaxAlphas,NumAlphas)
CALL GetObjectDefMaxArgs('Coil:Heating:Desuperheater',TotalArgs,NumAlphas,NumNums)
MaxNums=MAX(MaxNums,NumNums)
MaxAlphas=MAX(MaxAlphas,NumAlphas)
ALLOCATE(Alphas(MaxAlphas))
Alphas=' '
ALLOCATE(cAlphaFields(MaxAlphas))
cAlphaFields=' '
ALLOCATE(cNumericFields(MaxNums))
cNumericFields=' '
ALLOCATE(Numbers(MaxNums))
Numbers=0.0d0
ALLOCATE(lAlphaBlanks(MaxAlphas))
lAlphaBlanks=.true.
ALLOCATE(lNumericBlanks(MaxNums))
lNumericBlanks=.true.
! Get the data for electric heating coils
DO ElecCoilNum = 1, NumElecCoil
CoilNum= ElecCoilNum
CurrentModuleObject='Coil:Heating:Electric'
CALL GetObjectItem(CurrentModuleObject,ElecCoilNum,Alphas,NumAlphas,Numbers,NumNums,IOSTAT, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),HeatingCoil%Name,CoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CALL VerifyUniqueCoilName(CurrentModuleObject,Alphas(1),errflag,TRIM(CurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
HeatingCoil(CoilNum)%Name = Alphas(1)
HeatingCoil(CoilNum)%Schedule = Alphas(2)
IF (lAlphaBlanks(2)) THEN
HeatingCoil(CoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
HeatingCoil(CoilNum)%SchedPtr = GetScheduleIndex(Alphas(2))
IF (HeatingCoil(CoilNum)%SchedPtr == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFields(2))// &
' entered ='//TRIM(Alphas(2))// &
' for '//TRIM(cAlphaFields(1))//'='//TRIM(Alphas(1)))
ErrorsFound=.true.
END IF
ENDIF
HeatingCoil(CoilNum)%HeatingCoilType = 'Heating'
HeatingCoil(CoilNum)%HeatingCoilModel = 'Electric'
HeatingCoil(CoilNum)%HCoilType_Num = Coil_HeatingElectric
HeatingCoil(CoilNum)%Efficiency = Numbers(1)
HeatingCoil(CoilNum)%NominalCapacity = Numbers(2)
HeatingCoil(CoilNum)%AirInletNodeNum = &
GetOnlySingleNode(Alphas(3),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HeatingCoil(CoilNum)%AirOutletNodeNum = &
GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
CALL TestCompSet(TRIM(CurrentModuleObject),Alphas(1),Alphas(3),Alphas(4),'Air Nodes')
HeatingCoil(CoilNum)%TempSetPointNodeNum = &
GetOnlySingleNode(Alphas(5),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
! Setup Report variables for the Electric Coils
CALL SetupOutputVariable('Heating Coil Air Heating Energy [J]',HeatingCoil(CoilNum)%HeatingCoilLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATINGCOILS',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Air Heating Rate [W]', HeatingCoil(CoilNum)%HeatingCoilRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Electric Energy [J]',HeatingCoil(CoilNum)%ElecUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Electric Power [W]',HeatingCoil(CoilNum)%ElecUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
END DO
! Get the data for electric heating coils
DO ElecCoilNum = 1, NumElecCoilMultiStage
CoilNum= NumElecCoil + ElecCoilNum
CurrentModuleObject='Coil:Heating:Electric:MultiStage'
CALL GetObjectItem(CurrentModuleObject,ElecCoilNum,Alphas,NumAlphas,Numbers,NumNums,IOSTAT, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),HeatingCoil%Name,CoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CALL VerifyUniqueCoilName(CurrentModuleObject,Alphas(1),errflag,TRIM(CurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
HeatingCoil(CoilNum)%Name = Alphas(1)
HeatingCoil(CoilNum)%Schedule = Alphas(2)
IF (lAlphaBlanks(2)) THEN
HeatingCoil(CoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
HeatingCoil(CoilNum)%SchedPtr = GetScheduleIndex(Alphas(2))
IF (HeatingCoil(CoilNum)%SchedPtr == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFields(2))// &
' entered ='//TRIM(Alphas(2))// &
' for '//TRIM(cAlphaFields(1))//'='//TRIM(Alphas(1)))
ErrorsFound=.true.
END IF
ENDIF
HeatingCoil(CoilNum)%HeatingCoilType = 'Heating'
HeatingCoil(CoilNum)%HeatingCoilModel = 'ElectricMultiStage'
HeatingCoil(CoilNum)%HCoilType_Num = Coil_HeatingElectric_MultiStage
HeatingCoil(CoilNum)%NumOfStages = Numbers(1)
ALLOCATE(HeatingCoil(CoilNum)%MSEfficiency(HeatingCoil(CoilNum)%NumOfStages))
ALLOCATE(HeatingCoil(CoilNum)%MSNominalCapacity(HeatingCoil(CoilNum)%NumOfStages))
DO StageNum=1,HeatingCoil(CoilNum)%NumOfStages
HeatingCoil(CoilNum)%MSEfficiency(StageNum) = Numbers(StageNum*2)
HeatingCoil(CoilNum)%MSNominalCapacity(StageNum) = Numbers(StageNum*2 + 1)
END DO
HeatingCoil(CoilNum)%AirInletNodeNum = &
GetOnlySingleNode(Alphas(3),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HeatingCoil(CoilNum)%AirOutletNodeNum = &
GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
CALL TestCompSet(TRIM(CurrentModuleObject),Alphas(1),Alphas(3),Alphas(4),'Air Nodes')
HeatingCoil(CoilNum)%TempSetPointNodeNum = &
GetOnlySingleNode(Alphas(5),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
! Setup Report variables for the Electric Coils
CALL SetupOutputVariable('Heating Coil Air Heating Energy [J]',HeatingCoil(CoilNum)%HeatingCoilLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATINGCOILS',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Air Heating Rate [W]', HeatingCoil(CoilNum)%HeatingCoilRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Electric Energy [J]',HeatingCoil(CoilNum)%ElecUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Electric',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Electric Power [W]',HeatingCoil(CoilNum)%ElecUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
END DO
! Get the data for for gas heating coils
DO GasCoilNum = 1, NumGasCoil
CoilNum= NumElecCoil + NumElecCoilMultiStage + GasCoilNum
CurrentModuleObject='Coil:Heating:Gas'
CALL GetObjectItem(CurrentModuleObject,GasCoilNum,Alphas,NumAlphas,Numbers,NumNums,IOSTAT, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),HeatingCoil%Name,CoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CALL VerifyUniqueCoilName(CurrentModuleObject,Alphas(1),errflag,TRIM(CurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
HeatingCoil(CoilNum)%Name = Alphas(1)
HeatingCoil(CoilNum)%Schedule = Alphas(2)
IF (lAlphaBlanks(2)) THEN
HeatingCoil(CoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
HeatingCoil(CoilNum)%SchedPtr = GetScheduleIndex(Alphas(2))
IF (HeatingCoil(CoilNum)%SchedPtr == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFields(2))// &
' entered ='//TRIM(Alphas(2))// &
' for '//TRIM(cAlphaFields(1))//'='//TRIM(Alphas(1)))
ErrorsFound=.true.
END IF
ENDIF
HeatingCoil(CoilNum)%HeatingCoilType = 'Heating'
HeatingCoil(CoilNum)%HeatingCoilModel = 'Gas'
HeatingCoil(CoilNum)%HCoilType_Num = Coil_HeatingGas
HeatingCoil(CoilNum)%Efficiency = Numbers(1)
HeatingCoil(CoilNum)%NominalCapacity = Numbers(2)
HeatingCoil(CoilNum)%AirInletNodeNum = &
GetOnlySingleNode(Alphas(3),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HeatingCoil(CoilNum)%AirOutletNodeNum = &
GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
CALL TestCompSet(TRIM(CurrentModuleObject),Alphas(1),Alphas(3),Alphas(4),'Air Nodes')
HeatingCoil(CoilNum)%TempSetPointNodeNum = &
GetOnlySingleNode(Alphas(5),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
!parasitic electric load associated with the gas heating coil
HeatingCoil(CoilNum)%ParasiticElecLoad = Numbers(3)
HeatingCoil(CoilNum)%PLFCurveIndex = GetCurveIndex(Alphas(6)) ! convert curve name to number
!parasitic gas load associated with the gas heating coil (standing pilot light)
HeatingCoil(CoilNum)%ParasiticGasCapacity = Numbers(4)
! Setup Report variables for the Gas Coils
CALL SetupOutputVariable('Heating Coil Air Heating Energy [J]',HeatingCoil(CoilNum)%HeatingCoilLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATINGCOILS',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Air Heating Rate [W]', HeatingCoil(CoilNum)%HeatingCoilRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Gas Energy [J]',HeatingCoil(CoilNum)%GasUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Gas',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Gas Rate [W]',HeatingCoil(CoilNum)%GasUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Electric Energy [J]',HeatingCoil(CoilNum)%ElecUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Electricity',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Electric Power [W]',HeatingCoil(CoilNum)%ElecUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Runtime Fraction []',HeatingCoil(CoilNum)%RTF, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Ancillary Gas Rate [W]', HeatingCoil(CoilNum)%ParasiticGasRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Ancillary Gas Energy [J]',HeatingCoil(CoilNum)%ParasiticGasLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Gas',EndUseKey='Heating',GroupKey='System')
END DO
! Get the data for for gas heating coils
DO GasCoilNum = 1, NumGasCoilMultiStage
CoilNum= NumElecCoil + NumElecCoilMultiStage + NumGasCoil + GasCoilNum
CurrentModuleObject='Coil:Heating:Gas:MultiStage'
CALL GetObjectItem(CurrentModuleObject,GasCoilNum,Alphas,NumAlphas,Numbers,NumNums,IOSTAT, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),HeatingCoil%Name,CoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CALL VerifyUniqueCoilName(CurrentModuleObject,Alphas(1),errflag,TRIM(CurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
HeatingCoil(CoilNum)%Name = Alphas(1)
HeatingCoil(CoilNum)%Schedule = Alphas(2)
IF (lAlphaBlanks(2)) THEN
HeatingCoil(CoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
HeatingCoil(CoilNum)%SchedPtr = GetScheduleIndex(Alphas(2))
IF (HeatingCoil(CoilNum)%SchedPtr == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFields(2))// &
' entered ='//TRIM(Alphas(2))// &
' for '//TRIM(cAlphaFields(1))//'='//TRIM(Alphas(1)))
ErrorsFound=.true.
END IF
ENDIF
HeatingCoil(CoilNum)%HeatingCoilType = 'Heating'
HeatingCoil(CoilNum)%HeatingCoilModel = 'GasMultiStage'
HeatingCoil(CoilNum)%HCoilType_Num = Coil_HeatingGas_MultiStage
HeatingCoil(CoilNum)%ParasiticGasCapacity = Numbers(1)
HeatingCoil(CoilNum)%NumOfStages = Numbers(2)
ALLOCATE(HeatingCoil(CoilNum)%MSEfficiency(HeatingCoil(CoilNum)%NumOfStages))
ALLOCATE(HeatingCoil(CoilNum)%MSNominalCapacity(HeatingCoil(CoilNum)%NumOfStages))
ALLOCATE(HeatingCoil(CoilNum)%MSParasiticElecLoad(HeatingCoil(CoilNum)%NumOfStages))
DO StageNum=1,HeatingCoil(CoilNum)%NumOfStages
HeatingCoil(CoilNum)%MSEfficiency(StageNum) = Numbers(StageNum*3)
HeatingCoil(CoilNum)%MSNominalCapacity(StageNum) = Numbers(StageNum*3 + 1)
HeatingCoil(CoilNum)%MSParasiticElecLoad(StageNum) = Numbers(StageNum*3 + 2)
END DO
HeatingCoil(CoilNum)%AirInletNodeNum = &
GetOnlySingleNode(Alphas(3),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HeatingCoil(CoilNum)%AirOutletNodeNum = &
GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
CALL TestCompSet(TRIM(CurrentModuleObject),Alphas(1),Alphas(3),Alphas(4),'Air Nodes')
HeatingCoil(CoilNum)%TempSetPointNodeNum = &
GetOnlySingleNode(Alphas(5),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
!parasitic electric load associated with the gas heating coil
HeatingCoil(CoilNum)%ParasiticElecLoad = Numbers(10)
HeatingCoil(CoilNum)%PLFCurveIndex = GetCurveIndex(Alphas(6)) ! convert curve name to number
!parasitic gas load associated with the gas heating coil (standing pilot light)
! Setup Report variables for the Gas Coils
CALL SetupOutputVariable('Heating Coil Air Heating Energy [J]',HeatingCoil(CoilNum)%HeatingCoilLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATINGCOILS',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Air Heating Rate [W]', HeatingCoil(CoilNum)%HeatingCoilRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Gas Energy [J]',HeatingCoil(CoilNum)%GasUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Gas',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Gas Rate [W]',HeatingCoil(CoilNum)%GasUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Electric Energy [J]',HeatingCoil(CoilNum)%ElecUseLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Electricity',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Electric Power [W]',HeatingCoil(CoilNum)%ElecUseRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Runtime Fraction []',HeatingCoil(CoilNum)%RTF, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Ancillary Gas Rate [W]', HeatingCoil(CoilNum)%ParasiticGasRate, &
'System','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Ancillary Gas Energy [J]',HeatingCoil(CoilNum)%ParasiticGasLoad, &
'System','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Gas',EndUseKey='Heating',GroupKey='System')
END DO
! Get the data for for desuperheater heating coils
DO DesuperheaterCoilNum = 1, NumDesuperheaterCoil
CoilNum= NumElecCoil + NumElecCoilMultiStage + NumGasCoil + NumGasCoilMultiStage + DesuperheaterCoilNum
CurrentModuleObject='Coil:Heating:Desuperheater'
CALL GetObjectItem(CurrentModuleObject,DesuperheaterCoilNum,Alphas,NumAlphas,Numbers,NumNums,IOSTAT, &
NumBlank=lNumericBlanks,AlphaBlank=lAlphaBlanks, &
AlphaFieldNames=cAlphaFields,NumericFieldNames=cNumericFields)
IsNotOK=.false.
IsBlank=.false.
CALL VerifyName(Alphas(1),HeatingCoil%Name,CoilNum-1,IsNotOK,IsBlank,TRIM(CurrentModuleObject)//' Name')
IF (IsNotOK) THEN
ErrorsFound=.true.
IF (IsBlank) Alphas(1)='xxxxx'
ENDIF
CALL VerifyUniqueCoilName(CurrentModuleObject,Alphas(1),errflag,TRIM(CurrentModuleObject)//' Name')
IF (errflag) THEN
ErrorsFound=.true.
ENDIF
HeatingCoil(CoilNum)%Name = Alphas(1)
HeatingCoil(CoilNum)%Schedule = Alphas(2)
IF (lAlphaBlanks(2)) THEN
HeatingCoil(CoilNum)%SchedPtr = ScheduleAlwaysOn
ELSE
HeatingCoil(CoilNum)%SchedPtr = GetScheduleIndex(Alphas(2))
IF (HeatingCoil(CoilNum)%SchedPtr == 0) THEN
CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//': Invalid '//TRIM(cAlphaFields(2))// &
' entered ='//TRIM(Alphas(2))// &
' for '//TRIM(cAlphaFields(1))//'='//TRIM(Alphas(1)))
ErrorsFound=.true.
END IF
ENDIF
! check availability schedule for values between 0 and 1
IF (HeatingCoil(CoilNum)%SchedPtr .GT. 0)THEN
IF (.NOT. CheckScheduleValueMinMax(HeatingCoil(CoilNum)%SchedPtr,'>=',0.0d0,'<=',1.0d0)) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//' = "'//TRIM(HeatingCoil(CoilNum)%Name)//'"')
CALL ShowContinueError('Error found in '//TRIM(cAlphaFields(2))//' = '//TRIM(Alphas(2)))
CALL ShowContinueError('Schedule values must be (>=0., <=1.)')
ErrorsFound=.true.
END IF
END IF
HeatingCoil(CoilNum)%HeatingCoilType = 'Heating'
HeatingCoil(CoilNum)%HeatingCoilModel = 'Desuperheater'
HeatingCoil(CoilNum)%HCoilType_Num = Coil_HeatingDesuperheater
!HeatingCoil(CoilNum)%Efficiency = Numbers(1)
!(Numbers(1)) error limits checked and defaults applied on efficiency after
! identifying souce type.
HeatingCoil(CoilNum)%AirInletNodeNum = &
GetOnlySingleNode(Alphas(3),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Inlet,1,ObjectIsNotParent)
HeatingCoil(CoilNum)%AirOutletNodeNum = &
GetOnlySingleNode(Alphas(4),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Outlet,1,ObjectIsNotParent)
CALL TestCompSet(TRIM(CurrentModuleObject),Alphas(1),Alphas(3),Alphas(4),'Air Nodes')
! Find the DX equipment index associated with the desuperheater heating coil.
! The CoilNum may not be found here when zone heating equip. exists. Check again in InitHeatingCoil.
! (when zone equipment heating coils are included in the input, the air loop DX equipment has not yet been read in)
IF(SameString(Alphas(5),'Refrigeration:CompressorRack'))THEN
HeatingCoil(CoilNum)%ReclaimHeatingSource = COMPRESSORRACK_REFRIGERATEDCASE
CALL GetRefrigeratedRackIndex(Alphas(6),HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum, &
RefrigSystemTypeRack,DXCoilErrFlag,Alphas(5))
IF(HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum .GT. 0) ValidSourceType(CoilNum) = .TRUE.
ELSEIF((SameString(Alphas(5),'Refrigeration:Condenser:AirCooled')).OR.&
(SameString(Alphas(5),'Refrigeration:Condenser:EvaporativeCooled')).OR.&
(SameString(Alphas(5),'Refrigeration:Condenser:WaterCooled')))&
THEN
HeatingCoil(CoilNum)%ReclaimHeatingSource = CONDENSER_REFRIGERATION
CALL GetRefrigeratedRackIndex(Alphas(6),HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum, &
RefrigSystemTypeDetailed,DXCoilErrFlag,Alphas(5))
IF(HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum .GT. 0) ValidSourceType(CoilNum) = .TRUE.
ELSEIF(SameString(Alphas(5),'Coil:Cooling:DX:SingleSpeed'))THEN
HeatingCoil(CoilNum)%ReclaimHeatingSource = COIL_DX_COOLING
CALL GetDXCoilIndex(Alphas(6),HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5))
IF(HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum .GT. 0) ValidSourceType(CoilNum) = .TRUE.
ELSEIF(SameString(Alphas(5),'Coil:Cooling:DX:TwoSpeed'))THEN
HeatingCoil(CoilNum)%ReclaimHeatingSource = COIL_DX_MULTISPEED
CALL GetDXCoilIndex(Alphas(6),HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5))
IF(HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum .GT. 0) ValidSourceType(CoilNum) = .TRUE.
ELSEIF(SameString(Alphas(5),'Coil:Cooling:DX:TwoStageWithHumidityControlMode'))THEN
HeatingCoil(CoilNum)%ReclaimHeatingSource = COIL_DX_MULTIMODE
CALL GetDXCoilIndex(Alphas(6),HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum, DXCoilErrFlag, Alphas(5))
IF(HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum .GT. 0) ValidSourceType(CoilNum) = .TRUE.
ELSE
CALL ShowSevereError(TRIM(CurrentModuleObject)//', "'//TRIM(HeatingCoil(CoilNum)%Name)//&
'" valid desuperheater heat source object type not found: '//TRIM(Alphas(5)))
CALL ShowContinueError('Valid desuperheater heat source objects are:')
CALL ShowContinueError('Refrigeration:CompressorRack, Coil:Cooling:DX:SingleSpeed, '// &
'Refrigeration:Condenser:AirCooled, Refrigeration:Condenser:EvaporativeCooled, '//&
' Refrigeration:Condenser:WaterCooled,Coil:Cooling:DX:TwoSpeed, '// &
'and Coil:Cooling:DX:TwoStageWithHumidityControlMode')
ErrorsFound = .TRUE.
END IF
IF (HeatingCoil(CoilNum)%ReclaimHeatingSource == CONDENSER_REFRIGERATION) THEN
IF (lNumericBlanks(1))THEN
HeatingCoil(CoilNum)%Efficiency = 0.8d0
ELSE
HeatingCoil(CoilNum)%Efficiency = Numbers(1)
IF(Numbers(1) .LT. 0.0d0 .OR. Numbers(1) .GT. 0.9d0) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//', "'//TRIM(HeatingCoil(CoilNum)%Name)//&
'" heat reclaim recovery efficiency must be >= 0 and <=0.9')
ErrorsFound = .TRUE.
END IF
END IF
ELSE
IF (lNumericBlanks(1))THEN
HeatingCoil(CoilNum)%Efficiency = 0.25d0
ELSE
HeatingCoil(CoilNum)%Efficiency = Numbers(1)
IF(Numbers(1) .LT. 0.0d0 .OR. Numbers(1) .GT. 0.3d0) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//', "'//TRIM(HeatingCoil(CoilNum)%Name)//&
'" heat reclaim recovery efficiency must be >= 0 and <=0.3')
ErrorsFound = .TRUE.
END IF
END IF
END IF
HeatingCoil(CoilNum)%ReclaimHeatingCoilName = Alphas(6)
HeatingCoil(CoilNum)%TempSetPointNodeNum = &
GetOnlySingleNode(Alphas(7),ErrorsFound,TRIM(CurrentModuleObject),Alphas(1), &
NodeType_Air,NodeConnectionType_Sensor,1,ObjectIsNotParent)
!parasitic electric load associated with the desuperheater heating coil
HeatingCoil(CoilNum)%ParasiticElecLoad = Numbers(2)
IF(Numbers(2) .LT. 0.0d0) THEN
CALL ShowSevereError(TRIM(CurrentModuleObject)//', "'//TRIM(HeatingCoil(CoilNum)%Name)//&
'" parasitic electric load must be >= 0')
ErrorsFound = .TRUE.
END IF
! Setup Report variables for the Desuperheater Heating Coils
CALL SetupOutputVariable('Heating Coil Air Heating Energy [J]',HeatingCoil(CoilNum)%HeatingCoilLoad, &
'HVAC','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='ENERGYTRANSFER',EndUseKey='HEATINGCOILS',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Air Heating Rate [W]', HeatingCoil(CoilNum)%HeatingCoilRate, &
'HVAC','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Electric Energy [J]',HeatingCoil(CoilNum)%ElecUseLoad, &
'HVAC','Sum',HeatingCoil(CoilNum)%Name, &
ResourceTypeKey='Electricity',EndUseKey='Heating',GroupKey='System')
CALL SetupOutputVariable('Heating Coil Electric Power [W]',HeatingCoil(CoilNum)%ElecUseRate, &
'HVAC','Average',HeatingCoil(CoilNum)%Name)
CALL SetupOutputVariable('Heating Coil Runtime Fraction []',HeatingCoil(CoilNum)%RTF, &
'HVAC','Average',HeatingCoil(CoilNum)%Name)
END DO
! perform error check to make sure duplicate heating sources are not used (i.e. 2 desuperheating coils cannot
! use the same heat source). This error check will be expanded in the future to check for duplicates in
! desuperheaters used for water heating purposed.
DO CoilNum = NumElecCoil + NumGasCoil + 1, NumHeatingCoils
DO RemainingCoils = CoilNum + 1, NumHeatingCoils
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource.EQ.HeatingCoil(RemainingCoils)%ReclaimHeatingSource .AND. &
HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum.EQ.HeatingCoil(RemainingCoils)%ReclaimHeatingSourceIndexNum)THEN
SourceIndexNum = HeatingCoil(CoilNum)%ReclaimHeatingSourceIndexNum
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource .EQ. COMPRESSORRACK_REFRIGERATEDCASE)THEN
SourceTypeString='Refrigeration:CompressorRack'
SourceNameString=HeatReclaimRefrigeratedRack(SourceIndexNum)%Name
END IF
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource .EQ. CONDENSER_REFRIGERATION)THEN
SourceNameString=HeatReclaimRefrigCondenser(SourceIndexNum)%Name
IF(HeatReclaimRefrigCondenser(SourceIndexNum)%SourceType==RefrigCondenserTypeAir)&
SourceTypeString='Refrigeration:Condenser:AirCooled'
IF(HeatReclaimRefrigCondenser(SourceIndexNum)%SourceType==RefrigCondenserTypeEvap) &
SourceTypeString='Refrigeration:Condenser:EvaporativeCooled'
IF(HeatReclaimRefrigCondenser(SourceIndexNum)%SourceType==RefrigCondenserTypeWater) &
SourceTypeString='Refrigeration:Condenser:WaterCooled'
END IF
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource .EQ. COIL_DX_COOLING)THEN
SourceTypeString='Coil:Cooling:DX:SingleSpeed'
SourceNameString=HeatReclaimDXCoil(SourceIndexNum)%Name
END IF
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource .EQ. COIL_DX_MULTISPEED)THEN
SourceTypeString='Coil:Cooling:DX:TwoSpeed'
SourceNameString=HeatReclaimDXCoil(SourceIndexNum)%Name
END IF
IF(HeatingCoil(CoilNum)%ReclaimHeatingSource .EQ. COIL_DX_MULTIMODE)THEN
SourceTypeString='Coil:Cooling:DX:TwoStageWithHumidityControlMode'
SourceNameString=HeatReclaimDXCoil(SourceIndexNum)%Name
END IF
CALL ShowSevereError('Coil:Heating:Desuperheater, "'//TRIM(HeatingCoil(CoilNum)%Name)//&
'" and "'//TRIM(HeatingCoil(RemainingCoils)%Name)//'" cannot use the same')
CALL ShowContinueError(' heat source object '//TRIM(SourceTypeString)//', "'//TRIM(SourceNameString)//'"')
ErrorsFound = .TRUE.
END IF
END DO
END DO
IF (ErrorsFound) THEN
CALL ShowFatalError(RoutineName//'Errors found in input. Program terminates.')
ENDIF
DEALLOCATE(Alphas)
DEALLOCATE(cAlphaFields)
DEALLOCATE(cNumericFields)
DEALLOCATE(Numbers)
DEALLOCATE(lAlphaBlanks)
DEALLOCATE(lNumericBlanks)
RETURN
END SUBROUTINE GetHeatingCoilInput