Nodes of different colours represent the following:
Solid arrows point from a parent (sub)module to the submodule which is descended from it. Dashed arrows point from a module being used to the module or program unit using it. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | HeatingCoilType | |||
character(len=*), | intent(in) | :: | HeatingCoilName | |||
integer, | intent(in) | :: | HeatingCoilIndex |
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
Nodes of different colours represent the following:
Solid arrows point from a procedure to one which it calls. Dashed arrows point from an interface to procedures which implement that interface. This could include the module procedures in a generic interface or the implementation in a submodule of an interface in a parent module. Where possible, edges connecting nodes are given different colours to make them easier to distinguish in large graphs.
FUNCTION GetHPCoolingCoilIndex(HeatingCoilType, HeatingCoilName, HeatingCoilIndex) RESULT(DXCoolingCoilIndex)
! FUNCTION INFORMATION:
! AUTHOR R. Raustad
! DATE WRITTEN February 2007
! MODIFIED na
! RE-ENGINEERED na
! PURPOSE OF THIS FUNCTION:
! This function looks up the given DX heating coil and returns the companion DX cooling coil.
! METHODOLOGY EMPLOYED:
! na
! REFERENCES:
! na
! USE STATEMENTS:
USE InputProcessor, ONLY: FindItemInList, SameString
USE DataBranchNodeConnections, ONLY: CompSets, NumCompSets
IMPLICIT NONE ! Enforce explicit typing of all variables in this routine
! FUNCTION ARGUMENT DEFINITIONS:
CHARACTER(len=*), INTENT(IN) :: HeatingCoilType ! Type of DX heating coil used in HP
CHARACTER(len=*), INTENT(IN) :: HeatingCoilName ! Name of DX heating coil used in HP
INTEGER, INTENT(IN) :: HeatingCoilIndex ! Index of DX heating coil used in HP
! FUNCTION PARAMETER DEFINITIONS:
! na
! INTERFACE BLOCK SPECIFICATIONS:
! na
! DERIVED TYPE DEFINITIONS:
! na
! FUNCTION LOCAL VARIABLE DECLARATIONS:
INTEGER :: DXCoolingCoilIndex ! Index of HP DX cooling coil returned from this function
INTEGER :: WhichComp ! DO loop counter to find correct comp set
INTEGER :: WhichCompanionComp ! DO loop counter to find companion coil comp set
INTEGER :: WhichHXAssistedComp ! DO loop counter when DX coil is used in a HX assisted cooling coil
CHARACTER(len=MaxNameLength) :: CompSetsParentType ! Parent object type which uses DX heating coil pass into this function
CHARACTER(len=MaxNameLength) :: CompSetsParentName ! Parent object name which uses DX heating coil pass into this function
CHARACTER(len=MaxNameLength) :: HXCompSetsParentType ! Used when DX cooling coil is a child of a HX assisted cooling coil
CHARACTER(len=MaxNameLength) :: HXCompSetsParentName ! Used when DX cooling coil is a child of a HX assisted cooling coil
DXCoolingCoilIndex = 0
DO WhichComp = 1, NumCompSets
IF(.NOT. SameString(HeatingCoilType, CompSets(WhichComp)%CTYPE) .OR. &
.NOT. SameString(HeatingCoilName, CompSets(WhichComp)%CNAME))CYCLE
CompSetsParentType = CompSets(WhichComp)%PARENTCTYPE
CompSetsParentName = CompSets(WhichComp)%PARENTCNAME
IF(SameString(CompSetsParentType,'AirLoopHVAC:UnitaryHeatPump:AirToAir') .OR. &
SameString(CompSetsParentType,'ZoneHVAC:PackagedTerminalHeatPump') .OR. &
SameString(CompSetsParentType,'AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed') .OR. &
SameString(CompSetsParentType,'AirLoopHVAC:UnitaryHeatCool:VAVChangeoverBypass') .OR. &
SameString(CompSetsParentType,'AirLoopHVAC:UnitarySystem'))THEN
! Search for DX cooling coils
DO WhichCompanionComp = 1, NumCompSets
IF(.NOT. SameString(CompSets(WhichCompanionComp)%PARENTCNAME,CompSetsParentName) .OR. &
.NOT. SameString(CompSets(WhichCompanionComp)%CTYPE,'Coil:Cooling:DX:SingleSpeed'))CYCLE
DXCoolingCoilIndex = FindItemInList(CompSets(WhichCompanionComp)%CNAME,DXCoil%Name,NumDXCoils)
EXIT
END DO
DO WhichCompanionComp = 1, NumCompSets
IF(.NOT. SameString(CompSets(WhichCompanionComp)%PARENTCNAME,CompSetsParentName) .OR. &
.NOT. SameString(CompSets(WhichCompanionComp)%CTYPE,'Coil:Cooling:DX:MultiSpeed'))CYCLE
DXCoolingCoilIndex = FindItemInList(CompSets(WhichCompanionComp)%CNAME,DXCoil%Name,NumDXCoils)
EXIT
END DO
! Search for Heat Exchanger Assisted DX cooling coils
IF(DXCoolingCoilIndex .EQ. 0)THEN
DO WhichHXAssistedComp = 1, NumCompSets
IF(.NOT. SameString(CompSets(WhichHXAssistedComp)%PARENTCNAME,CompSetsParentName) .OR. &
.NOT. SameString(CompSets(WhichHXAssistedComp)%CTYPE,'CoilSystem:Cooling:DX:HeatExchangerAssisted'))CYCLE
HXCompSetsParentType = CompSets(WhichHXAssistedComp)%CTYPE
HXCompSetsParentName = CompSets(WhichHXAssistedComp)%CNAME
DO WhichCompanionComp = 1, NumCompSets
IF(.NOT. SameString(CompSets(WhichCompanionComp)%PARENTCNAME,HXCompSetsParentName) .OR. &
.NOT. SameString(CompSets(WhichCompanionComp)%CTYPE,'Coil:Cooling:DX:SingleSpeed'))CYCLE
DXCoolingCoilIndex = FindItemInList(CompSets(WhichCompanionComp)%CNAME,DXCoil%Name,NumDXCoils)
EXIT
END DO
EXIT
END DO
END IF
ELSE
! ErrorFound, Coil:Heating:DX:SingleSpeed is used in wrong type of parent object (should never get here)
CALL ShowSevereError('Configuration error in '//TRIM(CompSetsParentType)//' "'//TRIM(CompSetsParentName)//'"')
CALL ShowContinueError('DX heating coil not allowed in this configuration.')
CALL ShowFatalError('Preceding condition(s) causes termination.')
END IF
EXIT
END DO
! Check and warn user is crankcase heater power or max OAT for crankcase heater differs in DX cooling and heating coils
IF(DXCoolingCoilIndex .GT. 0)THEN
IF(DXCoil(DXCoolingCoilIndex)%CrankcaseHeaterCapacity /= 0.0d0) THEN
IF(DXCoil(DXCoolingCoilIndex)%CrankcaseHeaterCapacity /= DXCoil(HeatingCoilIndex)%CrankcaseHeaterCapacity .OR. &
DXCoil(DXCoolingCoilIndex)%MaxOATCrankcaseHeater /= DXCoil(HeatingCoilIndex)%MaxOATCrankcaseHeater) THEN
CALL ShowWarningError('Crankcase heater capacity or max outdoor temp for crankcase heater operation specified in')
CALL ShowContinueError('Coil:Cooling:DX:SingleSpeed = '//TRIM(DXCoil(DXCoolingCoilIndex)%Name))
CALL ShowContinueError('is different than that specified in Coil:Heating:DX:SingleSpeed = ' &
//TRIM(HeatingCoilName)//'.')
CALL ShowContinueError('Both of these DX coils are part of '//TRIM(CompSetsParentType)//' = '// &
TRIM(CompSetsParentName)//'.')
CALL ShowContinueError('The value specified in the DX heating coil will be used and the simulation continues...')
END IF
END IF
END IF
RETURN
END FUNCTION GetHPCoolingCoilIndex